@conecli/cone-render 0.8.15-beta.50 → 0.8.15-beta.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import { useReducer } from 'react'
|
|
2
1
|
const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
|
|
3
2
|
const isOverMax = arrTask.length >= 10
|
|
4
3
|
const hasData = arrTask.length > 0
|
|
5
4
|
if(hasData && (isTimeout || isOverMax)){
|
|
6
5
|
const reduceData = connactData(arrTask)
|
|
7
6
|
track.reportExposureEventLog(reduceData)
|
|
8
7
|
arrTask = []
|
|
9
8
|
startWaitTime = 0
|
|
10
9
|
clearTimeout(timer)
|
|
11
10
|
}
|
|
12
11
|
const initData = JSON.parse(JSON.stringify(arr[0]))
|
|
13
12
|
initData.jsonParam.logBaseInfo = []
|
|
14
13
|
initData.jsonParam.etModelInfo.lstms = []
|
|
15
14
|
return arr.reduce((acc, cur) => {
|
|
16
15
|
cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo.pos
|
|
17
16
|
acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
|
|
18
17
|
acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
|
|
19
18
|
return acc
|
|
20
19
|
}, initData)
|
|
21
20
|
if(!Array.isArray(data)){
|
|
22
21
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
|
|
23
22
|
return
|
|
24
23
|
}
|
|
25
24
|
const [floorData, mInfo, etModelInfo] = data
|
|
26
25
|
if(floorData && mInfo && etModelInfo){
|
|
27
26
|
const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
|
|
28
27
|
if(arrTask.length === 0){
|
|
29
28
|
startWaitTime = Date.now()
|
|
30
29
|
}
|
|
31
30
|
if(reportJson){
|
|
32
31
|
arrTask.push(reportJson)
|
|
33
32
|
clearTimeout(timer)
|
|
34
33
|
timer = setTimeout(check, 1000)
|
|
35
34
|
check()
|
|
36
35
|
}
|
|
37
36
|
}else{
|
|
38
37
|
console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
|
|
39
38
|
}
|
|
39
|
+
import track from '../../../open/api/track'
|
|
40
40
|
const {arr : arrTask, startWaitTime} = floorTask
|
|
41
41
|
const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
|
|
42
42
|
const isOverMax = arrTask.length >= 10
|
|
43
43
|
const hasData = arrTask.length > 0
|
|
44
44
|
if(hasData && (isTimeout || isOverMax)){
|
|
45
45
|
const reduceData = connactData(arrTask)
|
|
46
46
|
track.reportExposureEventLog(reduceData)
|
|
47
47
|
floorTask.arr = []
|
|
48
48
|
floorTask.startWaitTime = 0
|
|
49
49
|
clearTimeout(floorTask.timer)
|
|
50
50
|
}
|
|
51
51
|
const initData = JSON.parse(JSON.stringify(arr[0]))
|
|
52
52
|
initData.jsonParam.logBaseInfo = []
|
|
53
53
|
initData.jsonParam.etModelInfo.lstms = []
|
|
54
54
|
return arr.reduce((acc, cur) => {
|
|
55
55
|
cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo.pos
|
|
56
56
|
acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
|
|
57
57
|
acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
|
|
58
58
|
return acc
|
|
59
59
|
}, initData)
|
|
60
60
|
if(!Array.isArray(data)){
|
|
61
61
|
console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
|
|
62
62
|
return
|
|
63
63
|
}
|
|
64
64
|
const [floorData, mInfo, etModelInfo] = data
|
|
65
65
|
if(floorData && mInfo && etModelInfo){
|
|
66
66
|
const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
|
|
67
67
|
const { floorIdx } = floorData
|
|
68
68
|
if(!task[floorIdx]){
|
|
69
69
|
task[floorIdx] = {
|
|
70
70
|
arr: [],
|
|
71
71
|
startWaitTime: 0,
|
|
72
72
|
timer : 0
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
const floorTask = task[floorIdx]
|
|
76
76
|
if(floorTask.arr.length === 0){
|
|
77
77
|
floorTask.startWaitTime = Date.now()
|
|
78
78
|
}
|
|
79
79
|
if(reportJson){
|
|
80
80
|
floorTask.arr.push(reportJson)
|
|
81
81
|
clearTimeout(floorTask.timer)
|
|
82
82
|
floorTask.timer = setTimeout(() => {
|
|
83
83
|
check(floorTask)
|
|
84
84
|
}, 1000)
|
|
85
85
|
check(floorTask)
|
|
86
86
|
}
|
|
87
87
|
}else{
|
|
88
88
|
console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
|
|
89
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React, { Suspense, lazy } from 'react'
|
|
1
|
+
import React, { Suspense, lazy } from 'react'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React from 'react'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import DraException from "../utils/jm-js-agent";
|