@conecli/cone-render 0.8.20-shop.56 → 0.8.20-shop.57

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.
@@ -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
  !isAppClassifyPage && e && e.stopPropagation()
12
11
  if(!verticalScrolling) {
13
12
  needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
14
13
  }
15
14
  !isAppClassifyPage && e && e.stopPropagation()
16
15
  !isAppClassifyPage && e && e.stopPropagation()
17
16
  if(!verticalScrolling) {
18
17
  needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
19
18
  }
20
19
  if(!verticalScrolling) {
21
20
  needShowHighVersion && rootEleNode && rootEleNode.classList.remove('over-hidden')
22
21
  }
23
22
  <ScrollView
24
23
  scrollX
25
24
  onTouchStart={changeTouchStart}
26
25
  onTouchEnd={changeTouchEnd}
27
26
  onTouchCancel={changeTouchEnd}
28
27
  onTouchMove={changeTouchMove}
29
28
  enhanced
30
29
  showScrollbar={false}
31
30
  style={style}
32
31
  className={classNames(className, {
33
32
  [customScrollViewStyle[
34
33
  'd-custom-ios-h5-extend-border-radius'
35
34
  ]]: isIosDevice,
36
35
  },'J_customScroll')}
37
36
  {...otherProps}
38
37
  >
39
38
  {children}
40
39
  </ScrollView>
41
40
  verticalScrolling: false,
41
+ import React, {useRef, useEffect} from 'react'
42
42
  isH5AndJdShopView,
43
43
  isAndroidDevice,
44
44
  isIosDevice,
45
45
  isJdApp,
46
46
  isWxMin,
47
47
  isH5AndJdShopViewH5Scroll,
48
48
  isH5,
49
49
  const rootEleNode = isH5 && document ? document.querySelector('body') : null
50
50
  const needShowHighVersion = isH5AndJdShopViewH5Scroll && !(global.info.queryInfo?.downgraded && global.info.queryInfo.downgraded === "true")
51
51
  const GetSlideAngle = (dx,dy) => {
52
52
  return Math.atan2(dy,dx) * 180 / Math.PI;
53
53
  }
54
54
  const GetSlideDirection = (startX,startY,endX,endY) => {
55
55
  const dy = startY - endY;
56
56
  const dx = endX - startX;
57
57
  let result = 0;
58
58
  if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
59
59
  return result;
60
60
  }
61
61
  const angle = GetSlideAngle(dx, dy);
62
62
  if (angle >= -45 && angle < 45) {
63
63
  result = 4;
64
64
  }else if (angle >= 45 && angle < 135) {
65
65
  result = 1;
66
66
  }else if (angle >= -135 && angle < -45) {
67
67
  result = 2;
68
68
  }else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
69
69
  result = 3;
70
70
  }
71
71
  return result;
72
72
  }
73
73
  needShowHighVersion && rootEleNode && rootEleNode.classList.add('over-hidden')
74
74
  const touchEvent =
75
75
  e?.originalEvent?.targetTouches[0] || e?.targetTouches[0]
76
76
  const xDiff = Math.abs(
77
77
  touchEvent.clientX - mLastClientPosRef.current.mLastClientX,
78
78
  ).toFixed(2)
79
79
  const yDiff = Math.abs(
80
80
  touchEvent.clientY - mLastClientPosRef.current.mLastClientY,
81
81
  ).toFixed(2)
82
82
  if(isAndroidDevice) {
83
83
  if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
84
84
  console.log(
85
85
  '横向滚动触发',
86
86
  xDiff,
87
87
  touchEvent,
88
88
  window.JDJshopViewInfo.androidTouchSlop,
89
89
  )
90
90
  } else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
91
91
  console.log(
92
92
  '纵向滚动触发',
93
93
  yDiff,
94
94
  touchEvent,
95
95
  window.JDJshopViewInfo.androidTouchSlop,
96
96
  )
97
97
  androidDeviceStopNativeScrollEvent(false)
98
98
  }
99
99
  }
100
100
  if(needShowHighVersion) {
101
101
  const direction = GetSlideDirection(mLastClientPosRef.current.mLastClientX, mLastClientPosRef.current.mLastClientY, touchEvent.clientX, touchEvent.clientY);
102
102
  if(direction === 1 || direction === 2) {
103
103
  rootEleNode && rootEleNode.classList.remove('over-hidden')
104
104
  }
105
105
  }
106
106
  <ScrollView
107
107
  scrollX
108
108
  onTouchStart={changeTouchStart}
109
109
  onTouchEnd={changeTouchEnd}
110
110
  onTouchCancel={changeTouchEnd}
111
111
  onTouchMove={changeTouchMove}
112
112
  enhanced
113
113
  showScrollbar={false}
114
114
  style={style}
115
115
  className={classNames(className, {
116
116
  [customScrollViewStyle[
117
117
  'd-custom-ios-h5-extend-border-radius'
118
118
  ]]: isIosDevice,
119
119
  },'J_customScroll')}
120
120
  {...otherProps}
121
121
  >
122
122
  {children}
123
123
  </ScrollView>