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
1f6ee1b1
Commit
1f6ee1b1
authored
Jan 06, 2021
by
张卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文章埋点
parent
e9a09d7a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
5 deletions
+59
-5
src/api/index.js
+5
-0
src/pages/index/index.vue
+50
-4
src/pages/login/index.vue
+3
-1
src/utils/request.js
+1
-0
No files found.
src/api/index.js
View file @
1f6ee1b1
...
@@ -12,5 +12,9 @@ console.log(process.env,'-----------------config------')
...
@@ -12,5 +12,9 @@ console.log(process.env,'-----------------config------')
addRecord
(
data
)
{
addRecord
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/scanCodeCustomerRecord/addRecord`
,
data
);
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/scanCodeCustomerRecord/addRecord`
,
data
);
},
},
//POST /article/forward 转发分享
forward
(
data
)
{
return
requestPOST
(
`
${
process
.
env
.
OLSHOP_URL
}
/article/forward`
,
data
)
},
}
}
\ No newline at end of file
src/pages/index/index.vue
View file @
1f6ee1b1
...
@@ -9,9 +9,11 @@ import spokesman from "@/api/spokesman.js";
...
@@ -9,9 +9,11 @@ import spokesman from "@/api/spokesman.js";
import
shop
from
"@/api/shop.js"
;
import
shop
from
"@/api/shop.js"
;
import
indexApi
from
"@/api/index.js"
;
import
indexApi
from
"@/api/index.js"
;
import
{
serialize
,
getQueryVariable
,
DFSImg
}
from
"@/utils/index"
;
import
{
serialize
,
getQueryVariable
,
DFSImg
}
from
"@/utils/index"
;
import
login
from
"@/api/login"
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
code
:
''
,
shopId
:
this
.
$store
.
state
.
mixid
,
shopId
:
this
.
$store
.
state
.
mixid
,
options
:
{},
options
:
{},
session_key
:
""
,
session_key
:
""
,
...
@@ -50,12 +52,13 @@ export default {
...
@@ -50,12 +52,13 @@ export default {
},
},
computed
:
{
computed
:
{
pageUrl
()
{
pageUrl
()
{
return
this
.
link
+
this
.
page
+
this
.
params
return
this
.
link
+
this
.
page
+
this
.
params
;
}
}
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
Object
.
assign
(
this
.
$data
,
this
.
$options
.
data
());
console
.
log
(
console
.
log
(
wx
.
getStorageSync
(
"sessionid"
),
options
,
options
,
"index------"
,
"index------"
,
this
.
shopId
,
this
.
shopId
,
...
@@ -63,6 +66,23 @@ export default {
...
@@ -63,6 +66,23 @@ export default {
wx
.
getStorageSync
(
"openid"
),
wx
.
getStorageSync
(
"openid"
),
this
.
shopId
this
.
shopId
);
);
//获取openId
wx
.
login
({
success
:
res
=>
{
this
.
code
=
res
.
code
;
login
.
miniLogin
({
code
:
this
.
code
}).
then
(
res1
=>
{
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
.
checkLogin
();
this
.
checkLogin
();
...
@@ -271,7 +291,18 @@ export default {
...
@@ -271,7 +291,18 @@ export default {
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
// var query = options.query.dentistId; // 参数二维码传递过来的场景参数
}
}
console
.
log
(
"url"
,
this
.
link
+
this
.
page
+
this
.
params
);
//埋点未登录时进入文章
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('articleId',pair[1])
// }
// }
}
console
.
log
(
"url"
,
this
.
link
+
this
.
page
+
this
.
params
,
wx
.
getStorageSync
(
"openid"
));
this
.
init
();
this
.
init
();
},
},
onShow
()
{
onShow
()
{
...
@@ -360,8 +391,23 @@ export default {
...
@@ -360,8 +391,23 @@ export default {
//分享内容中有订单信息为送礼活动
//分享内容中有订单信息为送礼活动
this
.
shareOrderSn
=
res
.
target
.
data
[
len
].
orderSn
;
this
.
shareOrderSn
=
res
.
target
.
data
[
len
].
orderSn
;
this
.
shareTid
=
res
.
target
.
data
[
len
].
shareTid
;
this
.
shareTid
=
res
.
target
.
data
[
len
].
shareTid
;
this
.
newWindowHref
=
res
.
target
.
data
[
len
].
shareImgUrl
;
this
.
newWindowHref
=
res
.
target
.
data
[
len
].
shareImgUrl
;
// + '&fromVisitorOpenId=' + wx.getStorageSync("openid")
console
.
log
(
"分享信息:"
,
this
.
shareLogoUrl
,
this
.
shareShopName
,
this
.
newWindowHref
);
console
.
log
(
"分享信息:"
,
this
.
shareLogoUrl
,
this
.
shareShopName
,
1111111
,
this
.
newWindowHref
);
//文章详情分享埋点
if
(
this
.
newWindowHref
.
indexOf
(
'articleId'
)
!=-
1
)
{
var
articleId
=
''
var
vars
=
this
.
newWindowHref
.
split
(
"&"
);
for
(
var
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
var
pair
=
vars
[
i
].
split
(
"="
);
console
.
log
(
pair
,
2222
)
if
(
pair
[
0
]
==
'articleId'
)
{
articleId
=
pair
[
1
];
}
}
indexApi
.
forward
({
articleId
:
articleId
,}).
then
(
res
=>
{
})
}
},
},
//加载成功
//加载成功
handleLoad
(){
handleLoad
(){
...
...
src/pages/login/index.vue
View file @
1f6ee1b1
...
@@ -354,7 +354,8 @@ export default {
...
@@ -354,7 +354,8 @@ export default {
country
:
this
.
userInfo
.
country
,
country
:
this
.
userInfo
.
country
,
province
:
this
.
userInfo
.
province
,
province
:
this
.
userInfo
.
province
,
city
:
this
.
userInfo
.
city
,
city
:
this
.
userInfo
.
city
,
otherPhone
:
0
otherPhone
:
0
,
customerSourceType
:
wx
.
getStorageSync
(
"articleId"
)?
8
:
''
};
};
if
(
this
.
$store
.
state
.
spokesmanGroupId
!=
""
)
{
if
(
this
.
$store
.
state
.
spokesmanGroupId
!=
""
)
{
query
.
spokesmanRelId
=
this
.
$store
.
state
.
spokesmanRelId
;
query
.
spokesmanRelId
=
this
.
$store
.
state
.
spokesmanRelId
;
...
@@ -368,6 +369,7 @@ export default {
...
@@ -368,6 +369,7 @@ export default {
.
then
(
res
=>
{
.
then
(
res
=>
{
//绑定成功
//绑定成功
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
wx
.
setStorageSync
(
'articleId'
,
false
)
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
this
.
NEED_CERTIFIED
=
res
.
data
.
data
.
NEED_CERTIFIED
;
this
.
backParams
+=
`&sessionid=
${
this
.
backParams
+=
`&sessionid=
${
res
.
data
.
data
.
sessionId
res
.
data
.
data
.
sessionId
...
...
src/utils/request.js
View file @
1f6ee1b1
...
@@ -36,6 +36,7 @@ export async function requestPOST(url, options) {
...
@@ -36,6 +36,7 @@ export async function requestPOST(url, options) {
"Shop-Mixid"
:
shopMixid
,
"Shop-Mixid"
:
shopMixid
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
store
.
state
.
offlineShopCode
,
"Offline-Shop-Code"
:
store
.
state
.
offlineShopCode
,
"open_id"
:
wx
.
getStorageSync
(
"openid"
)
||
''
// "dubbo-tag": "ljx"
// "dubbo-tag": "ljx"
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
...
...
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