@conecli/cone-render 0.8.20 → 0.8.21-shop-beta.3

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.
Files changed (117) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.jd.ts +1 -1
  5. package/dist/common/index.ts +1 -1
  6. package/dist/common/index.weapp.ts +1 -1
  7. package/dist/common/isvStorage/index.h5.ts +1 -0
  8. package/dist/common/isvStorage/index.ts +1 -0
  9. package/dist/common/token/const.ts +1 -0
  10. package/dist/common/token/index.h5.ts +1 -0
  11. package/dist/common/token/index.ts +1 -0
  12. package/dist/common/token/token.jd.ts +1 -0
  13. package/dist/common/token/token.ts +1 -0
  14. package/dist/common/token/token.wxapp.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CommonFloorHead/index.module.scss +1 -1
  17. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  18. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  19. package/dist/components/base/CustomVideo/const.ts +1 -0
  20. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  21. package/dist/components/base/CustomVideo/index.tsx +1 -1
  22. package/dist/components/base/Dialog/index.module.scss +6 -2
  23. package/dist/components/base/Dialog/index.tsx +1 -1
  24. package/dist/components/base/ExposureSmart/const.ts +1 -0
  25. package/dist/components/base/ExposureSmart/index.h5.module.scss +18 -4
  26. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  28. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  29. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  30. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  31. package/dist/components/base/InViewRender/index.tsx +1 -1
  32. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  33. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  34. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  35. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  37. package/dist/components/base/NetworkDataError/const.ts +1 -1
  38. package/dist/components/base/NetworkDataError/index.module.scss +7 -1
  39. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  40. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  41. package/dist/components/base/Price/Base/index.module.scss +136 -0
  42. package/dist/components/base/Price/Base/index.tsx +1 -0
  43. package/dist/components/base/Price/Double/index.module.scss +158 -0
  44. package/dist/components/base/Price/Double/index.tsx +1 -0
  45. package/dist/components/base/Price/index.tsx +1 -1
  46. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  47. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  48. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  49. package/dist/components/floorItem.jd.tsx +1 -0
  50. package/dist/components/floorItem.tsx +1 -1
  51. package/dist/components/isv/Floor/index.tsx +1 -1
  52. package/dist/components/remoteFloorItem.tsx +1 -0
  53. package/dist/interface/common.ts +1 -1
  54. package/dist/interface/component.ts +1 -1
  55. package/dist/interface/jumpEventReport.ts +1 -1
  56. package/dist/interface/service.ts +1 -1
  57. package/dist/jumpEventReport/base.ts +1 -1
  58. package/dist/jumpEventReport/const.ts +1 -1
  59. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  60. package/dist/jumpEventReport/index.h5.ts +1 -1
  61. package/dist/jumpEventReport/index.ts +1 -1
  62. package/dist/jumpEventReport/index.weapp.ts +1 -1
  63. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  64. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  65. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  66. package/dist/jumpEventReport/web/report.ts +1 -1
  67. package/dist/jumpEventReport/web.base.ts +1 -1
  68. package/dist/jumpEventReport/web.jd.ts +1 -1
  69. package/dist/jumpEventReport/web.jdb.ts +1 -0
  70. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  71. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  72. package/dist/libs/taroAppReport.js +2 -2
  73. package/dist/modules/ContainerFloorList/index.h5.module.scss +10 -1
  74. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  75. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  76. package/dist/open/api/device.ts +1 -1
  77. package/dist/open/api/index.ts +1 -1
  78. package/dist/open/api/jump/business.ts +1 -0
  79. package/dist/open/api/jump/index.ts +1 -0
  80. package/dist/open/api/jump/minPath.ts +1 -0
  81. package/dist/open/api/jump/side.ts +1 -0
  82. package/dist/open/api/jump/webUrl.ts +1 -0
  83. package/dist/open/api/jump copy.ts +1 -0
  84. package/dist/open/api/moduleUtil.ts +1 -1
  85. package/dist/open/api/request.ts +1 -0
  86. package/dist/open/api/shopMember.ts +1 -0
  87. package/dist/open/api/track.ts +1 -1
  88. package/dist/open/api/userToken.ts +1 -0
  89. package/dist/open/api/util.ts +1 -1
  90. package/dist/open/components/index.ts +1 -1
  91. package/dist/service/bMallConst.ts +1 -0
  92. package/dist/service/bMallConst.weapp.ts +1 -0
  93. package/dist/service/fetchGateway.ts +1 -0
  94. package/dist/service/fetchJsonp.ts +1 -0
  95. package/dist/service/http/colorSign.ts +1 -0
  96. package/dist/service/http/colorSign.weapp.ts +1 -0
  97. package/dist/service/http/const.ts +1 -0
  98. package/dist/service/http/http.ts +1 -0
  99. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  100. package/dist/service/http/httpInterceptors.ts +1 -0
  101. package/dist/service/http/index.ts +1 -0
  102. package/dist/service/requestServer.ts +1 -0
  103. package/dist/utils/connectNativeJsBridge.ts +1 -1
  104. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  105. package/dist/utils/h5Utils.ts +1 -1
  106. package/dist/utils/index.h5.ts +1 -1
  107. package/dist/utils/index.ts +1 -1
  108. package/dist/utils/index.weapp.ts +1 -1
  109. package/dist/utils/intersectionObserver.ts +1 -1
  110. package/dist/utils/jm-common.js +1 -1
  111. package/dist/utils/memberFormatUtils.js +1 -0
  112. package/dist/utils/priceUtils.js +1 -0
  113. package/dist/utils/ready.ts +1 -0
  114. package/dist/utils/utils.ts +1 -1
  115. package/package.json +9 -5
  116. package/dist/components/base/Price/index.module.scss +0 -136
  117. package/dist/open/api/jump.ts +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
2
2
  title: '',
3
3
  message: null,
4
4
  className: '',
5
5
  maskCloseable: false,
6
6
  show: true,
7
7
  hasFooter: true,
8
8
  isCustom: false,
9
9
  titleNode: null,
10
10
  bodyNode: null,
11
11
  footerNode: null,
12
12
  closeBtnText: '取消',
13
13
  closeBtnHideState: false,
14
14
  confirmBtnText: '确定',
15
15
  confirmBtnHideState: false,
16
16
  onBeforeConfirm: null,
17
17
  onConfirm: null,
18
18
  onClose: null,
19
19
  onBackground: null,
20
20
  onHide: null,
21
21
  onInit: null,
22
22
  isFormDialog: false,
23
23
  onFormSubmit: null,
24
24
  onFormReset: null,
25
25
  forbiddenBgScrollState: true,
26
26
  const [dialogShowState, setDialogShowState] = useState(false)
27
27
  const [dialogConfig, setDialogConfig] =
28
28
  useState<ComponentInterFace.DialogConfigProps>({
29
29
  type: DialogType.BASE,
30
30
  })
31
31
  const dialogBackFnRef = useRef<ComponentInterFace.DialogConfigBackFn>({})
32
32
  useEffect(() => {
33
33
 
34
34
  Taro.eventCenter.on(TaroEventType.DIALOG, (res) => {
35
35
  res.show ? dialogInit(res) : setDialogShowState(false)
36
36
  })
37
37
  return () => {
38
38
  Taro.eventCenter.off(TaroEventType.DIALOG)
39
39
  }
40
40
  }, [])
41
41
 
42
42
  useEffect(() => {
43
43
  if (dialogConfig.forbiddenBgScrollState && taroJdBaseInfo.rootEleNode) {
44
44
  !dialogShowState ? taroJdBaseInfo.rootEleNode.classList.remove('over-hidden') : taroJdBaseInfo.rootEleNode.classList.add('over-hidden')
45
45
  }
46
46
  }, [dialogConfig, dialogShowState])
47
47
  const dialogInit = useCallback((opts) => {
48
48
  const {
49
49
  onBeforeConfirm,
50
50
  onConfirm,
51
51
  onClose,
52
52
  onBackground,
53
53
  onHide,
54
54
  onInit,
55
55
  onFormSubmit,
56
56
  onFormReset,
57
57
  ...otherOpts
58
58
  } = opts
59
59
  const dialogOpts = Object.assign(
60
60
  {},
61
61
  {
62
62
  ...dialogDefaultConfig,
63
63
  type: DialogType.BASE,
64
64
  },
65
65
  otherOpts,
66
66
  )
67
67
  dialogBackFnRef.current = {
68
68
  onInit,
69
69
  onBeforeConfirm,
70
70
  onConfirm,
71
71
  onClose,
72
72
  onBackground,
73
73
  onHide,
74
74
  onFormSubmit,
75
75
  onFormReset,
76
76
  }
77
77
  setDialogConfig(dialogOpts)
78
78
  setDialogShowState(true)
79
79
  }, [])
80
80
  const hideDialog = useCallback(() => {
81
81
  setDialogShowState(false)
82
82
  }, [])
83
83
  const closeDialog = useCallback(() => {
84
84
  hideDialog()
85
85
  dialogBackFnRef.current.onHide &&
86
86
  typeof dialogBackFnRef.current.onHide === 'function' &&
87
87
  dialogBackFnRef.current.onHide(dialogConfig)
88
88
  }, [dialogConfig])
89
89
 
90
90
  const updateDialogContentFn = (changeDialogConfig) => {
91
91
  setDialogConfig({
92
92
  ...dialogConfig,
93
93
  ...changeDialogConfig
94
94
  })
95
95
  }
96
96
  useEffect(() => {
97
97
  dialogShowState &&
98
98
  dialogBackFnRef.current.onInit &&
99
99
  typeof dialogBackFnRef.current.onInit === 'function' &&
100
100
  dialogBackFnRef.current.onInit(hideDialog, dialogConfig, updateDialogContentFn)
101
101
  }, [dialogShowState])
102
102
 
103
103
  const dialogConfirmFn = useCallback(
104
104
  (e) => {
105
105
  e.stopPropagation()
106
106
  if (
107
107
  dialogBackFnRef.current.onBeforeConfirm &&
108
108
  typeof dialogBackFnRef.current.onBeforeConfirm === 'function'
109
109
  ) {
110
110
  dialogBackFnRef.current.onBeforeConfirm(
111
111
  hideDialog,
112
112
  dialogConfig,
113
113
  )
114
114
  } else {
115
115
  closeDialog()
116
116
  dialogBackFnRef.current.onConfirm &&
117
117
  typeof dialogBackFnRef.current.onConfirm === 'function' &&
118
118
  dialogBackFnRef.current.onConfirm(dialogConfig)
119
119
  }
120
120
  },
121
121
  [dialogConfig],
122
122
  )
123
123
  const dialogCloseFn = useCallback(
124
124
  (e) => {
125
125
  e.stopPropagation()
126
126
  closeDialog()
127
127
  dialogBackFnRef.current.onClose &&
128
128
  typeof dialogBackFnRef.current.onClose === 'function' &&
129
129
  dialogBackFnRef.current.onClose(dialogConfig)
130
130
  },
131
131
  [dialogConfig],
132
132
  )
133
133
  const dialogBackgroundFn = useCallback(() => {
134
134
  if (dialogConfig.maskCloseable) {
135
135
  closeDialog()
136
136
  }
137
137
  if (
138
138
  dialogBackFnRef.current.onBackground &&
139
139
  typeof dialogBackFnRef.current.onBackground === 'function'
140
140
  ) {
141
141
  dialogBackFnRef.current.onBackground()
142
142
  }
143
143
  }, [dialogConfig])
