@conecli/cone-render 0.9.1-shop2.7 → 0.9.1-shop2.9

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 (62) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -0
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/sgmCustomCode.ts +1 -0
  9. package/dist/common/token/token.ts +1 -1
  10. package/dist/common/wxappApi.jd.ts +1 -0
  11. package/dist/components/ErrorBoundary.tsx +1 -1
  12. package/dist/components/base/CountDown/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  14. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  15. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  16. package/dist/components/base/Dialog/index.module.scss +5 -0
  17. package/dist/components/base/Dialog/index.tsx +1 -1
  18. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  19. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  20. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  21. package/dist/components/floorItem.jd.tsx +1 -1
  22. package/dist/components/floorItem.weapp.tsx +1 -1
  23. package/dist/components/remoteFloorItem.tsx +1 -1
  24. package/dist/interface/common.ts +1 -1
  25. package/dist/interface/component.ts +1 -1
  26. package/dist/interface/jumpEventReport.ts +1 -1
  27. package/dist/interface/service.ts +1 -1
  28. package/dist/interface/utils.ts +1 -1
  29. package/dist/jumpEventReport/base.ts +1 -1
  30. package/dist/jumpEventReport/const.ts +1 -1
  31. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  32. package/dist/jumpEventReport/index.h5.ts +1 -1
  33. package/dist/jumpEventReport/index.jd.ts +1 -1
  34. package/dist/jumpEventReport/index.weapp.ts +1 -1
  35. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  36. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  37. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  38. package/dist/jumpEventReport/web/report.ts +1 -1
  39. package/dist/jumpEventReport/web.base.ts +1 -1
  40. package/dist/jumpEventReport/web.jd.ts +1 -1
  41. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  42. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  43. package/dist/jumpEventReport/web.tjm.ts +1 -0
  44. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  45. package/dist/open/api/environment.ts +1 -1
  46. package/dist/open/api/jump copy.ts +1 -1
  47. package/dist/open/api/shopMember.ts +1 -1
  48. package/dist/open/api/track.ts +1 -1
  49. package/dist/open/api/util.ts +1 -1
  50. package/dist/sass/app.h5.scss +39 -3
  51. package/dist/service/requestServer.ts +1 -1
  52. package/dist/utils/connectNativeJsBridge.ts +1 -1
  53. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  54. package/dist/utils/draExceptionAndProfile.ts +1 -1
  55. package/dist/utils/h5Utils.ts +1 -1
  56. package/dist/utils/index.h5.ts +1 -1
  57. package/dist/utils/index.ts +1 -1
  58. package/dist/utils/index.weapp.ts +1 -1
  59. package/dist/utils/jm-common.js +1 -1
  60. package/dist/utils/sgmCodeUtils.ts +1 -0
  61. package/dist/utils/utils.ts +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  title: '',
3
2
  message: null,
4
3
  className: '',
5
4
  maskCloseable: false,
6
5
  show: true,
7
6
  hasFooter: true,
8
7
  isCustom: false,
9
8
  titleNode: null,
10
9
  bodyNode: null,
11
10
  footerNode: null,
12
11
  closeBtnText: '取消',
13
12
  closeBtnHideState: false,
14
13
  confirmBtnText: '确定',
15
14
  confirmBtnHideState: false,
16
15
  onBeforeConfirm: null,
17
16
  onConfirm: null,
18
17
  onClose: null,
19
18
  onBackground: null,
20
19
  onHide: null,
21
20
  onInit: null,
22
21
  isFormDialog: false,
23
22
  onFormSubmit: null,
24
23
  onFormReset: null,
25
24
  forbiddenBgScrollState: true,
26
25
  const [dialogShowState, setDialogShowState] = useState(false)
27
26
  const [dialogConfig, setDialogConfig] =
28
27
  useState<ComponentInterFace.DialogConfigProps>({
29
28
  type: DialogType.BASE,
30
29
  })
31
30
  const dialogBackFnRef = useRef<ComponentInterFace.DialogConfigBackFn>({})
32
31
  useEffect(() => {
33
32
 
34
33
  Taro.eventCenter.on(TaroEventType.DIALOG, (res) => {
35
34
  res.show ? dialogInit(res) : setDialogShowState(false)
36
35
  })
37
36
  return () => {
38
37
  Taro.eventCenter.off(TaroEventType.DIALOG)
39
38
  }
40
39
  }, [])
