@conecli/cone-render 0.8.19 → 0.8.20-beta.2

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 (183) hide show
  1. package/README.md +7 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/assets/icon_blue_info.svg +1 -0
  4. package/dist/common/const.ts +1 -1
  5. package/dist/common/environmentType.ts +1 -0
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/isvStorage/index.h5.ts +1 -0
  11. package/dist/common/isvStorage/index.ts +1 -0
  12. package/dist/common/jdplayerSdk.ts +1 -0
  13. package/dist/common/jssdk.ts +1 -0
  14. package/dist/common/pageType.ts +1 -0
  15. package/dist/common/sgmCustomCode.ts +1 -0
  16. package/dist/common/token/const.ts +1 -0
  17. package/dist/common/token/index.h5.ts +1 -0
  18. package/dist/common/token/index.ts +1 -0
  19. package/dist/common/token/token.jd.ts +1 -0
  20. package/dist/common/token/token.ts +1 -0
  21. package/dist/common/token/token.wxapp.ts +1 -0
  22. package/dist/common/wxappApi.jd.ts +1 -0
  23. package/dist/common/wxappApi.ts +1 -1
  24. package/dist/components/ErrorBoundary.tsx +1 -1
  25. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  26. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  27. package/dist/components/base/CountDown/index.module.scss +49 -44
  28. package/dist/components/base/CountDown/index.tsx +1 -1
  29. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  30. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  31. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  32. package/dist/components/base/CustomVideo/common.ts +1 -0
  33. package/dist/components/base/CustomVideo/const.ts +1 -0
  34. package/dist/components/base/CustomVideo/index.module.scss +40 -64
  35. package/dist/components/base/CustomVideo/index.tsx +1 -1
  36. package/dist/components/base/Dialog/index.module.scss +22 -2
  37. package/dist/components/base/Dialog/index.tsx +1 -1
  38. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  39. package/dist/components/base/ExposureSmart/const.ts +1 -0
  40. package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
  41. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  42. package/dist/components/base/ExposureSmart/index.module.scss +20 -9
  43. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  44. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  45. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  46. package/dist/components/base/InViewRender/index.tsx +1 -1
  47. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  48. package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
  49. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
  50. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  51. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  52. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  53. package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
  54. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  55. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  56. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  57. package/dist/components/base/NetworkDataError/const.ts +1 -1
  58. package/dist/components/base/NetworkDataError/index.module.scss +128 -69
  59. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  60. package/dist/components/base/Price/{const.ts → Base/const.ts} +0 -0
  61. package/dist/components/base/Price/Base/index.module.scss +148 -0
  62. package/dist/components/base/Price/Base/index.tsx +1 -0
  63. package/dist/components/base/Price/Double/index.module.scss +190 -0
  64. package/dist/components/base/Price/Double/index.tsx +1 -0
  65. package/dist/components/base/Price/index.tsx +1 -1
  66. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  67. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  68. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  69. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  70. package/dist/components/base/Skeleton/index.tsx +1 -1
  71. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  72. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  73. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  74. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  75. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  76. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  77. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  78. package/dist/components/floorItem.jd.tsx +1 -0
  79. package/dist/components/floorItem.tsx +1 -1
  80. package/dist/components/floorItem.weapp.tsx +1 -1
  81. package/dist/components/isv/Floor/index.tsx +1 -1
  82. package/dist/components/remoteFloorItem.tsx +1 -0
  83. package/dist/interface/common.ts +1 -1
  84. package/dist/interface/component.ts +1 -1
  85. package/dist/interface/jumpEventReport.ts +1 -1
  86. package/dist/interface/service.ts +1 -1
  87. package/dist/interface/utils.ts +1 -1
  88. package/dist/jumpEventReport/base.ts +1 -1
  89. package/dist/jumpEventReport/const.ts +1 -1
  90. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  91. package/dist/jumpEventReport/index.h5.ts +1 -1
  92. package/dist/jumpEventReport/index.jd.ts +1 -1
  93. package/dist/jumpEventReport/index.ts +1 -1
  94. package/dist/jumpEventReport/index.weapp.ts +1 -1
  95. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  96. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  97. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  98. package/dist/jumpEventReport/web/report.ts +1 -1
  99. package/dist/jumpEventReport/web.base.ts +1 -1
  100. package/dist/jumpEventReport/web.jd.ts +1 -1
  101. package/dist/jumpEventReport/web.jdb.ts +1 -0
  102. package/dist/jumpEventReport/web.jdjch.ts +1 -0
  103. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  104. package/dist/jumpEventReport/web.pc.ts +1 -0
  105. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  106. package/dist/jumpEventReport/web.tjm.ts +1 -0
  107. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  108. package/dist/language/en_US.json +231 -0
  109. package/dist/language/zh_CN.json +231 -0
  110. package/dist/language/zh_HK.json +231 -0
  111. package/dist/libs/taroAppReport.js +2 -2
  112. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -27
  113. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  114. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  115. package/dist/open/api/device.ts +1 -1
  116. package/dist/open/api/environment.ts +1 -1
  117. package/dist/open/api/index.ts +1 -1
  118. package/dist/open/api/jump/business.ts +1 -0
  119. package/dist/open/api/jump/index.ts +1 -0
  120. package/dist/open/api/jump/minPath.ts +1 -0
  121. package/dist/open/api/jump/side.ts +1 -0
  122. package/dist/open/api/jump/webUrl.ts +1 -0
  123. package/dist/open/api/jump copy.ts +1 -0
  124. package/dist/open/api/moduleUtil.ts +1 -1
  125. package/dist/open/api/request.ts +1 -0
  126. package/dist/open/api/shopMember.ts +1 -0
  127. package/dist/open/api/track.ts +1 -1
  128. package/dist/open/api/userToken.ts +1 -0
  129. package/dist/open/api/util.ts +1 -1
  130. package/dist/open/components/index.ts +1 -1
  131. package/dist/sass/app.h5.scss +294 -212
  132. package/dist/sass/base.scss +195 -137
  133. package/dist/service/bMallConst.ts +1 -0
  134. package/dist/service/bMallConst.weapp.ts +1 -0
  135. package/dist/service/fetchGateway.ts +1 -0
  136. package/dist/service/fetchGateway.weapp.ts +1 -0
  137. package/dist/service/fetchJsonp.ts +1 -0
  138. package/dist/service/http/colorSign.ts +1 -0
  139. package/dist/service/http/colorSign.weapp.ts +1 -0
  140. package/dist/service/http/const.ts +1 -0
  141. package/dist/service/http/h5Http.ts +1 -0
  142. package/dist/service/http/http.ts +1 -0
  143. package/dist/service/http/httpInterceptors.jd.ts +1 -0
  144. package/dist/service/http/httpInterceptors.ts +1 -0
  145. package/dist/service/http/index.h5.ts +1 -0
  146. package/dist/service/http/index.ts +1 -0
  147. package/dist/service/requestServer.h5.ts +1 -0
  148. package/dist/service/requestServer.ts +1 -0
  149. package/dist/service/requestServer.weapp.ts +1 -0
  150. package/dist/utils/connectNativeJsBridge.ts +1 -1
  151. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  152. package/dist/utils/draExceptionAndProfile.ts +1 -1
  153. package/dist/utils/h5Utils.ts +1 -1
  154. package/dist/utils/index.h5.ts +1 -1
  155. package/dist/utils/index.ts +1 -1
  156. package/dist/utils/index.weapp.ts +1 -1
  157. package/dist/utils/intersectionObserver.ts +1 -1
  158. package/dist/utils/jm-common.js +1 -1
  159. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  160. package/dist/utils/jumpExtMapUtil.ts +1 -0
  161. package/dist/utils/priceUtils.js +1 -0
  162. package/dist/utils/ready.ts +1 -0
  163. package/dist/utils/sColor.js +1 -0
  164. package/dist/utils/sgmCodeUtils.ts +1 -0
  165. package/dist/utils/taroRenderUtil.ts +1 -0
  166. package/dist/utils/utils.ts +1 -1
  167. package/dist/wxapp/api/helper.js +1 -0
  168. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  169. package/dist/wxapp/common/user_info.js +1 -1
  170. package/dist/wxapp/components/launch-app/index.js +1 -0
  171. package/dist/wxapp/components/launch-app/index.json +5 -0
  172. package/dist/wxapp/components/launch-app/index.wxml +0 -0
  173. package/dist/wxapp/components/launch-app/index.wxss +0 -0
  174. package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
  175. package/dist/wxapp/components/subscribe-guider/index.js +1 -0
  176. package/dist/wxapp/components/subscribe-guider/index.json +5 -0
  177. package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
  178. package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
  179. package/package.json +145 -114
  180. package/dist/components/base/Price/index.module.scss +0 -136
  181. package/dist/components/base/Skeleton/old.tsx +0 -1
  182. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  183. 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={classNames(dialogStyle['d-dialog-layout'],"J_customLayout")}
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
  {
176
176
  [dialogStyle['d-dialog-jdapp-wrap']]: isJdApp
177
177
  },