144
144
  const dialogFormSubmit = useCallback((e) => {
145
145
  if (
146
146
  dialogBackFnRef.current.onFormSubmit &&
147
147
  typeof dialogBackFnRef.current.onFormSubmit === 'function'
148
148
  ) {
149
149
  dialogBackFnRef.current.onFormSubmit(e,hideDialog, dialogConfig)
150
150
  }
151
151
  }, [dialogConfig])
152
152
  const dialogFormReset = useCallback((e) => {
153
153
  if (
154
154
  dialogBackFnRef.current.onFormReset &&
155
155
  typeof dialogBackFnRef.current.onFormReset === 'function'
156
156
  ) {
157
157
  dialogBackFnRef.current.onFormReset(e,hideDialog, dialogConfig)
158
158
  }
159
159
  }, [dialogConfig])
160
160
  const renderCustomViewCompontent = (children) => {
161
161
  return dialogConfig.isFormDialog ?
162
162
  <Form className={classNames(dialogStyle['d-form-dialog'])} onSubmit={dialogFormSubmit}
163
163
  onReset={dialogFormReset}>{children}</Form> : <>{children}</>
164
164
  }
165
165
  return dialogShowState ? renderCustomViewCompontent(
166
166
  <>
167
167
  <View
168
168
  className={dialogStyle['d-dialog-layout']}
169
169
  onClick={dialogBackgroundFn}
170
170
  >
171
171
  <View
172
172
  className={classNames(
173
173
  dialogStyle['d-dialog-wrap'],
174
174
  dialogStyle[`d-dialog-type-${dialogConfig.type}`],
175
175
  'flexible-center-box',
176
176
  dialogConfig.className,
177
177
  )}
178
178
  >
179
179
  {dialogConfig.isCustom ? (
180
180
  dialogConfig.bodyNode ? (
181
181
  dialogConfig.bodyNode
182
182
  ) : null
183
183
  ) : (
184
184
  <View
185
185
  className={classNames(
186
186
  dialogStyle['d-dialog-content'],
187
187
  'd-dialog-content',
188
188
  )}
189
189
  onClick={(e) => e.stopPropagation()}
190
190
  >
191
191
  {dialogConfig.title && dialogConfig.title != '' && (
192
192
  <View
193
193
  className={classNames(
194
194
  dialogStyle['d-dialog-header'],
195
195
  'd-dialog-header',
196
196
  )}
197
197
  >
198
198
  {dialogConfig.title}
199
199
  </View>
200
200
  )}
201
201
  {dialogConfig.message && (
202
202
  <View
203
203
  className={classNames(
204
204
  dialogStyle['d-dialog-body'],
205
205
  'd-dialog-body',
206
206
  )}
207
207
  dangerouslySetInnerHTML={{
208
208
  __html: dialogConfig.message,
209
209
  }}
210
210
  />
211
211
  )}
212
212
  {dialogConfig.bodyNode && (
213
213
  <View
214
214
  className={classNames(
215
215
  dialogStyle['d-dialog-body'],
216
216
  'd-dialog-body',
217
217
  )}
218
218
  >
219
219
  {dialogConfig.bodyNode
220
220
  ? dialogConfig.bodyNode
221
221
  : null}
222
222
  </View>
223
223
  )}
224
224
  {dialogConfig.footerNode ? (
225
225
  dialogConfig.footerNode
226
226
  ) : dialogConfig.hasFooter ? (
227
227
  <View
228
228
  className={classNames(
229
229
  dialogStyle['d-dialog-footer'],
230
230
  'd-dialog-footer',
231
231
  'flexible-box',
232
232
  )}
233
233
  >
234
234
  {!dialogConfig.closeBtnHideState && (
235
235
  <Button
236
236
  className={classNames(
237
237
  dialogStyle['d-dialog-btn'],
238
238
  dialogStyle[
239
239
  'd-dialog-cancel-btn'
240
240
  ],
241
241
  'd-dialog-cancel-btn',
242
242
  'adaptive-box-flex',
243
243
  )}
244
244
  form-type={dialogConfig.isFormDialog ? 'reset' : ''}
245
245
  onClick={dialogCloseFn}
246
246
  >
247
247
  {dialogConfig.closeBtnText}
248
248
  </Button>
249
249
  )}
250
250
  {!dialogConfig.confirmBtnHideState && (
251
251
  <Button
252
252
  className={classNames(
253
253
  dialogStyle['d-dialog-btn'],
254
254
  dialogStyle[
255
255
  'd-dialog-ensure-btn'
256
256
  ],
257
257
  'd-dialog-ensure-btn',
258
258
  'adaptive-box-flex',
259
259
  )}
260
260
  onClick={dialogConfirmFn}
261
261
  form-type={dialogConfig.isFormDialog ? 'submit' : ''}
262
262
  >
263
263
  {dialogConfig.confirmBtnText}
264
264
  </Button>
265
265
  )}
266
266
  </View>
267
267
  ) : null}
268
268
  </View>
269
269
  )
270
270
  }
271
271
  </View>
272
272
  </View>
273
273
  </>,
274
274
  ) : null
