Commit 68f942b1 by 李嘉林

原生pv

parent c45742c6
......@@ -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);
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment