@conecli/cone-render 0.10.1-shop3.3 → 0.10.1-shop3.30

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 (82) hide show
  1. package/README.md +1 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/common/const.ts +1 -1
  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/jssdk.ts +1 -1
  9. package/dist/common/token/index.h5.ts +1 -1
  10. package/dist/common/token/token.jd.ts +1 -1
  11. package/dist/common/wxappApi.ts +1 -1
  12. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  13. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  14. package/dist/components/base/CountDown/index.tsx +1 -1
  15. package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
  16. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  17. package/dist/components/base/Dialog/index.module.scss +11 -0
  18. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  19. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  20. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  21. package/dist/components/base/InViewRender/index.tsx +1 -1
  22. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  23. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  24. package/dist/components/base/NetworkDataError/const.ts +1 -1
  25. package/dist/components/base/NetworkDataError/index.module.scss +117 -71
  26. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  27. package/dist/components/base/Price/Base/index.module.scss +12 -0
  28. package/dist/components/base/Price/Base/index.tsx +1 -1
  29. package/dist/components/base/Price/Double/index.module.scss +6 -0
  30. package/dist/components/base/Price/Double/index.tsx +1 -1
  31. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  32. package/dist/components/floorItem.weapp.tsx +1 -1
  33. package/dist/interface/common.ts +1 -1
  34. package/dist/interface/component.ts +1 -1
  35. package/dist/interface/jumpEventReport.ts +1 -1
  36. package/dist/interface/service.ts +1 -1
  37. package/dist/jumpEventReport/base.ts +1 -1
  38. package/dist/jumpEventReport/const.ts +1 -1
  39. package/dist/jumpEventReport/index.h5.ts +1 -1
  40. package/dist/jumpEventReport/index.jd.ts +1 -1
  41. package/dist/jumpEventReport/index.weapp.ts +1 -1
  42. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  43. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  44. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  45. package/dist/jumpEventReport/web/report.ts +1 -1
  46. package/dist/jumpEventReport/web.base.ts +1 -1
  47. package/dist/jumpEventReport/web.jd.ts +1 -1
  48. package/dist/jumpEventReport/web.pc.ts +1 -1
  49. package/dist/jumpEventReport/web.tjm.ts +1 -1
  50. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  51. package/dist/language/en_US.json +176 -0
  52. package/dist/language/zh_CN.json +176 -0
  53. package/dist/language/zh_HK.json +176 -0
  54. package/dist/libs/taroAppReport.js +2 -2
  55. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -53
  56. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  57. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  58. package/dist/open/api/environment.ts +1 -1
  59. package/dist/open/api/shopMember.ts +1 -1
  60. package/dist/open/api/util.ts +1 -1
  61. package/dist/sass/app.h5.scss +273 -224
  62. package/dist/service/fetchGateway.ts +1 -1
  63. package/dist/service/fetchGateway.weapp.ts +1 -0
  64. package/dist/service/http/colorSign.ts +1 -1
  65. package/dist/service/http/const.ts +1 -1
  66. package/dist/service/http/h5Http.ts +1 -1
  67. package/dist/service/requestServer.h5.ts +1 -1
  68. package/dist/service/requestServer.ts +1 -1
  69. package/dist/service/requestServer.weapp.ts +1 -0
  70. package/dist/utils/connectNativeJsBridge.ts +1 -1
  71. package/dist/utils/h5Utils.ts +1 -1
  72. package/dist/utils/index.h5.ts +1 -1
  73. package/dist/utils/index.ts +1 -1
  74. package/dist/utils/index.weapp.ts +1 -1
  75. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  76. package/dist/utils/jumpExtMapUtil.ts +1 -0
  77. package/dist/utils/log.ts +1 -0
  78. package/dist/utils/sColor.js +1 -0
  79. package/dist/utils/utils.ts +1 -1
  80. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  81. package/dist/wxapp/common/user_info.js +1 -1
  82. package/package.json +158 -141
@@ -1 +1 @@
1
- import React, { useRef, useEffect } from 'react'
2
1
  isH5AndJdShopView,
3
2
  isAndroidDevice,
4
3
  isJdAndAndroidDevice,
5
4
  isJdAndIosDevice,