178
178
  'flexible-center-box',
179
179
  dialogConfig.className,
180
180
  )}
181
181
  >
182
182
  {dialogConfig.isCustom ? (
183
183
  dialogConfig.bodyNode ? (
184
184
  dialogConfig.bodyNode
185
185
  ) : null
186
186
  ) : (
187
187
  <View
188
188
  className={classNames(
189
189
  dialogStyle['d-dialog-content'],
190
190
  'd-dialog-content',
191
191
  )}
192
192
  onClick={(e) => e.stopPropagation()}
193
193
  >
194
194
  {dialogConfig.title && dialogConfig.title != '' && (
195
195
  <View
196
196
  className={classNames(
197
197
  dialogStyle['d-dialog-header'],
198
198
  'd-dialog-header',
199
199
  )}
200
200
  >
201
201
  {dialogConfig.title}
202
202
  </View>
203
203
  )}
204
204
  {dialogConfig.message && (
205
205
  <View
206
206
  className={classNames(
207
207
  dialogStyle['d-dialog-body'],
208
208
  'd-dialog-body',
209
209
  )}
210
210
  dangerouslySetInnerHTML={{
211
211
  __html: dialogConfig.message,
212
212
  }}
213
213
  />
214
214
  )}
215
215
  {dialogConfig.bodyNode && (
216
216
  <View
217
217
  className={classNames(
218
218
  dialogStyle['d-dialog-body'],
219
219
  'd-dialog-body',
220
220
  )}
221
221
  >
222
222
  {dialogConfig.bodyNode
223
223
  ? dialogConfig.bodyNode
224
224
  : null}
225
225
  </View>
226
226
  )}
227
227
  {dialogConfig.footerNode ? (
228
228
  dialogConfig.footerNode
229
229
  ) : dialogConfig.hasFooter ? (
230
230
  <View
231
231
  className={classNames(
232
232
  dialogStyle['d-dialog-footer'],
233
233
  'd-dialog-footer',
234
234
  'flexible-box',
235
235
  )}
236
236
  >
237
237
  {!dialogConfig.closeBtnHideState && (
238
238
  <Button
239
239
  className={classNames(
240
240
  dialogStyle['d-dialog-btn'],
241
241
  dialogStyle[
242
242
  'd-dialog-cancel-btn'
243
243
  ],
244
244
  'd-dialog-cancel-btn',
245
245
  'adaptive-box-flex',
246
246
  )}
247
247
  form-type={dialogConfig.isFormDialog ? 'reset' : ''}
248
248
  onClick={dialogCloseFn}
249
249
  >
250
250
  {dialogConfig.closeBtnText}
251
251
  </Button>
252
252
  )}
253
253
  {!dialogConfig.confirmBtnHideState && (
254
254
  <Button
255
255
  className={classNames(
256
256
  dialogStyle['d-dialog-btn'],
257
257
  dialogStyle[
258
258
  'd-dialog-ensure-btn'
259
259
  ],
260
260
  'd-dialog-ensure-btn',
261
261
  'adaptive-box-flex',
262
262
  )}
263
263
  onClick={dialogConfirmFn}
264
264
  form-type={dialogConfig.isFormDialog ? 'submit' : ''}
265
265
  >
266
266
  {dialogConfig.confirmBtnText}
267
267
  </Button>
268
268
  )}
269
269
  </View>
270
270
  ) : null}
271
271
  </View>
272
272
  )
273
273
  }
