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 {
...
@@ -248,8 +248,6 @@ export default {
}
}
this
.
page
=
""
;
this
.
page
=
""
;
this
.
params
=
""
;
this
.
params
=
""
;
// 记录分销员分享商品信息
this
.
saveSpokesmanShareGoodsLog
();
}
else
if
(
options
.
from
&&
options
.
from
==
"h5login"
)
{
}
else
if
(
options
.
from
&&
options
.
from
==
"h5login"
)
{
let
params
=
JSON
.
parse
(
options
.
params
);
let
params
=
JSON
.
parse
(
options
.
params
);
log
.
info
(
params
.
sessionid
,
'--------------h5login--params'
)
log
.
info
(
params
.
sessionid
,
'--------------h5login--params'
)
...
@@ -343,10 +341,7 @@ export default {
...
@@ -343,10 +341,7 @@ export default {
login
.
get_open_id_by_code
({
code
:
res
.
code
}).
then
(
res1
=>
{
login
.
get_open_id_by_code
({
code
:
res
.
code
}).
then
(
res1
=>
{
log
.
info
(
'get_open_id_by_code'
,
res1
)
log
.
info
(
'get_open_id_by_code'
,
res1
)
if
(
res1
.
data
.
code
==
200
)
{
if
(
res1
.
data
.
code
==
200
)
{
wx
.
setStorageSync
({
wx
.
setStorageSync
(
"openid"
,
res1
.
data
.
data
);
key
:
"openid"
,
data
:
res1
.
data
.
data
});
// 新华优选埋点
// 新华优选埋点
if
(
app
.
trackSetOpenid
)
{
if
(
app
.
trackSetOpenid
)
{
app
.
trackSetOpenid
(
res1
.
data
.
data
);
app
.
trackSetOpenid
(
res1
.
data
.
data
);
...
@@ -391,6 +386,8 @@ export default {
...
@@ -391,6 +386,8 @@ export default {
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
params
+=
"&"
+
i
+
'='
+
paramsObj
[
i
]
}
}
this
.
params
+=
params
this
.
params
+=
params
log
.
info
(
"存入商品分享日志"
,
this
.
page
+
this
.
params
);
this
.
saveSpokesmanShareGoodsLog
(
this
.
page
+
this
.
params
);
}
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
this
.
withoutScene
=
true
;
this
.
withoutScene
=
true
;
...
@@ -449,6 +446,12 @@ export default {
...
@@ -449,6 +446,12 @@ export default {
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
}
this
.
newPageUrl
=
this
.
pageUrl
;
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
();
this
.
init
();
},
},
onShow
(){
onShow
(){
...
@@ -613,16 +616,31 @@ export default {
...
@@ -613,16 +616,31 @@ export default {
url
=
beforeUrl
+
nextUrl
;
url
=
beforeUrl
+
nextUrl
;
return
url
;
return
url
;
},
},
saveSpokesmanShareGoodsLog
()
{
saveSpokesmanShareGoodsLog
(
link
)
{
let
query
=
{
let
query
=
{};
spokesmanGroupId
:
getQueryVariable
(
this
.
link
,
"spokesmanGroupId"
)
||
""
,
if
(
getQueryVariable
(
link
,
"spokesmanGroupId"
))
{
spokesmanRelId
:
getQueryVariable
(
this
.
link
,
"spokesmanRelId"
)
||
""
,
query
.
spokesmanGroupId
=
getQueryVariable
(
link
,
"spokesmanGroupId"
)
userId
:
getQueryVariable
(
this
.
link
,
"userId"
)
||
""
,
}
productId
:
getQueryVariable
(
this
.
link
,
"productId"
)
||
""
,
if
(
getQueryVariable
(
link
,
"spokesmanRelId"
))
{
terminalProductId
:
getQueryVariable
(
this
.
link
,
"terminalProductId"
)
||
""
,
query
.
spokesmanRelId
=
getQueryVariable
(
link
,
"spokesmanRelId"
)
mixid
:
getQueryVariable
(
this
.
link
,
"mixid"
)
||
""
,
}
spokesmanShopId
:
getQueryVariable
(
this
.
link
,
"spokesmanShopId"
)
||
""
,
if
(
getQueryVariable
(
link
,
"userId"
))
{
timeStamp
:
getQueryVariable
(
this
.
link
,
"timeStamp"
)
||
""
,
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
)
console
.
log
(
"saveSpokesmanShareGoodsLog"
,
query
)
goods
.
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