@@ -0,0 +1 @@
1
+ export const TrackType = {
2
  point: 0,
1
3
  floor: 1,
@@ -1,8 +1,22 @@
1
1
 
2
- .root {
3
- position: absolute;
4
- width: 1PX;
5
- height: 0;
2
+ //坑位曝光
3
+ .d-report-point {
4
+ position: absolute;
5
+ top: 0;
6
+ left: 0;
7
+ right: 0;
8
+ bottom: 0;
6
9
  opacity: 0;
7
10
  pointer-events: none;
11
+ z-index: -1;
12
+ }
13
+ //楼层曝光
14
+ .d-report-floor {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ right: 0;
19
+ height: 1px;
20
+ pointer-events: none;
21
+ z-index: -1;
8
22
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  const inViewCallback = () => {
3
2
  console.log('埋点收到进入可视区域的回到啦!', reportData)
4
3
  addReportData(reportData)
5
4
  }
6
5
  exposureStyle.root,
7
6
  className,
8
7
  )} height={'100%'} inViewCallback={inViewCallback}></InViewRender>
8
+ import React, { useMemo } from 'react'
9
9
  const { type, className, reportData, trackCallback, markPoint } = props
10
10
  const isViewOnlineState =
11
11
  taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
12
12
  const inViewCallback = () => {
13
13
  console.log('埋点收到进入可视区域的回到啦!', reportData)
14
14
  addReportData(reportData)
15
15
  typeof trackCallback === 'function' && trackCallback(reportData)
16
16
  }
17
17
  let chartPointClassName = ""
18
18
 
19
19
  if(isChartH5 && markPoint && Array.isArray(reportData)){
20
20
  const [floorData, mInfo] = reportData
21
21
  if(floorData && mInfo && mInfo.hasOwnProperty('pos') ){
22
22
  chartPointClassName = track.getFloorPointIndexClassName(floorData, mInfo.pos)
23
23
  }
24
24
  }
25
25
  return isViewOnlineState && reportData
26
26
  ? <InViewRender className={classNames(
27
27
  {
28
28
  [exposureStyle['d-report-point']]: type === TrackType.point,
29
29
  },
30
30
  {
31
31
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
32
32
  },
33
33
  className,
34
34
  chartPointClassName
35
35
  )} height={'100%'} inViewCallback={inViewCallback}></InViewRender>
36
36
  : null
37
37
  return useMemo(() => {
38
38
  return <Exposure {...props} />
39
39
  }, [])
40
40
  reportData: null,
41
41
  trackCallback: null,
42
42
  type: TrackType.point,
43
43
  markPoint: false
@@ -1,11 +1,22 @@
1
1
 
2
- .d-floor-exposure {
3
- position: absolute;
4
- top: 0;
5
- left: 0;
6
- right: 0;
7
- height: 1px;
8
- width: 100%;
9
- opacity: 0;
10
- pointer-events: none;
2
+ //坑位曝光
3
+ .d-report-point {
4
+ position: absolute;
5
+ top: 0;
6
+ left: 0;
7
+ right: 0;
8
+ bottom: 0;
9
+ opacity: 0;
10
+ pointer-events: none;
11
+ z-index: -1;
12
+ }
13
+ //楼层曝光
14
+ .d-report-floor {
15
+ position: absolute;
16
+ top: 0;
17
+ left: 0;
18
+ right: 0;
19
+ height: 1px;
20
+ pointer-events: none;
21
+ z-index: -1;
11
22
  }
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
1
+ import Taro from '@tarojs/taro'
2
2
  const { type, className, reportData, trackCallback } = props
3
3
  const checkReportData = Array.isArray(reportData)
4
4
  const [floorData, mInfo] = checkReportData ? reportData : []
5
5
  const getFloorPointClassName = `J_floor_${floorData?.uid}_index_${mInfo?.pos}`
6
6
  if (
7
7
  !taroJdBaseInfo.info.pageInfo.floorExposureInfo[
8
8
  getFloorPointClassName
9
9
  ]
10
10
  ){
11
11
  const createIntersectionObserver = new intersectionObserver({
12
12
  selector: `#J_floor_${floorData?.uid} >>> .${getFloorPointClassName}`,
13
13
  context: this,
14
14
  onFinal: (res) => {
15
15
  taroJdBaseInfo.info.pageInfo.floorExposureInfo[
16
16
  getFloorPointClassName
17
17
  ] = true
18
18
  console.log('小程序曝光埋点收到进入可视区域啦!', getFloorPointClassName, reportData, res)
19
19
  addReportData(reportData)
20
20
  typeof trackCallback === 'function' && trackCallback(reportData)
21
21
  createIntersectionObserver.disconnect()
22
22
  },
23
23
  })
24
24
  createIntersectionObserver.connect()
25
25
  }
26
26
  floorData &&
27
27
  mInfo && (
28
28
  {
29
29
  [exposureStyle['d-report-point']]: type === TrackType.point,
30
30
  },
31
31
  {
32
32
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
33
33
  },
34
34
  getFloorPointClassName,
35
35
  reportData: null,
36
36
  trackCallback: null,
37
37
  type: TrackType.point,
@@ -1 +1 @@
1
- import track from '../../../open/api/track'
2
1
  const {arr : arrTask, startWaitTime} = floorTask
3
2
  const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
4
3
  const isOverMax = arrTask.length >= 10
5
4
  const hasData = arrTask.length > 0
6
5
  if(hasData && (isTimeout || isOverMax)){
7
6
  const reduceData = connactData(arrTask)
8
7
  track.reportExposureEventLog(reduceData)
9
8
  floorTask.arr = []
10
9
  floorTask.startWaitTime = 0
11
10
  clearTimeout(floorTask.timer)
12
11
  }
13
12
  const initData = JSON.parse(JSON.stringify(arr[0]))
14
13
  initData.jsonParam.logBaseInfo = []
15
14
  initData.jsonParam.etModelInfo.lstms = []
16
15
  return arr.reduce((acc, cur) => {
17
16
  cur.jsonParam.etModelInfo.lstms[0].la_p = cur.jsonParam.logBaseInfo.mInfo.pos
18
17
  acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
19
18
  acc.jsonParam.etModelInfo.lstms.push(cur.jsonParam.etModelInfo.lstms)
20
19
  return acc
21
20
  }, initData)
22
21
  if(!Array.isArray(data)){
23
22
  console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
24
23
  return
25
24
  }
26
25
  const [floorData, mInfo, etModelInfo] = data
27
26
  if(floorData && mInfo && etModelInfo){
28
27
  const reportJson = track.getIsvExposureInfo(floorData, mInfo, etModelInfo)
29
28
  const { floorIdx } = floorData
30
29
  if(!task[floorIdx]){
31
30
  task[floorIdx] = {
32
31
  arr: [],
33
32
  startWaitTime: 0,
34
33
  timer : 0
35
34
  }
36
35
  }
37
36
  const floorTask = task[floorIdx]
38
37
  if(floorTask.arr.length === 0){
39
38
  floorTask.startWaitTime = Date.now()
40
39
  }
41
40
  if(reportJson){
42
41
  floorTask.arr.push(reportJson)
43
42
  clearTimeout(floorTask.timer)
44
43
  floorTask.timer = setTimeout(() => {
45
44
  check(floorTask)
46
45
  }, 1000)
47
46
  check(floorTask)
48
47
  }
49
48
  }else{
50
49
  console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
51
50
  }
51
+ import track from '../../../open/api/track'
52
52
  const {arr : arrTask, startWaitTime} = floorTask
53
53
  const isTimeout = startWaitTime != 0 && (Date.now() - startWaitTime >= 1000)
54
54
  const arrTaskNum = arrTask.length;
55
55
  const isOverMax = arrTaskNum >= 10
56
56
  const hasData = arrTaskNum > 0
57
57
  if(hasData && (isTimeout || isOverMax)){
58
58
  const reduceData = connactData(arrTask)
59
59
  track.reportExposureEventLog(reduceData)
60
60
  floorTask.arr = []
61
61
  floorTask.startWaitTime = 0
62
62
  clearTimeout(floorTask.timer)
63
63
  }
64
64
  const initData = JSON.parse(JSON.stringify(arr[0]))
65
65
  if(initData.jsonParam.etModelInfo) {
66
66
  initData.jsonParam.logBaseInfo = []
67
67
  initData.jsonParam.etModelInfo.lstms = []
68
68
  return arr.reduce((acc, cur) => {
69
69
  acc.jsonParam.logBaseInfo.push(cur.jsonParam.logBaseInfo)
70
70
  return acc
71
71
  }, initData)
72
72
  } else {
73
73
  return arr.reduce((acc) => {
74
74
  return acc
75
75
  })
76
76
  }
77
77
  if(!Array.isArray(data)){
78
78
  console.log('坑位曝光埋点原始数据参类型错误,期望是数组,实际是:', data)
79
79
  return
80
80
  }
81
81
  const [floorData, mInfo, etModelInfo] = data
82
82
  if(floorData && mInfo && etModelInfo){
83
83
  const isIsvReportModule = isvReportModuleTypeList.includes(floorData?.floorExtInfo?.moduleFlag)
84
84
  try {
85
85
  const reportJson = track.getExposureInfo(floorData, mInfo, etModelInfo,true, isIsvReportModule)
86
86
  console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`,reportJson)
87
87
  const { floorIdx } = floorData
88
88
  if(!task[floorIdx]){
89
89
  task[floorIdx] = {
90
90
  arr: [],
91
91
  startWaitTime: 0,
92
92
  timer : 0
93
93
  }
94
94
  }
95
95
  const floorTask = task[floorIdx]
96
96
  if(floorTask.arr.length === 0){
97
97
  floorTask.startWaitTime = Date.now()
98
98
  }
99
99
  if(reportJson){
100
100
  floorTask.arr.push(reportJson)
101
101
  clearTimeout(floorTask.timer)
102
102
  floorTask.timer = setTimeout(() => {
103
103
  check(floorTask)
104
104
  }, 1000)
105
105
  check(floorTask)
106
106
  }
107
107
  }catch (e) {
108
108
  {
109
109
  console.log('坑位曝光埋点出错啦',e)
110
110
  }
111
111
  }
112
112
  }else{
113
113
  console.log('坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:', data)
114
114
  }