274
274
  </View>
275
275
  </View>
276
276
  </>,
277
277
  ) : null
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  (
3
2
  <View
4
3
  className={classNames(
5
4
  exposureStyle['d-floor-exposure'],
6
5
  className,
7
6
  floorName,
8
7
  )}
9
8
  id={`J_floor_${floorName}`}
10
9
  />
11
10
  )
11
+ import Taro from '@tarojs/taro'
12
12
  const { windowHeight } = taroJdBaseInfo.info.sysInfo
13
13
  (
14
14
  <View
15
15
  className={classNames(
16
16
  exposureStyle['d-floor-exposure'],
17
17
  className,
18
18
  floorName,
19
19
  )}
20
20
  id={`J_floor_${floorName}`}
21
21
  />
22
22
  )
@@ -0,0 +1 @@
1
+ export const TrackType = {
2
  point: 0,
1
3
  floor: 1,
@@ -1,8 +1,32 @@
1
1
 
2
- .root {
3
- position: absolute;
4
- width: 1PX;
5
- height: 0;
6
- opacity: 0;
7
- 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;
8
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;
22
+ }
23
+
24
+ :global{
25
+ .d-report-exposure-jd-point{
26
+ &:not(:empty){
27
+ opacity: 1;
28
+ z-index: 20;
29
+ }
30
+ }
31
+ }
32
+
@@ -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 {
10
10
  type,
11
11
  className,
12
12
  reportData,
13
13
  customReportDataKey,
14
14
  customReportDataFn,
15
15
  trackCallback,
16
16
  markPoint,
17
17
  innerRef,
18
18
  } = props;
19
19
  const isCustomReport = customReportDataKey && customReportDataFn;
20
20
  const isViewOnlineState = taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE;
21
21
  const showRenderState = isCustomReport ? true : reportData;
22
22
  const inViewCallback = () => {
23
23
  const getInsertFlowMapEle =
24
24
  innerRef?.current?.querySelector('.d-report-exposure-point') || createDefaultFlowMapEle;
25
25
  if (!isCustomReport) {
26
26
  addReportData(reportData, getInsertFlowMapEle);
27
27
  typeof trackCallback === 'function' && trackCallback(reportData);
28
28
  } else {
29
29
  if (typeof customReportDataFn === 'function') {
30
30
  const getReportData = customReportDataFn(customReportDataKey);
31
31
  getReportData &&
32
32
  getReportData?.eventId &&
33
33
  getReportData?.jsonParam &&
34
34
  track.reportExposureEventLog({
35
35
  ...getReportData,
36
36
  target: getInsertFlowMapEle,
37
37
  });
38
38
  }
39
39
  }
40
40
  };
41
41
  let chartPointClassName = '';
42
42
 
43
43
  if (isChartH5 && markPoint && Array.isArray(reportData)) {
44
44
  const [floorData, mInfo] = reportData;
45
45
  if (floorData && mInfo && mInfo.hasOwnProperty('pos')) {
46
46
  chartPointClassName = track.getFloorPointIndexClassName(floorData, mInfo.pos);
47
47
  }
48
48
  } else if (isCustomReport) {
49
49
  chartPointClassName = `J_custom_${customReportDataKey}`;
50
50
  }
51
51
  return isViewOnlineState && showRenderState ? (
52
52
  <InViewRender
53
53
  className={classNames(
54
54
  'd-report-exposure-point',
55
55
  {
56
56
  [exposureStyle['d-report-point']]: type === TrackType.point,
57
57
  },
58
58
  {
59
59
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
60
60
  },
61
61
  {
62
62
  'd-report-exposure-jd-point': isJdApp,
63
63
  },
64
64
  className,
65
65
  chartPointClassName,
66
66
  )}
67
67
  height={'100%'}
68
68
  inViewCallback={inViewCallback}
69
69
  ></InViewRender>
70
70
  ) : null;
71
71
  return useMemo(() => {
72
72
  return <Exposure {...props} />;
73
73
  }, []);
74
74
  reportData: null,
75
75
  trackCallback: null,
76
76
  type: TrackType.point,
77
77
  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, customReportDataKey, customReportDataFn, trackCallback } = props
