Commit 2d67bd18 by 杨明

北森

1 parent 2a38b5a9
......@@ -289,5 +289,21 @@ module.exports = {
projectName: 'pad',
...data
})
},
//北森埋点进入
dynamicrecordAdd(data) {
return http.post({
method: 'dj.pad.api.beisen.dynamicrecord.add',
projectName: 'pad',
...data
})
},
//更新埋点离开信息
dynamicrecordLeave(data) {
return http.post({
method: 'dj.pad.api.beisen.dynamicrecord.leave',
projectName: 'pad',
...data
})
}
}
......@@ -11,13 +11,13 @@
</view>
<view :class="['left-tabs', { three: tabs.length == 3 }]">
<template v-for="(i, index) in tabs">
<view :class="['tab-item', { tabActive: tabIndex == index }]" :key="index" @click="changeIndex(index)">
<view :class="['tab-item', { tabActive: tabIndex == index }]" :key="index" @click="changeIndex(index, i)">
<view class="icon-box">
<view :class="['sprite-icon', `icon-${i.icon}${tabIndex == index ? '-active' : ''}`]"></view>
</view>
{{ i.label }}
<view class="dot" v-if="i.icon == 'record' && perRecordNumber"></view>
<view class="tip-box" v-if="i.icon == 'study'">待办事项:3</view>
<view class="tip-box" v-if="i.icon == 'study' && readCount" @click="readCount = 0">待办事项:{{ readCount }}</view>
</view>
</template>
</view>
......@@ -71,6 +71,7 @@ export default {
{
label: "学习中心",
icon: "study",
isTrack:true,
name: 'StudyCenter'
},
],
......@@ -80,12 +81,21 @@ export default {
total: 0
},
messageTotal: 0,
readCount:0,
trackId:0,
trackInterval:null,
collectTrack:false,
hasPerson: false
}
},
watch: {
userInfo(n) {
if (n.shopMerchantId) this.haveCustomerAccess(n)
},
trackId(n) {
if(!n) {
clearInterval(this.trackInterval)
}
}
},
computed: {
......@@ -100,11 +110,47 @@ export default {
this.getMessageInfo();
});
this.getMessageInfo()
this.getUnreadCount()
},
inject: ['showPage'],
methods: {
changeIndex(index) {
getUnreadCount() {
uni.$api.commonApi.getUnreadCount({}).then(res => {
this.readCount = res
})
},
addTrack() {
const { merchantId, merchantName } = uni.$storage.get("userInfo")
const params = {
goodsType: 1,
merchantId,
merchantName
}
uni.$api.commonApi.dynamicrecordAdd(params).then(res=>{
this.trackId = res
})
},
leaveTrack() {
if(!this.trackId) return
uni.$api.commonApi.dynamicrecordLeave({id:this.trackId}).then(res=>{
console.log(res)
})
},
startTrack() {
this.trackInterval = setInterval(()=>{
this.addTrack()
}, 5000)
},
changeIndex(index,item) {
if (this.tabIndex == index) return;
if(item.isTrack) {
this.readCount = 0
this.addTrack()
this.startTrack()
}else {
this.leaveTrack()
this.trackId = 0
}
this.$emit('update:tabIndex', index)
this.$emit("changeTab", index)
this.getMessageInfo()
......@@ -170,7 +216,10 @@ export default {
this.$emit('update:tabIndex', 99)
}
}
}
},
beforeCreate() {
clearInterval(this.trackInterval)
},
}
</script>
......
......@@ -151,7 +151,7 @@ export default {
const wv = currentWebview.children()[1]
console.log(wv, 1111)
if (wv) {
wv.setStyle({ left: '8%', height: '100%', width: '92%' })
wv.setStyle({ left: '8%', height: '100%', top: '3%', height: '97%', width: '92%' })
}
}, 100)
} else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!