41
40
 
42
41
  useEffect(() => {
43
42
  if (dialogConfig.forbiddenBgScrollState && taroJdBaseInfo.rootEleNode) {
44
43
  !dialogShowState ? taroJdBaseInfo.rootEleNode.classList.remove('over-hidden') : taroJdBaseInfo.rootEleNode.classList.add('over-hidden')
45
44
  }
46
45
  }, [dialogConfig, dialogShowState])
47
46
  const dialogInit = useCallback((opts) => {
48
47
  const {
49
48
  onBeforeConfirm,
50
49
  onConfirm,
51
50
  onClose,
52
51
  onBackground,
53
52
  onHide,
54
53
  onInit,
55
54
  onFormSubmit,
56
55
  onFormReset,
57
56
  ...otherOpts
58
57
  } = opts
59
58
  const dialogOpts = Object.assign(
60
59
  {},
61
60
  {
62
61
  ...dialogDefaultConfig,
63
62
  type: DialogType.BASE,
64
63
  },
65
64
  otherOpts,
66
65
  )
67
66
  dialogBackFnRef.current = {
68
67
  onInit,
69
68
  onBeforeConfirm,
70
69
  onConfirm,
71
70
  onClose,
72
71
  onBackground,
73
72
  onHide,
74
73
  onFormSubmit,
75
74
  onFormReset,
76
75
  }
77
76
  setDialogConfig(dialogOpts)
78
77
  setDialogShowState(true)
79
78
  }, [])
80
79
  const hideDialog = useCallback(() => {
81
80
  setDialogShowState(false)
82
81
  }, [])
83
82
  const closeDialog = useCallback(() => {
84
83
  hideDialog()
85
84
  dialogBackFnRef.current.onHide &&
86
85
  typeof dialogBackFnRef.current.onHide === 'function' &&
87
86
  dialogBackFnRef.current.onHide(dialogConfig)
88
87
  }, [dialogConfig])
89
88
 
90
89
  const updateDialogContentFn = (changeDialogConfig) => {
91
90
  setDialogConfig({
92
91
  ...dialogConfig,
93
92
  ...changeDialogConfig
94
93
  })
95
94
  }
96
95
  useEffect(() => {
97
96
  dialogShowState &&
98
97
  dialogBackFnRef.current.onInit &&
99
98
  typeof dialogBackFnRef.current.onInit === 'function' &&
100
99
  dialogBackFnRef.current.onInit(hideDialog, dialogConfig, updateDialogContentFn)
101
100
  }, [dialogShowState])
102
101
 
103
102
  const dialogConfirmFn = useCallback(
104
103
  (e) => {
105
104
  e.stopPropagation()
106
105
  if (
107
106
  dialogBackFnRef.current.onBeforeConfirm &&
108
107
  typeof dialogBackFnRef.current.onBeforeConfirm === 'function'
109
108
  ) {
110
109
  dialogBackFnRef.current.onBeforeConfirm(
111
110
  hideDialog,
112
111
  dialogConfig,
113
112
  )
114
113
  } else {
115
114
  closeDialog()
116
115
  dialogBackFnRef.current.onConfirm &&
117
116
  typeof dialogBackFnRef.current.onConfirm === 'function' &&
118
117
  dialogBackFnRef.current.onConfirm(dialogConfig)
119
118
  }
120
119
  },
121
120
  [dialogConfig],
122
121
  )
123
122
  const dialogCloseFn = useCallback(
124
123
  (e) => {
125
124
  e.stopPropagation()
126
125
  closeDialog()
127
126
  dialogBackFnRef.current.onClose &&
128
127
  typeof dialogBackFnRef.current.onClose === 'function' &&
129
128
  dialogBackFnRef.current.onClose(dialogConfig)
130
129
  },
131
130
  [dialogConfig],
132
131
  )
133
132
  const dialogBackgroundFn = useCallback(() => {
134
133
  if (dialogConfig.maskCloseable) {
135
134
  closeDialog()
136
135
  }
137
136
  if (
138
137
  dialogBackFnRef.current.onBackground &&
139
138
  typeof dialogBackFnRef.current.onBackground === 'function'
140
139
  ) {
141
140
  dialogBackFnRef.current.onBackground()
142
141
  }
143
142
  }, [dialogConfig])