6
5
  isIosDevice,
7
6
  isJdApp,
8
7
  isWxMin,
9
8
  isH5AndJdShopViewH5Scroll,
10
9
  isH5AndJdShopH5CustomScrollView,
11
10
  isH5,
12
11
  isAppClassifyPage,
13
12
  lodashThrottle,
14
13
  START: 'start',
15
14
  MOVE: 'move',
16
15
  END: 'end',
17
16
  const {
18
17
  style = {},
19
18
  scrollX = false,
20
19
  scrollY = false,
21
20
  scrollWithAnimation = true,
22
21
  iosNeedDisableVertical = false,
23
22
  className = null,
24
23
  dispatchTouchMove = true,
25
24
  children,
26
25
  ...otherProps
27
26
  } = props
28
27
  const rootEleNode = isH5 && document?.querySelector('body')
29
28
  const needShowHighVersion =
30
29
  isH5AndJdShopViewH5Scroll && global.info.queryInfo?.downgraded !== 'true'
31
30
  const mLastClientPosRef = useRef({
32
31
  mLastClientX: 0,
33
32
  mLastClientY: 0,
34
33
  })
35
34
  const isJdAndH5ScrollState =
36
35
  needShowHighVersion || isH5AndJdShopH5CustomScrollView
37
36
 
38
37
  const touchstartEventBubbleFunc = (e) => {
39
38
  const isH5SwiperCustomEle = e?.target?.closest('.J_h5SwiperCustom')
40
39
  if (!isH5SwiperCustomEle) {
41
40
  const hasCustomEle = e
42
41
  ? e?.target?.closest('.J_customScroll') ||
43
42
  e?.target?.closest('.J_customLayout')
44
43
  : false
45
44
  if (isJdAndAndroidDevice && !hasCustomEle) {
46
45
  window.JdAndroid && window.JdAndroid.requestEvent(false)
47
46
  }
48
47
  !hasCustomEle &&
49
48
  rootEleNode &&
50
49
  rootEleNode.classList.contains('over-hidden') &&
51
50
  rootEleNode.classList.remove('over-hidden')
52
51
  }
53
52
  }
54
53
  const touchstartEventCaptureFunc = (e) => {
55
54
  if (
56
55
  e &&
57
56
  !e?.target?.closest('.J_h5SwiperCustom') &&
58
57
  !e?.target?.closest('.J_customLayout')
59
58
  ) {
60
59
  rootEleNode &&
61
60
  rootEleNode.classList.contains('over-hidden') &&
62
61
  rootEleNode.classList.remove('over-hidden')
63
62
  }
64
63
  }
65
64
  useEffect(() => {
66
65
  isJdApp &&
67
66
  !window.JDJshopViewInfo.getAndroidTouchSlopState &&
68
67
  nativePageGetScaledTouchSlop((res) => {
69
68
  console.log('获取安卓系统滑动阈值', res)
70
69
  window.JDJshopViewInfo.androidTouchSlop = res
71
70
  window.JDJshopViewInfo.getAndroidTouchSlopState = true
72
71
  })
73
72
  if (isJdAndH5ScrollState && rootEleNode && !rootEleAddEventListenerState) {
74
73
  global?.removeJdAndroidRquestEventForTouchStart &&
75
74
  global.removeJdAndroidRquestEventForTouchStart()
76
75
  rootEleNode.addEventListener(
77
76
  'touchstart',
78
77
  touchstartEventBubbleFunc,
79
78
  false,
80
79
  )
81
80
 
82
81
  rootEleNode.addEventListener(
83
82
  'touchstart',
84
83
  touchstartEventCaptureFunc,
85
84
  true,
86
85
  )
87
86
  rootEleAddEventListenerState = true
88
87
  console.log('customScrollView 初始化document监听完成')
89
88
  }
90
89
  return () => {
91
90
  if (isJdAndH5ScrollState && rootEleNode && rootEleAddEventListenerState) {
92
91
  console.log('customScrollView document监听取消完成')
93
92
  rootEleNode.removeEventListener(
94
93
  'touchstart',
95
94
  touchstartEventBubbleFunc,
96
95
  false,
97
96
  )
98
97
  rootEleNode.removeEventListener(
99
98
  'touchstart',
100
99
  touchstartEventCaptureFunc,
101
100
  true,
102
101
  )
103
102
  }
104
103
  }
105
104
  }, [])
