Commit 1bb1fa15 by 李伟康

修改浏览埋点

1 parent b698e735
......@@ -134,14 +134,6 @@ class UsersApi {
...data
})
}
<<<<<<< HEAD
/** 退出登录 */
logout(data) {
return api.post({
method: 'scrm.api.sso.wechat.applets.logout',
...CODE,
...data
=======
/** 手机号授权解析(单纯解析内容返回前端)
* 只传loginToken就返回unionId和openid
* 传加密信息就解析手机号
......@@ -167,7 +159,6 @@ class UsersApi {
method: 'scrm.api.sso.wechat.applets.phone.grant.analysis',
...detail,
platformEntrance: 'BUSINESS_ASSISTANT'
>>>>>>> 453f605c17f20f69b383822ce6981abe179f022b
})
}
}
......
......@@ -59,31 +59,32 @@ Page({
actNum,
activeNavIdx
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
console.log(options)
if (options.shareOpenId) {
if (this.options?.shareOpenId) {
const WXUSERINFO = wx.$storage.get('wx_user_info'),
USERINFO = wx.$storage.get('userInfo')
USERINFO = wx.$storage.get('userInfo'),
shareInfo = this.options
reportData({
openId: WXUSERINFO.openId || '',
unionId: WXUSERINFO.unionId || '',
nickName: WXUSERINFO.nickName || '',
avatar: WXUSERINFO.avatarUrl || '',
phone: USERINFO.phone || '',
merchantId: options.merchantId || '',
shareOpenId: options.shareOpenId || '',
sharePhone: options.sharePhone || '',
productCode: options.productCode || '',
productDesc: options.productDesc || ''
merchantId: shareInfo.merchantId || '',
shareOpenId: shareInfo.shareOpenId || '',
sharePhone: shareInfo.sharePhone || '',
productCode: shareInfo.productCode || '',
productDesc: shareInfo.productDesc || ''
}, 1)
// 禁用分享功能
wx.hideShareMenu()
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
// actNum,activeNavIdx isShare
},
......
......@@ -5,6 +5,7 @@ import { IMG_URL } from '~/utils/constantData'
import { generateRoutList } from './wxOnAppRoute.js'
import { getNavigationBarTitleText } from '~/utils/cache/storageApi'
import { getUserInfo } from '~/utils/cache/userInfo'
import USERAPI from '~/api/usersApi/index'
class Router {
[_query] = {};
[_routeHooks] = [];
......@@ -12,11 +13,12 @@ class Router {
constructor(router) {
this[_routerList] = generateRoutList(router)
wx.onAppRoute &&
wx.onAppRoute(e => {
wx.onAppRoute(async e => {
let thisPage = this.getPageInstance()
if (thisPage) {
await USERAPI.getWXUserInfo()
thisPage.setData({ IMG_URL })
thisPage.options = this[_query]
if(Object.keys(this[_query]).length) thisPage.options = this[_query]
this.setNavigationBarTitleText(thisPage)
let onRoute = thisPage.onRoute
typeof onRoute === 'function' && onRoute(this[_query])
......
......@@ -5,16 +5,13 @@
* @param {*} shareQuery 分享页面参数
* @param {*} noPageAuth 分享页面是否需要登录拦截
* @param {*} shareFun 分享页面
* @param {*} isShareTrack 是否分享埋点
* @param {*} shareTrackData 分享埋点数据
* @returns
*/
import {
reportData
} from '~/api/index.js'
import USERAPI from '~/api/usersApi/index'
const _WXUSERINFO_ = Symbol('_WXUSERINFO_')
class Share {
[_WXUSERINFO_] = null
constructor() {
console.log('---------------- 分享初始化 ----------------')
this.initPageProxy()
......@@ -31,17 +28,11 @@ class Share {
}
}
}
async checkWxUserInfo() {
if (!this[_WXUSERINFO_]) {
const data = await USERAPI.getWXUserInfo()
this[_WXUSERINFO_] = data
}
}
/**设置全局分享 */
pageLeaveProxy(page) {
if (page.onShareAppMessage) {
const that = this
this.checkWxUserInfo()
page.onShareAppMessage = function () {
let {
shareTitle,
......@@ -89,7 +80,7 @@ class Share {
}
}
getCommonData() {
const WXUSERINFO = this[_WXUSERINFO_],
const WXUSERINFO = wx.$storage.get('wx_user_info'),
USERINFO = wx.$storage.get('userInfo')
return {
WXUSERINFO,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!