144
143
  const dialogFormSubmit = useCallback((e) => {
145
144
  if (
146
145
  dialogBackFnRef.current.onFormSubmit &&
147
146
  typeof dialogBackFnRef.current.onFormSubmit === 'function'
148
147
  ) {
149
148
  dialogBackFnRef.current.onFormSubmit(e,hideDialog, dialogConfig)
150
149
  }
151
150
  }, [dialogConfig])
152
151
  const dialogFormReset = useCallback((e) => {
153
152
  if (
154
153
  dialogBackFnRef.current.onFormReset &&
155
154
  typeof dialogBackFnRef.current.onFormReset === 'function'
156
155
  ) {
157
156
  dialogBackFnRef.current.onFormReset(e,hideDialog, dialogConfig)
158
157
  }
159
158
  }, [dialogConfig])
160
159
  const renderCustomViewCompontent = (children) => {
161
160
  return dialogConfig.isFormDialog ?
162
161
  <Form className={classNames(dialogStyle['d-form-dialog'])} onSubmit={dialogFormSubmit}
163
162
  onReset={dialogFormReset}>{children}</Form> : <>{children}</>
164
163
  }
165
164
  return dialogShowState ? renderCustomViewCompontent(
166
165
  <>
167
166
  <View
168
167
  className={classNames(dialogStyle['d-dialog-layout'],"J_customLayout")}
169
168
  onClick={dialogBackgroundFn}
170
169
  >
171
170
  <View
172
171
  className={classNames(
173
172
  dialogStyle['d-dialog-wrap'],
174
173
  dialogStyle[`d-dialog-type-${dialogConfig.type}`],
175
174
  'flexible-center-box',
176
175
  dialogConfig.className,
177
176
  )}
178
177
  >
179
178
  {dialogConfig.isCustom ? (
180
179
  dialogConfig.bodyNode ? (
181
180
  dialogConfig.bodyNode
182
181
  ) : null
183
182
  ) : (
184
183
  <View
185
184
  className={classNames(
186
185
  dialogStyle['d-dialog-content'],
187
186
  'd-dialog-content',
188
187
  )}
189
188
  onClick={(e) => e.stopPropagation()}
190
189
  >
191
190
  {dialogConfig.title && dialogConfig.title != '' && (
192
191
  <View
193
192
  className={classNames(
194
193
  dialogStyle['d-dialog-header'],
195
194
  'd-dialog-header',
196
195
  )}
197
196
  >
198
197
  {dialogConfig.title}
199
198
  </View>
200
199
  )}
201
200
  {dialogConfig.message && (
202
201
  <View
203
202
  className={classNames(
204
203
  dialogStyle['d-dialog-body'],
205
204
  'd-dialog-body',
206
205
  )}
207
206
  dangerouslySetInnerHTML={{
208
207
  __html: dialogConfig.message,
209
208
  }}
210
209
  />
211
210
  )}
212
211
  {dialogConfig.bodyNode && (
213
212
  <View
214
213
  className={classNames(
215
214
  dialogStyle['d-dialog-body'],
216
215
  'd-dialog-body',
217
216
  )}
218
217
  >
219
218
  {dialogConfig.bodyNode
220
219
  ? dialogConfig.bodyNode
221
220
  : null}
222
221
  </View>
223
222
  )}
224
223
  {dialogConfig.footerNode ? (
225
224
  dialogConfig.footerNode
226
225
  ) : dialogConfig.hasFooter ? (
227
226
  <View
228
227
  className={classNames(
229
228
  dialogStyle['d-dialog-footer'],
230
229
  'd-dialog-footer',
231
230
  'flexible-box',
232
231
  )}
233
232
  >
234
233
  {!dialogConfig.closeBtnHideState && (
235
234
  <Button
236
235
  className={classNames(
237
236
  dialogStyle['d-dialog-btn'],
238
237
  dialogStyle[
239
238
  'd-dialog-cancel-btn'
240
239
  ],
241
240
  'd-dialog-cancel-btn',
242
241
  'adaptive-box-flex',
243
242
  )}
244
243
  form-type={dialogConfig.isFormDialog ? 'reset' : ''}
245
244
  onClick={dialogCloseFn}
246
245
  >
247
246
  {dialogConfig.closeBtnText}
248
247
  </Button>
249
248
  )}
250
249
  {!dialogConfig.confirmBtnHideState && (
251
250
  <Button
252
251
  className={classNames(
253
252
  dialogStyle['d-dialog-btn'],
254
253
  dialogStyle[
255
254
  'd-dialog-ensure-btn'
256
255
  ],
257
256
  'd-dialog-ensure-btn',
258
257
  'adaptive-box-flex',
259
258
  )}
260
259
  onClick={dialogConfirmFn}
261
260
  form-type={dialogConfig.isFormDialog ? 'submit' : ''}
262
261
  >
263
262
  {dialogConfig.confirmBtnText}
264
263
  </Button>
265
264
  )}
266
265
  </View>
267
266
  ) : null}
268
267
  </View>
269
268
  )
270
269
  }
271
270
  </View>
272
271
  </View>
273
272
  </>,
274
273
  ) : null
