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
b5afaf37
Commit
b5afaf37
authored
Dec 15, 2023
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容不同场景分享埋点
parent
6703bca1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
16 deletions
+34
-16
src/pages/index/index.vue
+34
-16
No files found.
src/pages/index/index.vue
View file @
b5afaf37
...
...
@@ -248,8 +248,6 @@ export default {
}
this
.
page
=
""
;
this
.
params
=
""
;
// 记录分销员分享商品信息
this
.
saveSpokesmanShareGoodsLog
();
}
else
if
(
options
.
from
&&
options
.
from
==
"h5login"
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
log
.
info
(
params
.
sessionid
,
'--------------h5login--params'
)
...
...
@@ -343,10 +341,7 @@ export default {
login
.
get_open_id_by_code
({
code
:
res
.
code
}).
then
(
res1
=>
{
log
.
info
(
'get_open_id_by_code'
,
res1
)
if
(
res1
.
data
.
code
==
200
)
{
wx
.
setStorageSync
({
key
:
"openid"
,
data
:
res1
.
data
.
data
});
wx
.
setStorageSync
(
"openid"
,
res1
.
data
.
data
);
// 新华优选埋点
if
(
app
.
trackSetOpenid
)
{
app
.
trackSetOpenid
(
res1
.
data
.
data
);
...
...
@@ -391,6 +386,8 @@ export default {
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
}
this
.
params
+=
params
log
.
info
(
"存入商品分享日志"
,
this
.
page
+
this
.
params
);
this
.
saveSpokesmanShareGoodsLog
(
this
.
page
+
this
.
params
);
}
}).
catch
((
err
)
=>
{
this
.
withoutScene
=
true
;
...
...
@@ -449,6 +446,12 @@ export default {
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
this
.
newPageUrl
=
this
.
pageUrl
;
console
.
log
(
'this.newPageUrl'
,
this
.
newPageUrl
)
// 商品分享进入 (卡片分享、扫码、点击小程序链接)
if
(
this
.
newPageUrl
.
includes
(
'/goods/'
)
&&
(
options
.
share
||
options
.
share_copy
))
{
log
.
info
(
"存入商品分享日志"
,
this
.
newPageUrl
);
this
.
saveSpokesmanShareGoodsLog
(
this
.
newPageUrl
);
}
this
.
init
();
},
onShow
(){
...
...
@@ -613,16 +616,31 @@ export default {
url
=
beforeUrl
+
nextUrl
;
return
url
;
},
saveSpokesmanShareGoodsLog
()
{
let
query
=
{
spokesmanGroupId
:
getQueryVariable
(
this
.
link
,
"spokesmanGroupId"
)
||
""
,
spokesmanRelId
:
getQueryVariable
(
this
.
link
,
"spokesmanRelId"
)
||
""
,
userId
:
getQueryVariable
(
this
.
link
,
"userId"
)
||
""
,
productId
:
getQueryVariable
(
this
.
link
,
"productId"
)
||
""
,
terminalProductId
:
getQueryVariable
(
this
.
link
,
"terminalProductId"
)
||
""
,
mixid
:
getQueryVariable
(
this
.
link
,
"mixid"
)
||
""
,
spokesmanShopId
:
getQueryVariable
(
this
.
link
,
"spokesmanShopId"
)
||
""
,
timeStamp
:
getQueryVariable
(
this
.
link
,
"timeStamp"
)
||
""
,
saveSpokesmanShareGoodsLog
(
link
)
{
let
query
=
{};
if
(
getQueryVariable
(
link
,
"spokesmanGroupId"
))
{
query
.
spokesmanGroupId
=
getQueryVariable
(
link
,
"spokesmanGroupId"
)
}
if
(
getQueryVariable
(
link
,
"spokesmanRelId"
))
{
query
.
spokesmanRelId
=
getQueryVariable
(
link
,
"spokesmanRelId"
)
}
if
(
getQueryVariable
(
link
,
"userId"
))
{
query
.
userId
=
getQueryVariable
(
link
,
"userId"
)
}
if
(
getQueryVariable
(
link
,
"productId"
))
{
query
.
productId
=
getQueryVariable
(
link
,
"productId"
)
}
if
(
getQueryVariable
(
link
,
"terminalProductId"
))
{
query
.
terminalProductId
=
getQueryVariable
(
link
,
"terminalProductId"
)
}
if
(
getQueryVariable
(
link
,
"mixid"
))
{
query
.
mixid
=
getQueryVariable
(
link
,
"mixid"
)
}
if
(
getQueryVariable
(
link
,
"spokesmanShopId"
))
{
query
.
spokesmanShopId
=
getQueryVariable
(
link
,
"spokesmanShopId"
)
}
if
(
getQueryVariable
(
link
,
"timeStamp"
))
{
query
.
timeStamp
=
getQueryVariable
(
link
,
"timeStamp"
)
}
console
.
log
(
"saveSpokesmanShareGoodsLog"
,
query
)
goods
.
saveSpokesmanShareGoodsLog
(
query
);
...
...
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