@conecli/cone-render 0.9.1-shop2.2 → 0.9.1-shop2.20

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 (103) 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/jdplayerSdk.ts +1 -0
  9. package/dist/common/jssdk.ts +1 -0
  10. package/dist/common/pageType.ts +1 -0
  11. package/dist/common/sgmCustomCode.ts +1 -0
  12. package/dist/common/token/index.h5.ts +1 -1
  13. package/dist/common/token/token.jd.ts +1 -1
  14. package/dist/common/token/token.ts +1 -1
  15. package/dist/common/wxappApi.jd.ts +1 -0
  16. package/dist/components/ErrorBoundary.tsx +1 -1
  17. package/dist/components/base/CountDown/index.tsx +1 -1
  18. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  19. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  20. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  21. package/dist/components/base/CustomVideo/index.tsx +1 -1
  22. package/dist/components/base/Dialog/index.module.scss +5 -0
  23. package/dist/components/base/Dialog/index.tsx +1 -1
  24. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  25. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  26. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  28. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  29. package/dist/components/base/InViewRender/index.tsx +1 -1
  30. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  31. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  32. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  33. package/dist/components/base/LazyLoadImage/index.h5.module.scss +23 -20
  34. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  35. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  36. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  37. package/dist/components/base/NetworkDataError/const.ts +1 -1
  38. package/dist/components/base/NetworkDataError/index.module.scss +7 -0
  39. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  40. package/dist/components/base/Price/Double/index.tsx +1 -1
  41. package/dist/components/base/Price/index.tsx +1 -1
  42. package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
  43. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  44. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  45. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  46. package/dist/components/floorItem.jd.tsx +1 -1
  47. package/dist/components/floorItem.tsx +1 -1
  48. package/dist/components/floorItem.weapp.tsx +1 -1
  49. package/dist/components/isv/Floor/index.tsx +1 -1
  50. package/dist/components/remoteFloorItem.tsx +1 -1
  51. package/dist/interface/common.ts +1 -1
  52. package/dist/interface/component.ts +1 -1
  53. package/dist/interface/jumpEventReport.ts +1 -1
  54. package/dist/interface/service.ts +1 -1
  55. package/dist/interface/utils.ts +1 -1
  56. package/dist/jumpEventReport/base.ts +1 -1
  57. package/dist/jumpEventReport/const.ts +1 -1
  58. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  59. package/dist/jumpEventReport/index.h5.ts +1 -1
  60. package/dist/jumpEventReport/index.jd.ts +1 -1
  61. package/dist/jumpEventReport/index.weapp.ts +1 -1
  62. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  63. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  64. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  65. package/dist/jumpEventReport/web/report.ts +1 -1
  66. package/dist/jumpEventReport/web.base.ts +1 -1
  67. package/dist/jumpEventReport/web.jd.ts +1 -1
  68. package/dist/jumpEventReport/web.jdb.ts +1 -1
  69. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  70. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  71. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  72. package/dist/jumpEventReport/web.tjm.ts +1 -0
  73. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  74. package/dist/modules/ContainerFloorList/index.h5.module.scss +18 -1
  75. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  76. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  77. package/dist/open/api/device.ts +1 -1
  78. package/dist/open/api/environment.ts +1 -1
  79. package/dist/open/api/index.ts +1 -1
  80. package/dist/open/api/jump copy.ts +1 -1
  81. package/dist/open/api/request.ts +1 -1
  82. package/dist/open/api/shopMember.ts +1 -1
  83. package/dist/open/api/track.ts +1 -1
  84. package/dist/open/api/util.ts +1 -1
  85. package/dist/open/components/index.ts +1 -1
  86. package/dist/sass/app.h5.scss +49 -3
  87. package/dist/sass/base.scss +57 -0
  88. package/dist/service/fetchGateway.ts +1 -1
  89. package/dist/service/http/const.ts +1 -1
  90. package/dist/service/requestServer.ts +1 -1
  91. package/dist/utils/connectNativeJsBridge.ts +1 -1
  92. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  93. package/dist/utils/draExceptionAndProfile.ts +1 -1
  94. package/dist/utils/h5Utils.ts +1 -1
  95. package/dist/utils/index.h5.ts +1 -1
  96. package/dist/utils/index.ts +1 -1
  97. package/dist/utils/index.weapp.ts +1 -1
  98. package/dist/utils/jm-common.js +1 -1
  99. package/dist/utils/sgmCodeUtils.ts +1 -0
  100. package/dist/utils/taroRenderUtil.ts +1 -1
  101. package/dist/utils/utils.ts +1 -1
  102. package/package.json +1 -1
  103. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