274
+ import Taro from '@tarojs/taro'
275
275
  title: '',
276
276
  message: null,
277
277
  className: '',
278
278
  maskCloseable: false,
279
279
  show: true,
280
280
  hasFooter: true,
281
281
  isCustom: false,
282
282
  titleNode: null,
283
283
  bodyNode: null,
284
284
  footerNode: null,
285
285
  closeBtnText: '取消',
286
286
  closeBtnHideState: false,
287
287
  confirmBtnText: '确定',
288
288
  confirmBtnHideState: false,
289
289
  onBeforeConfirm: null,
290
290
  onConfirm: null,
291
291
  onClose: null,
292
292
  onBackground: null,
293
293
  onHide: null,
294
294
  onInit: null,
295
295
  isFormDialog: false,
296
296
  onFormSubmit: null,
297
297
  onFormReset: null,
298
298
  forbiddenBgScrollState: true,
299
299
  const [dialogShowState, setDialogShowState] = useState(false)
300
300
  const [dialogConfig, setDialogConfig] =
301
301
  useState<ComponentInterFace.DialogConfigProps>({
302
302
  type: DialogType.BASE,
303
303
  })
304
304
  const dialogBackFnRef = useRef<ComponentInterFace.DialogConfigBackFn>({})
305
305
  useEffect(() => {
306
306
 
307
307
  Taro.eventCenter.on(TaroEventType.DIALOG, (res) => {
308
308
  res.show ? dialogInit(res) : setDialogShowState(false)
309
309
  })
310
310
  return () => {
311
311
  Taro.eventCenter.off(TaroEventType.DIALOG)
312
312
  }
313
313
  }, [])
314
314
 
315
315
  useEffect(() => {
316
316
  if (dialogConfig.forbiddenBgScrollState && taroJdBaseInfo.rootEleNode) {
317
317
  !dialogShowState ? taroJdBaseInfo.rootEleNode.classList.remove('over-hidden') : taroJdBaseInfo.rootEleNode.classList.add('over-hidden')
318
318
  }
319
319
  }, [dialogConfig, dialogShowState])
320
320
  const dialogInit = useCallback((opts) => {
321
321
  const {
322
322
  onBeforeConfirm,
323
323
  onConfirm,
324
324
  onClose,
325
325
  onBackground,
326
326
  onHide,
327
327
  onInit,
328
328
  onFormSubmit,
329
329
  onFormReset,
330
330
  ...otherOpts
331
331
  } = opts
332
332
  const dialogOpts = Object.assign(
333
333
  {},
334
334
  {
335
335
  ...dialogDefaultConfig,
336
336
  type: DialogType.BASE,
337
337
  },
338
338
  otherOpts,
339
339
  )
340
340
  dialogBackFnRef.current = {
341
341
  onInit,
342
342
  onBeforeConfirm,
343
343
  onConfirm,
344
344
  onClose,
345
345
  onBackground,
346
346
  onHide,
347
347
  onFormSubmit,
348
348
  onFormReset,
349
349
  }
350
350
  setDialogConfig(dialogOpts)
351
351
  setDialogShowState(true)
352
352
  }, [])
353
353
  const hideDialog = useCallback(() => {
354
354
  setDialogShowState(false)
355
355
  }, [])
