@conecli/cone-render 0.8.41 → 0.8.43
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/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/sgmCustomCode.ts +1 -1
- package/dist/components/ErrorBoundary.tsx +1 -1
- package/dist/components/base/CustomVideo/index.tsx +1 -1
- package/dist/components/base/ExposureSmart/index.tsx +1 -1
- package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
- package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
- package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
- package/dist/components/base/MobileCommonHeader/index.module.scss +8 -0
- package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
- package/dist/components/base/NetworkDataError/index.module.scss +3 -0
- package/dist/components/base/NetworkDataError/index.tsx +1 -1
- package/dist/components/remoteFloorItem.tsx +1 -1
- package/dist/interface/component.ts +1 -1
- package/dist/jumpEventReport/base.ts +1 -1
- package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
- package/dist/jumpEventReport/logEventConfig.ts +1 -1
- package/dist/jumpEventReport/web.base.ts +1 -1
- package/dist/jumpEventReport/web.jd.ts +1 -1
- package/dist/jumpEventReport/web.wxapp.ts +1 -1
- package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
- package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
- package/dist/open/api/device.ts +1 -1
- package/dist/open/api/request.ts +1 -1
- package/dist/open/api/shopMember.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 +10 -0
- package/dist/service/requestServer.ts +1 -1
- package/dist/utils/connectNativeJsBridge.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/sgmCodeUtils.ts +1 -1
- package/dist/utils/taroRenderUtil.ts +1 -1
- package/dist/utils/utils.ts +1 -1
- package/package.json +1 -1
package/dist/utils/index.h5.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import Taro from '@tarojs/taro'
|
|
2
1
|
nativePageShowToast,
|
|
3
2
|
ToastAndroidType,
|
|
4
3
|
ToastIosType,
|
|
5
4
|
getAppChannelType,
|
|
6
5
|
isAndroidDevice,
|
|
7
6
|
isH5AndJdShopView,
|
|
8
7
|
isChartH5,
|
|
9
8
|
isH5AndJdShopViewNativeScroll,
|
|
10
9
|
isIosDevice,
|
|
11
10
|
isJdAndAndroidDevice,
|
|
12
11
|
isJdAndIosDevice,
|
|
13
12
|
isJdAndHarmonyDevice,
|
|
14
13
|
isJdApp,
|
|
15
14
|
isWxApp,
|
|
16
15
|
isWxMiniH5View,
|
|
17
16
|
isH5AndJingGouMini,
|
|
18
17
|
urlCookie,
|
|
19
18
|
sgmCustomReport,
|
|
20
19
|
isMemberPage,
|
|
21
20
|
isH5AndJdShopViewH5Scroll,
|
|
22
21
|
isH5AndJdShopH5CustomScrollView,
|
|
23
22
|
isAppClassifyPage,
|
|
24
23
|
isPc,
|
|
25
24
|
ipLoc_djd,
|
|
26
25
|
jdAppVersionCompare,
|
|
27
26
|
dealNativePixelToCssPixel,
|
|
28
27
|
isAppStowShop,
|
|
29
28
|
isJdAndroidX5Core,
|
|
30
29
|
isTjScence,
|
|
31
30
|
isH5AdnJxMini,
|
|
32
31
|
isTjM,
|
|
33
32
|
isTjJxM,
|
|
34
33
|
isTJApp,
|
|
35
34
|
isH5AdnHaoWuJie,
|
|
36
35
|
tjChannel
|
|
37
36
|
addHttps,
|
|
38
37
|
clearTaroStorageKey,
|
|
39
38
|
countStringify,
|
|
40
39
|
dateFormat,
|
|
41
40
|
dealAddress,
|
|
42
41
|
dealShopContentData as originDealShopContentData,
|
|
43
42
|
debounce,
|
|
44
43
|
filterUrlQueryData,
|
|
45
44
|
formatTabActiveMenuType,
|
|
46
45
|
getQualityImage,
|
|
47
46
|
getTaroStorageKeyValue,
|
|
48
47
|
getWxAppCookieStr,
|
|
49
48
|
isH5,
|
|
50
49
|
isMin,
|
|
51
50
|
isJdMin,
|
|
52
51
|
isWxMin,
|
|
53
52
|
isWxMinAndWxapp,
|
|
54
53
|
isJdMinAndHarmony,
|
|
55
54
|
lodashThrottle,
|
|
56
55
|
objectToUrlEncode,
|
|
57
56
|
parseQueryUrlString,
|
|
58
57
|
removeTaroStorageKey,
|
|
59
58
|
setLowSmallPicUrl,
|
|
60
59
|
setTaroStorage,
|
|
61
60
|
showFailToast,
|
|
62
61
|
showNormalToast,
|
|
63
62
|
showSuccessToast,
|
|
64
63
|
sliceArrToChunkList,
|
|
65
64
|
throttle,
|
|
66
65
|
isOpenJdAppUrl,
|
|
67
66
|
jdOpenAppParams,
|
|
68
67
|
createJdOpenAppUrl,
|
|
69
68
|
isEmpty,
|
|
70
69
|
getJdAppReportPageSource,
|
|
71
70
|
dealJdOpenAppData,
|
|
72
71
|
const getNum = Number(num)
|
|
73
72
|
let _changeLayoutWidth = layoutWidth
|
|
74
73
|
if (!_changeLayoutWidth) {
|
|
75
74
|
_changeLayoutWidth =
|
|
76
75
|
_ShopSystemInfo && _ShopSystemInfo?.windowWidth
|
|
77
76
|
? _ShopSystemInfo.windowWidth
|
|
78
77
|
: Taro.getSystemInfoSync()?.windowWidth
|
|
79
78
|
}
|
|
80
79
|
return Math.round((getNum / widthSize) * _changeLayoutWidth)
|
|
81
80
|
changeSize,
|
|
82
81
|
designWidth = 750,
|
|
83
82
|
systemInfo,
|
|
84
83
|
const getRootFontSize =
|
|
85
84
|
(40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth)) / 750
|
|
86
85
|
const getRealRootFontSize =
|
|
87
86
|
getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize
|
|
88
87
|
return Math.ceil(
|
|
89
88
|
(((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) *
|
|
90
89
|
getRealRootFontSize,
|
|
91
90
|
)
|
|
92
91
|
console.log(
|
|
93
92
|
'获取系统宽度systemInfo?.windowWidth',
|
|
94
93
|
systemInfo?.windowWidth,
|
|
95
94
|
'taroToTransformRoutimePXNumber(changeWidth)',
|
|
96
95
|
taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
|
|
97
96
|
)
|
|
98
97
|
return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
|
|
99
98
|
? systemInfo?.windowWidth -
|
|
100
99
|
taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
|
|
101
100
|
: systemInfo?.windowWidth ?? 0
|
|
102
101
|
const systemInfo = Taro.getSystemInfoSync()
|
|
103
102
|
if (params && params?.pageWidth && params?.pageHeight) {
|
|
104
103
|
systemInfo.windowWidth = params?.pageWidth
|
|
105
104
|
systemInfo.windowHeight = params?.pageHeight
|
|
106
105
|
}
|
|
107
106
|
systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo)
|
|
108
107
|
console.warn('====获取系统信息=====', systemInfo)
|
|
109
108
|
return systemInfo
|
|
110
109
|
const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
|
|
111
110
|
windowWidth: window.innerWidth,
|
|
112
111
|
containerWidth: getContainerWidth(buildType, {
|
|
113
112
|
windowWidth: window.innerWidth,
|
|
114
113
|
}),
|
|
115
114
|
screenWidth: window.innerWidth,
|
|
116
115
|
platform: '',
|
|
117
116
|
model: '',
|
|
118
117
|
system: '',
|
|
119
118
|
}
|
|
120
119
|
if (isJdApp && isAndroidDevice && getSystemInfo.windowWidth <= 0) {
|
|
121
120
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
122
121
|
getSystemInfo['containerWidth'] = getContainerWidth(
|
|
123
122
|
buildType,
|
|
124
123
|
getSystemInfo,
|
|
125
124
|
)
|
|
126
125
|
}
|
|
127
126
|
return getSystemInfo
|
|
128
127
|
const params = Object.assign(
|
|
129
128
|
{},
|
|
130
129
|
{
|
|
131
130
|
title: '',
|
|
132
131
|
duration: 1500,
|
|
133
132
|
},
|
|
134
133
|
options,
|
|
135
134
|
)
|
|
136
135
|
params.duration = params.duration / 1000
|
|
137
136
|
if (isJdApp) {
|
|
138
137
|
const showSuccessType = isIosDevice
|
|
139
138
|
? ToastIosType.SUCCESS
|
|
140
139
|
: ToastAndroidType.SUCCESS
|
|
141
140
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
142
141
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
143
142
|
console.log('执行原生toast success')
|
|
144
143
|
} else {
|
|
145
144
|
showSuccessToast(options)
|
|
146
145
|
}
|
|
147
146
|
const params = Object.assign(
|
|
148
147
|
{},
|
|
149
148
|
{
|
|
150
149
|
title: '',
|
|
151
150
|
duration: 1500,
|
|
152
151
|
},
|
|
153
152
|
options,
|
|
154
153
|
)
|
|
155
154
|
params.duration = params.duration / 1000
|
|
156
155
|
if (isJdApp) {
|
|
157
156
|
const showSuccessType = isIosDevice
|
|
158
157
|
? ToastIosType.FAIL
|
|
159
158
|
: ToastAndroidType.FAIL
|
|
160
159
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
161
160
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
162
161
|
console.log('执行原生toast fail')
|
|
163
162
|
} else {
|
|
164
163
|
console.log('执行H5 toast fail')
|
|
165
164
|
showFailToast(options)
|
|
166
165
|
}
|
|
167
166
|
const params = Object.assign(
|
|
168
167
|
{},
|
|
169
168
|
{
|
|
170
169
|
title: '',
|
|
171
170
|
duration: 1500,
|
|
172
171
|
},
|
|
173
172
|
options,
|
|
174
173
|
)
|
|
175
174
|
params.duration = params.duration / 1000
|
|
176
175
|
if (isJdApp) {
|
|
177
176
|
const showSuccessType = isIosDevice
|
|
178
177
|
? ToastIosType.NORMAL
|
|
179
178
|
: ToastAndroidType.NORMAL
|
|
180
179
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
181
180
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
182
181
|
} else {
|
|
183
182
|
showNormalToast(options)
|
|
184
183
|
}
|
|
185
184
|
const createLoadingEle = document.createElement('div')
|
|
186
185
|
createLoadingEle.id = 'J_shopLoading'
|
|
187
186
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
188
187
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
189
188
|
<span class='d-shop-loading-icon'></span>
|
|
190
189
|
<p class='d-shop-text'>${text}</p>
|
|
191
190
|
</div>`
|
|
192
191
|
const getEle = document.body
|
|
193
192
|
? document.body
|
|
194
193
|
: document.getElementsByTagName('body')[0]
|
|
195
194
|
getEle.appendChild(createLoadingEle)
|
|
196
195
|
const getEle = document.getElementById('J_shopLoading')
|
|
197
196
|
getEle && getEle.remove()
|
|
198
197
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(
|
|
199
198
|
params,
|
|
200
199
|
)
|
|
201
200
|
if (!systemInfo.system && window) {
|
|
202
201
|
systemInfo.system = window.navigator.userAgent
|
|
203
202
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
204
203
|
}
|
|
205
204
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
206
205
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
207
206
|
systemInfo.navBarHeight = 0
|
|
208
207
|
systemInfo.statusBarHeight = 0
|
|
209
208
|
systemInfo.capsulePosition = null
|
|
210
209
|
systemInfo.isIOS = isIOS
|
|
211
210
|
systemInfo.isAndroid = isAndroid
|
|
212
211
|
_ShopSystemInfo = systemInfo
|
|
213
212
|
return systemInfo
|
|
214
213
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev)
|
|
215
214
|
isJdApp,
|
|
216
215
|
isWxApp,
|
|
217
216
|
isIosDevice,
|
|
218
217
|
isAndroidDevice,
|
|
219
218
|
isJdAndIosDevice,
|
|
220
219
|
isJdAndAndroidDevice,
|
|
221
220
|
isJdAndHarmonyDevice,
|
|
222
221
|
isJdAndroidX5Core,
|
|
223
222
|
isMin,
|
|
224
223
|
isWxMin,
|
|
225
224
|
isWxMinAndWxapp,
|
|
226
225
|
isJdMinAndHarmony,
|
|
227
226
|
isJdMin,
|
|
228
227
|
isH5,
|
|
229
228
|
isH5AndJdShopView,
|
|
230
229
|
isChartH5,
|
|
231
230
|
isH5AndJdShopViewNativeScroll,
|
|
232
231
|
isH5AndJdShopViewH5Scroll,
|
|
233
232
|
isH5AndJdShopH5CustomScrollView,
|
|
234
233
|
isH5AndJingGouMini,
|
|
235
234
|
isWxMiniH5View,
|
|
236
235
|
urlCookie,
|
|
237
236
|
sliceArrToChunkList,
|
|
238
237
|
dealAddress,
|
|
239
238
|
objectToUrlEncode,
|
|
240
239
|
parseQueryUrlString,
|
|
241
240
|
setLowSmallPicUrl,
|
|
242
241
|
setTaroStorage,
|
|
243
242
|
getTaroStorageKeyValue,
|
|
244
243
|
removeTaroStorageKey,
|
|
245
244
|
clearTaroStorageKey,
|
|
246
245
|
getQualityImage,
|
|
247
246
|
countStringify,
|
|
248
247
|
getWxAppCookieStr,
|
|
249
248
|
getSystemInfos,
|
|
250
249
|
pxTransformFromData,
|
|
251
250
|
dealShopContentDataAndReport as dealShopContentData,
|
|
252
251
|
dateFormat,
|
|
253
252
|
throttle,
|
|
254
253
|
lodashThrottle,
|
|
255
254
|
debounce,
|
|
256
255
|
addHttps,
|
|
257
256
|
commonShowSuccessToast as showSuccessToast,
|
|
258
257
|
commonShowFailToast as showFailToast,
|
|
259
258
|
commonShowNormalToast as showNormalToast,
|
|
260
259
|
showShopLoading,
|
|
261
260
|
hideShopLoading,
|
|
262
261
|
getAppChannelType,
|
|
263
262
|
formatTabActiveMenuType,
|
|
264
263
|
filterUrlQueryData,
|
|
265
264
|
sgmCustomReport,
|
|
266
265
|
isMemberPage,
|
|
267
266
|
getFloorDataToDataDefines,
|
|
268
267
|
isOpenJdAppUrl,
|
|
269
268
|
jdOpenAppParams,
|
|
270
269
|
createJdOpenAppUrl,
|
|
271
270
|
isEmpty,
|
|
272
271
|
getJdAppReportPageSource,
|
|
273
272
|
isAppClassifyPage,
|
|
274
273
|
isPc,
|
|
275
274
|
ipLoc_djd,
|
|
276
275
|
isTjScence,
|
|
277
276
|
isH5AdnJxMini,
|
|
278
277
|
isTjM,
|
|
279
278
|
isTjJxM,
|
|
280
279
|
isTJApp,
|
|
281
280
|
isH5AdnHaoWuJie,
|
|
282
281
|
tjChannel,
|
|
283
282
|
dealJdOpenAppData,
|
|
284
283
|
jdAppVersionCompare,
|
|
285
284
|
dealNativePixelToCssPixel,
|
|
286
285
|
isAppStowShop,
|
|
287
286
|
getSgmCustomCode
|
|
287
|
+
import Taro from '@tarojs/taro'
|
|
288
288
|
nativePageShowToast,
|
|
289
289
|
ToastAndroidType,
|
|
290
290
|
ToastIosType,
|
|
291
291
|
getAppChannelType,
|
|
292
292
|
isAndroidDevice,
|
|
293
293
|
isH5AndJdShopView,
|
|
294
294
|
isChartH5,
|
|
295
295
|
isH5AndJdShopViewNativeScroll,
|
|
296
296
|
isIosDevice,
|
|
297
297
|
isJdAndAndroidDevice,
|
|
298
298
|
isJdAndIosDevice,
|
|
299
299
|
isJdAndHarmonyDevice,
|
|
300
300
|
isJdApp,
|
|
301
301
|
isWxApp,
|
|
302
302
|
isWxMiniH5View,
|
|
303
303
|
isH5AndJingGouMini,
|
|
304
304
|
urlCookie,
|
|
305
305
|
sgmCustomReport,
|
|
306
306
|
isMemberPage,
|
|
307
307
|
isH5AndJdShopViewH5Scroll,
|
|
308
308
|
isH5AndJdShopH5CustomScrollView,
|
|
309
309
|
isAppClassifyPage,
|
|
310
310
|
isAppHomeForMarketPage,
|
|
311
311
|
isPc,
|
|
312
312
|
ipLoc_djd,
|
|
313
313
|
jdAppVersionCompare,
|
|
314
314
|
dealNativePixelToCssPixel,
|
|
315
315
|
isAppStowShop,
|
|
316
316
|
isJdAndroidX5Core,
|
|
317
317
|
isTjScence,
|
|
318
318
|
isH5AdnJxMini,
|
|
319
319
|
isTjM,
|
|
320
320
|
isTjJxM,
|
|
321
321
|
isTJApp,
|
|
322
322
|
isH5AdnHaoWuJie,
|
|
323
323
|
tjChannel,
|
|
324
324
|
parseQueryUrlObj,
|
|
325
325
|
addHttps,
|
|
326
326
|
clearTaroStorageKey,
|
|
327
327
|
countStringify,
|
|
328
328
|
dateFormat,
|
|
329
329
|
dealAddress,
|
|
330
330
|
dealShopContentData as originDealShopContentData,
|
|
331
331
|
debounce,
|
|
332
332
|
filterUrlQueryData,
|
|
333
333
|
formatTabActiveMenuType,
|
|
334
334
|
getAvifSupport,
|
|
335
335
|
getWebpSupport,
|
|
336
336
|
getTaroStorageKeyValue,
|
|
337
337
|
getWxAppCookieStr,
|
|
338
338
|
isH5,
|
|
339
339
|
isMin,
|
|
340
340
|
isJdMin,
|
|
341
341
|
isWxMin,
|
|
342
342
|
isWxMinAndWxapp,
|
|
343
343
|
isJdMinAndHarmony,
|
|
344
344
|
lodashThrottle,
|
|
345
345
|
objectToUrlEncode,
|
|
346
346
|
parseQueryUrlString,
|
|
347
347
|
removeTaroStorageKey,
|
|
348
348
|
setLowSmallPicUrl,
|
|
349
349
|
setTaroStorage,
|
|
350
350
|
showFailToast,
|
|
351
351
|
showNormalToast,
|
|
352
352
|
showSuccessToast,
|
|
353
353
|
sliceArrToChunkList,
|
|
354
354
|
throttle,
|
|
355
355
|
getQualityImageNew,
|
|
356
356
|
getQualityImageOld,
|
|
357
357
|
isOpenJdAppUrl,
|
|
358
358
|
jdOpenAppParams,
|
|
359
359
|
createJdOpenAppUrl,
|
|
360
360
|
isEmpty,
|
|
361
361
|
getJdAppReportPageSource,
|
|
362
362
|
dealJdOpenAppData,
|
|
363
363
|
const getNum = Number(num)
|
|
364
364
|
let _changeLayoutWidth = layoutWidth
|
|
365
365
|
if (!_changeLayoutWidth) {
|
|
366
366
|
_changeLayoutWidth =
|
|
367
367
|
_ShopSystemInfo && _ShopSystemInfo?.windowWidth
|
|
368
368
|
? _ShopSystemInfo.windowWidth
|
|
369
369
|
: Taro.getSystemInfoSync()?.windowWidth
|
|
370
370
|
}
|
|
371
371
|
return Math.round((getNum / widthSize) * _changeLayoutWidth)
|
|
372
372
|
changeSize,
|
|
373
373
|
designWidth = 750,
|
|
374
374
|
systemInfo,
|
|
375
375
|
const getRootFontSize =
|
|
376
376
|
(40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth)) / 750
|
|
377
377
|
const getRealRootFontSize =
|
|
378
378
|
getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize
|
|
379
379
|
return Math.ceil(
|
|
380
380
|
(((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) *
|
|
381
381
|
getRealRootFontSize,
|
|
382
382
|
)
|
|
383
383
|
console.log(
|
|
384
384
|
'获取系统宽度systemInfo?.windowWidth',
|
|
385
385
|
systemInfo?.windowWidth,
|
|
386
386
|
'taroToTransformRoutimePXNumber(changeWidth)',
|
|
387
387
|
taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
|
|
388
388
|
)
|
|
389
389
|
return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
|
|
390
390
|
? systemInfo?.windowWidth -
|
|
391
391
|
taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
|
|
392
392
|
: systemInfo?.windowWidth ?? 0
|
|
393
393
|
const systemInfo = Taro.getSystemInfoSync()
|
|
394
394
|
if (params && params?.pageWidth && params?.pageHeight) {
|
|
395
395
|
systemInfo.windowWidth = params?.pageWidth
|
|
396
396
|
systemInfo.windowHeight = params?.pageHeight
|
|
397
397
|
}
|
|
398
398
|
systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo)
|
|
399
399
|
console.warn('====获取系统信息=====', systemInfo)
|
|
400
400
|
return systemInfo
|
|
401
401
|
const appVersionCheckPass = jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0
|
|
402
402
|
const supportBuildType = /app-view|app-member|app-classify|member-home/
|
|
403
403
|
const scopeCheckPass = supportBuildType.test(buildType || '')
|
|
404
404
|
const enableAvifOptimize = appVersionCheckPass && scopeCheckPass
|
|
405
405
|
if(enableAvifOptimize){
|
|
406
406
|
const configData = global.getDynamicConfig('avifSwitch')
|
|
407
407
|
if(!hasOutputLog){
|
|
408
408
|
console.warn("🚗 ~~ file: utils.ts:187 ~~ isImageOptimizeEnable ~~ enableAvifOptimize:", enableAvifOptimize, ' appVersionCheckPass:', appVersionCheckPass, ' scopeCheckPass:', scopeCheckPass)
|
|
409
409
|
console.warn("🚗 ~~ file: utils.ts:188 ~~ global.getDynamicConfig ~~ configData:", configData)
|
|
410
410
|
}
|
|
411
411
|
const { globalOn = true, ignoreOptimizeFromServer = false, page = {}, whiteList = [], blackList = [] } = configData || {}
|
|
412
412
|
const {shopId = '0', venderId = '0'} = parseQueryUrlObj
|
|
413
413
|
let imageEnableResult = true
|
|
414
414
|
isIgnoreOptimizeFromServer = ignoreOptimizeFromServer
|
|
415
415
|
if (blackList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
|
|
416
416
|
imageEnableResult = false
|
|
417
417
|
if(!hasOutputLog){
|
|
418
418
|
console.warn("🚗 ~~ file: utils.ts:198 命中黑名单!")
|
|
419
419
|
}
|
|
420
420
|
}else if(whiteList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
|
|
421
421
|
imageEnableResult = true
|
|
422
422
|
if(!hasOutputLog){
|
|
423
423
|
console.warn("🚗 ~~ file: utils.ts:205 命中白名单!")
|
|
424
424
|
}
|
|
425
425
|
}else{
|
|
426
426
|
imageEnableResult = globalOn === true || page[buildType] === true
|
|
427
427
|
if(!hasOutputLog){
|
|
428
428
|
console.warn("🚗 ~~ file: utils.ts:211 走全局开关+页面开关控制逻辑,开关结果:", imageEnableResult)
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
if(!hasOutputLog){
|
|
432
432
|
hasOutputLog = true
|
|
433
433
|
}
|
|
434
434
|
return imageEnableResult
|
|
435
435
|
}else{
|
|
436
436
|
return false
|
|
437
437
|
}
|
|
438
438
|
if(typeof options === 'object' && isImageOptimizeEnable()){
|
|
439
439
|
return getQualityImageNew(imgUrl, options, isIgnoreOptimizeFromServer)
|
|
440
440
|
}else{
|
|
441
441
|
return getQualityImageOld(imgUrl, options)
|
|
442
442
|
}
|
|
443
443
|
const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
|
|
444
444
|
windowWidth: window.innerWidth,
|
|
445
445
|
containerWidth: getContainerWidth(buildType, {
|
|
446
446
|
windowWidth: window.innerWidth,
|
|
447
447
|
}),
|
|
448
448
|
screenWidth: window.innerWidth,
|
|
449
449
|
platform: '',
|
|
450
450
|
model: '',
|
|
451
451
|
system: '',
|
|
452
452
|
}
|
|
453
453
|
if (isJdApp && isAndroidDevice && getSystemInfo.windowWidth <= 0) {
|
|
454
454
|
getSystemInfo.windowWidth = getSystemInfo.screenWidth
|
|
455
455
|
getSystemInfo['containerWidth'] = getContainerWidth(
|
|
456
456
|
buildType,
|
|
457
457
|
getSystemInfo,
|
|
458
458
|
)
|
|
459
459
|
}
|
|
460
460
|
return getSystemInfo
|
|
461
461
|
const params = Object.assign(
|
|
462
462
|
{},
|
|
463
463
|
{
|
|
464
464
|
title: '',
|
|
465
465
|
duration: 1500,
|
|
466
466
|
},
|
|
467
467
|
options,
|
|
468
468
|
)
|
|
469
469
|
params.duration = params.duration / 1000
|
|
470
470
|
if (isJdApp) {
|
|
471
471
|
const showSuccessType = isIosDevice
|
|
472
472
|
? ToastIosType.SUCCESS
|
|
473
473
|
: ToastAndroidType.SUCCESS
|
|
474
474
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
475
475
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
476
476
|
console.log('执行原生toast success')
|
|
477
477
|
} else {
|
|
478
478
|
showSuccessToast(options)
|
|
479
479
|
}
|
|
480
480
|
const params = Object.assign(
|
|
481
481
|
{},
|
|
482
482
|
{
|
|
483
483
|
title: '',
|
|
484
484
|
duration: 1500,
|
|
485
485
|
},
|
|
486
486
|
options,
|
|
487
487
|
)
|
|
488
488
|
params.duration = params.duration / 1000
|
|
489
489
|
if (isJdApp) {
|
|
490
490
|
const showSuccessType = isIosDevice
|
|
491
491
|
? ToastIosType.FAIL
|
|
492
492
|
: ToastAndroidType.FAIL
|
|
493
493
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
494
494
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
495
495
|
console.log('执行原生toast fail')
|
|
496
496
|
} else {
|
|
497
497
|
console.log('执行H5 toast fail')
|
|
498
498
|
showFailToast(options)
|
|
499
499
|
}
|
|
500
500
|
const params = Object.assign(
|
|
501
501
|
{},
|
|
502
502
|
{
|
|
503
503
|
title: '',
|
|
504
504
|
duration: 1500,
|
|
505
505
|
},
|
|
506
506
|
options,
|
|
507
507
|
)
|
|
508
508
|
params.duration = params.duration / 1000
|
|
509
509
|
if (isJdApp) {
|
|
510
510
|
const showSuccessType = isIosDevice
|
|
511
511
|
? ToastIosType.NORMAL
|
|
512
512
|
: ToastAndroidType.NORMAL
|
|
513
513
|
const duration = isAndroidDevice ? 0 : params.duration
|
|
514
514
|
nativePageShowToast(options.title, showSuccessType, duration)
|
|
515
515
|
} else {
|
|
516
516
|
showNormalToast(options)
|
|
517
517
|
}
|
|
518
518
|
const createLoadingEle = document.createElement('div')
|
|
519
519
|
createLoadingEle.id = 'J_shopLoading'
|
|
520
520
|
createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
|
|
521
521
|
createLoadingEle.innerHTML = `<div class='d-loading-content'>
|
|
522
522
|
<span class='d-shop-loading-icon'></span>
|
|
523
523
|
<p class='d-shop-text'>${text}</p>
|
|
524
524
|
</div>`
|
|
525
525
|
const getEle = document.body
|
|
526
526
|
? document.body
|
|
527
527
|
: document.getElementsByTagName('body')[0]
|
|
528
528
|
getEle.appendChild(createLoadingEle)
|
|
529
529
|
const getEle = document.getElementById('J_shopLoading')
|
|
530
530
|
getEle && getEle.remove()
|
|
531
531
|
const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(
|
|
532
532
|
params,
|
|
533
533
|
)
|
|
534
534
|
if (!systemInfo.system && window) {
|
|
535
535
|
systemInfo.system = window.navigator.userAgent
|
|
536
536
|
systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
|
|
537
537
|
}
|
|
538
538
|
const isIOS = !!systemInfo?.system.match(/ios/i)
|
|
539
539
|
const isAndroid = !!systemInfo?.system.match(/android/i)
|
|
540
540
|
systemInfo.navBarHeight = 0
|
|
541
541
|
systemInfo.statusBarHeight = 0
|
|
542
542
|
systemInfo.capsulePosition = null
|
|
543
543
|
systemInfo.isIOS = isIOS
|
|
544
544
|
systemInfo.isAndroid = isAndroid
|
|
545
545
|
_ShopSystemInfo = systemInfo
|
|
546
546
|
return systemInfo
|
|
547
547
|
return originDealShopContentData(pageData, sgmCustomReport, isvdev)
|
|
548
548
|
isJdApp,
|
|
549
549
|
isWxApp,
|
|
550
550
|
isIosDevice,
|
|
551
551
|
isAndroidDevice,
|
|
552
552
|
isJdAndIosDevice,
|
|
553
553
|
isJdAndAndroidDevice,
|
|
554
554
|
isJdAndHarmonyDevice,
|
|
555
555
|
isJdAndroidX5Core,
|
|
556
556
|
isMin,
|
|
557
557
|
isWxMin,
|
|
558
558
|
isWxMinAndWxapp,
|
|
559
559
|
isJdMinAndHarmony,
|
|
560
560
|
isJdMin,
|
|
561
561
|
isH5,
|
|
562
562
|
isH5AndJdShopView,
|
|
563
563
|
isChartH5,
|
|
564
564
|
isH5AndJdShopViewNativeScroll,
|
|
565
565
|
isH5AndJdShopViewH5Scroll,
|
|
566
566
|
isH5AndJdShopH5CustomScrollView,
|
|
567
567
|
isH5AndJingGouMini,
|
|
568
568
|
isWxMiniH5View,
|
|
569
569
|
urlCookie,
|
|
570
570
|
sliceArrToChunkList,
|
|
571
571
|
dealAddress,
|
|
572
572
|
objectToUrlEncode,
|
|
573
573
|
parseQueryUrlString,
|
|
574
574
|
setLowSmallPicUrl,
|
|
575
575
|
setTaroStorage,
|
|
576
576
|
getTaroStorageKeyValue,
|
|
577
577
|
removeTaroStorageKey,
|
|
578
578
|
clearTaroStorageKey,
|
|
579
579
|
getAvifSupport,
|
|
580
580
|
getWebpSupport,
|
|
581
581
|
getQualityImage,
|
|
582
582
|
countStringify,
|
|
583
583
|
getWxAppCookieStr,
|
|
584
584
|
getSystemInfos,
|
|
585
585
|
pxTransformFromData,
|
|
586
586
|
dealShopContentDataAndReport as dealShopContentData,
|
|
587
587
|
dateFormat,
|
|
588
588
|
throttle,
|
|
589
589
|
lodashThrottle,
|
|
590
590
|
debounce,
|
|
591
591
|
addHttps,
|
|
592
592
|
commonShowSuccessToast as showSuccessToast,
|
|
593
593
|
commonShowFailToast as showFailToast,
|
|
594
594
|
commonShowNormalToast as showNormalToast,
|
|
595
595
|
showShopLoading,
|
|
596
596
|
hideShopLoading,
|
|
597
597
|
getAppChannelType,
|
|
598
598
|
formatTabActiveMenuType,
|
|
599
599
|
filterUrlQueryData,
|
|
600
600
|
sgmCustomReport,
|
|
601
601
|
isMemberPage,
|
|
602
602
|
getFloorDataToDataDefines,
|
|
603
603
|
isOpenJdAppUrl,
|
|
604
604
|
jdOpenAppParams,
|
|
605
605
|
createJdOpenAppUrl,
|
|
606
606
|
isEmpty,
|
|
607
607
|
getJdAppReportPageSource,
|
|
608
608
|
isAppClassifyPage,
|
|
609
609
|
isAppHomeForMarketPage,
|
|
610
610
|
isImageOptimizeEnable,
|
|
611
611
|
isPc,
|
|
612
612
|
ipLoc_djd,
|
|
613
613
|
isTjScence,
|
|
614
614
|
isH5AdnJxMini,
|
|
615
615
|
isTjM,
|
|
616
616
|
isTjJxM,
|
|
617
617
|
isTJApp,
|
|
618
618
|
isH5AdnHaoWuJie,
|
|
619
619
|
tjChannel,
|
|
620
620
|
dealJdOpenAppData,
|
|
621
621
|
jdAppVersionCompare,
|
|
622
622
|
dealNativePixelToCssPixel,
|
|
623
623
|
isAppStowShop,
|
|
624
624
|
getSgmCustomCode,
|
|
625
625
|
handleSgmCodeTaroVersion,
|