@@ -1 +1 @@
1
- import React, {useRef, useEffect} from 'react'
2
1
  isH5AndJdShopView,
3
2
  isAndroidDevice,
4
3
  isIosDevice,
5
4
  isJdApp,
6
5
  isWxMin,
7
6
  isH5AndJdShopViewH5Scroll,
8
7
  isH5,
9
8
  const rootEleNode = isH5 && document ? document.querySelector('body') : null
10
9
  const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
11
10
  const GetSlideAngle = (dx,dy) => {
12
11
  return Math.atan2(dy,dx) * 180 / Math.PI;
13
12
  }
14
13
  const GetSlideDirection = (startX,startY,endX,endY) => {
15
14
  const dy = startY - endY;
16
15
  const dx = endX - startX;
17
16
  let result = 0;
18
17
  if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
19
18
  return result;
20
19
  }
21
20
  const angle = GetSlideAngle(dx, dy);
22
21
  if (angle >= -45 && angle < 45) {
23
22
  result = 4;
24
23
  }else if (angle >= 45 && angle < 135) {
25
24
  result = 1;
26
25
  }else if (angle >= -135 && angle < -45) {
27
26
  result = 2;
28
27
  }else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
29
28
  result = 3;
30
29
  }
31
30
  return result;
32
31
  }
33
32
  needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
34
33
  const touchEvent =
35
34
  e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
36
35
  const xDiff = Math.abs(
37
36
  touchEvent.clientX - mLastClientPosRef.current.mLastClientX,
38
37
  ).toFixed(2)
39
38
  const yDiff = Math.abs(
40
39
  touchEvent.clientY - mLastClientPosRef.current.mLastClientY,
41
40
  ).toFixed(2)
42
41
  if(isAndroidDevice) {
43
42
  if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
44
43
  console.log(
45
44
  '横向滚动触发',
46
45
  xDiff,
47
46
  touchEvent,
48
47
  window.JDJshopViewInfo.androidTouchSlop,
49
48
  )
50
49
  } else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
51
50
  console.log(
52
51
  '纵向滚动触发',
53
52
  yDiff,
54
53
  touchEvent,
55
54
  window.JDJshopViewInfo.androidTouchSlop,
56
55
  )
57
56
  androidDeviceStopNativeScrollEvent(false)
58
57
  }
59
58
  }
60
59
  if(needShowHighVersion) {
61
60
  const direction = GetSlideDirection(mLastClientPosRef.current.mLastClientX, mLastClientPosRef.current.mLastClientY, touchEvent.clientX, touchEvent.clientY);
62
61
  if(direction === 1 || direction === 2) {
63
62
  rootEleNode && rootEleNode.classList.remove('over-hidden')
64
63
  }
65
64
  }
66
65
  <ScrollView
67
66
  scrollX
68
67
  onTouchStart={changeTouchStart}
69
68
  onTouchEnd={changeTouchEnd}
70
69
  onTouchCancel={changeTouchEnd}
71
70
  onTouchMove={changeTouchMove}
72
71
  enhanced
73
72
  showScrollbar={false}
74
73
  style={style}
75
74
  className={classNames(className, {
76
75
  [customScrollViewStyle[
77
76
  'd-custom-ios-h5-extend-border-radius'
78
77
  ]]: isIosDevice,
79
78
  },'J_customScroll')}
