Commit eee4872a by 李伟康

Merge branch 'dev_2.10.1' of http://192.168.3.233:8090/glsx/scrm-wx-merchant-act…

…ivity into dev_2.10.1
2 parents be67e05e 38f03583
...@@ -49,22 +49,22 @@ export default { ...@@ -49,22 +49,22 @@ export default {
openListener() { openListener() {
this.timer = setInterval(() => { this.timer = setInterval(() => {
this.heartbeat() this.heartbeat()
}, 60*1000) }, 60 * 1000)
}, },
closeListener() { closeListener() {
clearInterval(this.timer) clearInterval(this.timer)
}, },
// 心跳检测 // 心跳检测
heartbeat() { heartbeat() {
this.trackFn('heartbeat',5) this.trackFn('heartbeat', 5)
}, },
//离开事件 //离开事件
leave() { leave() {
this.trackFn('reportTrack',5) this.trackFn('leaveReportTrack', 5)
}, },
trackFn(name,actionType) { trackFn(name, actionType) {
const { id } = this.getQuery() const { id } = this.getQuery()
bigdatautilApi[name](id,actionType) bigdatautilApi[name](id, actionType)
} }
} }
} }
......
...@@ -5,6 +5,8 @@ import dayjs from 'dayjs' ...@@ -5,6 +5,8 @@ import dayjs from 'dayjs'
const commonUrl = '/rop-scrm-bigdatautil/router' const commonUrl = '/rop-scrm-bigdatautil/router'
// 心跳检测 // 心跳检测
const heartbeatUrl = '/rop-scrm-shopmall/router' const heartbeatUrl = '/rop-scrm-shopmall/router'
// 离开埋点url
const leaveUrl = '/rop-scrm-bigdatautil/data/report'
// 第一次进入时间 // 第一次进入时间
let firstEnter = true let firstEnter = true
...@@ -17,9 +19,10 @@ const enter_time = new Date().format('yyyy-MM-dd hh:mm:ss') ...@@ -17,9 +19,10 @@ const enter_time = new Date().format('yyyy-MM-dd hh:mm:ss')
* @param {*} share_channel // 分享类型(1:转发,2:朋友圈) * @param {*} share_channel // 分享类型(1:转发,2:朋友圈)
* @param {*} url // 基础路径 * @param {*} url // 基础路径
* @param {*} method 方法地址 * @param {*} method 方法地址
* @param {*} leave 是否离开事件 默认是false
* @returns * @returns
*/ */
const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method = 'entmicro.api.customercollect.reportCustomerList') => { const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method = 'entmicro.api.customercollect.reportCustomerList', leave = false) => {
const userInfo = util.getUserInfo() const userInfo = util.getUserInfo()
const params = util.getLocalStorage('wx_scrm_link_params') || {} const params = util.getLocalStorage('wx_scrm_link_params') || {}
const ISWXWORK = util.getLocalStorage('is_wxwork') const ISWXWORK = util.getLocalStorage('is_wxwork')
...@@ -63,10 +66,24 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method = ...@@ -63,10 +66,24 @@ const reportTrack = (id, view = 1, share_channel = '', url = commonUrl, method =
jsonList: [JSON.stringify(data)] jsonList: [JSON.stringify(data)]
} }
firstEnter = false firstEnter = false
return window.$HTTP({
url, // 是否离开事件
data if (leave) {
}) if (navigator.sendBeacon) {
const params = JSON.stringify(data)
return navigator.sendBeacon(url, params)
} else {
return window.$HTTP({
url,
data
})
}
} else {
return window.$HTTP({
url,
data
})
}
} }
// 心跳检测 // 心跳检测
...@@ -74,7 +91,14 @@ const heartbeat = (id, view = 5, share_channel = '', url = heartbeatUrl, method ...@@ -74,7 +91,14 @@ const heartbeat = (id, view = 5, share_channel = '', url = heartbeatUrl, method
reportTrack(id, view, share_channel, url, method) reportTrack(id, view, share_channel, url, method)
} }
//离开事件数据上报
const leaveReportTrack = (id, view = 5) => {
// console.log('离开事件数据上报')
reportTrack(id, view, '', leaveUrl, '', true)
}
export default { export default {
reportTrack, reportTrack,
heartbeat heartbeat,
leaveReportTrack
} }

21.9 KB | W: | H:

31.8 KB | W: | H:

src/assets/images/active-empty.png
src/assets/images/active-empty.png
src/assets/images/active-empty.png
src/assets/images/active-empty.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -459,7 +459,7 @@ export default { ...@@ -459,7 +459,7 @@ export default {
if (this.noPro) { if (this.noPro) {
return true return true
} }
var data = res.data var data = res.data || {}
const arr = [] const arr = []
let items = [] let items = []
// console.log(JSON.parse(JSON.stringify(data))) // console.log(JSON.parse(JSON.stringify(data)))
...@@ -475,7 +475,7 @@ export default { ...@@ -475,7 +475,7 @@ export default {
}) })
if (items.length) arr.push(items) if (items.length) arr.push(items)
data.arr = arr data.arr = arr
this.groupInfo = data this.groupInfo = data || {}
if (data.progress < 20) { if (data.progress < 20) {
this.progress = data.progress this.progress = data.progress
this.count = this.decimal(data.progress, 2) this.count = this.decimal(data.progress, 2)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!