Commit 1ae7e4b6 by 胡悦

修改

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