80
79
  {...otherProps}
81
80
  >
82
81
  {children}
83
82
  </ScrollView>
83
+ import React, { useRef, useEffect } from 'react'
84
84
  isH5AndJdShopView,
85
85
  isAndroidDevice,
86
86
  isJdAndAndroidDevice,
87
87
  isJdAndIosDevice,
88
88
  isIosDevice,
89
89
  isJdApp,
90
90
  isWxMin,
91
91
  isH5AndJdShopViewH5Scroll,
92
92
  isH5AndJdShopH5CustomScrollView,
93
93
  isH5,
94
94
  isAppClassifyPage,
95
95
  lodashThrottle,
96
96
  START: 'start',
97
97
  MOVE: 'move',
98
98
  END: 'end',
99
99
  const rootEleNode = isH5 && document ? document.querySelector('body') : null
100
100
  const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
101
101
  const isJdAndH5ScrollState = needShowHighVersion || isH5AndJdShopH5CustomScrollView
102
102
 
103
103
  const touchstartEventBubbleFunc = (e) => {
104
104
  const isH5SwiperCustomEle = e?.target?.closest('.J_h5SwiperCustom')
105
105
  if(!isH5SwiperCustomEle){
106
106
  const hasCustomEle = e ? (e?.target?.closest('.J_customScroll') || e?.target?.closest('.J_customLayout')) : false
107
107
  if (isJdAndAndroidDevice && !hasCustomEle) {
108
108
  window.JdAndroid && window.JdAndroid.requestEvent(false)
109
109
  }
110
110
  !hasCustomEle && rootEleNode && rootEleNode.classList.contains('over-hidden') && rootEleNode.classList.remove('over-hidden')
111
111
  console.log("customScrollView所在页面document touch start事件是否有J_customScroll元素",hasCustomEle,"根元素是否有over-hidden",rootEleNode.classList)
112
112
  }
113
113
  }
114
114
  const touchstartEventCaptureFunc = (e) => {
115
115
  if (e && !e?.target?.closest('.J_h5SwiperCustom') && !e?.target?.closest('.J_customLayout')){
116
116
  rootEleNode && rootEleNode.classList.contains('over-hidden') && rootEleNode.classList.remove('over-hidden')
117
117
  console.log("customScrollView所在页面document touch start事件捕获阶段移除根元素是否有over-hidden",rootEleNode.classList)
118
118
  }
119
119
  }
120
120
  useEffect(() => {
121
121
  isJdApp && !window.JDJshopViewInfo.getAndroidTouchSlopState &&
122
122
  nativePageGetScaledTouchSlop((res) => {
123
123
  console.log('获取安卓系统滑动阈值', res)
124
124
  window.JDJshopViewInfo.androidTouchSlop = res
125
125
  window.JDJshopViewInfo.getAndroidTouchSlopState = true
126
126
  })
127
127
  if(isJdAndH5ScrollState && rootEleNode && !rootEleAddEventListenerState){
128
128
  global?.removeJdAndroidRquestEventForTouchStart && global.removeJdAndroidRquestEventForTouchStart()
129
129
  rootEleNode.addEventListener(
130
130
  'touchstart',
131
131
  touchstartEventBubbleFunc,
132
132
  false,
133
133
  )
134
134
 
135
135
  rootEleNode.addEventListener(
136
136
  'touchstart',
137
137
  touchstartEventCaptureFunc,
138
138
  true,
139
139
  )
140
140
  rootEleAddEventListenerState = true
141
141
  console.warn("customScrollView 初始化document监听完成")
142
142
  }
143
143
  return () => {
144
144
  if(isJdAndH5ScrollState && rootEleNode && rootEleAddEventListenerState){
145
145
  console.warn("customScrollView document监听取消完成")
146
146
  rootEleNode.removeEventListener(
147
147
  'touchstart',
148
148
  touchstartEventBubbleFunc,
149
149
  false,
150
150
  )
151
151
  rootEleNode.removeEventListener(
152
152
  'touchstart',
153
153
  touchstartEventCaptureFunc,
154
154
  true,
155
155
  )
156
156
  }
157
157
  }
158
158
  }, [])