106
105
 
107
106
  const androidDeviceStopNativeScrollEvent = (touchType) => {
108
107
  isJdApp &&
109
108
  isAndroidDevice &&
110
109
  window?.JdAndroid &&
111
110
  window?.JdAndroid.requestEvent(touchType === TouchType.START)
112
111
  }
113
112
  const iosDeviceStopNativeScrollEvent = (
114
113
  e,
115
114
  touchType,
116
115
  sendIosState = true,
117
116
  ) => {
118
117
  sendIosState && iosDeviceSendRouter(touchType)
119
118
  }
120
119
 
121
120
  const iosDeviceSendRouter = (state: string) => {
122
121
  window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
123
122
  method: 'callRouterModuleWithParams',
124
123
  params: {
125
124
  routerURL: 'router://JDShopModule/processShoph5SlideState',
126
125
  routerParam: {
127
126
  slideDirection: 'horizontal',
128
127
  needDisableVertical: `${iosNeedDisableVertical}`,
129
128
  state,
130
129
  },
131
130
  callBackId: new Date().getTime(),
132
131
  },
133
132
  })
134
133
  }
135
134
  const stopNativeScrollEvent = (e: Event, touchType, sendIosState = true) => {
136
135
  if (isJdApp) {
137
136
  if (isIosDevice && !isAppClassifyPage) {
138
137
  iosDeviceStopNativeScrollEvent(e, touchType, sendIosState)
139
138
  } else if (isAndroidDevice) {
140
139
  androidDeviceStopNativeScrollEvent(touchType)
141
140
  }
142
141
  }
143
142
  }
144
143
 
145
144
  const GetSlideAngle = (dx, dy) => {
146
145
  return (Math.atan2(dy, dx) * 180) / Math.PI
147
146
  }
148
147
 
149
148
  const GetSlideDirection = (startX, startY, endX, endY) => {
150
149
  const dy = startY - endY
151
150
  const dx = endX - startX
152
151
  let result = 0
153
152
  if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
154
153
  return result
155
154
  }
156
155
  const angle = GetSlideAngle(dx, dy)
157
156
  if (angle >= -45 && angle < 45) {
158
157
  result = 4
159
158
  } else if (angle >= 45 && angle < 135) {
160
159
  result = 1
161
160
  } else if (angle >= -135 && angle < -45) {
162
161
  result = 2
163
162
  } else if (
164
163
  (angle >= 135 && angle <= 180) ||
165
164
  (angle >= -180 && angle < -135)
166
165
  ) {
167
166
  result = 3
168
167
  }
169
168
  return result
170
169
  }
171
170
  const changeTouchStart = (e) => {
172
171
  if (isJdApp) {
173
172
  stopNativeScrollEvent(e, TouchType.START, !iosNeedDisableVertical)
174
173
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
175
174
  isJdAndH5ScrollState &&
176
175
  rootEleNode &&
177
176
  rootEleNode.classList.add('over-hidden')
178
177
  const touchEvent =
179
178
  e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
180
179
  mLastClientPosRef.current.mLastClientX = touchEvent.clientX
181
180
  mLastClientPosRef.current.mLastClientY = touchEvent.clientY
182
181
  }
183
182
  }
184
183
  }
185
184
  const changeTouchEnd = (e) => {
186
185
  stopNativeScrollEvent(e, TouchType.END)
187
186
  mLastClientPosRef.current.mLastClientX = 0
188
187
  mLastClientPosRef.current.mLastClientY = 0
189
188
  }
190
189
  const triggerIosTouchMove = () => {
191
190
  isJdAndIosDevice &&
192
191
  iosDeviceStopNativeScrollEvent(null, TouchType.START, true)
193
192
  }
194
193
 
195
194
  const lodashThrottleTriggerIosTouchMove = lodashThrottle(
196
195
  triggerIosTouchMove,
197
196
  500,
198
197
  )
199
198
 