3
3
  const isViewOnlineState =
4
4
  taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
5
5
  const isCustomReport = customReportDataKey && customReportDataFn
6
6
  const checkReportData = Array.isArray(reportData)
7
7
  const [floorData, mInfo] = checkReportData ? reportData : []
8
8
  const showRenderState = isCustomReport ? true : floorData && mInfo
9
9
  const getFloorPointClassName = isCustomReport ? `J_custom_${customReportDataKey}` : `J_floor_${floorData?.uid}_index_${mInfo?.pos}`
10
10
  const getTaroSelector = isCustomReport ? `#J_miniShopRoot >>> .${getFloorPointClassName}` : `#J_floor_${floorData?.uid} >>> .${getFloorPointClassName}`
11
11
  useEffect(() => {
12
12
  if (isViewOnlineState && reportData) {
13
13
  Taro.nextTick(() => {
14
14
  if (
15
15
  !taroJdBaseInfo.info.pageInfo.floorExposureInfo[
16
16
  getFloorPointClassName
17
17
  ]
18
18
  ){
19
19
  const createIntersectionObserver = new intersectionObserver({
20
20
  selector: getTaroSelector,
21
21
  context: this,
22
22
  onFinal: (res) => {
23
23
  taroJdBaseInfo.info.pageInfo.floorExposureInfo[
24
24
  getFloorPointClassName
25
25
  ] = true
26
26
  console.log('小程序曝光埋点收到进入可视区域啦!', getFloorPointClassName, reportData, res)
27
27
  if(!isCustomReport){
28
28
  addReportData(reportData)
29
29
  typeof trackCallback === 'function' && trackCallback(reportData)
30
30
  }else {
31
31
  typeof customReportDataFn === 'function' && customReportDataFn(customReportDataKey)
32
32
  }
33
33
  createIntersectionObserver.disconnect()
34
34
  },
35
35
  })
36
36
  createIntersectionObserver.connect()
37
37
  }
38
38
  })
39
39
  }
40
40
  }, [])