159
159
 
160
160
  const androidDeviceStopNativeScrollEvent = (touchType) => {
161
161
  isJdApp &&
162
162
  isAndroidDevice &&
163
163
  window?.JdAndroid &&
164
164
  window?.JdAndroid.requestEvent(touchType === TouchType.START)
165
165
  console.log("触发window?.JdAndroid.requestEvent",touchType === TouchType.START,touchType)
166
166
  }
167
167
  const iosDeviceStopNativeScrollEvent = (e, touchType, sendIosState = true) => {
168
168
  e && e.stopPropagation()
169
169
  sendIosState && iosDeviceSendRouter(touchType)
170
170
  }
171
171
  const iosDeviceSendRouter = (state) => {
172
172
  window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
173
173
  method: 'callRouterModuleWithParams',
174
174
  params: {
175
175
  routerURL: 'router://JDShopModule/processShoph5SlideState',
176
176
  routerParam: {
177
177
  slideDirection: 'horizontal',
178
178
  needDisableVertical: `${iosNeedDisableVertical}`,
179
179
  state,
180
180
  },
181
181
  callBackId: new Date().getTime(),
182
182
  },
183
183
  })
184
184
  }
185
185
  isAndroidDevice && androidDeviceStopNativeScrollEvent(touchType)
186
186
  console.log("当前customScrollView touch事件", touchType, e, "是否是e instanceof CustomEvent", e instanceof CustomEvent)
187
187
  const GetSlideAngle = (dx,dy) => {
188
188
  return Math.atan2(dy,dx) * 180 / Math.PI;
189
189
  }
190
190
  const GetSlideDirection = (startX, startY, endX, endY) => {
191
191
  const dy = startY - endY
192
192
  const dx = endX - startX
193
193
  let result = 0
194
194
  if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
195
195
  return result
196
196
  }
197
197
  const angle = GetSlideAngle(dx, dy)
198
198
  if (angle >= -45 && angle < 45) {
199
199
  result = 4
200
200
  } else if (angle >= 45 && angle < 135) {
201
201
  result = 1
202
202
  } else if (angle >= -135 && angle < -45) {
203
203
  result = 2
204
204
  } else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
205
205
  result = 3
206
206
  }
207
207
  return result
208
208
  }
209
209
  if(isJdApp){
210
210
  stopNativeScrollEvent(e, TouchType.START, !iosNeedDisableVertical)
211
211
  if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
212
212
  isJdAndH5ScrollState && rootEleNode && rootEleNode.classList.add('over-hidden')
213
213
  console.info("customScrollView touchstart 当前根元素是否添加还是删除over-hidden",TouchType.START,rootEleNode.classList)
214
214
  const touchEvent =
215
215
  e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
216
216
  mLastClientPosRef.current.mLastClientX = touchEvent.clientX
217
217
  mLastClientPosRef.current.mLastClientY = touchEvent.clientY
218
218
  console.log('ustomScrollView touchstart 获取mLastClientPosRef', mLastClientPosRef)
219
219
  }
220
220
  }
221
221
  stopNativeScrollEvent(e,TouchType.END)
222
222
  mLastClientPosRef.current.mLastClientX = 0
223
223
  mLastClientPosRef.current.mLastClientY = 0
224
224
  console.log('ustomScrollView touchend 获取mLastClientPosRef', mLastClientPosRef)
225
225
  const triggerIosTouchMove = () => {
226
226
  isJdAndIosDevice && iosDeviceStopNativeScrollEvent(null,TouchType.START, true)
227
227
  }
228
228
 
