Commit 1ae7e4b6 by 胡悦

修改

1 parent 18116627
......@@ -14,7 +14,7 @@ App({
wx.$router = router
wx.$imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
wx.$appId = wx.getAccountInfoSync().miniProgram.appId
wx.$trackData = options.query
this.globalData.appId = wx.getAccountInfoSync().miniProgram.appId
const systemInfo = wx.getStorageSync('srcm_shopmall_system_info')
if (!systemInfo) wx.getSystemInfo({
......@@ -63,6 +63,7 @@ App({
})
if (wx.$trackData.scene) {
_this.getScene(wx.$trackData.scene).then(res => {
console.log('scene', wx.$trackData.scene)
wx.$trackData.merchant = res.merchantId
wx.$trackData.cardId = res.cardId
const systemInfo = wx.getStorageSync('srcm_shopmall_system_info')
......
......@@ -112,7 +112,10 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
console.log(wx.$trackData)
console.log(wx.$trackData, wx.getLaunchOptionsSync())
const options = wx.getLaunchOptionsSync()
wx.$trackData = options.query
console.log(options.query,'--------------')
if (wx.$trackData.merchant) {
wx.$Track.sendTrack(this.data.curTab[this.data.curTabIndex])
}
......@@ -271,7 +274,6 @@ Page({
},
// 获取用户昵称
getUserProfile(e) {
console.log(e);
this.setData({
hasUserInfo: true,
});
......@@ -305,7 +307,6 @@ Page({
const sessionId = util.getSessionId();
let params = {};
params.cardId = wx.$trackData.cardId
console.log(params, "+++");
entmicroApi.getCardDetail(params).then(({data}) => {
this.setData({
cardInfo: data
......
......@@ -23,7 +23,6 @@ const track_interval_time = 60 * 1e3
class TRACK {
constructor() {
console.log('---------------- 埋点初始化 ----------------')
this.initPageProxy()
// this.sendTrack()
// this.getAddressInfo().then(res => ADDRESS_INFO = res)
......@@ -86,7 +85,6 @@ class TRACK {
// this.sendTrack()
wx.offAppShow()
this.appHide()
console.log('---------------- 重新打开埋点 ----------------')
})
}
appHide() {
......@@ -94,7 +92,6 @@ class TRACK {
if (TRACK_TIME) clearInterval(TRACK_TIME)
wx.offAppHide()
this.appShow()
console.log('---------------- APP隐藏 埋点停止推送 ----------------')
})
}
/**设置埋点数据 */
......@@ -148,23 +145,6 @@ class TRACK {
}) => {
console.log('埋点设置成功')
})
// TRACK_TIME = setInterval(() => {
// let prepare_data = wx.getStorageSync('prepare_data')
// let data = {
// method: 'entmicro.api.business.card.cardRecord',
// // jsonList: prepare_data
// }
// if (prepare_data && prepare_data.length) api.reportTrack(data).then(({
// code,
// data,
// message
// }) => {
// if (code == 0 && data) {
// wx.setStorageSync('prepare_data', [])
// console.log('---------------- 埋点定时推送成功 ----------------', new Date().format('yyyy-MM-dd hh:mm:ss'), ':', prepare_data)
// } else console.log('---------------- 埋点定时推送失败 ----------------', new Date().format('yyyy-MM-dd hh:mm:ss'), ':', message)
// })
// }, track_interval_time)
}
/**获取页面对象实例 */
getPageInstance = (size = 1) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!