200
199
  const recoverRootEleVerticalScroll = (touchEvent) => {
201
200
  const direction = GetSlideDirection(
202
201
  mLastClientPosRef.current.mLastClientX,
203
202
  mLastClientPosRef.current.mLastClientY,
204
203
  touchEvent.clientX,
205
204
  touchEvent.clientY,
206
205
  )
207
206
  if (direction === 1 || direction === 2) {
208
207
  rootEleNode &&
209
208
  rootEleNode.classList.contains('over-hidden') &&
210
209
  rootEleNode.classList.remove('over-hidden')
211
210
  }
212
211
  }
213
212
  const changeTouchMove = (e) => {
214
213
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
215
214
  const touchEvent =
216
215
  e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
217
216
  const xDiff = Math.abs(
218
217
  touchEvent.clientX - mLastClientPosRef.current.mLastClientX,
219
218
  ).toFixed(2)
220
219
  const yDiff = Math.abs(
221
220
  touchEvent.clientY - mLastClientPosRef.current.mLastClientY,
222
221
  ).toFixed(2)
223
222
  if (isJdApp) {
224
223
  if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
225
224
  iosNeedDisableVertical &&
226
225
  isJdApp &&
227
226
  lodashThrottleTriggerIosTouchMove()
228
227
  } else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
229
228
  stopNativeScrollEvent(e, TouchType.END)
230
229
  }
231
230
  }
232
231
  isJdAndH5ScrollState && recoverRootEleVerticalScroll(touchEvent)
233
232
  }
234
233
  if (!dispatchTouchMove) {
235
234
  return
236
235
  }
237
236
  const parentNode = e.target?.parentNode
238
237
  if (!parentNode) {
239
238
  return
240
239
  }
241
240
  const event = new TouchEvent('touchmove', e)
242
241
  parentNode.dispatchEvent(event)
243
242
  }
244
243
  if (scrollX && isJdApp && !isIgnorePreventNative) {
245
244
  return (
246
245
  <ScrollView
247
246
  scrollX
248
247
  onTouchStart={changeTouchStart}
249
248
  onTouchEnd={changeTouchEnd}
250
249
  onTouchCancel={changeTouchEnd}
251
250
  onTouchMove={changeTouchMove}
252
251
  enhanced
253
252
  showScrollbar={false}
254
253
  style={style}
255
254
  className={classNames(
256
255
  className,
257
256
  {
258
257
  [customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]:
259
258
  isIosDevice,
260
259
  },
261
260
  'J_customScroll',
262
261
  )}
263
262
  {...otherProps}
264
263
  >
265
264
  {children}
266
265
  </ScrollView>
267
266
  )
268
267
  } else {
269
268
  return (
270
269
  <ScrollView
271
270
  scrollX
272
271
  enhanced
273
272
  showScrollbar={false}
274
273
  {...otherProps}
275
274
  className={classNames(
276
275
  className,
277
276
  {
278
277
  [customScrollViewStyle['d-custom-ios-mini-extend-border-radius']]:
279
278
  isIosDevice && isWxMin && scrollX && style['borderRadius'],
280
279
  },
281
280
  {
282
281
  [customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]:
283
282
  isIosDevice,
284
283
  },
285
284
  {
286
285
  [customScrollViewStyle['d-custom-mini-hide-scroll']]: isWxMin,
287
286
  },
288
287
  )}
289
288
  style={style}
290
289
  >
291
290
  {children}
292
291
  </ScrollView>
293
292
  )
294
293
  }
294
+ import React, { useRef, useEffect } from 'react';
295
295
  isH5AndJdShopView,
296
296
  isAndroidDevice,
297
297
  isJdAndAndroidDevice,
298
298
  isJdAndHarmonyDevice,
299
299
  isJdAndIosDevice,
300
300
  isIosDevice,
301
301
  isJdApp,
302
302
  isWxMin,
303
303
  isH5AndJdShopViewH5Scroll,
304
304
  isH5AndJdShopH5CustomScrollView,
305
305
  isH5,
306
306
  isAppClassifyPage,
307
307
  lodashThrottle,
308
308
  START: 'start',
309
309
  MOVE: 'move',
310
310
  END: 'end',