41
41
  return (showRenderState ? (
42
42
  <View
43
43
  className={classNames(
44
44
  {
45
45
  [exposureStyle['d-report-point']]: type === TrackType.point,
46
46
  },
47
47
  {
48
48
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
49
49
  },
50
50
  getFloorPointClassName,
51
51
  className,
52
52
  )}
53
53
  />
54
54
  ) : null
55
55
  )
56
56
  return useMemo(() => {
57
57
  return <ExposureFloor {...props} />
58
58
  }, [])
59
59
  reportData: null,
60
60
  trackCallback: null,
61
61
  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(
86
86
  floorData,
87
87
  mInfo,
88
88
  etModelInfo,
89
89
  true,
90
90
  isIsvReportModule,
91
91
  );
92
92
  console.log(`${floorData?.floorExtInfo?.moduleFlag}===reportJson===`, reportJson);
93
93
  const { floorIdx } = floorData;
94
94
  if (!task[floorIdx]) {
95
95
  task[floorIdx] = {
96
96
  arr: [],
97
97
  startWaitTime: 0,
98
98
  timer: 0,
99
99
  };
100
100
  }
101
101
  const floorTask = task[floorIdx];
102
102
  if (floorTask.arr.length === 0) {
103
103
  floorTask.startWaitTime = Date.now();
104
104
  }
105
105
  if (reportJson) {
106
106
  floorTask.arr.push(reportJson);
107
107
  clearTimeout(floorTask.timer);
108
108
  floorTask.timer = setTimeout(() => {
109
109
  check(floorTask);
110
110
  }, 1000);
111
111
  check(floorTask);
112
112
  }
113
113
  } catch (e) {
114
114
  {
115
115
  console.log('坑位曝光埋点出错啦', e);
116
116
  }
117
117
  }
118
118
  } else {
119
119
  console.log(
120
120
  '坑位曝光埋点原始数据参数缺失,期望是[floorData, mInfo, etModelInfo],实际是:',
121
121
  data,
122
122
  );
123
123
  }