Commit 5f1f8d41 by 胡悦

提交

1 parent 38d0be18
// components/UserInfo/UserInfo.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
<text>这里是用户信息组件</text>
\ No newline at end of file \ No newline at end of file
...@@ -5,16 +5,25 @@ Page({ ...@@ -5,16 +5,25 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
introduceName: ''
},
introduce(e) {
console.log(e.target.dataset.name)
const name = e.target.dataset.name
this.setData({
introduceName: name
})
},
jump() {
wx.$router.go('application')
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
setTimeout(() => { // setTimeout(() => {
wx.$router.go('application') // wx.$router.go('application')
}, 2e3) // }, 2e3)
}, },
/** /**
......
{ {
"usingComponents": {} "usingComponents": {
"user-info": "../../../components/UserInfo/UserInfo"
}
} }
\ No newline at end of file \ No newline at end of file
<!--pages/tab/index/index.wxml--> <!--pages/tab/index/index.wxml-->
<text>pages/tab/index/index.wxml</text> <user-info></user-info>
<view class="tab-list">
<view class="tab-item" data-name="公司介绍" bindtap="introduce">
公司介绍
</view>
<view class="tab-item" data-name="产品介绍" bindtap="introduce">
产品介绍
</view>
<view class="tab-item" data-name="视频直播" bindtap="introduce">
视频直播
</view>
<view class="tab-item" data-name="城市合伙人" bindtap="introduce">
城市合伙人
</view>
</view>
<view>{{introduceName}}</view>
<view hidden="{{introduceName != '产品介绍'}}">
产品介绍
<view class="tab-list">
<view class="tab-item">
企微魔方
</view>
<view class="tab-item">
数字化权益
</view>
<view class="tab-item">
智能线索
</view>
<view class="tab-item">
D+增值转化
</view>
</view>
</view>
<import src="../../template/demo/demo.wxml" />
<template is="demo"></template>
\ No newline at end of file \ No newline at end of file
/* pages/tab/index/index.wxss */ /* pages/tab/index/index.wxss */
@import '../../template/demo/demo.wxss';
.tab-list {
display: flex;
justify-content: space-evenly
}
.tab-item {
background-color: bisque;
}
\ No newline at end of file \ No newline at end of file
<template name="demo">
<view class="bg">这是一个demo模板</view>
<button bindtap="jump">跳转</button>
</template>
\ No newline at end of file \ No newline at end of file
.bg {
background-color: blueviolet;
}
\ No newline at end of file \ No newline at end of file
...@@ -25,7 +25,7 @@ class TRACK { ...@@ -25,7 +25,7 @@ class TRACK {
console.log('---------------- 埋点初始化 ----------------') console.log('---------------- 埋点初始化 ----------------')
this.initPageProxy() this.initPageProxy()
this.sendTrack() this.sendTrack()
this.getAddressInfo().then(res => ADDRESS_INFO = res) // this.getAddressInfo().then(res => ADDRESS_INFO = res)
this.appHide() this.appHide()
} }
/**监听页面 */ /**监听页面 */
...@@ -82,7 +82,7 @@ class TRACK { ...@@ -82,7 +82,7 @@ class TRACK {
appShow() { appShow() {
wx.onAppShow(() => { wx.onAppShow(() => {
if (TRACK_TIME) clearInterval(TRACK_TIME) if (TRACK_TIME) clearInterval(TRACK_TIME)
this.sendTrack() // this.sendTrack()
wx.offAppShow() wx.offAppShow()
this.appHide() this.appHide()
console.log('---------------- 重新打开埋点 ----------------') console.log('---------------- 重新打开埋点 ----------------')
...@@ -99,58 +99,19 @@ class TRACK { ...@@ -99,58 +99,19 @@ class TRACK {
/**设置埋点数据 */ /**设置埋点数据 */
setTrack(e, act_id = 1) { setTrack(e, act_id = 1) {
// console.log('---------------- 获取小程序启动时的参数 ----------------', wx.getLaunchOptionsSync()) // console.log('---------------- 获取小程序启动时的参数 ----------------', wx.getLaunchOptionsSync())
let { let userInfo = wx.$util.getUserInfo()
route // wx.setStorageSync('track_last_time', now)
} = this.getPageInstance(), { let data = {}
query
} = wx.getLaunchOptionsSync(),
prepare_data = wx.getStorageSync('prepare_data'),
last_time = wx.getStorageSync('track_last_time'),
now = new Date().format('yyyy-MM-dd hh:mm:ss'),
merchantInfo = this.getMerchantInfo(),
userInfo = wx.$util.getUserInfo(),
systemInfo = this.getSystemInfo(),
page_title = this.getPageTitle(),
guest_no = this.getGuestNo(),
storageQuery = wx.getStorageSync('track_query')
if (!last_time) last_time = now
let data = {
burying_pointa: 'GH_MINIPROGRAM',
plateform: 'miniprogram',
create_time: now,
...merchantInfo,
add_way: '104',
page_id: route,
act_status: 0,
last_time,
guest_no,
act_id,
ext: {
...systemInfo,
page_title,
...e
}
}
wx.setStorageSync('track_last_time', now)
if (userInfo) { if (userInfo) {
/**用户信息 */ /**用户信息 */
if (userInfo.openId) data.open_id = userInfo.openId if (userInfo.openId) data.open_id = userInfo.openId
if (userInfo.unionId) data.union_id = userInfo.unionId if (userInfo.unionId) data.union_id = userInfo.unionId
if (userInfo.phone) data.customer_phone = userInfo.phone if (userInfo.phone) data.customer_phone = userInfo.phone
} }
if (ADDRESS_INFO) {
data.city = ADDRESS_INFO.address
data.gps = ADDRESS_INFO.location
}
if (Object.keys(query).length) {
data.entry_id = query
wx.setStorageSync('storageQuery', query)
} else data.entry_id = storageQuery
console.log('---------------- 触发了埋点 ----------------', data) console.log('---------------- 触发了埋点 ----------------', data)
if (!prepare_data) prepare_data = [] // if (!prepare_data) prepare_data = []
prepare_data.push(JSON.stringify(data)) // prepare_data.push(JSON.stringify(data))
wx.setStorageSync('prepare_data', prepare_data) // wx.setStorageSync('prepare_data', prepare_data)
} }
getGuestNo() { getGuestNo() {
let guest_no = wx.getStorageSync('guest_no') let guest_no = wx.getStorageSync('guest_no')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!