@conecli/cone-render 0.10.1-shop3.5 → 0.10.1-shop3.51
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.
- package/README.md +1 -1
- package/dist/common/accessibility.h5.ts +1 -0
- package/dist/common/accessibility.ts +0 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/index.h5.ts +1 -1
- package/dist/common/index.jd.ts +1 -1
- package/dist/common/index.ts +1 -1
- package/dist/common/index.weapp.ts +1 -1
- package/dist/common/jdplayerSdk.weapp.tsx +1 -0
- package/dist/common/jssdk.ts +1 -1
- package/dist/common/jssdk.weapp.ts +1 -0
- package/dist/common/pageType.ts +1 -1
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/wxappApi.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
- package/dist/components/base/CommonFloorHead/index.tsx +1 -1
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
- package/dist/components/base/Dialog/index.module.scss +11 -0
- package/dist/components/base/InOrOutViewObserver/index.weapp.tsx +1 -0
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +118 -72
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/base/Price/Base/index.module.scss +12 -0
- package/dist/components/base/Price/Base/index.tsx +1 -1
- package/dist/components/base/Price/Double/index.module.scss +24 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +2 -2
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/const.ts +1 -1
- package/dist/jumpEventReport/createReportFloorData.ts +1 -1
- package/dist/jumpEventReport/index.h5.ts +1 -1
- package/dist/jumpEventReport/index.jd.ts +1 -1
- package/dist/jumpEventReport/index.weapp.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web/report.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.pc.ts +1 -1
- package/dist/jumpEventReport/web.tjm.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/language/en_US.json +231 -0
- package/dist/language/zh_CN.json +231 -0
- package/dist/language/zh_HK.json +231 -0
- package/dist/libs/taroAppReport.js +2 -2
- package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -56
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/shopMember.weapp.ts +1 -0
- package/dist/open/api/util.ts +1 -1
- package/dist/open/index.ts +1 -1
- package/dist/sass/app.h5.scss +278 -224
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.weapp.ts +1 -0
- package/dist/service/fetchJsonp.weapp.ts +1 -0
- package/dist/service/http/colorSign.ts +1 -1
- package/dist/service/http/const.ts +1 -1
- package/dist/service/http/h5Http.ts +1 -1
- package/dist/service/http/httpInterceptors.weapp.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -1
- package/dist/service/requestServer.ts +1 -1
- package/dist/service/requestServer.weapp.ts +1 -0
- package/dist/utils/connectNativeJsBridge.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- package/dist/utils/harmonyCallRouter.h5.ts +1 -0
- package/dist/utils/harmonyCallRouter.ts +0 -0
- package/dist/utils/index.h5.ts +1 -1
- package/dist/utils/index.ts +1 -1
- package/dist/utils/index.weapp.ts +1 -1
- package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/log.ts +1 -0
- package/dist/utils/{sColor.js → sColor.ts} +1 -1
- package/dist/utils/sColor.weapp.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/package.json +160 -141
- package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
- package/dist/utils/priceUtils.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from 'react';
|
|
2
|
isH5AndJdShopView,
|
|
1
3
|
isAndroidDevice,
|
|
2
4
|
isJdAndAndroidDevice,
|
|
3
5
|
isJdAndIosDevice,
|
|
4
6
|
isIosDevice,
|
|
5
7
|
isJdApp,
|
|
6
8
|
isWxMin,
|
|
7
9
|
isH5AndJdShopViewH5Scroll,
|
|
8
10
|
isH5AndJdShopH5CustomScrollView,
|
|
9
11
|
isH5,
|
|
10
12
|
isAppClassifyPage,
|
|
11
13
|
lodashThrottle,
|
|
12
14
|
START: 'start',
|
|
13
15
|
MOVE: 'move',
|
|
14
16
|
END: 'end',
|
|
15
17
|
const {
|
|
16
18
|
style = {},
|
|
17
19
|
scrollX = false,
|
|
18
20
|
scrollY = false,
|
|
19
21
|
scrollWithAnimation = true,
|
|
20
22
|
iosNeedDisableVertical = false,
|
|
21
23
|
className = null,
|
|
22
24
|
dispatchTouchMove = true,
|
|
23
25
|
children,
|
|
24
26
|
...otherProps
|
|
25
27
|
} = props;
|
|
26
28
|
const rootEleNode = isH5 && document?.querySelector('body');
|
|
27
29
|
const needShowHighVersion =
|
|
28
30
|
isH5AndJdShopViewH5Scroll && global.info.queryInfo?.downgraded !== 'true';
|
|
29
31
|
const mLastClientPosRef = useRef({
|
|
30
32
|
mLastClientX: 0,
|
|
31
33
|
mLastClientY: 0,
|
|
32
34
|
});
|
|
33
35
|
const isJdAndH5ScrollState = needShowHighVersion || isH5AndJdShopH5CustomScrollView;
|
|
34
36
|
|
|
35
37
|
const touchstartEventBubbleFunc = (e) => {
|
|
36
38
|
const isH5SwiperCustomEle = e?.target?.closest('.J_h5SwiperCustom');
|
|
37
39
|
if (!isH5SwiperCustomEle) {
|
|
38
40
|
const hasCustomEle = e
|
|
39
41
|
? e?.target?.closest('.J_customScroll') || e?.target?.closest('.J_customLayout')
|
|
40
42
|
: false;
|
|
41
43
|
if (isJdAndAndroidDevice && !hasCustomEle) {
|
|
42
44
|
window.JdAndroid && window.JdAndroid.requestEvent(false);
|
|
43
45
|
}
|
|
44
46
|
!hasCustomEle &&
|
|
45
47
|
rootEleNode &&
|
|
46
48
|
rootEleNode.classList.contains('over-hidden') &&
|
|
47
49
|
rootEleNode.classList.remove('over-hidden');
|
|
48
50
|
}
|
|
49
51
|
};
|
|
50
52
|
const touchstartEventCaptureFunc = (e) => {
|
|
51
53
|
if (e && !e?.target?.closest('.J_h5SwiperCustom') && !e?.target?.closest('.J_customLayout')) {
|
|
52
54
|
rootEleNode &&
|
|
53
55
|
rootEleNode.classList.contains('over-hidden') &&
|
|
54
56
|
rootEleNode.classList.remove('over-hidden');
|
|
55
57
|
}
|
|
56
58
|
};
|
|
57
59
|
useEffect(() => {
|
|
58
60
|
isJdApp &&
|
|
59
61
|
!window.JDJshopViewInfo.getAndroidTouchSlopState &&
|
|
60
62
|
nativePageGetScaledTouchSlop((res) => {
|
|
61
63
|
console.log('获取安卓系统滑动阈值', res);
|
|
62
64
|
window.JDJshopViewInfo.androidTouchSlop = res;
|
|
63
65
|
window.JDJshopViewInfo.getAndroidTouchSlopState = true;
|
|
64
66
|
});
|
|
65
67
|
if (isJdAndH5ScrollState && rootEleNode && !rootEleAddEventListenerState) {
|
|
66
68
|
global?.removeJdAndroidRquestEventForTouchStart &&
|
|
67
69
|
global.removeJdAndroidRquestEventForTouchStart();
|
|
68
70
|
rootEleNode.addEventListener('touchstart', touchstartEventBubbleFunc, false);
|
|
69
71
|
|
|
70
72
|
rootEleNode.addEventListener('touchstart', touchstartEventCaptureFunc, true);
|
|
71
73
|
rootEleAddEventListenerState = true;
|
|
72
74
|
console.log('customScrollView 初始化document监听完成');
|
|
73
75
|
}
|
|
74
76
|
return () => {
|
|
75
77
|
if (isJdAndH5ScrollState && rootEleNode && rootEleAddEventListenerState) {
|
|
76
78
|
console.log('customScrollView document监听取消完成');
|
|
77
79
|
rootEleNode.removeEventListener('touchstart', touchstartEventBubbleFunc, false);
|
|
78
80
|
rootEleNode.removeEventListener('touchstart', touchstartEventCaptureFunc, true);
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
83
|
}, []);
|
|
82
84
|
|
|
83
85
|
const androidDeviceStopNativeScrollEvent = (touchType) => {
|
|
84
86
|
isJdApp &&
|
|
85
87
|
isAndroidDevice &&
|
|
86
88
|
window?.JdAndroid &&
|
|
87
89
|
window?.JdAndroid.requestEvent(touchType === TouchType.START);
|
|
88
90
|
};
|
|
89
91
|
const iosDeviceStopNativeScrollEvent = (e, touchType, sendIosState = true) => {
|
|
90
92
|
sendIosState && iosDeviceSendRouter(touchType);
|
|
91
93
|
};
|
|
92
94
|
|
|
93
95
|
const iosDeviceSendRouter = (state: string) => {
|
|
94
96
|
window?.webkit?.messageHandlers?.MobileNavi?.postMessage?.({
|
|
95
97
|
method: 'callRouterModuleWithParams',
|
|
96
98
|
params: {
|
|
97
99
|
routerURL: 'router://JDShopModule/processShoph5SlideState',
|
|
98
100
|
routerParam: {
|
|
99
101
|
slideDirection: 'horizontal',
|
|
100
102
|
needDisableVertical: `${iosNeedDisableVertical}`,
|
|
101
103
|
state,
|
|
102
104
|
},
|
|
103
105
|
callBackId: new Date().getTime(),
|
|
104
106
|
},
|
|
105
107
|
});
|
|
106
108
|
};
|
|
107
109
|
const stopNativeScrollEvent = (e: Event, touchType, sendIosState = true) => {
|
|
108
110
|
if (isJdApp) {
|
|
109
111
|
if (isIosDevice && !isAppClassifyPage) {
|
|
110
112
|
iosDeviceStopNativeScrollEvent(e, touchType, sendIosState);
|
|
111
113
|
} else if (isAndroidDevice) {
|
|
112
114
|
androidDeviceStopNativeScrollEvent(touchType);
|
|
113
115
|
}
|
|
114
116
|
}
|
|
115
117
|
};
|
|
116
118
|
|
|
117
119
|
const GetSlideAngle = (dx, dy) => {
|
|
118
120
|
return (Math.atan2(dy, dx) * 180) / Math.PI;
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
const GetSlideDirection = (startX, startY, endX, endY) => {
|
|
122
124
|
const dy = startY - endY;
|
|
123
125
|
const dx = endX - startX;
|
|
124
126
|
let result = 0;
|
|
125
127
|
if (Math.abs(dx) < 2 && Math.abs(dy) < 2) {
|
|
126
128
|
return result;
|
|
127
129
|
}
|
|
128
130
|
const angle = GetSlideAngle(dx, dy);
|
|
129
131
|
if (angle >= -45 && angle < 45) {
|
|
130
132
|
result = 4;
|
|
131
133
|
} else if (angle >= 45 && angle < 135) {
|
|
132
134
|
result = 1;
|
|
133
135
|
} else if (angle >= -135 && angle < -45) {
|
|
134
136
|
result = 2;
|
|
135
137
|
} else if ((angle >= 135 && angle <= 180) || (angle >= -180 && angle < -135)) {
|
|
136
138
|
result = 3;
|
|
137
139
|
}
|
|
138
140
|
return result;
|
|
139
141
|
};
|
|
140
142
|
const changeTouchStart = (e) => {
|
|
141
143
|
if (isJdApp) {
|
|
142
144
|
stopNativeScrollEvent(e, TouchType.START, !iosNeedDisableVertical);
|
|
143
145
|
if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
|
|
144
146
|
isJdAndH5ScrollState && rootEleNode && rootEleNode.classList.add('over-hidden');
|
|
145
147
|
const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
|
|
146
148
|
mLastClientPosRef.current.mLastClientX = touchEvent.clientX;
|
|
147
149
|
mLastClientPosRef.current.mLastClientY = touchEvent.clientY;
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
152
|
};
|
|
151
153
|
const changeTouchEnd = (e) => {
|
|
152
154
|
stopNativeScrollEvent(e, TouchType.END);
|
|
153
155
|
mLastClientPosRef.current.mLastClientX = 0;
|
|
154
156
|
mLastClientPosRef.current.mLastClientY = 0;
|
|
155
157
|
};
|
|
156
158
|
const triggerIosTouchMove = () => {
|
|
157
159
|
isJdAndIosDevice && iosDeviceStopNativeScrollEvent(null, TouchType.START, true);
|
|
158
160
|
};
|
|
159
161
|
|
|
160
162
|
const lodashThrottleTriggerIosTouchMove = lodashThrottle(triggerIosTouchMove, 500);
|
|
161
163
|
|
|
162
164
|
const recoverRootEleVerticalScroll = (touchEvent) => {
|
|
163
165
|
const direction = GetSlideDirection(
|
|
164
166
|
mLastClientPosRef.current.mLastClientX,
|
|
165
167
|
mLastClientPosRef.current.mLastClientY,
|
|
166
168
|
touchEvent.clientX,
|
|
167
169
|
touchEvent.clientY,
|
|
168
170
|
);
|
|
169
171
|
if (direction === 1 || direction === 2) {
|
|
170
172
|
rootEleNode &&
|
|
171
173
|
rootEleNode.classList.contains('over-hidden') &&
|
|
172
174
|
rootEleNode.classList.remove('over-hidden');
|
|
173
175
|
}
|
|
174
176
|
};
|
|
175
177
|
const changeTouchMove = (e) => {
|
|
176
178
|
if (isH5AndJdShopView || isH5AndJdShopH5CustomScrollView) {
|
|
177
179
|
const touchEvent = e?.originalEvent?.targetTouches[0] || e?.targetTouches[0];
|
|
178
180
|
const xDiff = Math.abs(touchEvent.clientX - mLastClientPosRef.current.mLastClientX).toFixed(
|
|
179
181
|
2,
|
|
180
182
|
);
|
|
181
183
|
const yDiff = Math.abs(touchEvent.clientY - mLastClientPosRef.current.mLastClientY).toFixed(
|
|
182
184
|
2,
|
|
183
185
|
);
|
|
184
186
|
if (isJdApp) {
|
|
185
187
|
if (xDiff >= window.JDJshopViewInfo.androidTouchSlop) {
|
|
186
188
|
iosNeedDisableVertical && isJdApp && lodashThrottleTriggerIosTouchMove();
|
|
187
189
|
} else if (yDiff > window.JDJshopViewInfo.androidTouchSlop) {
|
|
188
190
|
stopNativeScrollEvent(e, TouchType.END);
|
|
189
191
|
}
|
|
190
192
|
}
|
|
191
193
|
isJdAndH5ScrollState && recoverRootEleVerticalScroll(touchEvent);
|
|
192
194
|
}
|
|
193
195
|
if (!dispatchTouchMove) {
|
|
194
196
|
return;
|
|
195
197
|
}
|
|
196
198
|
const parentNode = e.target?.parentNode;
|
|
197
199
|
if (!parentNode) {
|
|
198
200
|
return;
|
|
199
201
|
}
|
|
200
202
|
const event = new TouchEvent('touchmove', e);
|
|
201
203
|
parentNode.dispatchEvent(event);
|
|
202
204
|
};
|
|
203
205
|
if (scrollX && isJdApp && !isIgnorePreventNative) {
|
|
204
206
|
return (
|
|
205
207
|
<ScrollView
|
|
206
208
|
scrollX
|
|
207
209
|
onTouchStart={changeTouchStart}
|
|
208
210
|
onTouchEnd={changeTouchEnd}
|
|
209
211
|
onTouchCancel={changeTouchEnd}
|
|
210
212
|
onTouchMove={changeTouchMove}
|
|
211
213
|
enhanced
|
|
212
214
|
showScrollbar={false}
|
|
213
215
|
style={style}
|
|
214
216
|
className={classNames(
|
|
215
217
|
className,
|
|
216
218
|
{
|
|
217
219
|
[customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]: isIosDevice,
|
|
218
220
|
},
|
|
219
221
|
'J_customScroll',
|
|
220
222
|
)}
|
|
221
223
|
scrollY
|
|
222
224
|
scrollWithAnimation
|
|
223
225
|
{...otherProps}
|
|
224
226
|
>
|
|
225
227
|
{children}
|
|
226
228
|
</ScrollView>
|
|
227
229
|
);
|
|
228
230
|
} else {
|
|
229
231
|
return (
|
|
230
232
|
<ScrollView
|
|
231
233
|
scrollX
|
|
232
234
|
scrollY
|
|
233
235
|
scrollWithAnimation
|
|
234
236
|
enhanced
|
|
235
237
|
showScrollbar={false}
|
|
236
238
|
{...otherProps}
|
|
237
239
|
className={classNames(
|
|
238
240
|
className,
|
|
239
241
|
{
|
|
240
242
|
[customScrollViewStyle['d-custom-ios-mini-extend-border-radius']]:
|
|
241
243
|
isIosDevice && isWxMin && scrollX && style['borderRadius'],
|
|
242
244
|
},
|
|
243
245
|
{
|
|
244
246
|
[customScrollViewStyle['d-custom-ios-h5-extend-border-radius']]: isIosDevice,
|
|
245
247
|
},
|
|
246
248
|
{
|
|
247
249
|
[customScrollViewStyle['d-custom-mini-hide-scroll']]: isWxMin,
|
|
248
250
|
},
|
|
249
251
|
)}
|
|
250
252
|
style={style}
|
|
251
253
|
>
|
|
252
254
|
{children}
|
|
253
255
|
</ScrollView>
|
|
254
256
|
);
|
|
255
257
|
}
|