356
356
  const closeDialog = useCallback(() => {
357
357
  hideDialog()
358
358
  dialogBackFnRef.current.onHide &&
359
359
  typeof dialogBackFnRef.current.onHide === 'function' &&
360
360
  dialogBackFnRef.current.onHide(dialogConfig)
361
361
  }, [dialogConfig])
362
362
 
363
363
  const updateDialogContentFn = (changeDialogConfig) => {
364
364
  setDialogConfig({
365
365
  ...dialogConfig,
366
366
  ...changeDialogConfig
367
367
  })
368
368
  }
369
369
  useEffect(() => {
370
370
  dialogShowState &&
371
371
  dialogBackFnRef.current.onInit &&
372
372
  typeof dialogBackFnRef.current.onInit === 'function' &&
373
373
  dialogBackFnRef.current.onInit(hideDialog, dialogConfig, updateDialogContentFn)
374
374
  }, [dialogShowState])
375
375
 
376
376
  const dialogConfirmFn = useCallback(
377
377
  (e) => {
378
378
  e.stopPropagation()
379
379
  if (
380
380
  dialogBackFnRef.current.onBeforeConfirm &&
381
381
  typeof dialogBackFnRef.current.onBeforeConfirm === 'function'
382
382
  ) {
383
383
  dialogBackFnRef.current.onBeforeConfirm(
384
384
  hideDialog,
385
385
  dialogConfig,
386
386
  )
387
387
  } else {
388
388
  closeDialog()
389
389
  dialogBackFnRef.current.onConfirm &&
390
390
  typeof dialogBackFnRef.current.onConfirm === 'function' &&
391
391
  dialogBackFnRef.current.onConfirm(dialogConfig)
392
392
  }
393
393
  },
394
394
  [dialogConfig],
395
395
  )
396
396
  const dialogCloseFn = useCallback(
397
397
  (e) => {
398
398
  e.stopPropagation()
399
399
  closeDialog()
400
400
  dialogBackFnRef.current.onClose &&
401
401
  typeof dialogBackFnRef.current.onClose === 'function' &&
402
402
  dialogBackFnRef.current.onClose(dialogConfig)
403
403
  },
404
404
  [dialogConfig],
405
405
  )
406
406
  const dialogBackgroundFn = useCallback(() => {
407
407
  if (dialogConfig.maskCloseable) {
408
408
  closeDialog()
409
409
  }
410
410
  if (
411
411
  dialogBackFnRef.current.onBackground &&
412
412
  typeof dialogBackFnRef.current.onBackground === 'function'
413
413
  ) {
414
414
  dialogBackFnRef.current.onBackground()
415
415
  }
416
416
  }, [dialogConfig])
417
417
  const dialogFormSubmit = useCallback((e) => {
418
418
  if (
419
419
  dialogBackFnRef.current.onFormSubmit &&
420
420
  typeof dialogBackFnRef.current.onFormSubmit === 'function'
421
421
  ) {
422
422
  dialogBackFnRef.current.onFormSubmit(e,hideDialog, dialogConfig)
423
423
  }
424
424
  }, [dialogConfig])
425
425
  const dialogFormReset = useCallback((e) => {
426
426
  if (
427
427
  dialogBackFnRef.current.onFormReset &&
428
428
  typeof dialogBackFnRef.current.onFormReset === 'function'
429
429
  ) {
430
430
  dialogBackFnRef.current.onFormReset(e,hideDialog, dialogConfig)
431
431
  }
432
432
  }, [dialogConfig])
433
433
  const renderCustomViewCompontent = (children) => {
434
434
  return dialogConfig.isFormDialog ?
435
435
  <Form className={classNames(dialogStyle['d-form-dialog'])} onSubmit={dialogFormSubmit}
436
436
  onReset={dialogFormReset}>{children}</Form> : <>{children}</>
437
437
  }
