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
65e8a616
Commit
65e8a616
authored
Jan 07, 2021
by
张卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序授权绑定手机号文章埋点
parent
ad5a138b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
16 deletions
+25
-16
src/pages/index/index.vue
+24
-15
src/pages/login/index.vue
+1
-1
No files found.
src/pages/index/index.vue
View file @
65e8a616
...
...
@@ -55,7 +55,27 @@ export default {
return
this
.
link
+
this
.
page
+
this
.
params
;
}
},
watch
:
{
pageUrl
()
{
//埋点未登录时进入文章
// this.params+='&articleId=111'
console
.
log
(
wx
.
getStorageSync
(
"sessionid"
),
3333333
,
this
.
pageUrl
)
if
(
!
wx
.
getStorageSync
(
"sessionid"
)
&&
this
.
pageUrl
.
indexOf
(
'articleId'
)
!=-
1
)
{
// wx.setStorageSync('articleId',true)
var
vars
=
this
.
pageUrl
.
split
(
"&"
);
console
.
log
(
vars
,
2222
)
for
(
var
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
var
pair
=
vars
[
i
].
split
(
"="
);
console
.
log
(
pair
,
1111
)
if
(
pair
[
0
]
==
'articleId'
)
{
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'articleId'
,
pair
[
1
])
}
}
}
}
},
onLoad
(
options
)
{
this
.
options
=
options
;
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
console
.
log
(
wx
.
getStorageSync
(
"sessionid"
),
...
...
@@ -71,21 +91,22 @@ export default {
success
:
res
=>
{
this
.
code
=
res
.
code
;
login
.
miniLogin
({
code
:
this
.
code
}).
then
(
res1
=>
{
console
.
log
(
res1
,
555555
)
if
(
res1
.
data
.
code
==
200
)
{
wx
.
setStorage
({
key
:
"openid"
,
data
:
res1
.
data
.
data
.
openid
});
}
this
.
params
+=
'&open_id='
+
wx
.
getStorageSync
(
"openid"
);
console
.
log
(
this
.
code
,
77777
,
this
.
params
)
})
this
.
params
+=
'&open_id='
+
wx
.
getStorageSync
(
"openid"
);
console
.
log
(
this
.
code
,
77777
,
this
.
params
)
},
})
//检测登录态
this
.
checkLogin
();
console
.
log
(
this
.
params
,
6666666
)
this
.
options
=
options
;
console
.
log
(
'-------1'
,
options
.
scene
)
console
.
log
(
this
.
options
)
...
...
@@ -291,18 +312,6 @@ export default {
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
//埋点未登录时进入文章
if
(
!
wx
.
getStorageSync
(
"sessionid"
)
&&
this
.
params
.
indexOf
(
'articleId'
)
!=-
1
)
{
// wx.setStorageSync('articleId',true)
var
vars
=
this
.
params
.
split
(
"&"
);
for
(
var
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
var
pair
=
vars
[
i
].
split
(
"="
);
if
(
pair
[
0
]
==
'articleId'
)
{
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'articleId'
,
pair
[
1
])
}
}
}
console
.
log
(
"url"
,
this
.
link
+
this
.
page
+
this
.
params
,
wx
.
getStorageSync
(
"openid"
));
this
.
init
();
},
onShow
()
{
...
...
src/pages/login/index.vue
View file @
65e8a616
...
...
@@ -370,7 +370,7 @@ export default {
.
then
(
res
=>
{
//绑定成功
if
(
res
.
data
.
code
==
200
)
{
wx
.
setStorageSync
(
'articleId'
,
false
)
wx
.
setStorageSync
(
this
.
$store
.
state
.
mixid
+
'articleId'
,
false
)
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
this
.
backParams
+=
`&sessionid=
${
res
.
data
.
data
.
sessionId
...
...
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