@conecli/cone-render 0.9.1-shop2.12 → 0.9.1-shop2.13

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