438
438
  return dialogShowState ? renderCustomViewCompontent(
439
439
  <>
440
440
  <View
441
441
  className={classNames(dialogStyle['d-dialog-layout'],"J_customLayout")}
442
442
  onClick={dialogBackgroundFn}
443
443
  >
444
444
  <View
445
445
  className={classNames(
446
446
  dialogStyle['d-dialog-wrap'],
447
447
  dialogStyle[`d-dialog-type-${dialogConfig.type}`],
448
448
  {
449
449
  [dialogStyle['d-dialog-jdapp-wrap']]: isJdApp
450
450
  },
451
451
  'flexible-center-box',
452
452
  dialogConfig.className,
453
453
  )}
454
454
  >
455
455
  {dialogConfig.isCustom ? (
456
456
  dialogConfig.bodyNode ? (
457
457
  dialogConfig.bodyNode
458
458
  ) : null
459
459
  ) : (
460
460
  <View
461
461
  className={classNames(
462
462
  dialogStyle['d-dialog-content'],
463
463
  'd-dialog-content',
464
464
  )}
465
465
  onClick={(e) => e.stopPropagation()}
466
466
  >
467
467
  {dialogConfig.title && dialogConfig.title != '' && (
468
468
  <View
469
469
  className={classNames(
470
470
  dialogStyle['d-dialog-header'],
471
471
  'd-dialog-header',
472
472
  )}
473
473
  >
474
474
  {dialogConfig.title}
475
475
  </View>
476
476
  )}
477
477
  {dialogConfig.message && (
478
478
  <View
479
479
  className={classNames(
480
480
  dialogStyle['d-dialog-body'],
481
481
  'd-dialog-body',
482
482
  )}
483
483
  dangerouslySetInnerHTML={{
484
484
  __html: dialogConfig.message,
485
485
  }}
486
486
  />
487
487
  )}
488
488
  {dialogConfig.bodyNode && (
489
489
  <View
490
490
  className={classNames(
491
491
  dialogStyle['d-dialog-body'],
492
492
  'd-dialog-body',
493
493
  )}
494
494
  >
495
495
  {dialogConfig.bodyNode
496
496
  ? dialogConfig.bodyNode
497
497
  : null}
498
498
  </View>
499
499
  )}
500
500
  {dialogConfig.footerNode ? (
501
501
  dialogConfig.footerNode
502
502
  ) : dialogConfig.hasFooter ? (
503
503
  <View
504
504
  className={classNames(
505
505
  dialogStyle['d-dialog-footer'],
506
506
  'd-dialog-footer',
507
507
  'flexible-box',
508
508
  )}
509
509
  >
510
510
  {!dialogConfig.closeBtnHideState && (
511
511
  <Button
512
512
  className={classNames(
513
513
  dialogStyle['d-dialog-btn'],
514
514
  dialogStyle[
515
515
  'd-dialog-cancel-btn'
516
516
  ],
517
517
  'd-dialog-cancel-btn',
518
518
  'adaptive-box-flex',
519
519
  )}
520
520
  form-type={dialogConfig.isFormDialog ? 'reset' : ''}
521
521
  onClick={dialogCloseFn}
522
522
  >
523
523
  {dialogConfig.closeBtnText}
524
524
  </Button>
525
525
  )}
526
526
  {!dialogConfig.confirmBtnHideState && (
527
527
  <Button
528
528
  className={classNames(
529
529
  dialogStyle['d-dialog-btn'],
530
530
  dialogStyle[
531
531
  'd-dialog-ensure-btn'
532
532
  ],
533
533
  'd-dialog-ensure-btn',
534
534
  'adaptive-box-flex',
535
535
  )}
536
536
  onClick={dialogConfirmFn}
537
537
  form-type={dialogConfig.isFormDialog ? 'submit' : ''}
538
538
  >
539
539
  {dialogConfig.confirmBtnText}
540
540
  </Button>
541
541
  )}
542
542
  </View>
543
543
  ) : null}
544
544
  </View>
545
545
  )
546
546
  }
547
547
  </View>
548
548
  </View>
549
549
  </>,
550
550
  ) : null
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  const { type, className, reportData, customReportDataKey, customReportDataFn, trackCallback } = props
3
2
  const isCustomReport = customReportDataKey && customReportDataFn
4
3
  const checkReportData = Array.isArray(reportData)
5
4
  const [floorData, mInfo] = checkReportData ? reportData : []
6
5
  const showRenderState = isCustomReport ? true : floorData && mInfo
7
6
  const getFloorPointClassName = isCustomReport ? `J_custom_${customReportDataKey}` : `J_floor_${floorData?.uid}_index_${mInfo?.pos}`