311
311
  const {
312
312
  scrollX,
313
313
  children,
314
314
  style = {},
315
315
  iosNeedDisableVertical,
316
316
  dispatchTouchMove,
317
317
  className,
318
318
  ...otherProps
319
319
  } = props;
320
320
  const rootEleNode = isH5 && document ? document.querySelector('body') : null;
321
321
  const needShowHighVersion =
322
322
  isH5AndJdShopViewH5Scroll &&
323
323
  !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === 'true');
324
324
  const mLastClientPosRef = useRef({
325
325
  mLastClientX: 0,
326
326
  mLastClientY: 0,
327
327
  });
328
328
  const isJdAndH5ScrollState = needShowHighVersion || isH5AndJdShopH5CustomScrollView;
329
329
 
330
330
  const touchstartEventBubbleFunc = (e) => {
331
331
  const isH5SwiperCustomEle = e?.target?.closest('.J_h5SwiperCustom');
332
332
  if (!isH5SwiperCustomEle) {
333
333
  const hasCustomEle = e
334
334
  ? e?.target?.closest('.J_customScroll') || e?.target?.closest('.J_customLayout')
335
335
  : false;
336
336
  if (isJdAndAndroidDevice && !hasCustomEle) {
337
337
  window?.JdAndroid &&
338
338
  window?.JdAndroid?.requestEvent &&
339
339
  window.JdAndroid.requestEvent(false);
340
340
  }
341
341
  !hasCustomEle &&
342
342
  rootEleNode &&
343
343
  rootEleNode.classList.contains('over-hidden') &&
344
344
  rootEleNode.classList.remove('over-hidden');
345
345
  console.log(
346
346
  'customScrollView所在页面document touch start事件是否有J_customScroll元素',
347
347
  hasCustomEle,
348
348
  '根元素是否有over-hidden',
349
349
  rootEleNode.classList,
350
350
  );
351
351
  }
352
352
  };
353
353
  const touchstartEventCaptureFunc = (e) => {
354
354
  if (e && !e?.target?.closest('.J_h5SwiperCustom') && !e?.target?.closest('.J_customLayout')) {
355
355
  rootEleNode &&
356
356
  rootEleNode.classList.contains('over-hidden') &&
357
357
  rootEleNode.classList.remove('over-hidden');
358
358
  console.log(
359
359
  'customScrollView所在页面document touch start事件捕获阶段移除根元素是否有over-hidden',
360
360
  rootEleNode.classList,
361
361
  );
362
362
  }
363
363
  };
364
364
  useEffect(() => {
365
365
  isJdApp &&
366
366
  !window.JDJshopViewInfo.getAndroidTouchSlopState &&
367
367
  nativePageGetScaledTouchSlop((res) => {
368
368
  console.log('获取安卓系统滑动阈值', res);
369
369
  window.JDJshopViewInfo.androidTouchSlop = res;
370
370
  window.JDJshopViewInfo.getAndroidTouchSlopState = true;
371
371
  });
372
372
  if (isJdAndH5ScrollState && rootEleNode && !rootEleAddEventListenerState) {
373
373
  global?.removeJdAndroidRquestEventForTouchStart &&
374
374
  global.removeJdAndroidRquestEventForTouchStart();
375
375
  rootEleNode.addEventListener('touchstart', touchstartEventBubbleFunc, false);
376
376
 
377
377
  rootEleNode.addEventListener('touchstart', touchstartEventCaptureFunc, true);
378
378
  rootEleAddEventListenerState = true;
379
379
  console.log('customScrollView 初始化document监听完成');
380
380
  }
381
381
  return () => {
382
382
  if (isJdAndH5ScrollState && rootEleNode && rootEleAddEventListenerState) {
383
383
  console.log('customScrollView document监听取消完成');
384
384
  rootEleNode.removeEventListener('touchstart', touchstartEventBubbleFunc, false);
385
385
  rootEleNode.removeEventListener('touchstart', touchstartEventCaptureFunc, true);
386
386
  }
387
387
  };
388
388
  }, []);
389
389
 