229
229
  const lodashThrottleTriggerIosTouchMove = lodashThrottle(
230
230
  triggerIosTouchMove,
231
231
  500,
232
232
  )
233
233
 
234
234
  const recoverRootEleVerticalScroll = (touchEvent) => {
235
235
  const direction = GetSlideDirection(mLastClientPosRef.current.mLastClientX, mLastClientPosRef.current.mLastClientY, touchEvent.clientX, touchEvent.clientY)
236
236
  if (direction === 1 || direction === 2) {
237
237
  rootEleNode && rootEleNode.classList.contains('over-hidden') && rootEleNode.classList.remove('over-hidden')
238
238
  }
239
239
  console.log("获取当前滚动方向,向上向下1、2",direction,'根元素的classList',rootEleNode.classList,'mLastClientPosRef.current.mLastClientX',mLastClientPosRef.current.mLastClientX)
240
240
  }
241
241
  const touchEvent =
242
242
  e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
243
243
  const xDiff = Math.abs(
244
244
  touchEvent.clientX - mLastClientPosRef.current.mLastClientX,
245
245
  ).toFixed(2)
246
246
  const yDiff = Math.abs(
247
247
  touchEvent.clientY - mLastClientPosRef.current.mLastClientY,
248
248
  ).toFixed(2)
249
249
  if(isJdApp) {
250
250
  if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
251
251
  console.log(
252
252
  '横向滚动触发',
253
253
  xDiff,
254
254
  touchEvent,
255
255
  window.JDJshopViewInfo.androidTouchSlop,
256
256
  "iosNeedDisableVertical",
257
257
  iosNeedDisableVertical
258
258
  )
259
259
  iosNeedDisableVertical && isJdApp && lodashThrottleTriggerIosTouchMove()
260
260
  } else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
261
261
  console.log(
262
262
  '纵向滚动触发',
263
263
  yDiff,
264
264
  touchEvent,
265
265
  window.JDJshopViewInfo.androidTouchSlop,
266
266
  )
267
267
  stopNativeScrollEvent(e, TouchType.END)
268
268
  }
269
269
  }
270
270
  isJdAndH5ScrollState && recoverRootEleVerticalScroll(touchEvent)
271
271
  <ScrollView
272
272
  scrollX
273
273
  onTouchStart={changeTouchStart}
274
274
  onTouchEnd={changeTouchEnd}
275
275
  onTouchCancel={changeTouchEnd}
276
276
  onTouchMove={changeTouchMove}
277
277
  enhanced
278
278
  showScrollbar={false}
279
279
  style={style}
280
280
  className={classNames(className, {
281
281
  [customScrollViewStyle[
282
282
  'd-custom-ios-h5-extend-border-radius'
283
283
  ]]: isIosDevice,
284
284
  }, 'J_customScroll')}
285
285
  {...otherProps}
286
286
  >
287
287
  {children}
288
288
  </ScrollView>
289
289
  )
290
290
  } else {
291
291
  return (
292
292
  <ScrollView
293
293
  scrollX
294
294
  enhanced
295
295
  showScrollbar={false}
296
296
  {...otherProps}
297
297
  className={classNames(
298
298
  className,
299
299
  {
300
300
  [customScrollViewStyle[
301
301
  'd-custom-ios-mini-extend-border-radius'
302
302
  ]]:
303
303
  isIosDevice &&
304
304
  isWxMin &&
305
305
  scrollX &&
306
306
  style['borderRadius'],
307
307
  },
308
308
  {
309
309
  [customScrollViewStyle[
310
310
  'd-custom-ios-h5-extend-border-radius'
311
311
  ]]: isIosDevice,
312
312
  },
313
313
  {
314
314
  [customScrollViewStyle['d-custom-mini-hide-scroll']]:
315
315
  isWxMin,
316
316
  },
317
317
  )}
318
318
  style={style}
319
319
  >
320
320
  {children}
321
321
  </ScrollView>
322
322
  )
323
323
  }
324
324
  iosNeedDisableVertical: false,