Commit 68f942b1 by 李嘉林

原生pv

parent c45742c6
...@@ -10,7 +10,7 @@ import { createdUserJWTApi, getBcakUrlApi } from "./api/daoke"; ...@@ -10,7 +10,7 @@ import { createdUserJWTApi, getBcakUrlApi } from "./api/daoke";
import cartApi from './api/cart' import cartApi from './api/cart'
import classificationApi from "./api/classification"; import classificationApi from "./api/classification";
import spokesmanApi from './api/spokesman' import spokesmanApi from './api/spokesman'
import { DFSImg, concatUrl } from "@/utils/index"; import { DFSImg, concatUrl, serialize } from "@/utils/index";
//一些js工具类 //一些js工具类
import tool from "@/utils/tool"; import tool from "@/utils/tool";
var log = require('./utils/log') var log = require('./utils/log')
...@@ -178,6 +178,8 @@ let spokesmanId ...@@ -178,6 +178,8 @@ let spokesmanId
wx.onAppRoute(res => { wx.onAppRoute(res => {
// 获取当前页面信息 // 获取当前页面信息
let currentPage = getCurrentPages() let currentPage = getCurrentPages()
console.log(currentPage,'--currentPage')
console.log(res,'--res')
// let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath // let fromPath = currentPage[currentPage.length - 1].__displayReporter.showReferpagepath
let whetherToForceLogin = mpApp.globalData.shopInfo && mpApp.globalData.shopInfo.whetherToForceLogin || 0 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"); log.info("wx.onAppRoute", res, mpApp.globalData.shopInfo, whetherToForceLogin, wx.getStorageSync('sessionid'), res.path != "pages/login/main");
...@@ -205,25 +207,26 @@ wx.onAppRoute(res => { ...@@ -205,25 +207,26 @@ wx.onAppRoute(res => {
// 获取当前用户 id // 获取当前用户 id
live.getUserInfo().then(res => { live.getUserInfo().then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
console.log("-------------------208")
Store.commit("setShopUserInfo", res.data.data); Store.commit("setShopUserInfo", res.data.data);
wx.setStorageSync('loginUserInfo',res.data.data ? 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 = res.data.data ? res.data.data.userId : ''
} }
}) })
} }
userId && resolve() resolve();
}).then(() => { }).then(() => {
mpBehavior.trackPageView({ let trackPageViewQuery = {
title: '', title: '',
location: res.path, location: res.path,
// path: fromPath.substring(0, fromPath.length - 5), // path: fromPath.substring(0, fromPath.length - 5),
path: res.path, path: `${res.path}${serialize(res.query)?('?'+serialize(res.query)):''}`,
sales: spokesmanId, sales: spokesmanId || "",
userId: userId 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