390
390
  const androidDeviceStopNativeScrollEvent = (touchType) => {
391
391
  isJdApp &&
392
392
  isAndroidDevice &&
393
393
  window?.JdAndroid &&
394
394
  window?.JdAndroid?.requestEvent &&
395
395
  window.JdAndroid.requestEvent(touchType === TouchType.START);
396
396
  console.log('触发window?.JdAndroid.requestEvent', touchType === TouchType.START, touchType);
397
397
  };
398
398
  const iosDeviceStopNativeScrollEvent = (e, touchType, sendIosState = true) => {
399
399
  sendIosState && iosDeviceSendRouter(touchType);
400
400
  };
401
401
 
402
402
  const iosDeviceSendRouter = (state: string) => {
403
403
  window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
404
404
  method: 'callRouterModuleWithParams',
405
405
  params: {
406
406
  routerURL: 'router://JDShopModule/processShoph5SlideState',
407
407
  routerParam: {
408
408
  slideDirection: 'horizontal',
409
409
  needDisableVertical: `${iosNeedDisableVertical}`,
410
410
  state,
411
411
  },
412
412
  callBackId: new Date().getTime(),
413
413
  },
414
414
  });
415
415
  };
416
416
  const stopNativeScrollEvent = (e: Event, touchType, sendIosState = true) => {
417
417
  if (isJdApp) {
418
418
  isIosDevice &&
419
419
  !isAppClassifyPage &&
420
420
  iosDeviceStopNativeScrollEvent(e, touchType, sendIosState);
421
421
  isAndroidDevice && androidDeviceStopNativeScrollEvent(touchType);
422
422
  }
423
423
  };
424
424
 
425
425
  const GetSlideAngle = (dx, dy) => {
426
426
  return (Math.atan2(dy, dx) * 180) / Math.PI;
427
427
  };
428
428
 
429
429
  const GetSlideDirection = (startX, startY, endX, endY) => {
430
430
  const dy = startY - endY;
431
431
  const dx = endX - startX;
432
432
  let result = 0;
433
433
  if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
434
434
  return result;
435
435
  }
436
436
  const angle = GetSlideAngle(dx, dy);
437
437
  if (angle >= -45 && angle < 45) {
438
438
  result = 4;
439
439
  } else if (angle >= 45 && angle < 135) {
440
440
  result = 1;
441
441
  } else if (angle >= -135 && angle < -45) {
442
442
  result = 2;
443
443
  } else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
444
444
  result = 3;
445
445
  }
446
446
  return result;
447
447
  };
448
448
  const changeTouchStart = (e) => {
449
449
  if (isJdApp) {
450
450
  stopNativeScrollEvent(e, TouchType.START, !iosNeedDisableVertical);
451
451
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
452
452
  isJdAndH5ScrollState && rootEleNode && rootEleNode.classList.add('over-hidden');
453
453
  const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
454
454
  mLastClientPosRef.current.mLastClientX = touchEvent.clientX;
455
455
  mLastClientPosRef.current.mLastClientY = touchEvent.clientY;
456
456
  }
457
457
  }
458
458
  };
459
459
  const changeTouchEnd = (e) => {
460
460
  stopNativeScrollEvent(e, TouchType.END);
461
461
  mLastClientPosRef.current.mLastClientX = 0;
462
462
  mLastClientPosRef.current.mLastClientY = 0;
463
463
  };
464
464
  const triggerIosTouchMove = () => {
465
465
  isJdAndIosDevice && iosDeviceStopNativeScrollEvent(null, TouchType.START, true);
466
466
  };
467
467
 
468
468
  const lodashThrottleTriggerIosTouchMove = lodashThrottle(triggerIosTouchMove, 500);
469
469
 
470
470
  const recoverRootEleVerticalScroll = (touchEvent) => {
471
471
  const direction = GetSlideDirection(
472
472
  mLastClientPosRef.current.mLastClientX,
473
473
  mLastClientPosRef.current.mLastClientY,
474
474
  touchEvent.clientX,
475
475
  touchEvent.clientY,
476
476
  );
477
477
  if (direction === 1 || direction === 2) {
478
478
  rootEleNode &&
479
479
  rootEleNode.classList.contains('over-hidden') &&
480
480
  rootEleNode.classList.remove('over-hidden');
481
481
  }
482
482
  };
483
483
  const changeTouchMove = (e) => {
484
484
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
485
485
  const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
486
486
  const xDiff = Math.abs(touchEvent.clientX - mLastClientPosRef.current.mLastClientX).toFixed(
487
487
  2,
488
488
  );
489
489
  const yDiff = Math.abs(touchEvent.clientY - mLastClientPosRef.current.mLastClientY).toFixed(
490
490
  2,
491
491
  );
492
492
  if (isJdApp) {
493
493
  if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
494
494
  iosNeedDisableVertical && isJdApp && lodashThrottleTriggerIosTouchMove();
495
495
  } else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
496
496
  console.log('纵向滚动触发', yDiff, touchEvent, window.JDJshopViewInfo.androidTouchSlop);
497
497
  stopNativeScrollEvent(e, TouchType.END);
498
498
  }
499
499
  }
500
500
  isJdAndH5ScrollState && recoverRootEleVerticalScroll(touchEvent);
501
501
  }
502
502
  if (!dispatchTouchMove) {
503
503
  return;
504
504
  }
505
505
  const parentNode = e.target?.parentNode;
506
506
  if (!parentNode) {
507
507
  return;
508
508
  }
509
509
  const event = new TouchEvent('touchmove', e);
510
510
  parentNode.dispatchEvent(event);
511
511
  };
512
512
  if (scrollX && isJdApp && !isIgnorePreventNative) {
513
513
  return (
514
514
  <ScrollView
515
515
  scrollX
516
516
  onTouchStart={changeTouchStart}
517
517
  onTouchEnd={changeTouchEnd}
518
518
  onTouchCancel={changeTouchEnd}
519
519
  onTouchMove={changeTouchMove}
520
520
  enhanced
521
521
  showScrollbar={false}
522
522
  style={style}
523
523
  className={classNames(
524
524
  className,
525
525
  {
526
526
  [customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]: isIosDevice,
527
527
  },
528
528
  'J_customScroll',
529
529
  )}
530
530
  {...otherProps}
531
531
  >
532
532
  {children}
533
533
  </ScrollView>
534
534
  );
535
535
  } else {
536
536
  return (
537
537
  <ScrollView
538
538
  scrollX
539
539
  enhanced
540
540
  showScrollbar={false}
541
541
  {...otherProps}
542
542
  className={classNames(
543
543
  className,
544
544
  {
545
545
  [customScrollViewStyle['d-custom-ios-mini-extend-border-radius']]:
546
546
  isIosDevice && isWxMin && scrollX && style['borderRadius'],
547
547
  },
548
548
  {
549
549
  [customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]: isIosDevice,
550
550
  },
551
551
  {
552
552
  [customScrollViewStyle['d-custom-mini-hide-scroll']]: isWxMin,
553
553
  },
554
554
  )}
555
555
  style={style}
556
556
  >
557
557
  {children}
558
558
  </ScrollView>
559
559
  );
560
560
  }
561
561
  style: {},
562
562
  scrollX: false,
563
563
  scrollY: false,
564
564
  scrollWithAnimation: true,
565
565
  iosNeedDisableVertical: false,
566
566
  className: null,
567
567
  dispatchTouchMove: true,
@@ -119,3 +119,14 @@
119
119
  transform: scale3d(1, 1, 1);
120
120
  }
121
121
  }
122
+ :global{
123
+ .d-shop-pad{
124
+ :local{
125
+
126
+ .d-dialog-content{
127
+ max-width: 520PX;
128
+ }
129
+ }
130
+ }
131
+
132
+ }
@@ -6,8 +6,8 @@
6
6
  left: 0;
7
7
  right: 0;
8
8
  bottom: 0;
9
- opacity: 0;
10
- pointer-events: none;
9
+ opacity: 0;
10
+ pointer-events: none;
11
11
  z-index: -1;
12
12
  }
13
13
  //楼层曝光
@@ -20,3 +20,13 @@
20
20
  pointer-events: none;
21
21
  z-index: -1;
22
22
  }
23
+
24
+ :global{
25
+ .d-report-exposure-jd-point{
26
+ &:not(:empty){
27
+ opacity: 1;
28
+ z-index: 20;
29
+ }
30
+ }
31
+ }
32
+