8
7
  useEffect(() => {
9
8
  if (
10
9
  !taroJdBaseInfo.info.pageInfo.floorExposureInfo[
11
10
  getFloorPointClassName
12
11
  ]
13
12
  ){
14
13
  const createIntersectionObserver = new intersectionObserver({
15
14
  selector: getTaroSelector,
16
15
  context: this,
17
16
  onFinal: (res) => {
18
17
  taroJdBaseInfo.info.pageInfo.floorExposureInfo[
19
18
  getFloorPointClassName
20
19
  ] = true
21
20
  console.log('小程序曝光埋点收到进入可视区域啦!', getFloorPointClassName, reportData, res)
22
21
  if(!isCustomReport){
23
22
  addReportData(reportData)
24
23
  typeof trackCallback === 'function' && trackCallback(reportData)
25
24
  }else {
26
25
  typeof customReportDataFn === 'function' && customReportDataFn(customReportDataKey)
27
26
  }
28
27
  createIntersectionObserver.disconnect()
29
28
  },
30
29
  })
31
30
  createIntersectionObserver.connect()
32
31
  }
33
32
  {
34
33
  [exposureStyle['d-report-point']]: type === TrackType.point,
35
34
  },
36
35
  {
37
36
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
38
37
  },
39
38
  getFloorPointClassName,
40
39
  return useMemo(() => {
41
40
  return <ExposureFloor {...props} />
42
41
  }, [])
43
42
  reportData: null,
44
43
  trackCallback: null,
45
44
  type: TrackType.point,
45
+ import Taro from '@tarojs/taro'
46
46
  const { type, className, reportData, customReportDataKey, customReportDataFn, trackCallback } = props
47
47
  const isViewOnlineState =
48
48
  taroJdBaseInfo.info.pageInfo.dataType === BUSINESS_TYPE.ONLINE
49
49
  const isCustomReport = customReportDataKey && customReportDataFn
50
50
  const checkReportData = Array.isArray(reportData)
51
51
  const [floorData, mInfo] = checkReportData ? reportData : []
52
52
  const showRenderState = isCustomReport ? true : floorData && mInfo
53
53
  const getFloorPointClassName = isCustomReport ? `J_custom_${customReportDataKey}` : `J_floor_${floorData?.uid}_index_${mInfo?.pos}`
54
54
  const getTaroSelector = isCustomReport ? `#J_miniShopRoot >>> ${getFloorPointClassName}` : `#J_floor_${floorData?.uid} >>> .${getFloorPointClassName}`
55
55
  useEffect(() => {
56
56
  if (isViewOnlineState && reportData) {
57
57
  Taro.nextTick(() => {
58
58
  if (
59
59
  !taroJdBaseInfo.info.pageInfo.floorExposureInfo[
60
60
  getFloorPointClassName
61
61
  ]
62
62
  ){
63
63
  const createIntersectionObserver = new intersectionObserver({
64
64
  selector: getTaroSelector,
65
65
  context: this,
66
66
  onFinal: (res) => {
67
67
  taroJdBaseInfo.info.pageInfo.floorExposureInfo[
68
68
  getFloorPointClassName
69
69
  ] = true
70
70
  console.log('小程序曝光埋点收到进入可视区域啦!', getFloorPointClassName, reportData, res)
71
71
  if(!isCustomReport){
72
72
  addReportData(reportData)
73
73
  typeof trackCallback === 'function' && trackCallback(reportData)
74
74
  }else {
75
75
  typeof customReportDataFn === 'function' && customReportDataFn(customReportDataKey)
76
76
  }
77
77
  createIntersectionObserver.disconnect()
78
78
  },
79
79
  })
80
80
  createIntersectionObserver.connect()
81
81
  }
82
82
  })
83
83
  }
84
84
  }, [])
85
85
  return (showRenderState ? (
86
86
  <View
87
87
  className={classNames(
88
88
  {
89
89
  [exposureStyle['d-report-point']]: type === TrackType.point,
90
90
  },
91
91
  {
92
92
  [exposureStyle['d-report-floor']]: type === TrackType.floor,
93
93
  },
94
94
  getFloorPointClassName,
95
95
  className,
96
96
  )}
97
97
  />
98
98
  ) : null
99
99
  )
100
100
  return useMemo(() => {
101
101
  return <ExposureFloor {...props} />
102
102
  }, [])
103
103
  reportData: null,
104
104
  trackCallback: null,
105
105
  type: TrackType.point,