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
68f942b1
Commit
68f942b1
authored
Aug 16, 2022
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
原生pv
parent
c45742c6
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
src/main.js
+12
-9
No files found.
src/main.js
View file @
68f942b1
...
...
@@ -10,7 +10,7 @@ import { createdUserJWTApi, getBcakUrlApi } from "./api/daoke";
import
cartApi
from
'./api/cart'
import
classificationApi
from
"./api/classification"
;
import
spokesmanApi
from
'./api/spokesman'
import
{
DFSImg
,
concatUrl
}
from
"@/utils/index"
;
import
{
DFSImg
,
concatUrl
,
serialize
}
from
"@/utils/index"
;
//一些js工具类
import
tool
from
"@/utils/tool"
;
var
log
=
require
(
'./utils/log'
)
...
...
@@ -178,6 +178,8 @@ let spokesmanId
wx
.
onAppRoute
(
res
=>
{
// 获取当前页面信息
let
currentPage
=
getCurrentPages
()
console
.
log
(
currentPage
,
'--currentPage'
)
console
.
log
(
res
,
'--res'
)
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
let
whetherToForceLogin
=
mpApp
.
globalData
.
shopInfo
&&
mpApp
.
globalData
.
shopInfo
.
whetherToForceLogin
||
0
log
.
info
(
"wx.onAppRoute"
,
res
,
mpApp
.
globalData
.
shopInfo
,
whetherToForceLogin
,
wx
.
getStorageSync
(
'sessionid'
),
res
.
path
!=
"pages/login/main"
);
...
...
@@ -205,25 +207,26 @@ wx.onAppRoute(res => {
// 获取当前用户 id
live
.
getUserInfo
().
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
console
.
log
(
"-------------------208"
)
Store
.
commit
(
"setShopUserInfo"
,
res
.
data
.
data
);
wx
.
setStorageSync
(
'loginUserInfo'
,
res
.
data
.
data
?
res
.
data
.
data
:
{})
console
.
log
(
Store
.
state
.
loginUserInfo
.
mobilephone
,
'--------------mobilephone---1'
)
userId
=
res
.
data
.
data
?
res
.
data
.
data
.
userId
:
''
}
})
}
userId
&&
resolve
()
resolve
();
}).
then
(()
=>
{
mpBehavior
.
trackPageView
(
{
let
trackPageViewQuery
=
{
title
:
''
,
location
:
res
.
path
,
// path: fromPath.substring(0, fromPath.length - 5),
path
:
res
.
path
,
sales
:
spokesmanId
,
userId
:
userId
});
path
:
`
${
res
.
path
}${
serialize
(
res
.
query
)?(
'?'
+
serialize
(
res
.
query
)):
''
}
`
,
sales
:
spokesmanId
||
""
,
userId
:
userId
||
""
}
log
.
info
(
"mpBehavior.trackPageView"
,
trackPageViewQuery
)
console
.
log
(
"mpBehavior.trackPageView"
,
trackPageViewQuery
)
mpBehavior
.
trackPageView
(
trackPageViewQuery
);
})
})
...
...
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