Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
5c4ba6cc
Commit
5c4ba6cc
authored
Jul 03, 2024
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
✨
feat: 下单加进店方式
parent
e33ba3ee
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
+20
-1
src/pages/home/index.vue
+12
-1
src/pages/index/index.vue
+8
-0
No files found.
src/pages/home/index.vue
View file @
5c4ba6cc
...
@@ -360,6 +360,7 @@ export default {
...
@@ -360,6 +360,7 @@ export default {
},
},
async
onLoad
(
options
)
{
async
onLoad
(
options
)
{
log
.
info
(
'home-onLoad'
)
log
.
info
(
'home-onLoad'
)
console
.
log
(
'home-onLoad-options->'
,
options
);
if
(
this
.
$options
)
{
if
(
this
.
$options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
}
}
...
@@ -406,6 +407,7 @@ export default {
...
@@ -406,6 +407,7 @@ export default {
methods
:
{
methods
:
{
async
pageInit
(
options
)
{
async
pageInit
(
options
)
{
wx
.
setStorageSync
(
"entryMode"
,
''
);
log
.
info
(
options
,
'---------home----options'
)
log
.
info
(
options
,
'---------home----options'
)
let
h5Params
=
options
&&
options
.
params
?
JSON
.
parse
(
decodeURIComponent
(
options
.
params
))
:
{};
let
h5Params
=
options
&&
options
.
params
?
JSON
.
parse
(
decodeURIComponent
(
options
.
params
))
:
{};
this
.
h5Params
=
h5Params
;
this
.
h5Params
=
h5Params
;
...
@@ -437,8 +439,14 @@ export default {
...
@@ -437,8 +439,14 @@ export default {
});
});
log
.
info
(
wx
.
getStorageSync
(
"becomeInfo"
),
'home---wx.getStorageSync("becomeInfo")'
)
log
.
info
(
wx
.
getStorageSync
(
"becomeInfo"
),
'home---wx.getStorageSync("becomeInfo")'
)
}
}
if
(
options
.
share
)
{
log
.
info
(
'options.share'
,
options
.
share
)
console
.
log
(
'home-options-share->'
,
options
);
wx
.
setStorageSync
(
"entryMode"
,
'share'
);
}
if
(
options
.
scene
){
if
(
options
.
scene
){
wx
.
setStorageSync
(
"firstView"
,
1
);
wx
.
setStorageSync
(
"firstView"
,
1
);
wx
.
setStorageSync
(
"entryMode"
,
'scene'
);
this
.
reloadPage
=
true
;
this
.
reloadPage
=
true
;
//新二维码扫码进入
//新二维码扫码进入
let
res
=
await
indexApi
.
getShareSceneRecord
(
options
.
scene
);
let
res
=
await
indexApi
.
getShareSceneRecord
(
options
.
scene
);
...
@@ -1277,6 +1285,7 @@ export default {
...
@@ -1277,6 +1285,7 @@ export default {
let
newHref
=
'/pages/home/main'
;
let
newHref
=
'/pages/home/main'
;
let
title
=
app
.
globalData
.
shopInfo
.
shopName
;
let
title
=
app
.
globalData
.
shopInfo
.
shopName
;
let
hasInvitationStatus
=
0
;
let
hasInvitationStatus
=
0
;
let
newData
=
{}
if
(
wx
.
getStorageSync
(
"sessionid"
))
{
if
(
wx
.
getStorageSync
(
"sessionid"
))
{
await
app
.
fenxiaoModel
.
getSpokesmanidByShare
().
then
(
data
=>
{
await
app
.
fenxiaoModel
.
getSpokesmanidByShare
().
then
(
data
=>
{
log
.
info
(
data
,
'onShareAppMessage-getSpokesmanidByShare'
)
log
.
info
(
data
,
'onShareAppMessage-getSpokesmanidByShare'
)
...
@@ -1288,7 +1297,6 @@ export default {
...
@@ -1288,7 +1297,6 @@ export default {
log
.
info
(
hasInvitationStatus
,
'onShareAppMessage-hasInvitationStatus'
)
log
.
info
(
hasInvitationStatus
,
'onShareAppMessage-hasInvitationStatus'
)
await
app
.
fenxiaoModel
.
getSpokesmanInfo
().
then
(
data
=>
{
await
app
.
fenxiaoModel
.
getSpokesmanInfo
().
then
(
data
=>
{
log
.
info
(
'onShareAppMessage调用getSpokesmanInfo'
)
log
.
info
(
'onShareAppMessage调用getSpokesmanInfo'
)
let
newData
=
{}
log
.
info
(
data
,
'getSpokesmanInfo.data'
)
log
.
info
(
data
,
'getSpokesmanInfo.data'
)
if
(
data
!=
null
)
{
if
(
data
!=
null
)
{
if
(
hasInvitationStatus
==
1
)
{
if
(
hasInvitationStatus
==
1
)
{
...
@@ -1318,6 +1326,9 @@ export default {
...
@@ -1318,6 +1326,9 @@ export default {
imageUrl
=
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
shareImg
imageUrl
=
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
shareImg
}
}
log
.
info
(
newHref
,
3333555666
,
title
,
res
)
log
.
info
(
newHref
,
3333555666
,
title
,
res
)
newHref
=
concatUrl
(
newHref
,
{
share
:
1
})
return
{
return
{
title
:
title
,
// 默认是小程序的名称
title
:
title
,
// 默认是小程序的名称
path
:
newHref
,
// 默认是当前页面
path
:
newHref
,
// 默认是当前页面
...
...
src/pages/index/index.vue
View file @
5c4ba6cc
...
@@ -168,6 +168,7 @@ export default {
...
@@ -168,6 +168,7 @@ export default {
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
let
{
offlineShopCode
,
offlineShopName
}
=
getStoreInfo
();
let
{
offlineShopCode
,
offlineShopName
}
=
getStoreInfo
();
wx
.
setStorageSync
(
"entryMode"
,
''
);
// 新用户首次扫码进入此页没缓存认定为第一次访问
// 新用户首次扫码进入此页没缓存认定为第一次访问
if
(
offlineShopCode
)
{
if
(
offlineShopCode
)
{
wx
.
removeStorageSync
(
"firstView"
);
wx
.
removeStorageSync
(
"firstView"
);
...
@@ -243,6 +244,7 @@ export default {
...
@@ -243,6 +244,7 @@ export default {
this
.
checkLogin
();
this
.
checkLogin
();
this
.
options
=
options
;
this
.
options
=
options
;
if
(
options
.
share
)
{
if
(
options
.
share
)
{
wx
.
setStorageSync
(
"entryMode"
,
'share'
);
log
.
info
(
'options.share'
,
options
.
share
)
log
.
info
(
'options.share'
,
options
.
share
)
//来自分享
//来自分享
this
.
link
=
decodeURIComponent
(
options
.
share
);
this
.
link
=
decodeURIComponent
(
options
.
share
);
...
@@ -350,6 +352,7 @@ export default {
...
@@ -350,6 +352,7 @@ export default {
this
.
params
+=
"&"
+
serialize
(
options
.
params
);
this
.
params
+=
"&"
+
serialize
(
options
.
params
);
}
else
if
(
options
.
scene
)
{
}
else
if
(
options
.
scene
)
{
log
.
info
(
'options.scene'
,
options
)
log
.
info
(
'options.scene'
,
options
)
wx
.
setStorageSync
(
"entryMode"
,
'scene'
);
if
(
options
.
scene
.
indexOf
(
'_'
)
==
-
1
){
if
(
options
.
scene
.
indexOf
(
'_'
)
==
-
1
){
log
.
info
(
"新版本(scene参数)分享进入"
)
log
.
info
(
"新版本(scene参数)分享进入"
)
this
.
withoutScene
=
false
;
this
.
withoutScene
=
false
;
...
@@ -511,6 +514,11 @@ export default {
...
@@ -511,6 +514,11 @@ export default {
}
}
}
}
// 加进入方式参数
let
entryMode
=
wx
.
getStorageSync
(
'entryMode'
)
?
wx
.
getStorageSync
(
'entryMode'
)
:
''
;
if
(
entryMode
)
{
this
.
params
+=
`&entryMode=
${
entryMode
}
`
;
}
this
.
newPageUrl
=
this
.
removeEmptyQueryParams
(
this
.
pageUrl
);
this
.
newPageUrl
=
this
.
removeEmptyQueryParams
(
this
.
pageUrl
);
console
.
log
(
'this.newPageUrl'
,
this
.
newPageUrl
)
console
.
log
(
'this.newPageUrl'
,
this
.
newPageUrl
)
// 商品分享进入 (卡片分享、扫码、点击小程序链接)
// 商品分享进入 (卡片分享、扫码、点击小程序链接)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment