@conecli/cone-render 0.8.20-beta.0 → 0.8.20-beta.2
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 +7 -1
- package/dist/api/index.ts +1 -1
- package/dist/assets/icon_blue_info.svg +1 -0
- package/dist/common/const.ts +1 -1
- package/dist/common/environmentType.ts +1 -0
- 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.ts +1 -0
- package/dist/common/jssdk.ts +1 -0
- package/dist/common/pageType.ts +1 -0
- package/dist/common/sgmCustomCode.ts +1 -0
- package/dist/common/token/index.h5.ts +1 -1
- package/dist/common/token/token.jd.ts +1 -1
- package/dist/common/token/token.ts +1 -1
- package/dist/common/wxappApi.jd.ts +1 -0
- 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.module.scss +49 -44
- package/dist/components/base/CountDown/index.tsx +1 -1
- package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
- package/dist/components/base/CustomScrollView/index.module.scss +7 -0
- package/dist/components/base/CustomScrollView/index.tsx +1 -1
- package/dist/components/base/CustomVideo/common.ts +1 -0
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/Dialog/index.module.scss +16 -0
- package/dist/components/base/Dialog/index.tsx +1 -1
- package/dist/components/base/Exposure/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/const.ts +1 -0
- package/dist/components/base/ExposureSmart/index.h5.module.scss +30 -6
- package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.module.scss +20 -9
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
- package/dist/components/base/InViewRender/index.tsx +1 -1
- package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
- package/dist/components/base/ItemViewExposureSmart/index.module.scss +8 -0
- package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -0
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
- package/dist/components/base/LazyLoadImage/const.ts +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.module.scss +24 -20
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
- package/dist/components/base/NetworkDataError/const.ts +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +125 -69
- 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 +32 -0
- package/dist/components/base/Price/Double/index.tsx +1 -1
- package/dist/components/base/Price/index.tsx +1 -1
- package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
- package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
- package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
- package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
- package/dist/components/base/Skeleton/index.tsx +1 -1
- package/dist/components/debug/DebugLayout/index.module.scss +67 -0
- package/dist/components/debug/DebugLayout/index.tsx +1 -0
- package/dist/components/debug/DebugLayout/utils.ts +1 -0
- package/dist/components/decorate/DecorateFloorModule/index.module.scss +32 -2
- package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
- package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
- package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
- package/dist/components/floorItem.jd.tsx +1 -1
- package/dist/components/floorItem.tsx +1 -1
- package/dist/components/floorItem.weapp.tsx +1 -1
- package/dist/components/isv/Floor/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -0
- package/dist/interface/common.ts +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/interface/jumpEventReport.ts +1 -1
- package/dist/interface/service.ts +1 -1
- package/dist/interface/utils.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.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.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.jdb.ts +1 -1
- package/dist/jumpEventReport/web.jdjch.ts +1 -0
- package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
- package/dist/jumpEventReport/web.pc.ts +1 -0
- package/dist/jumpEventReport/web.tjapp.ts +1 -0
- package/dist/jumpEventReport/web.tjm.ts +1 -0
- 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 -27
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/modules/ContainerFloorList/index.tsx +1 -1
- package/dist/open/api/device.ts +1 -1
- package/dist/open/api/environment.ts +1 -1
- package/dist/open/api/index.ts +1 -1
- package/dist/open/api/jump copy.ts +1 -1
- package/dist/open/api/request.ts +1 -1
- package/dist/open/api/shopMember.ts +1 -1
- package/dist/open/api/track.ts +1 -1
- package/dist/open/api/util.ts +1 -1
- package/dist/open/components/index.ts +1 -1
- package/dist/sass/app.h5.scss +294 -212
- package/dist/sass/base.scss +195 -137
- package/dist/service/bMallConst.ts +1 -1
- package/dist/service/fetchGateway.ts +1 -1
- package/dist/service/fetchGateway.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 -0
- package/dist/service/http/index.h5.ts +1 -0
- package/dist/service/requestServer.h5.ts +1 -0
- 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/connectNativeJsBridge.weapp.ts +1 -1
- package/dist/utils/draExceptionAndProfile.ts +1 -1
- package/dist/utils/h5Utils.ts +1 -1
- 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/intersectionObserver.ts +1 -1
- package/dist/utils/jm-common.js +1 -1
- package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
- package/dist/utils/jumpExtMapUtil.ts +1 -0
- package/dist/utils/sColor.js +1 -0
- package/dist/utils/sgmCodeUtils.ts +1 -0
- package/dist/utils/taroRenderUtil.ts +1 -0
- package/dist/utils/utils.ts +1 -1
- package/dist/wxapp/api/helper.js +1 -0
- package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
- package/dist/wxapp/common/user_info.js +1 -1
- package/dist/wxapp/components/launch-app/index.js +1 -0
- package/dist/wxapp/components/launch-app/index.json +5 -0
- package/dist/wxapp/components/launch-app/index.wxml +0 -0
- package/dist/wxapp/components/launch-app/index.wxss +0 -0
- package/dist/wxapp/components/subscribe-guider/helper.js +1 -0
- package/dist/wxapp/components/subscribe-guider/index.js +1 -0
- package/dist/wxapp/components/subscribe-guider/index.json +5 -0
- package/dist/wxapp/components/subscribe-guider/index.wxml +0 -0
- package/dist/wxapp/components/subscribe-guider/index.wxss +0 -0
- package/package.json +145 -115
- package/dist/components/base/Skeleton/old.tsx +0 -1
- package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
- package/dist/utils/memberFormatUtils.js +0 -1
- /package/dist/service/{bMallConst.wxapp.ts → bMallConst.weapp.ts} +0 -0
- /package/dist/service/http/{colorSign.wxapp.ts → colorSign.weapp.ts} +0 -0
package/dist/utils/index.h5.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
nativePageShowToast, ToastAndroidType,
|
|
3
2
|
ToastIosType,
|
|
4
3
|
getAppChannelType, isAndroidDevice, isH5AndJdShopView,
|
|
5
4
|
isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdApp,
|
|
6
5
|
isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
|
|
7
6
|
sgmCustomReport, isMemberPage
|
|
8
7
|
addHttps,
|
|
9
8
|
clearTaroStorageKey,
|
|
10
9
|
countStringify,
|
|
11
10
|
dateFormat,
|
|
12
11
|
dealAddress,
|
|
13
12
|
dealShopContentData as originDealShopContentData,
|
|
14
13
|
debounce,
|
|
15
14
|
filterUrlQueryData,
|
|
16
15
|
formatTabActiveMenuType,
|
|
17
16
|
getQualityImage,
|
|
18
17
|
getTaroStorageKeyValue,
|
|
19
18
|
getWxAppCookieStr,
|
|
20
19
|
isH5,
|
|
21
20
|
isJdMin,
|
|
22
21
|
isWxMin,
|
|
23
22
|
isWxMinAndWxapp,
|
|
24
23
|
lodashThrottle,
|
|
25
24
|
objectToUrlEncode,
|
|
26
25
|
parseQueryUrlString,
|
|
27
26
|
removeTaroStorageKey,
|
|
28
27
|
setLowSmallPicUrl,
|
|
29
28
|
setTaroStorage,
|
|
30
29
|
showFailToast,
|
|
31
30
|
showNormalToast,
|
|
32
31
|
showSuccessToast,
|
|
33
32
|
sliceArrToChunkList,
|
|
34
33
|
throttle,
|
|
35
34
|
windowWidth: window.innerWidth,
|
|
36
35
|
screenWidth: window.innerWidth,
|
|
37
36
|
platform: '',
|
|
38
37
|
model: '',
|
|
39
38
|
system: '',
|
|
40
39
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
41
40
|
const params = Object.assign(
|
|
42
41
|
{},
|
|
43
42
|
{
|
|
44
43
|
title: '',
|
|
45
44
|
duration: 1500,
|
|
46
45
|
},
|
|
47
46
|
options,
|
|
48
47
|
)
|
|
49
48
|
params.duration = params.duration / 1000
|
|
50
49
|
if (isJdApp && isH5AndJdShopView) {
|
|
51
50
|
const showSuccessType = isIosDevice
|
|
52
51
|
? ToastIosType.SUCCESS
|
|
53
52
|
: ToastAndroidType.SUCCESS
|
|
54
53
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
55
54
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
56
55
|
console.log('执行原生toast success')
|
|
57
56
|
} else {
|
|
58
57
|
showSuccessToast(options)
|
|
59
58
|
}
|
|
60
59
|
const params = Object.assign(
|
|
61
60
|
{},
|
|
62
61
|
{
|
|
63
62
|
title: '',
|
|
64
63
|
duration: 1500,
|
|
65
64
|
},
|
|
66
65
|
options,
|
|
67
66
|
)
|
|
68
67
|
params.duration = params.duration / 1000
|
|
69
68
|
console.log(`isJdApp${isJdApp}`)
|
|
70
69
|
if (isJdApp && isH5AndJdShopView) {
|
|
71
70
|
const showSuccessType = isIosDevice
|
|
72
71
|
? ToastIosType.FAIL
|
|
73
72
|
: ToastAndroidType.FAIL
|
|
74
73
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
75
74
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
76
75
|
console.log('执行原生toast fail')
|
|
77
76
|
} else {
|
|
78
77
|
console.log('执行H5 toast fail')
|
|
79
78
|
showFailToast(options)
|
|
80
79
|
}
|
|
81
80
|
const params = Object.assign(
|
|
82
81
|
{},
|
|
83
82
|
{
|
|
84
83
|
title: '',
|
|
85
84
|
duration: 1500,
|
|
86
85
|
},
|
|
87
86
|
options,
|
|
88
87
|
)
|
|
89
88
|
params.duration = params.duration / 1000
|
|
90
89
|
if (isJdApp) {
|
|
91
90
|
const showSuccessType = isIosDevice
|
|
92
91
|
? ToastIosType.NORMAL
|
|
93
92
|
: ToastAndroidType.NORMAL
|
|
94
93
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
95
94
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
96
95
|
} else {
|
|
97
96
|
showNormalToast(options)
|
|
98
97
|
}
|
|
99
98
|
const createLoadingEle = document.createElement('div')
|
|
100
99
|
createLoadingEle.id = 'J_shopLoading'
|
|
101
100
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
102
101
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
103
102
|
<span class='d-shop-loading-icon'></span>
|
|
104
103
|
<p class='d-shop-text'>${text}</p>
|
|
105
104
|
</div>`
|
|
106
105
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
|
|
107
106
|
console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
|
|
108
107
|
getEle.appendChild(createLoadingEle)
|
|
109
108
|
const getEle = document.getElementById('J_shopLoading')
|
|
110
109
|
getEle && getEle.remove()
|
|
111
110
|
num,
|
|
112
111
|
widthSize = 375,
|
|
113
112
|
layoutWidth = getSystemInfo.windowWidth,
|
|
114
113
|
const getNum = Number(num)
|
|
115
114
|
return Math.round((getNum / widthSize) * layoutWidth)
|
|
116
115
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
|
|
117
116
|
if (!systemInfo.system && window) {
|
|
118
117
|
systemInfo.system = window.navigator.userAgent
|
|
119
118
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
120
119
|
}
|
|
121
120
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
122
121
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
123
122
|
systemInfo.navBarHeight = 0
|
|
124
123
|
systemInfo.statusBarHeight = 0
|
|
125
124
|
systemInfo.capsulePosition = null
|
|
126
125
|
systemInfo.isIOS = isIOS
|
|
127
126
|
systemInfo.isAndroid = isAndroid
|
|
128
127
|
return systemInfo
|
|
129
128
|
return originDealShopContentData(pageData, DraJSAgentReport, isvdev)
|
|
130
129
|
isJdApp,
|
|
131
130
|
isWxApp,
|
|
132
131
|
isIosDevice,
|
|
133
132
|
isAndroidDevice,
|
|
134
133
|
isJdAndIosDevice,
|
|
135
134
|
isJdAndAndroidDevice,
|
|
136
135
|
isWxMin,
|
|
137
136
|
isWxMinAndWxapp,
|
|
138
137
|
isJdMin,
|
|
139
138
|
isH5,
|
|
140
139
|
isH5AndJdShopView,
|
|
141
140
|
isH5AndJdShopViewNativeScroll,
|
|
142
141
|
isH5AndJingGouMini,
|
|
143
142
|
isWxMiniH5View,
|
|
144
143
|
urlCookie,
|
|
145
144
|
sliceArrToChunkList,
|
|
146
145
|
dealAddress,
|
|
147
146
|
objectToUrlEncode,
|
|
148
147
|
parseQueryUrlString,
|
|
149
148
|
setLowSmallPicUrl,
|
|
150
149
|
setTaroStorage,
|
|
151
150
|
getTaroStorageKeyValue,
|
|
152
151
|
removeTaroStorageKey,
|
|
153
152
|
clearTaroStorageKey,
|
|
154
153
|
getQualityImage,
|
|
155
154
|
countStringify,
|
|
156
155
|
getWxAppCookieStr,
|
|
157
156
|
getSystemInfos,
|
|
158
157
|
pxTransformFromData,
|
|
159
158
|
dealShopContentDataAndReport as dealShopContentData,
|
|
160
159
|
dateFormat,
|
|
161
160
|
throttle,
|
|
162
161
|
lodashThrottle,
|
|
163
162
|
debounce,
|
|
164
163
|
addHttps,
|
|
165
164
|
commonShowSuccessToast as showSuccessToast,
|
|
166
165
|
commonShowFailToast as showFailToast,
|
|
167
166
|
commonShowNormalToast as showNormalToast,
|
|
168
167
|
showShopLoading,
|
|
169
168
|
hideShopLoading,
|
|
170
169
|
getAppChannelType,
|
|
171
170
|
formatTabActiveMenuType,
|
|
172
171
|
filterUrlQueryData,
|
|
173
172
|
sgmCustomReport,
|
|
174
173
|
isMemberPage,
|
|
175
174
|
memberFormatUtils
|
|
175
|
+
import Taro from '@tarojs/taro';
|
|
176
176
|
stopNativeScrollEvent,
|
|
177
177
|
getAppChannelType,
|
|
178
178
|
isAndroidDevice,
|
|
179
179
|
isHarmonyDevice,
|
|
180
180
|
isH5AndJdShopView,
|
|
181
181
|
isChartH5,
|
|
182
182
|
isH5AndJdShopViewNativeScroll,
|
|
183
183
|
isIosDevice,
|
|
184
184
|
isJdAndAndroidDevice,
|
|
185
185
|
isJdAndIosDevice,
|
|
186
186
|
isJdAndHarmonyDevice,
|
|
187
187
|
isJdApp,
|
|
188
188
|
isWxApp,
|
|
189
189
|
isWxMiniH5View,
|
|
190
190
|
isH5AndJingGouMini,
|
|
191
191
|
urlCookie,
|
|
192
192
|
sgmCustomReport,
|
|
193
193
|
draCustomReport,
|
|
194
194
|
remoteCustomReport,
|
|
195
195
|
draInterfaceCustomReport,
|
|
196
196
|
draBusinessCustomReport,
|
|
197
197
|
draBusinessCustomLogReport,
|
|
198
198
|
isMemberPage,
|
|
199
199
|
isH5AndJdShopViewH5Scroll,
|
|
200
200
|
isH5AndJdShopH5CustomScrollView,
|
|
201
201
|
isAppClassifyPage,
|
|
202
202
|
isAppHomeForMarketPage,
|
|
203
203
|
isPc,
|
|
204
204
|
ipLoc_djd,
|
|
205
205
|
jdAppVersionCompare,
|
|
206
206
|
dealNativePixelToCssPixel,
|
|
207
207
|
isAppStowShop,
|
|
208
208
|
isJdAndroidX5Core,
|
|
209
209
|
isTjScence,
|
|
210
210
|
isH5AdnJxMini,
|
|
211
211
|
isTjM,
|
|
212
212
|
isTjJxM,
|
|
213
213
|
isTJApp,
|
|
214
214
|
isH5AdnHaoWuJie,
|
|
215
215
|
tjChannel,
|
|
216
216
|
parseQueryUrlObj,
|
|
217
217
|
isIpadDevice,
|
|
218
218
|
isTabletDevice,
|
|
219
219
|
checkPadScreenOrientationIsLandscape,
|
|
220
220
|
isSupportHybridHttpRequest,
|
|
221
221
|
isLanguageForEn,
|
|
222
222
|
sColor,
|
|
223
223
|
draInterfaceDSMCustomReport,
|
|
224
224
|
isInJdShopView,
|
|
225
225
|
isDongWebView,
|
|
226
226
|
isLanguageForHk,
|
|
227
227
|
languageNowType,
|
|
228
228
|
addHttps,
|
|
229
229
|
clearTaroStorageKey,
|
|
230
230
|
countStringify as h5CountStringify,
|
|
231
231
|
dateFormat,
|
|
232
232
|
dealAddress,
|
|
233
233
|
dealShopContentData as originDealShopContentData,
|
|
234
234
|
debounce,
|
|
235
235
|
filterUrlQueryData,
|
|
236
236
|
formatTabActiveMenuType,
|
|
237
237
|
getAvifSupport,
|
|
238
238
|
getWebpSupport,
|
|
239
239
|
getTaroStorageKeyValue,
|
|
240
240
|
getWxAppCookieStr,
|
|
241
241
|
isH5,
|
|
242
242
|
isMin,
|
|
243
243
|
isJdMin,
|
|
244
244
|
isWxMin,
|
|
245
245
|
isWxMinAndWxapp,
|
|
246
246
|
isJdMinAndHarmony,
|
|
247
247
|
lodashThrottle,
|
|
248
248
|
objectToUrlEncode,
|
|
249
249
|
parseQueryUrlString,
|
|
250
250
|
removeTaroStorageKey,
|
|
251
251
|
setLowSmallPicUrl,
|
|
252
252
|
setTaroStorage,
|
|
253
253
|
showFailToast,
|
|
254
254
|
showNormalToast,
|
|
255
255
|
showSuccessToast,
|
|
256
256
|
sliceArrToChunkList,
|
|
257
257
|
throttle,
|
|
258
258
|
getQualityImageNew,
|
|
259
259
|
getQualityImageOld,
|
|
260
260
|
isOpenJdAppUrl,
|
|
261
261
|
jdOpenAppParams,
|
|
262
262
|
createJdOpenAppUrl,
|
|
263
263
|
isEmpty,
|
|
264
264
|
getJdAppReportPageSource,
|
|
265
265
|
dealJdOpenAppData,
|
|
266
266
|
getBorderStyle,
|
|
267
267
|
const getNum = Number(num);
|
|
268
268
|
let _changeLayoutWidth = layoutWidth;
|
|
269
269
|
if (!_changeLayoutWidth) {
|
|
270
270
|
_changeLayoutWidth =
|
|
271
271
|
_ShopSystemInfo && _ShopSystemInfo?.windowWidth
|
|
272
272
|
? _ShopSystemInfo.windowWidth
|
|
273
273
|
: Taro.getSystemInfoSync()?.windowWidth;
|
|
274
274
|
}
|
|
275
275
|
return _ShopSystemInfo?.isJdTabletDevice && !layoutWidth
|
|
276
276
|
? Math.floor(getNum * 1.2 * (_changeLayoutWidth / 720))
|
|
277
277
|
: Math.round((getNum / widthSize) * _changeLayoutWidth);
|
|
278
278
|
const getRootFontSize = (40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth)) / 750;
|
|
279
279
|
let getRealRootFontSize = getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize;
|
|
280
280
|
if (_ShopSystemInfo?.isJdTabletDevice) {
|
|
281
281
|
getRealRootFontSize = Math.floor(
|
|
282
282
|
24 * ((systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth) / 720),
|
|
283
283
|
);
|
|
284
284
|
}
|
|
285
285
|
return Math.ceil(
|
|
286
286
|
(((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) * getRealRootFontSize,
|
|
287
287
|
);
|
|
288
288
|
console.log(
|
|
289
289
|
'获取系统宽度systemInfo?.windowWidth',
|
|
290
290
|
systemInfo?.windowWidth,
|
|
291
291
|
'taroToTransformRoutimePXNumber(changeWidth)',
|
|
292
292
|
taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
|
|
293
293
|
);
|
|
294
294
|
return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
|
|
295
295
|
? systemInfo?.windowWidth - taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
|
|
296
296
|
: (systemInfo?.windowWidth ?? 0);
|
|
297
297
|
const systemInfo = _ShopSystemInfo || Taro.getSystemInfoSync();
|
|
298
298
|
console.log(
|
|
299
299
|
'获取系统宽度systemInfo?.windowWidth',
|
|
300
300
|
systemInfo?.windowWidth,
|
|
301
301
|
'taroToTransformRoutimePXNumber(changeWidth)',
|
|
302
302
|
taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
|
|
303
303
|
);
|
|
304
304
|
const containerWidth =
|
|
305
305
|
isClassify && systemInfo?.windowWidth
|
|
306
306
|
? systemInfo?.windowWidth - taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
|
|
307
307
|
: (systemInfo?.windowWidth ?? 0);
|
|
308
308
|
if (global?.info?.sysInfo) {
|
|
309
309
|
global.info.sysInfo['containerWidth'] = containerWidth;
|
|
310
310
|
}
|
|
311
311
|
return (
|
|
312
312
|
isJdApp &&
|
|
313
313
|
(parseQueryUrlObj['device'] === 'tablet' || Math.min(rootEleWidth, window.screen.height) >= 720)
|
|
314
314
|
);
|
|
315
315
|
const systemInfo = Taro.getSystemInfoSync();
|
|
316
316
|
if (params && params?.pageWidth && params?.pageHeight) {
|
|
317
317
|
systemInfo.windowWidth = params?.pageWidth;
|
|
318
318
|
systemInfo.windowHeight = params?.pageHeight;
|
|
319
319
|
console.warn('松果app内获取重置系统信息宽度值', params, ',systemInfo信息集合为', systemInfo);
|
|
320
320
|
} else {
|
|
321
321
|
if (isPc) {
|
|
322
322
|
systemInfo.windowWidth = 375;
|
|
323
323
|
} else {
|
|
324
324
|
const getWinWidth = window.innerWidth;
|
|
325
325
|
const getWinHeight = window.innerHeight;
|
|
326
326
|
const getScreenWidth = window.screen.width;
|
|
327
327
|
const getScreenHeight = window.screen.height;
|
|
328
328
|
const getRootEleInitWidth = params?.rootEleInitWidth || 0;
|
|
329
329
|
const isReplaceSystemWidth = params?.replaceSystemWidth || false;
|
|
330
330
|
systemInfo.isJdTabletDevice = checkIsJdTabletDevice(getRootEleInitWidth);
|
|
331
331
|
systemInfo.isJdTabletLandscape =
|
|
332
332
|
systemInfo.isJdTabletDevice &&
|
|
333
333
|
checkPadScreenOrientationIsLandscape(getRootEleInitWidth, getScreenWidth, getScreenHeight);
|
|
334
334
|
if (!systemInfo.isJdTabletDevice && isReplaceSystemWidth) {
|
|
335
335
|
if (systemInfo?.windowWidth <= 0) {
|
|
336
336
|
systemInfo.windowWidth = Math.min(getRootEleInitWidth, getScreenWidth);
|
|
337
337
|
systemInfo.windowHeight = getScreenHeight;
|
|
338
338
|
console.warn(
|
|
339
339
|
'====初始化获取当前设备不是pad,但是触发屏幕宽高最小值600,系统获取宽度为0,进行重置系统宽度为根元素宽度与屏幕宽度最小值====',
|
|
340
340
|
systemInfo.windowWidth,
|
|
341
341
|
'getRootEleInitWidth',
|
|
342
342
|
getRootEleInitWidth,
|
|
343
343
|
'getScreenWidth',
|
|
344
344
|
getScreenWidth,
|
|
345
345
|
'getScreenHeight',
|
|
346
346
|
getScreenHeight,
|
|
347
347
|
);
|
|
348
348
|
draBusinessCustomReport({
|
|
349
349
|
type: 'jdapp_pad_width_error_info',
|
|
350
350
|
errMsg: `松果app内获取当前设备不是pad,触发屏幕宽高最小值600,系统信息宽度为0,进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
|
|
351
351
|
originReqDataStr: JSON.stringify({
|
|
352
352
|
isJdApp,
|
|
353
353
|
isAndroidDevice,
|
|
354
354
|
getScreenWidth,
|
|
355
355
|
getScreenHeight,
|
|
356
356
|
getWinWidth,
|
|
357
357
|
getWinHeight,
|
|
358
358
|
getRootEleInitWidth,
|
|
359
359
|
}),
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
362
|
} else {
|
|
363
363
|
if (isJdApp && isAndroidDevice && !systemInfo.isJdTabletDevice && systemInfo) {
|
|
364
364
|
const isLandscape = getScreenWidth >= getScreenHeight;
|
|
365
365
|
const { windowWidth, windowHeight, screenWidth, screenHeight } = systemInfo;
|
|
366
366
|
if (windowWidth <= 0) {
|
|
367
367
|
systemInfo.initWindowWidth = windowWidth;
|
|
368
368
|
if (isLandscape) {
|
|
369
369
|
systemInfo.windowWidth = getScreenHeight;
|
|
370
370
|
systemInfo.windowHeight = getScreenWidth;
|
|
371
371
|
systemInfo.screenWidth = getScreenHeight;
|
|
372
372
|
systemInfo.screenHeight = getScreenWidth;
|
|
373
373
|
} else {
|
|
374
374
|
systemInfo.windowWidth = getScreenWidth;
|
|
375
375
|
systemInfo.windowHeight = getScreenHeight;
|
|
376
376
|
systemInfo.screenWidth = getScreenWidth;
|
|
377
377
|
systemInfo.screenHeight = getScreenHeight;
|
|
378
378
|
}
|
|
379
379
|
console.warn(
|
|
380
380
|
`松果安卓app内获取系统信息宽度异常为小于等于0,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取窗口高度值${windowHeight},重置后的高度值${systemInfo.windowHeight},根元素宽度值${getRootEleInitWidth}`,
|
|
381
381
|
);
|
|
382
382
|
draBusinessCustomReport({
|
|
383
383
|
type: 'android_jdapp_width_error_info',
|
|
384
384
|
errMsg: `松果安卓app内获取系统信息宽度为小于等于0,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
|
|
385
385
|
originReqDataStr: JSON.stringify({
|
|
386
386
|
isJdApp,
|
|
387
387
|
initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
|
|
388
388
|
getScreenWidth,
|
|
389
389
|
getScreenHeight,
|
|
390
390
|
getWinWidth,
|
|
391
391
|
getWinHeight,
|
|
392
392
|
getRootEleInitWidth,
|
|
393
393
|
}),
|
|
394
394
|
});
|
|
395
395
|
sgmCustomReport({
|
|
396
396
|
type: 2,
|
|
397
397
|
code: 'android_jdapp_width_error_info',
|
|
398
398
|
msg: {
|
|
399
399
|
title: `松果安卓app内获取系统信息宽度为小于等于0,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
|
|
400
400
|
initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
|
|
401
401
|
taroSysInfo: systemInfo,
|
|
402
402
|
},
|
|
403
403
|
});
|
|
404
404
|
} else {
|
|
405
405
|
let _getChangeWinWidthState = false;
|
|
406
406
|
if (getWinWidth > 0 && windowWidth > 0 && windowWidth > getWinWidth) {
|
|
407
407
|
if (isLandscape) {
|
|
408
408
|
systemInfo.windowWidth = getScreenHeight;
|
|
409
409
|
systemInfo.windowHeight = getScreenWidth;
|
|
410
410
|
systemInfo.screenWidth = getScreenHeight;
|
|
411
411
|
systemInfo.screenHeight = getScreenWidth;
|
|
412
412
|
} else {
|
|
413
413
|
systemInfo.windowWidth = getScreenWidth;
|
|
414
414
|
systemInfo.windowHeight = getScreenHeight;
|
|
415
415
|
systemInfo.screenWidth = getScreenWidth;
|
|
416
416
|
systemInfo.screenHeight = getScreenHeight;
|
|
417
417
|
}
|
|
418
418
|
_getChangeWinWidthState = true;
|
|
419
419
|
}
|
|
420
420
|
_getChangeWinWidthState &&
|
|
421
421
|
console.warn(
|
|
422
422
|
`松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取屏幕宽度值${screenWidth},重置后的宽度值${systemInfo.screenWidth}`,
|
|
423
423
|
);
|
|
424
424
|
if (_getChangeWinWidthState) {
|
|
425
425
|
draBusinessCustomReport({
|
|
426
426
|
type: 'android_jdapp_width_error_info_2',
|
|
427
427
|
title: `松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
|
|
428
428
|
originReqDataStr: JSON.stringify({
|
|
429
429
|
isJdApp,
|
|
430
430
|
initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
|
|
431
431
|
getScreenWidth,
|
|
432
432
|
getScreenHeight,
|
|
433
433
|
getWinWidth,
|
|
434
434
|
getWinHeight,
|
|
435
435
|
getRootEleInitWidth,
|
|
436
436
|
}),
|
|
437
437
|
});
|
|
438
438
|
sgmCustomReport({
|
|
439
439
|
type: 2,
|
|
440
440
|
code: 'android_jdapp_width_error_info_2',
|
|
441
441
|
msg: {
|
|
442
442
|
title: `松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
|
|
443
443
|
initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
|
|
444
444
|
taroSysInfo: systemInfo,
|
|
445
445
|
},
|
|
446
446
|
});
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
|
|
452
452
|
if (systemInfo.isJdTabletDevice) {
|
|
453
453
|
systemInfo.windowWidth = Math.min(getRootEleInitWidth, getScreenWidth, getScreenHeight);
|
|
454
454
|
systemInfo.windowHeight = Math.max(getScreenWidth, getScreenHeight);
|
|
455
455
|
if (systemInfo.isJdTabletLandscape) {
|
|
456
456
|
const getRenderCenterState = window?.PAGE_DATA?.businessData?.fitPadCenterRenderLowVersion
|
|
457
457
|
? jdAppVersionCompare(window.PAGE_DATA.businessData.fitPadCenterRenderLowVersion) < 0
|
|
458
458
|
: false;
|
|
459
459
|
if (getRenderCenterState && window?.PAGE_DATA) {
|
|
460
460
|
window.PAGE_DATA.isFitJdPadRenderCenter = true;
|
|
461
461
|
}
|
|
462
462
|
if (window?.PAGE_DATA?.isFitJdPadRenderCenter) {
|
|
463
463
|
systemInfo.windowWidth = Math.min(getRootEleInitWidth, getScreenWidth, getScreenHeight);
|
|
464
464
|
systemInfo.windowHeight = Math.max(
|
|
465
465
|
getRootEleInitWidth,
|
|
466
466
|
getScreenWidth,
|
|
467
467
|
getScreenHeight,
|
|
468
468
|
);
|
|
469
469
|
} else {
|
|
470
470
|
systemInfo.windowWidth = Math.max(getRootEleInitWidth, getScreenWidth, getScreenHeight);
|
|
471
471
|
systemInfo.windowHeight = Math.min(
|
|
472
472
|
getRootEleInitWidth,
|
|
473
473
|
getScreenWidth,
|
|
474
474
|
getScreenHeight,
|
|
475
475
|
);
|
|
476
476
|
}
|
|
477
477
|
}
|
|
478
478
|
console.warn(
|
|
479
479
|
'====初始化获取当前设备是否是平板设备,是否横屏====',
|
|
480
480
|
systemInfo.isJdTabletDevice,
|
|
481
481
|
systemInfo.isJdTabletLandscape,
|
|
482
482
|
'屏幕信息',
|
|
483
483
|
window.screen,
|
|
484
484
|
'getScreenWidth',
|
|
485
485
|
getScreenWidth,
|
|
486
486
|
'getScreenHeight',
|
|
487
487
|
getScreenHeight,
|
|
488
488
|
'getRootEleInitWidth',
|
|
489
489
|
getRootEleInitWidth,
|
|
490
490
|
'当前是否要求居中展示,居中展示那么宽高值要对调',
|
|
491
491
|
window?.PAGE_DATA?.isFitJdPadRenderCenter,
|
|
492
492
|
'当前pad最终展示的窗口宽度',
|
|
493
493
|
systemInfo.windowWidth,
|
|
494
494
|
);
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
498
|
systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo);
|
|
499
499
|
console.warn('====获取系统信息=====', systemInfo);
|
|
500
500
|
return systemInfo;
|
|
501
501
|
let result: boolean | null = null;
|
|
502
502
|
return function () {
|
|
503
503
|
if (result === null) {
|
|
504
504
|
const appVersionCheckPass = jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0;
|
|
505
505
|
if (!isJdApp) {
|
|
506
506
|
console.warn('🚗 ~~ file: utils.ts:191 站外H5默认打开图片优化~');
|
|
507
507
|
isIgnoreOptimizeFromServer = true;
|
|
508
508
|
result = true;
|
|
509
509
|
return true;
|
|
510
510
|
}
|
|
511
511
|
const enableAvifOptimize = appVersionCheckPass;
|
|
512
512
|
if (enableAvifOptimize) {
|
|
513
513
|
const configData = global?.getDynamicConfig('avifSwitch');
|
|
514
514
|
const {
|
|
515
515
|
globalOn = true,
|
|
516
516
|
ignoreOptimizeFromServer = false,
|
|
517
517
|
page = {},
|
|
518
518
|
grayscale = {},
|
|
519
519
|
whiteList = [],
|
|
520
520
|
blackList = [],
|
|
521
521
|
} = configData || {};
|
|
522
522
|
const { shopId = '0', venderId = '0' } = parseQueryUrlObj;
|
|
523
523
|
let imageEnableResult = true;
|
|
524
524
|
isIgnoreOptimizeFromServer = ignoreOptimizeFromServer;
|
|
525
525
|
if (
|
|
526
526
|
blackList.find((item) => item.sId === Number(shopId) || item.vId === Number(venderId))
|
|
527
527
|
) {
|
|
528
528
|
imageEnableResult = false;
|
|
529
529
|
} else if (
|
|
530
530
|
whiteList.find((item) => item.sId === Number(shopId) || item.vId === Number(venderId))
|
|
531
531
|
) {
|
|
532
532
|
isIgnoreOptimizeFromServer = true;
|
|
533
533
|
imageEnableResult = true;
|
|
534
534
|
} else if (grayscale[buildType] && isInGrayscale(grayscale[buildType])) {
|
|
535
535
|
isIgnoreOptimizeFromServer = true;
|
|
536
536
|
imageEnableResult = true;
|
|
537
537
|
} else {
|
|
538
538
|
imageEnableResult = globalOn === true || page[buildType] === true;
|
|
539
539
|
if (globalOn === true) {
|
|
540
540
|
isIgnoreOptimizeFromServer = true;
|
|
541
541
|
} else if (page[buildType] === true) {
|
|
542
542
|
} else {
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
result = imageEnableResult;
|
|
546
546
|
return imageEnableResult;
|
|
547
547
|
} else {
|
|
548
548
|
result = false;
|
|
549
549
|
return false;
|
|
550
550
|
}
|
|
551
551
|
} else {
|
|
552
552
|
return result;
|
|
553
553
|
}
|
|
554
554
|
};
|
|
555
555
|
if (typeof options === 'object' && isImageOptimizeEnable()) {
|
|
556
556
|
return getQualityImageNew(imgUrl, options, isIgnoreOptimizeFromServer);
|
|
557
557
|
} else {
|
|
558
558
|
return getQualityImageOld(imgUrl, options);
|
|
559
559
|
}
|
|
560
560
|
const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
|
|
561
561
|
windowWidth: window.innerWidth,
|
|
562
562
|
containerWidth: getContainerWidth(buildType, {
|
|
563
563
|
windowWidth: window.innerWidth,
|
|
564
564
|
}),
|
|
565
565
|
screenWidth: window.innerWidth,
|
|
566
566
|
platform: '',
|
|
567
567
|
model: '',
|
|
568
568
|
system: '',
|
|
569
569
|
};
|
|
570
570
|
return getSystemInfo;
|
|
571
571
|
const params = Object.assign(
|
|
572
572
|
{},
|
|
573
573
|
{
|
|
574
574
|
title: '',
|
|
575
575
|
duration: 1500,
|
|
576
576
|
},
|
|
577
577
|
options,
|
|
578
578
|
);
|
|
579
579
|
params.duration = params.duration / 1000;
|
|
580
580
|
if (isJdApp && !isJdAndHarmonyDevice && !window?.PAGE_DATA?.businessData?.hideNativeToast) {
|
|
581
581
|
const showSuccessType = isIosDevice ? ToastIosType.SUCCESS : ToastAndroidType.SUCCESS;
|
|
582
582
|
const duration = isAndroidDevice ? 0 : params.duration;
|
|
583
583
|
nativePageShowToast(options.title, showSuccessType, duration);
|
|
584
584
|
console.log('执行原生toast success');
|
|
585
585
|
} else {
|
|
586
586
|
showSuccessToast(options);
|
|
587
587
|
}
|
|
588
588
|
const params = Object.assign(
|
|
589
589
|
{},
|
|
590
590
|
{
|
|
591
591
|
title: '',
|
|
592
592
|
duration: 1500,
|
|
593
593
|
},
|
|
594
594
|
options,
|
|
595
595
|
);
|
|
596
596
|
params.duration = params.duration / 1000;
|
|
597
597
|
if (isJdApp && !isJdAndHarmonyDevice && !window?.PAGE_DATA?.businessData?.hideNativeToast) {
|
|
598
598
|
const showSuccessType = isIosDevice ? ToastIosType.FAIL : ToastAndroidType.FAIL;
|
|
599
599
|
const duration = isAndroidDevice ? 0 : params.duration;
|
|
600
600
|
nativePageShowToast(options.title, showSuccessType, duration);
|
|
601
601
|
console.log('执行原生toast fail');
|
|
602
602
|
} else {
|
|
603
603
|
console.log('执行H5 toast fail');
|
|
604
604
|
showFailToast(options);
|
|
605
605
|
}
|
|
606
606
|
const params = Object.assign(
|
|
607
607
|
{},
|
|
608
608
|
{
|
|
609
609
|
title: '',
|
|
610
610
|
duration: 1500,
|
|
611
611
|
},
|
|
612
612
|
options,
|
|
613
613
|
);
|
|
614
614
|
params.duration = params.duration / 1000;
|
|
615
615
|
if (isJdApp && !isJdAndHarmonyDevice && !window?.PAGE_DATA?.businessData?.hideNativeToast) {
|
|
616
616
|
const showSuccessType = isIosDevice ? ToastIosType.NORMAL : ToastAndroidType.NORMAL;
|
|
617
617
|
const duration = isAndroidDevice ? 0 : params.duration;
|
|
618
618
|
nativePageShowToast(options.title, showSuccessType, duration);
|
|
619
619
|
} else {
|
|
620
620
|
showNormalToast(options);
|
|
621
621
|
}
|
|
622
622
|
if (isLanguageForEn) {
|
|
623
623
|
count = Number(count);
|
|
624
624
|
if (count >= 1000000000) {
|
|
625
625
|
return (count / 1000000000).toFixed(fixedNum) + 'B';
|
|
626
626
|
} else if (count >= 1000000) {
|
|
627
627
|
return (count / 1000000).toFixed(fixedNum) + 'M';
|
|
628
628
|
} else if (count >= 1000) {
|
|
629
629
|
return (count / 1000).toFixed(fixedNum) + 'K';
|
|
630
630
|
} else {
|
|
631
631
|
return count;
|
|
632
632
|
}
|
|
633
633
|
} else {
|
|
634
634
|
return h5CountStringify(count, fixedNum, unit, maxNum);
|
|
635
635
|
}
|
|
636
636
|
const createLoadingEle = document.createElement('div');
|
|
637
637
|
createLoadingEle.id = 'J_shopLoading';
|
|
638
638
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`;
|
|
639
639
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
640
640
|
<span class='d-shop-loading-icon'></span>
|
|
641
641
|
<p class='d-shop-text'>${text}</p>
|
|
642
642
|
</div>`;
|
|
643
643
|
const getEle = document.body ? document.body : document.getElementsByTagName('body')[0];
|
|
644
644
|
getEle.appendChild(createLoadingEle);
|
|
645
645
|
const getEle = document.getElementById('J_shopLoading');
|
|
646
646
|
getEle && getEle.remove();
|
|
647
647
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(params);
|
|
648
648
|
if (!systemInfo.system && window) {
|
|
649
649
|
systemInfo.system = window.navigator.userAgent;
|
|
650
650
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i);
|
|
651
651
|
}
|
|
652
652
|
const isIOS = !!systemInfo?.system.match(/ios/i);
|
|
653
653
|
const isAndroid = !!systemInfo?.system.match(/android/i);
|
|
654
654
|
systemInfo.navBarHeight = 0;
|
|
655
655
|
systemInfo.statusBarHeight = 0;
|
|
656
656
|
systemInfo.capsulePosition = null;
|
|
657
657
|
systemInfo.isIOS = isIOS;
|
|
658
658
|
systemInfo.isAndroid = isAndroid;
|
|
659
659
|
_ShopSystemInfo = systemInfo;
|
|
660
660
|
return systemInfo;
|
|
661
661
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev);
|
|
662
662
|
const numScale = Number(scale);
|
|
663
663
|
if (isNaN(numScale)) {
|
|
664
664
|
console.warn(
|
|
665
665
|
`The 'scale' parameter of the 'isInGrayscale' function is invalid! Expected a number, but received ${scale}`,
|
|
666
666
|
);
|
|
667
667
|
return false;
|
|
668
668
|
}
|
|
669
669
|
const { venderId } = global.info.queryInfo || {};
|
|
670
670
|
const id = venderId;
|
|
671
671
|
if (!id && numScale !== 1) {
|
|
672
672
|
return false;
|
|
673
673
|
}
|
|
674
674
|
const useScale = Math.max(0, Math.min(1, numScale));
|
|
675
675
|
const isMatch = numScale === 1 || Math.floor(Number(id) % (1 / useScale)) === 0;
|
|
676
676
|
if (reportKey) {
|
|
677
677
|
sgmCustomReport({
|
|
678
678
|
code: getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`),
|
|
679
679
|
msg: '灰度调用',
|
|
680
680
|
});
|
|
681
681
|
console.log(
|
|
682
682
|
`基于KEY[${reportKey}]的灰度调用1次~`,
|
|
683
683
|
getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`),
|
|
684
684
|
);
|
|
685
685
|
if (isMatch) {
|
|
686
686
|
sgmCustomReport({
|
|
687
687
|
code: getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`),
|
|
688
688
|
msg: '灰度命中',
|
|
689
689
|
});
|
|
690
690
|
console.log(
|
|
691
691
|
`基于KEY[${reportKey}]的命中1次灰度!`,
|
|
692
692
|
getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`),
|
|
693
693
|
);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
return isMatch;
|
|
697
697
|
isJdApp,
|
|
698
698
|
isWxApp,
|
|
699
699
|
isIosDevice,
|
|
700
700
|
isAndroidDevice,
|
|
701
701
|
isHarmonyDevice,
|
|
702
702
|
isJdAndIosDevice,
|
|
703
703
|
isJdAndAndroidDevice,
|
|
704
704
|
isJdAndHarmonyDevice,
|
|
705
705
|
isJdAndroidX5Core,
|
|
706
706
|
isMin,
|
|
707
707
|
isWxMin,
|
|
708
708
|
isWxMinAndWxapp,
|
|
709
709
|
isJdMinAndHarmony,
|
|
710
710
|
isJdMin,
|
|
711
711
|
isH5,
|
|
712
712
|
isH5AndJdShopView,
|
|
713
713
|
isChartH5,
|
|
714
714
|
isH5AndJdShopViewNativeScroll,
|
|
715
715
|
isH5AndJdShopViewH5Scroll,
|
|
716
716
|
isH5AndJdShopH5CustomScrollView,
|
|
717
717
|
isH5AndJingGouMini,
|
|
718
718
|
isWxMiniH5View,
|
|
719
719
|
urlCookie,
|
|
720
720
|
sliceArrToChunkList,
|
|
721
721
|
dealAddress,
|
|
722
722
|
objectToUrlEncode,
|
|
723
723
|
parseQueryUrlString,
|
|
724
724
|
setLowSmallPicUrl,
|
|
725
725
|
setTaroStorage,
|
|
726
726
|
getTaroStorageKeyValue,
|
|
727
727
|
removeTaroStorageKey,
|
|
728
728
|
clearTaroStorageKey,
|
|
729
729
|
getAvifSupport,
|
|
730
730
|
getWebpSupport,
|
|
731
731
|
getQualityImage,
|
|
732
732
|
formatCountForUnit as countStringify,
|
|
733
733
|
getWxAppCookieStr,
|
|
734
734
|
getSystemInfos,
|
|
735
735
|
pxTransformFromData,
|
|
736
736
|
dealShopContentDataAndReport as dealShopContentData,
|
|
737
737
|
dateFormat,
|
|
738
738
|
throttle,
|
|
739
739
|
lodashThrottle,
|
|
740
740
|
debounce,
|
|
741
741
|
addHttps,
|
|
742
742
|
commonShowSuccessToast as showSuccessToast,
|
|
743
743
|
commonShowFailToast as showFailToast,
|
|
744
744
|
commonShowNormalToast as showNormalToast,
|
|
745
745
|
showShopLoading,
|
|
746
746
|
hideShopLoading,
|
|
747
747
|
stopNativeScrollEvent,
|
|
748
748
|
getAppChannelType,
|
|
749
749
|
formatTabActiveMenuType,
|
|
750
750
|
filterUrlQueryData,
|
|
751
751
|
sgmCustomReport,
|
|
752
752
|
draCustomReport,
|
|
753
753
|
remoteCustomReport,
|
|
754
754
|
draInterfaceCustomReport,
|
|
755
755
|
draBusinessCustomReport,
|
|
756
756
|
draBusinessCustomLogReport,
|
|
757
757
|
isMemberPage,
|
|
758
758
|
getFloorDataToDataDefines,
|
|
759
759
|
isOpenJdAppUrl,
|
|
760
760
|
jdOpenAppParams,
|
|
761
761
|
createJdOpenAppUrl,
|
|
762
762
|
isEmpty,
|
|
763
763
|
getJdAppReportPageSource,
|
|
764
764
|
isAppClassifyPage,
|
|
765
765
|
isAppHomeForMarketPage,
|
|
766
766
|
isImageOptimizeEnable,
|
|
767
767
|
isPc,
|
|
768
768
|
ipLoc_djd,
|
|
769
769
|
isTjScence,
|
|
770
770
|
isH5AdnJxMini,
|
|
771
771
|
isTjM,
|
|
772
772
|
isTjJxM,
|
|
773
773
|
isTJApp,
|
|
774
774
|
isH5AdnHaoWuJie,
|
|
775
775
|
tjChannel,
|
|
776
776
|
dealJdOpenAppData,
|
|
777
777
|
jdAppVersionCompare,
|
|
778
778
|
dealNativePixelToCssPixel,
|
|
779
779
|
isAppStowShop,
|
|
780
780
|
getSgmCustomCode,
|
|
781
781
|
handleSgmCodeTaroVersion,
|
|
782
782
|
isInGrayscale,
|
|
783
783
|
isIpadDevice,
|
|
784
784
|
getBorderStyle,
|
|
785
785
|
isSupportHybridHttpRequest,
|
|
786
786
|
isLanguageForEn,
|
|
787
787
|
sColor,
|
|
788
788
|
draInterfaceDSMCustomReport,
|
|
789
789
|
isTabletDevice,
|
|
790
790
|
taroToTransformRoutimePXNumber,
|
|
791
791
|
updateContainerWidth,
|
|
792
792
|
isInJdShopView,
|
|
793
793
|
isDongWebView,
|
|
794
794
|
isLanguageForHk,
|
|
795
795
|
languageNowType,
|