@conecli/cone-render 0.10.1-beta.3 → 0.10.1-beta.5

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.
Files changed (56) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/index.h5.ts +1 -1
  4. package/dist/common/index.weapp.ts +1 -1
  5. package/dist/common/sgmCustomCode.ts +1 -1
  6. package/dist/components/ErrorBoundary.tsx +1 -1
  7. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  8. package/dist/components/base/CustomVideo/index.tsx +1 -1
  9. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  10. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  11. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  12. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  13. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  14. package/dist/components/base/LazyLoadImage/index.h5.module.scss +3 -0
  15. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  16. package/dist/components/base/MobileCommonHeader/index.module.scss +8 -0
  17. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  18. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  19. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  20. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  21. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  22. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  23. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  24. package/dist/components/floorItem.tsx +1 -1
  25. package/dist/components/remoteFloorItem.tsx +1 -1
  26. package/dist/interface/common.ts +1 -1
  27. package/dist/interface/component.ts +1 -1
  28. package/dist/interface/jumpEventReport.ts +1 -1
  29. package/dist/interface/service.ts +1 -1
  30. package/dist/jumpEventReport/base.ts +1 -1
  31. package/dist/jumpEventReport/const.ts +1 -1
  32. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  33. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  34. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  35. package/dist/jumpEventReport/web.base.ts +1 -1
  36. package/dist/jumpEventReport/web.jd.ts +1 -1
  37. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  38. package/dist/modules/ContainerFloorList/index.h5.module.scss +1 -0
  39. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  40. package/dist/open/api/device.ts +1 -1
  41. package/dist/open/api/request.ts +1 -1
  42. package/dist/open/api/shopMember.ts +1 -1
  43. package/dist/open/api/util.ts +1 -1
  44. package/dist/open/components/index.ts +1 -1
  45. package/dist/sass/app.h5.scss +5 -0
  46. package/dist/sass/base.scss +45 -0
  47. package/dist/service/requestServer.ts +1 -1
  48. package/dist/utils/connectNativeJsBridge.ts +1 -1
  49. package/dist/utils/h5Utils.ts +1 -1
  50. package/dist/utils/index.h5.ts +1 -1
  51. package/dist/utils/index.ts +1 -1
  52. package/dist/utils/index.weapp.ts +1 -1
  53. package/dist/utils/sgmCodeUtils.ts +1 -1
  54. package/dist/utils/taroRenderUtil.ts +1 -1
  55. package/dist/utils/utils.ts +1 -1
  56. package/package.json +24 -23
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  SHOP_MENU_ID_TYPE,
3
2
  SHOP_MENU_ID_QUERY_NAME,
4
3
  SECTION_HOME_TAB_TYPE,
5
4
  SECTION_HOME_TAB_NAME_TYPE,
6
5
  SECTION_HOME_TAB_QUERY_TYPE,
7
6
  CHANNEL_TYPE,
8
7
  JDShopViewBusinessPathType,
9
8
  FloorModuleType,
10
9
  RemoteLoadFloorList,
11
10
  MPAAS_CONFIG_APP_VERSION,
12
11
  getBundleUrl,
13
12
  getBundleFileName,
14
13
  formatPackResult,
15
14
  key: string,
16
15
  value: string | object,
17
16
  successBack?: any,
18
17
  failBack?: any,
19
18
  return Taro.setStorage({
20
19
  key: key,
21
20
  data: value,
22
21
  success: successBack,
23
22
  fail: failBack,
24
23
  })
25
24
  return Taro.getStorageSync(key)
26
25
  return Taro.removeStorage({
27
26
  key: key,
28
27
  })
29
28
  return Taro.clearStorage()
30
29
  const appVersionCheckPass =
31
30
  versionCompare(jdAppVersionStr, MPAAS_CONFIG_APP_VERSION) >= 0
32
31
  const supportBuildType = /app-view|app-member|app-classify/
33
32
  const scopeCheckPass = supportBuildType.test(buildType || '')
34
33
  const enableAvifOptimize = appVersionCheckPass && scopeCheckPass
35
34
  if (!hasOutputLog) {
36
35
  hasOutputLog = true
37
36
  console.log(
38
37
  '� ~~ file: utils.ts:119 ~~ isImageOptimizeEnable ~~ jdAppVersionStr:',
39
38
  jdAppVersionStr,
40
39
  ' MPAAS_CONFIG_APP_VERSION:',
41
40
  MPAAS_CONFIG_APP_VERSION,
42
41
  ' scopeCheckPass:',
43
42
  scopeCheckPass,
44
43
  ' buildType:',
45
44
  buildType,
46
45
  ' supportBuildType:',
47
46
  supportBuildType,
48
47
  )
49
48
  console.log(
50
49
  '� ~~ file: utils.ts:119 ~~ isImageOptimizeEnable ~~ enableAvifOptimize:',
51
50
  enableAvifOptimize,
52
51
  ' appVersionCheckPass:',
53
52
  appVersionCheckPass,
54
53
  ' scopeCheckPass:',
55
54
  scopeCheckPass,
56
55
  )
57
56
  }
58
57
  if (enableAvifOptimize) {
59
58
  const configData = global.getDynamicConfig('avifSwitch')
60
59
  console.warn(
61
60
  '� ~~ file: utils.ts:142 ~~ global.getDynamicConfig ~~ configData:',
62
61
  configData,
63
62
  )
64
63
  const {
65
64
  globalOn = true,
66
65
  ignoreOptimizeFromServer = false,
67
66
  page = {},
68
67
  whiteList = [],
69
68
  blackList = [],
70
69
  } = configData || {}
71
70
  const { shopId = '0', venderId = '0' } = parseQueryUrlString(
72
71
  window?.location?.href ?? '',
73
72
  )
74
73
  let imageEnableResult = true
75
74
  isIgnoreOptimizeFromServer = ignoreOptimizeFromServer
76
75
  if (
77
76
  blackList.find(
78
77
  item => item.sId === Number(shopId) || item.vId === Number(venderId),
79
78
  )
80
79
  ) {
81
80
  imageEnableResult = false
82
81
  console.warn('� ~~ file: utils.ts:149 命中黑名单!')
83
82
  } else if (
84
83
  whiteList.find(
85
84
  item => item.sId === Number(shopId) || item.vId === Number(venderId),
86
85
  )
87
86
  ) {
88
87
  imageEnableResult = true
89
88
  console.warn('� ~~ file: utils.ts:154 命中白名单!')
90
89
  } else {
91
90
  imageEnableResult = globalOn === true || page[buildType] === true
92
91
  console.warn(
93
92
  '� ~~ file: utils.ts:158 走全局开关+页面开关控制逻辑,开关结果:',
94
93
  imageEnableResult,
95
94
  )
96
95
  }
97
96
  return imageEnableResult
98
97
  } else {
99
98
  return false
100
99
  }
101
100
  if (isH5) {
102
101
  const avifCache = getTaroStorageKeyValue(KEY_AVIF)
103
102
  if (avifCache === null || avifCache === '') {
104
103
  const img = new Image()
105
104
  img.onload = function() {
106
105
  if (img.height > 0 && img.width > 0) {
107
106
  setTaroStorage(KEY_AVIF, '1')
108
107
  } else {
109
108
  setTaroStorage(KEY_AVIF, '0')
110
109
  }
111
110
  }
112
111
  img.onerror = () => {
113
112
  setTaroStorage(KEY_AVIF, '0')
114
113
  }
115
114
  img.src =
116
115
  'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A='
117
116
  }
118
117
  const webpCache = getTaroStorageKeyValue(KEY_WEBP)
119
118
  if (webpCache === null || webpCache === '') {
120
119
  const img = new Image()
121
120
  img.onload = function() {
122
121
  if (img.height > 0 && img.width > 0) {
123
122
  setTaroStorage(KEY_WEBP, '1')
124
123
  } else {
125
124
  setTaroStorage(KEY_WEBP, '0')
126
125
  }
127
126
  }
128
127
  img.onerror = () => {
129
128
  setTaroStorage(KEY_WEBP, '0')
130
129
  }
131
130
  img.src =
132
131
  'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAUAmJaQAA3AA/vz0AAA='
133
132
  }
134
133
  }
135
134
  const resultList: Array<any> = [],
136
135
  arrLen = arr.length
137
136
  if (arrLen) {
138
137
  if (arrLen > size) {
139
138
  for (let i = 0; i < arrLen; i = i + size) {
140
139
  resultList.push(arr.slice(i, i + size))
141
140
  }
142
141
  } else {
143
142
  resultList.push(arr)
144
143
  }
145
144
  }
146
145
  return resultList
147
146
  let _address = ids
148
147
  const _areaAreaSplit = ids.split('.')
149
148
  const _areaAreaSplit2 = ids.split('_')
150
149
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address
151
150
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address
152
151
  return _address
153
152
  let paramStr = ''
154
153
  obj &&
155
154
  Object.keys(obj).forEach((key, index) => {
156
155
  const getValue = `${obj[key]}`
157
156
  .replace(/undefined/, '')
158
157
  .replace(/null/, '')
159
158
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(
160
159
  getValue,
161
160
  )}`
162
161
  })
163
162
  return paramStr
164
163
  const result = {}
165
164
  if (
166
165
  !urlOrQueryStr ||
167
166
  ('string' !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
168
167
  ) {
169
168
  return result
170
169
  }
171
170
  if (urlOrQueryStr.indexOf('?') > -1) {
172
171
  const queryStr = urlOrQueryStr.split('?')
173
172
  const queryItemList =
174
173
  queryStr && queryStr.length > 1 ? queryStr[1].split('&') : []
175
174
  const queryItemListLen = queryItemList.length
176
175
  queryItemListLen > 0 &&
177
176
  queryItemList.forEach(item => {
178
177
  const thisItemList = item.split('=')
179
178
  result[thisItemList[0]] = thisItemList[1]
180
179
  })
181
180
  } else {
182
181
  const queryItemList =
183
182
  urlOrQueryStr.indexOf('&') > -1
184
183
  ? urlOrQueryStr.split('&')
185
184
  : [urlOrQueryStr]
186
185
  const queryItemListLen = queryItemList.length
187
186
  queryItemListLen > 0 &&
188
187
  queryItemList.forEach(item => {
189
188
  const thisItemList = item.split('=')
190
189
  result[thisItemList[0]] = thisItemList[1]
191
190
  })
192
191
  }
193
192
  return result
194
193
  url: string,
195
194
  size?: {
196
195
  w: number
197
196
  h: number
198
197
  },
199
198
  quality?: number,
200
199
  if (url && size) {
201
200
  const _w = Math.floor(size.w)
202
201
  const _h = Math.floor(size.h)
203
202
  if (url.match(/gif$/i)) {
204
203
  return url
205
204
  } else {
206
205
  if (_w > 0 && _h > 0) {
207
206
  url = url.replace('jfs/', `s${_w}x${_h}_jfs/`)
208
207
  }
209
208
  url += quality != null ? `!q${quality}.dpg` : '.dpg'
210
209
  }
211
210
  }
212
211
  return url
213
212
  url: string,
214
213
  jfsImgInfo: UtilsInterFace.getJfsImageInfo = {},
215
214
  if (url.match(/\.(jpg|png|dpg)$/i)) {
216
215
  const { width, height, quality } = jfsImgInfo
217
216
  if (typeof width === 'number' || typeof height === 'number') {
218
217
  url = url.replace(
219
218
  '/jfs/',
220
219
  `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`,
221
220
  )
222
221
  }
223
222
  if (
224
223
  typeof quality === 'number' &&
225
224
  quality > 0 &&
226
225
  quality < 100 &&
227
226
  url.match(/\.jpg$/i)
228
227
  ) {
229
228
  url += `!q${quality}.dpg`
230
229
  }
231
230
  }
232
231
  return addHttps(url)
233
232
  if (imgUrl) {
234
233
  if (
235
234
  !imgUrl.match(
236
235
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
237
236
  )
238
237
  ) {
239
238
  if (!imgUrl.includes('360buyimg.com')) {
240
239
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
241
240
  }
242
241
  if (quality != 100)
243
242
  imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
244
243
  }
245
244
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl
246
245
  }
247
246
  return imgUrl
248
247
  const result = value % step
249
248
  return result === 0 ? value : Math.ceil(value / step) * step
250
249
  const MAX = 3.5
251
250
  return Math.min(window?.devicePixelRatio ?? 2, MAX)
252
251
  isSkuImage: boolean
253
252
  size: number
254
253
  imgUrl: string,
255
254
  options: QualityOptions,
256
255
  if (!imgUrl) {
257
256
  console.error(
258
257
  'The input parameter imageUrl for the getQualityImage() cannot be empty!',
259
258
  )
260
259
  return imgUrl
261
260
  }
262
261
  if (isIgnoreOptimizeFromServer) {
263
262
  imgUrl = imgUrl.replace(/\.(jpe?g|png).*/, '.$1')
264
263
  }
265
264
  if (!/^((https?):)?\/\//.test(imgUrl)) {
266
265
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
267
266
  }
268
267
  const imgServerRegExp = /(img|m)\d{0,2}\.360buyimg\.com\/.*\.(jpe?g|png)/i
269
268
  if (!imgServerRegExp.test(imgUrl)) {
270
269
  return imgUrl
271
270
  }
272
271
  imgUrl = /^\/\//.test(imgUrl) ? `https:${imgUrl}` : imgUrl
273
272
  const { isSkuImage, size } = options || {}
274
273
  const needReduceSize = isSkuImage && size
275
274
  if (needReduceSize) {
276
275
  const devicePixelRatio = getDevicePixelRatio()
277
276
  const useWidth = getValueByStep(size * devicePixelRatio, 40)
278
277
  imgUrl = imgUrl.replace(/\/[^\/]*jfs\//, `/s${useWidth}x${useWidth}_jfs/`)
279
278
  }
280
279
  const needCompress = !global?.info?.pageInfo?.isVipShop
281
280
  const result = imgUrl.match(/\/\w+\.(jpe?g|png)$/)
282
281
  if (needCompress && result) {
283
282
  if (getAvifSupport() === '1') {
284
283
  imgUrl += '.avif'
285
284
  } else if (getWebpSupport() === '1') {
286
285
  imgUrl += '.webp'
287
286
  } else if (/jpe?g/.test(result[1])) {
288
287
  imgUrl += '!q80'
289
288
  }
290
289
  }
291
290
  if (needReduceSize) {
292
291
  imgUrl += '!z2'
293
292
  }
294
293
  return imgUrl
295
294
  if (imgUrl) {
296
295
  if (
297
296
  !imgUrl.match(
298
297
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
299
298
  )
300
299
  ) {
301
300
  if (!imgUrl.includes('360buyimg.com')) {
302
301
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
303
302
  }
304
303
  if (quality != 100)
305
304
  imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
306
305
  }
307
306
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl
308
307
  }
309
308
  return imgUrl
310
309
  return getTaroStorageKeyValue(KEY_AVIF) || '0'
311
310
  return getTaroStorageKeyValue(KEY_WEBP) || '0'
312
311
  count: number,
313
312
  fixedNum = 2,
314
313
  unit = '万',
315
314
  maxNum = 10000,
316
315
  count = Number(count)
317
316
  if (count > maxNum) {
318
317
  return (count / maxNum).toFixed(fixedNum) + unit
319
318
  }
320
319
  return count
321
320
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo || {
322
321
  platform: '',
323
322
  model: '',
324
323
  system: '',
325
324
  }
326
325
  const isIOS = !!systemInfo.system.match(/ios/i)
327
326
  const isAndroid = !!systemInfo.system.match(/android/i)
328
327
  if (!systemInfo.statusBarHeight) {
329
328
  systemInfo.statusBarHeight = screenHeight - windowHeight - 20
330
329
  systemInfo.navBarExtendHeight = 0
331
330
  } else {
332
331
  if (isIOS) {
333
332
  systemInfo.navBarExtendHeight = 4
334
333
  } else {
335
334
  systemInfo.navBarExtendHeight = 0
336
335
  }
337
336
  }
338
337
  let rect = Taro.getMenuButtonBoundingClientRect
339
338
  ? Taro.getMenuButtonBoundingClientRect()
340
339
  : null
341
340
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
342
341
  let gap = 0
343
342
  let width = 96
344
343
  if (systemInfo.platform === 'android') {
345
344
  gap = 8
346
345
  width = 96
347
346
  } else if (systemInfo.platform === 'devtools') {
348
347
  if (isIOS) {
349
348
  gap = 5.5
350
349
  } else {
351
350
  gap = 7.5
352
351
  }
353
352
  } else {
354
353
  gap = 4
355
354
  width = 88
356
355
  }
357
356
  rect = {
358
357
  bottom: systemInfo.statusBarHeight + gap + 32,
359
358
  height: 32,
360
359
  left: systemInfo.windowWidth - width - 10,
361
360
  right: systemInfo.windowWidth - 10,
362
361
  top: systemInfo.statusBarHeight + gap,
363
362
  width,
364
363
  }
365
364
  }
366
365
  const gap = rect.top - systemInfo.statusBarHeight
367
366
  systemInfo.navBarTopToStatusBar = gap
368
367
  systemInfo.navBarHeight = 2 * gap + rect.height
369
368
  systemInfo.capsulePosition = rect
370
369
  systemInfo.isIOS = isIOS
371
370
  systemInfo.isAndroid = isAndroid
372
371
  return systemInfo
373
372
  if (str.match(/^\/\//)) {
374
373
  str = 'https:' + str
375
374
  }
376
375
  return str
377
376
  dateTimeOrdate: Date | string | number | null,
378
377
  format = 'yyyy-MM-dd HH:mm:ss',
379
378
  noPadStart = {
380
379
  M: '0',
381
380
  d: '0',
382
381
  H: '0',
383
382
  m: '0',
384
383
  s: '0',
385
384
  },
386
385
  let dateResult = ''
387
386
  const padStarts = Object.assign(
388
387
  {
389
388
  M: '0',
390
389
  d: '0',
391
390
  H: '0',
392
391
  m: '0',
393
392
  s: '0',
394
393
  },
395
394
  noPadStart,
396
395
  )
397
396
  if (dateTimeOrdate) {
398
397
  let changeDateTimeOrdate = dateTimeOrdate
399
398
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate)
400
399
  if (getChangeDateTimeToNumber) {
401
400
  changeDateTimeOrdate = getChangeDateTimeToNumber
402
401
  } else {
403
402
  changeDateTimeOrdate = `${changeDateTimeOrdate}`
404
403
  .replace(/-/g, '/')
405
404
  .replace(/\./g, '/')
406
405
  }
407
406
  const nowDate =
408
407
  dateTimeOrdate instanceof Date
409
408
  ? dateTimeOrdate
410
409
  : new Date(changeDateTimeOrdate)
411
410
  const dateMap = {
412
411
  y: `${nowDate.getFullYear()}`,
413
412
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts['M']),
414
413
  d: `${nowDate.getDate()}`.padStart(2, padStarts['d']),
415
414
  H: `${nowDate.getHours()}`.padStart(2, padStarts['H']),
416
415
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts['m']),
417
416
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts['s']),
418
417
  }
419
418
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g')
420
419
  const regYear = new RegExp('y')
421
420
  dateResult = format.replace(regDate, v => {
422
421
  let changeValue = v
423
422
  if (regYear.test(changeValue)) {
424
423
  const thisYear = dateMap.y
425
424
  const subValueLen = 4 - changeValue.length
426
425
  changeValue = thisYear.substr(subValueLen)
427
426
  } else {
428
427
  const dateKey = v.substr(0, 1)
429
428
  changeValue = dateMap[dateKey]
430
429
  }
431
430
  return changeValue
432
431
  })
433
432
  }
434
433
  return dateResult
435
434
  let timer: any = null
436
435
  let startTime = Date.now()
437
436
  return function() {
438
437
  const curTime = Date.now()
439
438
  const remaining = delay - (curTime - startTime)
440
439
  const context = this
441
440
  const args = arguments
442
441
  clearTimeout(timer)
443
442
  if (remaining <= 0) {
444
443
  func.apply(context, args)
445
444
  startTime = Date.now()
446
445
  } else {
447
446
  timer = setTimeout(func, remaining)
448
447
  }
449
448
  }
450
449
  let context, args, result
451
450
  let timeout = null
452
451
  let previous = 0
453
452
  if (!options) options = {}
454
453
  const later = function() {
455
454
  previous = options.leading === false ? 0 : Date.now()
456
455
  timeout = null
457
456
  result = func.apply(context, args)
458
457
  if (!timeout) context = args = null
459
458
  }
460
459
  return function() {
461
460
  const now = Date.now()
462
461
  if (!previous && options.leading === false) previous = now
463
462
  const remaining = wait - (now - previous)
464
463
  context = this
465
464
  args = arguments
466
465
  if (remaining <= 0 || remaining > wait) {
467
466
  if (timeout) {
468
467
  clearTimeout(timeout)
469
468
  timeout = null
470
469
  }
471
470
  previous = now
472
471
  result = func.apply(context, args)
473
472
  if (!timeout) context = args = null
474
473
  } else if (!timeout && options.trailing !== false) {
475
474
  timeout = setTimeout(later, remaining)
476
475
  }
477
476
  return result
478
477
  }
479
478
  let timer: any = null
480
479
  return function() {
481
480
  const context: any = this
482
481
  const args = arguments
483
482
  timer && clearTimeout(timer)
484
483
  timer = setTimeout(function() {
485
484
  fn.apply(context, args)
486
485
  }, delay)
487
486
  }
488
487
  if (txt) {
489
488
  txt = txt.trim()
490
489
  const reg = new RegExp(/[\d-]+/)
491
490
  const res = reg.exec(txt)
492
491
  if (res && res.length > 0) {
493
492
  let tel = res[0]
494
493
  if (tel && delSeparator) {
495
494
  tel = tel.replace(/-/g, '')
496
495
  }
497
496
  return tel
498
497
  }
499
498
  }
500
499
  return ''
501
500
  if (rgb) {
502
501
  const reg = /^(rgb|RGB)/
503
502
  const color = rgb
504
503
  if (reg.test(color)) {
505
504
  let strHex = '#'
506
505
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',')
507
506
  for (let i = 0; i < colorArr.length; i++) {
508
507
  let hex = Number(colorArr[i]).toString(16)
509
508
  if (hex === '0') {
510
509
  hex += hex
511
510
  }
512
511
  strHex += hex
513
512
  }
514
513
  return strHex
515
514
  } else {
516
515
  return String(color)
517
516
  }
518
517
  } else {
519
518
  return ''
520
519
  }
521
520
  if (hex) {
522
521
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
523
522
  let color = hex.toLowerCase()
524
523
  if (reg.test(color)) {
525
524
  if (color.length === 4) {
526
525
  let colorNew = '#'
527
526
  for (let i = 1; i < 4; i += 1) {
528
527
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1))
529
528
  }
530
529
  color = colorNew
531
530
  }
532
531
  const colorChange: number[] = []
533
532
  for (let i = 1; i < 7; i += 2) {
534
533
  colorChange.push(parseInt('0x' + color.slice(i, i + 2)))
535
534
  }
536
535
  if (returnList) {
537
536
  return colorChange
538
537
  } else {
539
538
  return 'RGB(' + colorChange.join(',') + ')'
540
539
  }
541
540
  } else {
542
541
  return color
543
542
  }
544
543
  } else {
545
544
  return ''
546
545
  }
547
546
  n: number,
548
547
  m: number,
549
548
  filterNum: number | undefined = undefined,
550
549
  const c = m - n + 1
551
550
  const res = Math.floor(Math.random() * c + n)
552
551
  if (filterNum && filterNum == res) {
553
552
  console.log('随机数二次开始', res, filterNum)
554
553
  return getRandom(n, m, filterNum)
555
554
  } else {
556
555
  return res
557
556
  }
558
557
  cookie: UtilsInterFace.wxAppCookie,
559
558
  wqCookieStr: string
560
559
  wqCookie: {
561
560
  pin?: string
562
561
  visitkey?: string
563
562
  [key: string]: any
564
563
  }
565
564
  const {
566
565
  jdpin,
567
566
  pinStatus,
568
567
  visitkey,
569
568
  unionid,
570
569
  skey,
571
570
  __jda,
572
571
  __jdv,
573
572
  __wga,
574
573
  wid,
575
574
  wq_skey,
576
575
  wq_uin,
577
576
  wq_auth_token,
578
577
  wxapp_scene,
579
578
  wq_unionid,
580
579
  wxapp_openid,
581
580
  wxapp_version,
582
581
  wxapp_type,
583
582
  appType,
584
583
  } = cookie
585
584
  const ret: string[] = []
586
585
  const getUserCookieObj = {}
587
586
  const createUseCookieArr = [
588
587
  jdpin,
589
588
  pinStatus,
590
589
  visitkey,
591
590
  unionid,
592
591
  skey,
593
592
  __jda,
594
593
  __jdv,
595
594
  __wga,
596
595
  wid,
597
596
  wq_skey,
598
597
  wq_uin,
599
598
  wq_auth_token,
600
599
  wxapp_scene,
601
600
  wq_unionid,
602
601
  wxapp_openid,
603
602
  wxapp_version,
604
603
  wxapp_type,
605
604
  appType,
606
605
  ]
607
606
  createUseCookieArr.forEach(keyItem => {
608
607
  if (keyItem && keyItem['name']) {
609
608
  let { name, value } = keyItem
610
609
  name = name === 'jdpin' ? 'pin' : name
611
610
  name === 'pin' && ret.push(`pt_pin=${encodeURIComponent(value)}`)
612
611
  ret.push(`${name}=${encodeURIComponent(value)}`)
613
612
  getUserCookieObj[name] = value
614
613
  }
615
614
  })
616
615
  return {
617
616
  wqCookieStr: ret.join(';'),
618
617
  wqCookie: getUserCookieObj,
619
618
  }
620
619
  num,
621
620
  widthSize = 375,
622
621
  layoutWidth = windowWidth,
623
622
  const getNum = Number(num)
624
623
  return Math.round((getNum / widthSize) * layoutWidth)
625
624
  let checkState = false
626
625
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag
627
626
  if (couponFloorModuleType === FloorModuleType.COUPON) {
628
627
  try {
629
628
  const dataDefines = getFloorDataToDataDefines(floorData)
630
629
  const couponDataDefine = dataDefines
631
630
  ? dataDefines.filter(item => {
632
631
  return item.type === 'coupon'
633
632
  })
634
633
  : [],
635
634
  couponList = couponDataDefine[0]?.nodeText?.data
636
635
  ? couponDataDefine[0]?.nodeText?.data
637
636
  : [],
638
637
  couponLength = couponList.length,
639
638
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
640
639
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
641
640
  : 0
642
641
  if (numShowPerLine === 0 && couponLength > 3) {
643
642
  checkState = true
644
643
  }
645
644
  } catch (e) {
646
645
  checkState = false
647
646
  }
648
647
  return checkState
649
648
  }
650
649
  const {
651
650
  containers = [],
652
651
  floors = [],
653
652
  clearFirstContaierMarginTop = false,
654
653
  isLuxuryShop = false,
655
654
  isShowNativeImmersivePlayer = false,
656
655
  screenHeight = null,
657
656
  screenWidth = null,
658
657
  bottomBarHeight = null,
659
658
  } = pageData
660
659
  console.log('dealShopContentData:', pageData, 'isvdev:', isvdev)
661
660
  const getThisTimeKey = Date.now()
662
661
  let shopContentContainerListData = containers?.filter(
663
662
  item => (!isvdev && item.typeCode !== 'mShopHeader') || isvdev,
664
663
  )
665
664
  const shopContentFloorListData = floors?.filter(
666
665
  ({ floorPosition }) =>
667
666
  (!isvdev && floorPosition !== 'header' && floorPosition !== 'footer') ||
668
667
  isvdev,
669
668
  )
670
669
  const unableIsvContainerListData = getUnableIsvContainerListData(
671
670
  shopContentFloorListData,
672
671
  shopContentContainerListData,
673
672
  exceptionReportFn,
674
673
  )
675
674
  shopContentContainerListData.forEach((item, index) => {
676
675
  item.key = `${getThisTimeKey + index}`
677
676
  item.floors = []
678
677
  item.includeUids &&
679
678
  item.includeUids.forEach(floorUid => {
680
679
  const getFloorData = shopContentFloorListData.find(
681
680
  floorItem => floorItem.uid === floorUid,
682
681
  )
683
682
  if (getFloorData) {
684
683
  const changeFloorData = {
685
684
  containerId: item.containerId,
686
685
  containerIndex: index,
687
686
  ...getFloorData,
688
687
  }
689
688
  const getCheckMoreCouponState = checkCouponAndChangeContainerSetData(
690
689
  getFloorData,
691
690
  )
692
691
  if (getCheckMoreCouponState) {
693
692
  item.marginLeft && (item.marginLeft = 0)
694
693
  item.marginRight && (item.marginRight = 0)
695
694
  item.borderRadius && (item.borderRadius = 0)
696
695
  }
697
696
  if (getFloorData?.floorExtInfo?.floorLoadWay === 2) {
698
697
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(
699
698
  getFloorData,
700
699
  exceptionReportFn,
701
700
  )
702
701
  !getSysFloorToLoadTypeRes &&
703
702
  (getFloorData.floorExtInfo.floorLoadWay = 1)
704
703
  }
705
704
  item.floors.push(changeFloorData)
706
705
  }
707
706
  })
708
707
  if (
709
708
  ((!isvdev && index === 0) || (isvdev && index === 1)) &&
710
709
  item?.containerPosition == 'content' &&
711
710
  item?.marginBottom > 0 &&
712
711
  !clearFirstContaierMarginTop
713
712
  ) {
714
713
  item.marginTop = item.marginBottom
715
714
  }
716
715
  })
717
716
  shopContentContainerListData = shopContentContainerListData.filter(
718
717
  item =>
719
718
  item.floors.length > 0 &&
720
719
  unableIsvContainerListData.every(
721
720
  containerItem => containerItem.containerId != item.containerId,
722
721
  ),
723
722
  )
724
723
  console.log(
725
724
  'dealShopContentData isWxMinAndWxapp:',
726
725
  isWxMinAndWxapp,
727
726
  'weappJumpToH5:',
728
727
  pageData?.homeExtInfo?.weappJumpToH5,
729
728
  )
730
729
  if (isProd && isWxMinAndWxapp) {
731
730
  shopContentContainerListData = shopContentContainerListData.filter(
732
731
  item =>
733
732
  item.floors.length > 0 &&
734
733
  !isIsvContainer(
735
734
  item.containerId,
736
735
  shopContentFloorListData,
737
736
  shopContentContainerListData,
738
737
  ),
739
738
  )
740
739
  }
741
740
  shopContentContainerListData = [].concat(shopContentContainerListData)
742
741
  return {
743
742
  shopContentContainerListData,
744
743
  shopContentFloorListData,
745
744
  }
746
745
  const changeOpts = {
747
746
  title: '',
748
747
  icon: 'success',
749
748
  duration: 1500,
750
749
  mask: true,
751
750
  ...options,
752
751
  }
753
752
  if (changeOpts.title.length > 7) {
754
753
  showNormalToast(options)
755
754
  } else {
756
755
  Taro.showToast(changeOpts as any)
757
756
  }
758
757
  const changeOpts = {
759
758
  title: '',
760
759
  icon: 'error',
761
760
  duration: 1500,
762
761
  mask: true,
763
762
  ...options,
764
763
  }
765
764
  if (changeOpts.title.length > 7) {
766
765
  showNormalToast(options)
767
766
  } else {
768
767
  Taro.showToast(changeOpts as any)
769
768
  }
770
769
  Taro.showToast({
771
770
  title: '',
772
771
  icon: 'none',
773
772
  duration: 1500,
774
773
  mask: true,
775
774
  ...options,
776
775
  })
777
776
  return Taro.showLoading({
778
777
  title: text,
779
778
  })
780
779
  return new Promise(() => {
781
780
  Taro.nextTick(() => {
782
781
  setTimeout(() => {
783
782
  Taro.hideLoading(options)
784
783
  }, 300)
785
784
  })
786
785
  })
787
786
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
788
787
  const {
789
788
  tabActive = SECTION_HOME_TAB_NAME_TYPE[
790
789
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
791
790
  ],
792
791
  sceneId,
793
792
  } = query
794
793
  let changeTabActive = tabActive
795
794
  if (sceneId) {
796
795
  if (isH5) {
797
796
  if (sceneId == '1002') {
798
797
  changeTabActive =
799
798
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
800
799
  }
801
800
  else if (sceneId == '1003') {
802
801
  changeTabActive =
803
802
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY]
804
803
  }
805
804
  } else if (isWxMinAndWxapp) {
806
805
  if (sceneId == '1001' || sceneId == '1002') {
807
806
  changeTabActive =
808
807
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
809
808
  }
810
809
  else if (sceneId == '1003') {
811
810
  changeTabActive =
812
811
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]
813
812
  }
814
813
  }
815
814
  }
816
815
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
817
816
  return {
818
817
  menuType: SHOP_MENU_ID_TYPE.HOME,
819
818
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
820
819
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
821
820
  }
822
821
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
823
822
  return {
824
823
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
825
824
  tabActiveType: 0,
826
825
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
827
826
  }
828
827
  } else {
829
828
  return {
830
829
  menuType: SHOP_MENU_ID_TYPE.HOME,
831
830
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
832
831
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
833
832
  }
834
833
  }
835
834
  const deleteKeyList = [
836
835
  '$taroTimestamp',
837
836
  'cookie',
838
837
  'wdref',
839
838
  'navStart',
840
839
  'originOpts',
841
840
  'originParams',
842
841
  'originUrl',
843
842
  'referer',
844
843
  'stamp',
845
844
  ]
846
845
  let changeQueryData: any = { ...queryData }
847
846
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false
848
847
  const sceneQuery =
849
848
  qrCodeScene && typeof qrCodeScene == 'string'
850
849
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
851
850
  : {}
852
851
  changeQueryData = { ...changeQueryData, ...sceneQuery }
853
852
  deleteKeyList.forEach(key => {
854
853
  changeQueryData[key] && delete changeQueryData[key]
855
854
  })
856
855
  changeQueryData['shopid'] &&
857
856
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
858
857
  delete changeQueryData['shopid']
859
858
  changeQueryData['venderid'] &&
860
859
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
861
860
  delete changeQueryData['venderid']
862
861
  changeQueryData['vendorId'] &&
863
862
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
864
863
  delete changeQueryData['vendorId']
865
864
  return changeQueryData
866
865
  let isUsable = false
867
866
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
868
867
  const modularPackResultObj = formatPackResult(modularPackResult)
869
868
  const bundleUrl = getBundleUrl(modularPackResultObj)
870
869
  const bundleFileName = getBundleFileName(modularPackResultObj)
871
870
  if (bundleUrl && bundleFileName) {
872
871
  isUsable = true
873
872
  }
874
873
  if (!isUsable && typeof exceptionReportFn === 'function') {
875
874
  exceptionReportFn({
876
875
  code: getSgmCustomCode(SgmCustomCode.REMOTEMODULE_DATA),
877
876
  msg: {
878
877
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
879
878
  floorIdx: floorData?.floorIdx,
880
879
  uid: floorData?.uid,
881
880
  shopId: floorData?.floorExtInfo?.shopId,
882
881
  moduleId: floorData?.moduleId,
883
882
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
884
883
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
885
884
  floorKind: floorData?.floorExtInfo?.floorKind,
886
885
  middleTemplateId: floorData?.middleTemplateId,
887
886
  modularPackResult: modularPackResult,
888
887
  },
889
888
  })
890
889
  }
891
890
  return isUsable
892
891
  const objContainer = containerListData.find(
893
892
  item => item.containerId === containerId,
894
893
  )
895
894
  return (
896
895
  objContainer?.includeUids?.some(itemUid => {
897
896
  const objectFloor = floorListData.find(
898
897
  floorItem => itemUid === floorItem.uid,
899
898
  )
900
899
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
901
900
  }) ?? false
902
901
  )
903
902
  floorListData,
904
903
  containerListData,
905
904
  exceptionReportFn?,
906
905
  const unableIsvFloorListData = floorListData.filter(
907
906
  floorItem =>
908
907
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
909
908
  !isIsvFloorUseable(floorItem, exceptionReportFn),
910
909
  )
911
910
  const unableIsvFloorUidList = unableIsvFloorListData.map(
912
911
  floorItem => floorItem.uid,
913
912
  )
914
913
  const unableIsvContainerListData = containerListData.filter(
915
914
  item =>
916
915
  item.includeUids &&
917
916
  item.includeUids.every(
918
917
  itemUid => unableIsvFloorUidList.indexOf(itemUid) != -1,
919
918
  ),
920
919
  )
921
920
  return unableIsvContainerListData
922
921
  return -2
923
922
  return customObj
924
923
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl)
925
924
  let getParams = false
926
925
  if (isOpenJdAppUrl(openAppUrl)) {
927
926
  try {
928
927
  getParams = openAppUrl.replace(
929
928
  /openApp\.jdMobile:\/\/virtual\?params=/i,
930
929
  '',
931
930
  )
932
931
  getParams = JSON.parse(String(getParams))
933
932
  } catch (e) {
934
933
  console.log(e)
935
934
  }
936
935
  }
937
936
  return getParams
938
937
  return `openapp.jdmobile:
939
938
  Object.assign({}, openParams),
940
939
  )}`
941
940
  if (val === null || val === '' || typeof val === 'undefined') {
942
941
  return true
943
942
  }
944
943
  return false
945
944
  const {
946
945
  moduleId = 'none',
947
946
  entrance = 'none',
948
947
  sourceType = 'none',
949
948
  sourceValue = 'none',
950
949
  } = params
951
950
  if (isIosDevice) {
952
951
  return `${moduleId}#${entrance}`
953
952
  } else if (isAndroidDevice) {
954
953
  return `${sourceType}#${sourceValue}`
955
954
  }
956
955
  return 'none#none'
957
956
  if (data && typeof data === 'object') {
958
957
  let getOpenAppData = { ...data }
959
958
  try {
960
959
  const { sourceInfo, designerId, templateId, source } = getOpenAppData
961
960
  if (designerId && templateId) {
962
961
  getOpenAppData = Object.assign({}, getOpenAppData, {
963
962
  sourceInfo: {
964
963
  entrance: '设计师预览',
965
964
  },
966
965
  })
967
966
  } else if (sourceInfo) {
968
967
  const { entrance } = sourceInfo
969
968
  getOpenAppData.sourceInfo.entrance =
970
969
  entrance && entrance.length > 0 ? entrance : '其他'
971
970
  } else if (source && !sourceInfo) {
972
971
  if (typeof source === 'object') {
973
972
  const { sourceType, entrance, sourceValue, moduleId } = source
974
973
  getOpenAppData = Object.assign({}, getOpenAppData, {
975
974
  sourceInfo: {
976
975
  entrance: sourceType || entrance || '其他',
977
976
  moduleId: sourceValue || moduleId || '-100',
978
977
  },
979
978
  })
980
979
  } else {
981
980
  getOpenAppData = Object.assign({}, getOpenAppData, {
982
981
  sourceInfo: {
983
982
  entrance: source,
984
983
  },
985
984
  })
986
985
  }
987
986
  } else {
988
987
  getOpenAppData = Object.assign({}, getOpenAppData, {
989
988
  sourceInfo: {
990
989
  entrance: '其他',
991
990
  },
992
991
  })
993
992
  }
994
993
  } catch (e) {
995
994
  console.log(e)
996
995
  }
997
996
  return getOpenAppData
998
997
  }
999
998
  return data
1000
999
  return displayObj
1001
1000
  if (typeof input === 'string') {
1002
1001
  try {
1003
1002
  return JSON.parse(input)
1004
1003
  } catch (e) {
1005
1004
  console.error('JSON解析失败', e)
1006
1005
  return {}
1007
1006
  }
1008
1007
  }
1009
1008
  return input || {}
1010
1009
  isJdApp,
1011
1010
  isWxApp,
1012
1011
  isIosDevice,
1013
1012
  isAndroidDevice,
1014
1013
  isJdAndIosDevice,
1015
1014
  isJdAndAndroidDevice,
1016
1015
  isWxMin,
1017
1016
  isWxMinAndWxapp,
1018
1017
  isJdMin,
1019
1018
  isMin,
1020
1019
  isJdMinAndHarmony,
1021
1020
  isH5,
1022
1021
  isH5AndJdShopView,
1023
1022
  isImageOptimizeEnable,
1024
1023
  isChartH5,
1025
1024
  isH5AndJdShopViewNativeScroll,
1026
1025
  isH5AndJdShopViewH5Scroll,
1027
1026
  isH5AndJdShopH5CustomScrollView,
1028
1027
  isWxMiniH5View,
1029
1028
  sliceArrToChunkList,
1030
1029
  dealAddress,
1031
1030
  objectToUrlEncode,
1032
1031
  parseQueryUrlString,
1033
1032
  setLowSmallPicUrl,
1034
1033
  getJfsImage,
1035
1034
  getQualityImage,
1036
1035
  countStringify,
1037
1036
  setTaroStorage,
1038
1037
  getTaroStorageKeyValue,
1039
1038
  removeTaroStorageKey,
1040
1039
  clearTaroStorageKey,
1041
1040
  getSystemInfos,
1042
1041
  addHttps,
1043
1042
  dateFormat,
1044
1043
  throttle,
1045
1044
  lodashThrottle,
1046
1045
  debounce,
1047
1046
  getTelephone,
1048
1047
  rgbToHex,
1049
1048
  hexToRgb,
1050
1049
  getRandom,
1051
1050
  getWxAppCookieStr,
1052
1051
  pxTransformFromData,
1053
1052
  dealShopContentData,
1054
1053
  showSuccessToast,
1055
1054
  showFailToast,
1056
1055
  showNormalToast,
1057
1056
  showShopLoading,
1058
1057
  hideShopLoading,
1059
1058
  getAppChannelType,
1060
1059
  formatTabActiveMenuType,
1061
1060
  filterUrlQueryData,
1062
1061
  getAvifSupport,
1063
1062
  getWebpSupport,
1064
1063
  isMemberPage,
1065
1064
  sgmCustomReport,
1066
1065
  isOpenJdAppUrl,
1067
1066
  jdOpenAppParams,
1068
1067
  createJdOpenAppUrl,
1069
1068
  dealJdOpenAppData,
1070
1069
  isEmpty,
1071
1070
  getJdAppReportPageSource,
1072
1071
  isAppClassifyPage,
1073
1072
  getQualityImageNew,
1074
1073
  getQualityImageOld,
1075
1074
  isPc,
1076
1075
  ipLoc_djd,
1077
1076
  jdAppVersionCompare,
1078
1077
  dealNativePixelToCssPixel,
1079
1078
  isAppStowShop,
1079
+ import Taro from "@tarojs/taro";
1080
1080
  SHOP_MENU_ID_TYPE,
1081
1081
  SHOP_MENU_ID_QUERY_NAME,
1082
1082
  SECTION_HOME_TAB_TYPE,
1083
1083
  SECTION_HOME_TAB_NAME_TYPE,
1084
1084
  SECTION_HOME_TAB_QUERY_TYPE,
1085
1085
  CHANNEL_TYPE,
1086
1086
  JDShopViewBusinessPathType,
1087
1087
  FloorModuleType,
1088
1088
  RemoteLoadFloorList,
1089
1089
  MPAAS_CONFIG_APP_VERSION,
1090
1090
  FLOOR_KIND,
1091
1091
  getBundleUrl,
1092
1092
  getBundleFileName,
1093
1093
  formatPackResult,
1094
1094
  getTaroVersion,
1095
1095
  SgmCustomCode,
1096
1096
  NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG,
1097
1097
  key: string,
1098
1098
  value: string | object,
1099
1099
  successBack?: any,
1100
1100
  failBack?: any,
1101
1101
  return Taro.setStorage({
1102
1102
  key: key,
1103
1103
  data: value,
1104
1104
  success: successBack,
1105
1105
  fail: failBack,
1106
1106
  })
1107
1107
  return Taro.getStorageSync(key);
1108
1108
  return Taro.removeStorage({
1109
1109
  key: key,
1110
1110
  });
1111
1111
  return Taro.clearStorage();
1112
1112
  if (isH5) {
1113
1113
  const avifCache = getTaroStorageKeyValue(KEY_AVIF);
1114
1114
  if (avifCache === null || avifCache === "" || forceUpdate) {
1115
1115
  const img = new Image();
1116
1116
  img.onload = function () {
1117
1117
  if (img.height > 0 && img.width > 0) {
1118
1118
  setTaroStorage(KEY_AVIF, "1");
1119
1119
  } else {
1120
1120
  setTaroStorage(KEY_AVIF, "0");
1121
1121
  }
1122
1122
  };
1123
1123
  img.onerror = () => {
1124
1124
  setTaroStorage(KEY_AVIF, "0");
1125
1125
  };
1126
1126
  img.src =
1127
1127
  "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=";
1128
1128
  }
1129
1129
  const webpCache = getTaroStorageKeyValue(KEY_WEBP);
1130
1130
  if (webpCache === null || webpCache === "" || forceUpdate) {
1131
1131
  const img = new Image();
1132
1132
  img.onload = function () {
1133
1133
  if (img.height > 0 && img.width > 0) {
1134
1134
  setTaroStorage(KEY_WEBP, "1");
1135
1135
  } else {
1136
1136
  setTaroStorage(KEY_WEBP, "0");
1137
1137
  }
1138
1138
  };
1139
1139
  img.onerror = () => {
1140
1140
  setTaroStorage(KEY_WEBP, "0");
1141
1141
  };
1142
1142
  img.src =
1143
1143
  "data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAUAmJaQAA3AA/vz0AAA=";
1144
1144
  }
1145
1145
  }
1146
1146
  imageFormatSupport(false);
1147
1147
  setTimeout(imageFormatSupport, 5000);
1148
1148
  const resultList: Array<any> = [],
1149
1149
  arrLen = arr.length;
1150
1150
  if (arrLen) {
1151
1151
  if (arrLen > size) {
1152
1152
  for (let i = 0; i < arrLen; i = i + size) {
1153
1153
  resultList.push(arr.slice(i, i + size));
1154
1154
  }
1155
1155
  } else {
1156
1156
  resultList.push(arr);
1157
1157
  }
1158
1158
  }
1159
1159
  return resultList;
1160
1160
  let _address = ids;
1161
1161
  const _areaAreaSplit = ids.split(".");
1162
1162
  const _areaAreaSplit2 = ids.split("_");
1163
1163
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address;
1164
1164
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address;
1165
1165
  return _address;
1166
1166
  let paramStr = "";
1167
1167
  obj &&
1168
1168
  Object.keys(obj).forEach((key, index) => {
1169
1169
  const getValue = `${obj[key]}`
1170
1170
  .replace(/undefined/, "")
1171
1171
  .replace(/null/, "");
1172
1172
  paramStr += `${index === 0 ? "" : "&"}${key}=${encodeURIComponent(
1173
1173
  getValue
1174
1174
  )}`;
1175
1175
  });
1176
1176
  return paramStr;
1177
1177
  const result = {};
1178
1178
  if (
1179
1179
  !urlOrQueryStr ||
1180
1180
  ("string" !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
1181
1181
  ) {
1182
1182
  return result;
1183
1183
  }
1184
1184
  if (urlOrQueryStr.indexOf("?") > -1) {
1185
1185
  const queryStr = urlOrQueryStr.split("?");
1186
1186
  const queryItemList =
1187
1187
  queryStr && queryStr.length > 1 ? queryStr[1].split("&") : [];
1188
1188
  const queryItemListLen = queryItemList.length;
1189
1189
  queryItemListLen > 0 &&
1190
1190
  queryItemList.forEach((item) => {
1191
1191
  const thisItemList = item.split("=");
1192
1192
  result[thisItemList[0]] = thisItemList[1];
1193
1193
  });
1194
1194
  } else {
1195
1195
  const queryItemList =
1196
1196
  urlOrQueryStr.indexOf("&") > -1
1197
1197
  ? urlOrQueryStr.split("&")
1198
1198
  : [urlOrQueryStr];
1199
1199
  const queryItemListLen = queryItemList.length;
1200
1200
  queryItemListLen > 0 &&
1201
1201
  queryItemList.forEach((item) => {
1202
1202
  const thisItemList = item.split("=");
1203
1203
  result[thisItemList[0]] = thisItemList[1];
1204
1204
  });
1205
1205
  }
1206
1206
  return result;
1207
1207
  url: string,
1208
1208
  size?: {
1209
1209
  w: number;
1210
1210
  h: number;
1211
1211
  },
1212
1212
  quality?: number
1213
1213
  if (url && size) {
1214
1214
  const _w = Math.floor(size.w);
1215
1215
  const _h = Math.floor(size.h);
1216
1216
  if (url.match(/gif$/i)) {
1217
1217
  return url;
1218
1218
  } else {
1219
1219
  if (_w > 0 && _h > 0) {
1220
1220
  url = url.replace("jfs/", `s${_w}x${_h}_jfs/`);
1221
1221
  }
1222
1222
  url += quality != null ? `!q${quality}.dpg` : ".dpg";
1223
1223
  }
1224
1224
  }
1225
1225
  return url;
1226
1226
  url: string,
1227
1227
  jfsImgInfo: UtilsInterFace.getJfsImageInfo = {}
1228
1228
  if (url.match(/\.(jpg|png|dpg)$/i)) {
1229
1229
  const { width, height, quality } = jfsImgInfo;
1230
1230
  if (typeof width === "number" || typeof height === "number") {
1231
1231
  url = url.replace(
1232
1232
  "/jfs/",
1233
1233
  `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`
1234
1234
  );
1235
1235
  }
1236
1236
  if (
1237
1237
  typeof quality === "number" &&
1238
1238
  quality > 0 &&
1239
1239
  quality < 100 &&
1240
1240
  url.match(/\.jpg$/i)
1241
1241
  ) {
1242
1242
  url += `!q${quality}.dpg`;
1243
1243
  }
1244
1244
  }
1245
1245
  return addHttps(url);
1246
1246
  if (imgUrl) {
1247
1247
  if (
1248
1248
  !imgUrl.match(
1249
1249
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i
1250
1250
  )
1251
1251
  ) {
1252
1252
  if (!imgUrl.includes("360buyimg.com")) {
1253
1253
  imgUrl = "//m.360buyimg.com/cms/" + imgUrl;
1254
1254
  }
1255
1255
  if (quality != 100)
1256
1256
  imgUrl += /\.png/.test(imgUrl) ? ".dpg" : `!q${quality}`;
1257
1257
  }
1258
1258
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
1259
1259
  }
1260
1260
  return imgUrl;
1261
1261
  const result = value % step;
1262
1262
  return result === 0 ? value : Math.ceil(value / step) * step;
1263
1263
  const MAX = 3.5;
1264
1264
  return Math.min(window?.devicePixelRatio ?? 2, MAX);
1265
1265
  isSkuImage: boolean;
1266
1266
  size: number;
1267
1267
  imgUrl: string,
1268
1268
  options: QualityOptions,
1269
1269
  isIgnoreOptimizeFromServer: boolean = false
1270
1270
  if (!imgUrl) {
1271
1271
  console.error(
1272
1272
  "The input parameter imageUrl for the getQualityImage() cannot be empty!"
1273
1273
  );
1274
1274
  return imgUrl;
1275
1275
  }
1276
1276
  console.warn(
1277
1277
  "� ~~ file: utils.ts:369 ~~ getQualityImageNew ~~ isIgnoreOptimizeFromServer:",
1278
1278
  isIgnoreOptimizeFromServer
1279
1279
  );
1280
1280
  if (isIgnoreOptimizeFromServer) {
1281
1281
  imgUrl = imgUrl.replace(/\.(jpe?g|png).*/, ".$1");
1282
1282
  }
1283
1283
  if (!/^((https?):)?\/\//.test(imgUrl)) {
1284
1284
  imgUrl = "//m.360buyimg.com/cms/" + imgUrl;
1285
1285
  }
1286
1286
  const imgServerRegExp = /(img|m)\d{0,2}\.360buyimg\.com\/.*\.(jpe?g|png)/i;
1287
1287
  if (!imgServerRegExp.test(imgUrl)) {
1288
1288
  return imgUrl;
1289
1289
  }
1290
1290
  imgUrl = /^\/\//.test(imgUrl) ? `https:${imgUrl}` : imgUrl;
1291
1291
  const { isSkuImage, size } = options || {};
1292
1292
  const needReduceSize = isSkuImage && size;
1293
1293
  if (needReduceSize) {
1294
1294
  const devicePixelRatio = getDevicePixelRatio();
1295
1295
  const useWidth = getValueByStep(size * devicePixelRatio, 40);
1296
1296
  imgUrl = imgUrl.replace(/\/[^\/]*jfs\//, `/s${useWidth}x${useWidth}_jfs/`);
1297
1297
  }
1298
1298
  const needCompress = !global?.info?.pageInfo?.isVipShop;
1299
1299
  const result = imgUrl.match(/\/\w+\.(jpe?g|png)$/);
1300
1300
  if (needCompress && result) {
1301
1301
  if (getAvifSupport() === "1") {
1302
1302
  imgUrl += ".avif";
1303
1303
  } else if (getWebpSupport() === "1") {
1304
1304
  imgUrl += ".webp";
1305
1305
  } else if (/jpe?g/.test(result[1])) {
1306
1306
  imgUrl += "!q80";
1307
1307
  }
1308
1308
  }
1309
1309
  if (needReduceSize) {
1310
1310
  imgUrl += "!z2";
1311
1311
  }
1312
1312
  return imgUrl;
1313
1313
  if (imgUrl) {
1314
1314
  if (
1315
1315
  !imgUrl.match(
1316
1316
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i
1317
1317
  )
1318
1318
  ) {
1319
1319
  if (!imgUrl.includes("360buyimg.com")) {
1320
1320
  imgUrl = "//m.360buyimg.com/cms/" + imgUrl;
1321
1321
  }
1322
1322
  if (quality != 100)
1323
1323
  imgUrl += /\.png/.test(imgUrl) ? ".dpg" : `!q${quality}`;
1324
1324
  }
1325
1325
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
1326
1326
  }
1327
1327
  return imgUrl;
1328
1328
  return getTaroStorageKeyValue(KEY_AVIF) || "0";
1329
1329
  return getTaroStorageKeyValue(KEY_WEBP) || "0";
1330
1330
  count: number,
1331
1331
  fixedNum = 1,
1332
1332
  unit = "万",
1333
1333
  maxNum = 10000
1334
1334
  count = Number(count);
1335
1335
  const getMaxNum = count > 100000000 ? 100000000 : maxNum;
1336
1336
  const getUnit = count > 100000000 ? "亿" : unit;
1337
1337
  if (count >= getMaxNum) {
1338
1338
  return (count / getMaxNum).toFixed(fixedNum) + getUnit;
1339
1339
  }
1340
1340
  return count;
1341
1341
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo || {
1342
1342
  platform: "",
1343
1343
  model: "",
1344
1344
  system: "",
1345
1345
  };
1346
1346
  const isIOS = !!systemInfo.system.match(/ios/i);
1347
1347
  const isAndroid = !!systemInfo.system.match(/android/i);
1348
1348
  if (!systemInfo.statusBarHeight) {
1349
1349
  systemInfo.statusBarHeight = screenHeight - windowHeight - 20;
1350
1350
  systemInfo.navBarExtendHeight = 0;
1351
1351
  } else {
1352
1352
  if (isIOS) {
1353
1353
  systemInfo.navBarExtendHeight = 4;
1354
1354
  } else {
1355
1355
  systemInfo.navBarExtendHeight = 0;
1356
1356
  }
1357
1357
  }
1358
1358
  let rect = Taro.getMenuButtonBoundingClientRect
1359
1359
  ? Taro.getMenuButtonBoundingClientRect()
1360
1360
  : null;
1361
1361
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
1362
1362
  let gap = 0;
1363
1363
  let width = 96;
1364
1364
  if (systemInfo.platform === "android") {
1365
1365
  gap = 8;
1366
1366
  width = 96;
1367
1367
  } else if (systemInfo.platform === "devtools") {
1368
1368
  if (isIOS) {
1369
1369
  gap = 5.5;
1370
1370
  } else {
1371
1371
  gap = 7.5;
1372
1372
  }
1373
1373
  } else {
1374
1374
  gap = 4;
1375
1375
  width = 88;
1376
1376
  }
1377
1377
  rect = {
1378
1378
  bottom: systemInfo.statusBarHeight + gap + 32,
1379
1379
  height: 32,
1380
1380
  left: systemInfo.windowWidth - width - 10,
1381
1381
  right: systemInfo.windowWidth - 10,
1382
1382
  top: systemInfo.statusBarHeight + gap,
1383
1383
  width,
1384
1384
  };
1385
1385
  }
1386
1386
  const gap = rect.top - systemInfo.statusBarHeight;
1387
1387
  systemInfo.navBarTopToStatusBar = gap;
1388
1388
  systemInfo.navBarHeight = 2 * gap + rect.height;
1389
1389
  systemInfo.capsulePosition = rect;
1390
1390
  systemInfo.isIOS = isIOS;
1391
1391
  systemInfo.isAndroid = isAndroid;
1392
1392
  return systemInfo;
1393
1393
  if (str.match(/^\/\//)) {
1394
1394
  str = "https:" + str;
1395
1395
  }
1396
1396
  return str;
1397
1397
  dateTimeOrdate: Date | string | number | null,
1398
1398
  format = "yyyy-MM-dd HH:mm:ss",
1399
1399
  noPadStart = {
1400
1400
  M: "0",
1401
1401
  d: "0",
1402
1402
  H: "0",
1403
1403
  m: "0",
1404
1404
  s: "0",
1405
1405
  }
1406
1406
  let dateResult = "";
1407
1407
  const padStarts = Object.assign(
1408
1408
  {
1409
1409
  M: "0",
1410
1410
  d: "0",
1411
1411
  H: "0",
1412
1412
  m: "0",
1413
1413
  s: "0",
1414
1414
  },
1415
1415
  noPadStart
1416
1416
  );
1417
1417
  if (dateTimeOrdate) {
1418
1418
  let changeDateTimeOrdate = dateTimeOrdate;
1419
1419
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate);
1420
1420
  if (getChangeDateTimeToNumber) {
1421
1421
  changeDateTimeOrdate = getChangeDateTimeToNumber;
1422
1422
  } else {
1423
1423
  changeDateTimeOrdate = `${changeDateTimeOrdate}`
1424
1424
  .replace(/-/g, "/")
1425
1425
  .replace(/\./g, "/");
1426
1426
  }
1427
1427
  const nowDate =
1428
1428
  dateTimeOrdate instanceof Date
1429
1429
  ? dateTimeOrdate
1430
1430
  : new Date(changeDateTimeOrdate);
1431
1431
  const dateMap = {
1432
1432
  y: `${nowDate.getFullYear()}`,
1433
1433
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts["M"]),
1434
1434
  d: `${nowDate.getDate()}`.padStart(2, padStarts["d"]),
1435
1435
  H: `${nowDate.getHours()}`.padStart(2, padStarts["H"]),
1436
1436
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts["m"]),
1437
1437
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts["s"]),
1438
1438
  };
1439
1439
  const regDate = new RegExp("y+|M+|d+|H+|m+|s+", "g");
1440
1440
  const regYear = new RegExp("y");
1441
1441
  dateResult = format.replace(regDate, (v) => {
1442
1442
  let changeValue = v;
1443
1443
  if (regYear.test(changeValue)) {
1444
1444
  const thisYear = dateMap.y;
1445
1445
  const subValueLen = 4 - changeValue.length;
1446
1446
  changeValue = thisYear.substr(subValueLen);
1447
1447
  } else {
1448
1448
  const dateKey = v.substr(0, 1);
1449
1449
  changeValue = dateMap[dateKey];
1450
1450
  }
1451
1451
  return changeValue;
1452
1452
  });
1453
1453
  }
1454
1454
  return dateResult;
1455
1455
  let timer: any = null;
1456
1456
  let startTime = Date.now();
1457
1457
  return function () {
1458
1458
  const curTime = Date.now();
1459
1459
  const remaining = delay - (curTime - startTime);
1460
1460
  const context = this;
1461
1461
  const args = arguments;
1462
1462
  clearTimeout(timer);
1463
1463
  if (remaining <= 0) {
1464
1464
  func.apply(context, args);
1465
1465
  startTime = Date.now();
1466
1466
  } else {
1467
1467
  timer = setTimeout(func, remaining);
1468
1468
  }
1469
1469
  };
1470
1470
  let context, args, result;
1471
1471
  let timeout = null;
1472
1472
  let previous = 0;
1473
1473
  if (!options) options = {};
1474
1474
  const later = function () {
1475
1475
  previous = options.leading === false ? 0 : Date.now();
1476
1476
  timeout = null;
1477
1477
  result = func.apply(context, args);
1478
1478
  if (!timeout) context = args = null;
1479
1479
  };
1480
1480
  return function () {
1481
1481
  const now = Date.now();
1482
1482
  if (!previous && options.leading === false) previous = now;
1483
1483
  const remaining = wait - (now - previous);
1484
1484
  context = this;
1485
1485
  args = arguments;
1486
1486
  if (remaining <= 0 || remaining > wait) {
1487
1487
  if (timeout) {
1488
1488
  clearTimeout(timeout);
1489
1489
  timeout = null;
1490
1490
  }
1491
1491
  previous = now;
1492
1492
  result = func.apply(context, args);
1493
1493
  if (!timeout) context = args = null;
1494
1494
  } else if (!timeout && options.trailing !== false) {
1495
1495
  timeout = setTimeout(later, remaining);
1496
1496
  }
1497
1497
  return result;
1498
1498
  };
1499
1499
  let timer: any = null;
1500
1500
  return function () {
1501
1501
  const context: any = this;
1502
1502
  const args = arguments;
1503
1503
  timer && clearTimeout(timer);
1504
1504
  timer = setTimeout(function () {
1505
1505
  fn.apply(context, args);
1506
1506
  }, delay);
1507
1507
  };
1508
1508
  if (txt) {
1509
1509
  txt = txt.trim();
1510
1510
  const reg = new RegExp(/[\d-]+/);
1511
1511
  const res = reg.exec(txt);
1512
1512
  if (res && res.length > 0) {
1513
1513
  let tel = res[0];
1514
1514
  if (tel && delSeparator) {
1515
1515
  tel = tel.replace(/-/g, "");
1516
1516
  }
1517
1517
  return tel;
1518
1518
  }
1519
1519
  }
1520
1520
  return "";
1521
1521
  if (rgb) {
1522
1522
  const reg = /^(rgb|RGB)/;
1523
1523
  const color = rgb;
1524
1524
  if (reg.test(color)) {
1525
1525
  let strHex = "#";
1526
1526
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
1527
1527
  for (let i = 0; i < colorArr.length; i++) {
1528
1528
  let hex = Number(colorArr[i]).toString(16);
1529
1529
  if (hex === "0") {
1530
1530
  hex += hex;
1531
1531
  }
1532
1532
  strHex += hex;
1533
1533
  }
1534
1534
  return strHex;
1535
1535
  } else {
1536
1536
  return String(color);
1537
1537
  }
1538
1538
  } else {
1539
1539
  return "";
1540
1540
  }
1541
1541
  if (hex) {
1542
1542
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
1543
1543
  let color = hex.toLowerCase();
1544
1544
  if (reg.test(color)) {
1545
1545
  if (color.length === 4) {
1546
1546
  let colorNew = "#";
1547
1547
  for (let i = 1; i < 4; i += 1) {
1548
1548
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
1549
1549
  }
1550
1550
  color = colorNew;
1551
1551
  }
1552
1552
  const colorChange: number[] = [];
1553
1553
  for (let i = 1; i < 7; i += 2) {
1554
1554
  colorChange.push(parseInt("0x" + color.slice(i, i + 2)));
1555
1555
  }
1556
1556
  if (returnList) {
1557
1557
  return colorChange;
1558
1558
  } else {
1559
1559
  return "RGB(" + colorChange.join(",") + ")";
1560
1560
  }
1561
1561
  } else {
1562
1562
  return color;
1563
1563
  }
1564
1564
  } else {
1565
1565
  return "";
1566
1566
  }
1567
1567
  n: number,
1568
1568
  m: number,
1569
1569
  filterNum: number | undefined = undefined
1570
1570
  const c = m - n + 1;
1571
1571
  const res = Math.floor(Math.random() * c + n);
1572
1572
  if (filterNum && filterNum == res) {
1573
1573
  console.log("随机数二次开始", res, filterNum);
1574
1574
  return getRandom(n, m, filterNum);
1575
1575
  } else {
1576
1576
  return res;
1577
1577
  }
1578
1578
  wqCookieStr: string;
1579
1579
  wqCookie: {
1580
1580
  pin?: string;
1581
1581
  visitkey?: string;
1582
1582
  [key: string]: any;
1583
1583
  };
1584
1584
  const {
1585
1585
  jdpin,
1586
1586
  pinStatus,
1587
1587
  visitkey,
1588
1588
  unionid,
1589
1589
  skey,
1590
1590
  __jda,
1591
1591
  __jdv,
1592
1592
  __wga,
1593
1593
  wid,
1594
1594
  wq_skey,
1595
1595
  wq_uin,
1596
1596
  wq_auth_token,
1597
1597
  wxapp_scene,
1598
1598
  wq_unionid,
1599
1599
  wxapp_openid,
1600
1600
  wxapp_version,
1601
1601
  wxapp_type,
1602
1602
  appType,
1603
1603
  } = cookie;
1604
1604
  const ret: string[] = [];
1605
1605
  const getUserCookieObj = {};
1606
1606
  const createUseCookieArr = [
1607
1607
  jdpin,
1608
1608
  pinStatus,
1609
1609
  visitkey,
1610
1610
  unionid,
1611
1611
  skey,
1612
1612
  __jda,
1613
1613
  __jdv,
1614
1614
  __wga,
1615
1615
  wid,
1616
1616
  wq_skey,
1617
1617
  wq_uin,
1618
1618
  wq_auth_token,
1619
1619
  wxapp_scene,
1620
1620
  wq_unionid,
1621
1621
  wxapp_openid,
1622
1622
  wxapp_version,
1623
1623
  wxapp_type,
1624
1624
  appType,
1625
1625
  ];
1626
1626
  createUseCookieArr.forEach((keyItem) => {
1627
1627
  if (keyItem && keyItem["name"]) {
1628
1628
  let { name, value } = keyItem;
1629
1629
  name = name === "jdpin" ? "pin" : name;
1630
1630
  name === "pin" && ret.push(`pt_pin=${encodeURIComponent(value)}`);
1631
1631
  ret.push(`${name}=${encodeURIComponent(value)}`);
1632
1632
  getUserCookieObj[name] = value;
1633
1633
  }
1634
1634
  });
1635
1635
  return {
1636
1636
  wqCookieStr: ret.join(";"),
1637
1637
  wqCookie: getUserCookieObj,
1638
1638
  };
1639
1639
  num,
1640
1640
  widthSize = 375,
1641
1641
  layoutWidth = windowWidth
1642
1642
  const getNum = Number(num);
1643
1643
  return Math.round((getNum / widthSize) * layoutWidth);
1644
1644
  let checkState = false;
1645
1645
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag;
1646
1646
  if (couponFloorModuleType === FloorModuleType.COUPON) {
1647
1647
  try {
1648
1648
  const dataDefines = getFloorDataToDataDefines(floorData);
1649
1649
  const couponDataDefine = dataDefines
1650
1650
  ? dataDefines.filter((item) => {
1651
1651
  return item.type === "coupon";
1652
1652
  })
1653
1653
  : [],
1654
1654
  couponList = couponDataDefine[0]?.nodeText?.data
1655
1655
  ? couponDataDefine[0]?.nodeText?.data
1656
1656
  : [],
1657
1657
  couponLength = couponList.length,
1658
1658
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
1659
1659
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
1660
1660
  : 0;
1661
1661
  if (numShowPerLine === 0 && couponLength > 3) {
1662
1662
  checkState = true;
1663
1663
  }
1664
1664
  } catch (e) {
1665
1665
  checkState = false;
1666
1666
  }
1667
1667
  return checkState;
1668
1668
  }
1669
1669
  const {
1670
1670
  containers = [],
1671
1671
  floors = [],
1672
1672
  clearFirstContaierMarginTop = false,
1673
1673
  isLuxuryShop = false,
1674
1674
  isShowNativeImmersivePlayer = false,
1675
1675
  screenHeight = null,
1676
1676
  screenWidth = null,
1677
1677
  bottomBarHeight = null,
1678
1678
  } = pageData;
1679
1679
  console.log("dealShopContentData:", pageData, "isvdev:", isvdev);
1680
1680
  const getThisTimeKey = Date.now();
1681
1681
  let shopContentContainerListData = containers?.filter(
1682
1682
  (item) => (!isvdev && item.typeCode !== "mShopHeader") || isvdev
1683
1683
  );
1684
1684
  const shopContentFloorListData = floors?.filter(
1685
1685
  ({ floorPosition }) =>
1686
1686
  (!isvdev && floorPosition !== "header" && floorPosition !== "footer") ||
1687
1687
  isvdev
1688
1688
  );
1689
1689
  const unableIsvContainerListData = getUnableIsvContainerListData(
1690
1690
  shopContentFloorListData,
1691
1691
  shopContentContainerListData,
1692
1692
  exceptionReportFn
1693
1693
  );
1694
1694
  shopContentContainerListData.forEach((item, index) => {
1695
1695
  item.key = `${getThisTimeKey + index}`;
1696
1696
  item.floors = [];
1697
1697
  item.includeUids &&
1698
1698
  item.includeUids.forEach((floorUid) => {
1699
1699
  const getFloorData = shopContentFloorListData.find(
1700
1700
  (floorItem) => floorItem.uid === floorUid
1701
1701
  );
1702
1702
  if (getFloorData) {
1703
1703
  const changeFloorData = {
1704
1704
  containerId: item.containerId,
1705
1705
  containerIndex: index,
1706
1706
  ...getFloorData,
1707
1707
  };
1708
1708
  const getCheckMoreCouponState =
1709
1709
  checkCouponAndChangeContainerSetData(getFloorData);
1710
1710
  if (getCheckMoreCouponState) {
1711
1711
  item.marginLeft && (item.marginLeft = 0);
1712
1712
  item.marginRight && (item.marginRight = 0);
1713
1713
  item.borderRadius && (item.borderRadius = 0);
1714
1714
  }
1715
1715
  if (getFloorData?.floorExtInfo?.floorLoadWay === 2) {
1716
1716
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(
1717
1717
  getFloorData,
1718
1718
  exceptionReportFn
1719
1719
  );
1720
1720
  !getSysFloorToLoadTypeRes &&
1721
1721
  (getFloorData.floorExtInfo.floorLoadWay = 1);
1722
1722
  }
1723
1723
  item.floors.push(changeFloorData);
1724
1724
  }
1725
1725
  });
1726
1726
  if (
1727
1727
  ((!isvdev && index === 0) || (isvdev && index === 1)) &&
1728
1728
  item?.containerPosition == "content" &&
1729
1729
  item?.marginBottom > 0 &&
1730
1730
  !clearFirstContaierMarginTop
1731
1731
  ) {
1732
1732
  item.marginTop = item.marginBottom;
1733
1733
  }
1734
1734
  });
1735
1735
  shopContentContainerListData = shopContentContainerListData.filter(
1736
1736
  (item) =>
1737
1737
  item.floors.length > 0 &&
1738
1738
  unableIsvContainerListData.every(
1739
1739
  (containerItem) => containerItem.containerId != item.containerId
1740
1740
  )
1741
1741
  );
1742
1742
  console.log(
1743
1743
  "dealShopContentData isWxMinAndWxapp:",
1744
1744
  isWxMinAndWxapp,
1745
1745
  "weappJumpToH5:",
1746
1746
  pageData?.homeExtInfo?.weappJumpToH5
1747
1747
  );
1748
1748
  if (isProd && isWxMinAndWxapp) {
1749
1749
  shopContentContainerListData = shopContentContainerListData.filter(
1750
1750
  (item) =>
1751
1751
  item.floors.length > 0 &&
1752
1752
  !isIsvContainer(
1753
1753
  item.containerId,
1754
1754
  shopContentFloorListData,
1755
1755
  shopContentContainerListData
1756
1756
  )
1757
1757
  );
1758
1758
  }
1759
1759
  shopContentContainerListData = [].concat(shopContentContainerListData);
1760
1760
  return {
1761
1761
  shopContentContainerListData,
1762
1762
  shopContentFloorListData,
1763
1763
  };
1764
1764
  const changeOpts = {
1765
1765
  title: "",
1766
1766
  icon: "success",
1767
1767
  duration: 1500,
1768
1768
  mask: true,
1769
1769
  ...options,
1770
1770
  };
1771
1771
  if (changeOpts.title.length > 7) {
1772
1772
  showNormalToast(options);
1773
1773
  } else {
1774
1774
  Taro.showToast(changeOpts as any);
1775
1775
  }
1776
1776
  const changeOpts = {
1777
1777
  title: "",
1778
1778
  icon: "error",
1779
1779
  duration: 1500,
1780
1780
  mask: true,
1781
1781
  ...options,
1782
1782
  };
1783
1783
  if (changeOpts.title.length > 7) {
1784
1784
  showNormalToast(options);
1785
1785
  } else {
1786
1786
  Taro.showToast(changeOpts as any);
1787
1787
  }
1788
1788
  Taro.showToast({
1789
1789
  title: "",
1790
1790
  icon: "none",
1791
1791
  duration: 1500,
1792
1792
  mask: true,
1793
1793
  ...options,
1794
1794
  });
1795
1795
  return Taro.showLoading({
1796
1796
  title: text,
1797
1797
  });
1798
1798
  return new Promise(() => {
1799
1799
  Taro.nextTick(() => {
1800
1800
  setTimeout(() => {
1801
1801
  Taro.hideLoading(options);
1802
1802
  }, 300);
1803
1803
  });
1804
1804
  });
1805
1805
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
1806
1806
  const {
1807
1807
  tabActive = SECTION_HOME_TAB_NAME_TYPE[
1808
1808
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
1809
1809
  ],
1810
1810
  sceneId,
1811
1811
  } = query;
1812
1812
  let changeTabActive = tabActive;
1813
1813
  if (sceneId) {
1814
1814
  if (isH5) {
1815
1815
  if (sceneId == "1002") {
1816
1816
  changeTabActive =
1817
1817
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1818
1818
  }
1819
1819
  else if (sceneId == "1003") {
1820
1820
  changeTabActive =
1821
1821
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY];
1822
1822
  }
1823
1823
  } else if (isWxMinAndWxapp) {
1824
1824
  if (sceneId == "1001" || sceneId == "1002") {
1825
1825
  changeTabActive =
1826
1826
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1827
1827
  }
1828
1828
  else if (sceneId == "1003") {
1829
1829
  changeTabActive =
1830
1830
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION];
1831
1831
  }
1832
1832
  }
1833
1833
  }
1834
1834
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
1835
1835
  return {
1836
1836
  menuType: SHOP_MENU_ID_TYPE.HOME,
1837
1837
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
1838
1838
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
1839
1839
  };
1840
1840
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
1841
1841
  return {
1842
1842
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
1843
1843
  tabActiveType: 0,
1844
1844
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
1845
1845
  };
1846
1846
  } else {
1847
1847
  return {
1848
1848
  menuType: SHOP_MENU_ID_TYPE.HOME,
1849
1849
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
1850
1850
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
1851
1851
  };
1852
1852
  }
1853
1853
  const deleteKeyList = [
1854
1854
  "$taroTimestamp",
1855
1855
  "cookie",
1856
1856
  "wdref",
1857
1857
  "navStart",
1858
1858
  "originOpts",
1859
1859
  "originParams",
1860
1860
  "originUrl",
1861
1861
  "referer",
1862
1862
  "stamp",
1863
1863
  "hybrid",
1864
1864
  "sr",
1865
1865
  "navh",
1866
1866
  "stath",
1867
1867
  ];
1868
1868
  let changeQueryData: any = { ...queryData };
1869
1869
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false;
1870
1870
  const sceneQuery =
1871
1871
  qrCodeScene && typeof qrCodeScene == "string"
1872
1872
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
1873
1873
  : {};
1874
1874
  changeQueryData = { ...changeQueryData, ...sceneQuery };
1875
1875
  deleteKeyList.forEach((key) => {
1876
1876
  changeQueryData[key] && delete changeQueryData[key];
1877
1877
  });
1878
1878
  changeQueryData["shopid"] &&
1879
1879
  (changeQueryData["shopId"] = changeQueryData["shopid"]) &&
1880
1880
  delete changeQueryData["shopid"];
1881
1881
  changeQueryData["venderid"] &&
1882
1882
  (changeQueryData["venderId"] = changeQueryData["venderid"]) &&
1883
1883
  delete changeQueryData["venderid"];
1884
1884
  changeQueryData["vendorId"] &&
1885
1885
  (changeQueryData["venderId"] = changeQueryData["vendorId"]) &&
1886
1886
  delete changeQueryData["vendorId"];
1887
1887
  return changeQueryData;
1888
1888
  let isUsable = false;
1889
1889
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult;
1890
1890
  const modularPackResultObj = formatPackResult(modularPackResult);
1891
1891
  const bundleUrl = getBundleUrl(modularPackResultObj);
1892
1892
  const bundleFileName = getBundleFileName(modularPackResultObj);
1893
1893
  const taroVersion = getTaroVersion(modularPackResultObj);
1894
1894
  if (bundleUrl && bundleFileName) {
1895
1895
  isUsable = true;
1896
1896
  }
1897
1897
  if (!isUsable && typeof exceptionReportFn === "function") {
1898
1898
  exceptionReportFn({
1899
1899
  code: `${NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG}${
1900
1900
  floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE
1901
1901
  ? SgmCustomCode.SYSTEMPDCMODULE_DATA
1902
1902
  : SgmCustomCode.REMOTEMODULE_DATA
1903
1903
  }`,
1904
1904
  msg: {
1905
1905
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
1906
1906
  floorIdx: floorData?.floorIdx,
1907
1907
  uid: floorData?.uid,
1908
1908
  shopId: floorData?.floorExtInfo?.shopId,
1909
1909
  moduleId: floorData?.moduleId,
1910
1910
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
1911
1911
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
1912
1912
  floorKind: floorData?.floorExtInfo?.floorKind,
1913
1913
  middleTemplateId: floorData?.middleTemplateId,
1914
1914
  modularPackResult: {
1915
1915
  bundleUrl,
1916
1916
  taroVersion,
1917
1917
  },
1918
1918
  },
1919
1919
  });
1920
1920
  }
1921
1921
  return isUsable;
1922
1922
  const objContainer = containerListData.find(
1923
1923
  (item) => item.containerId === containerId
1924
1924
  );
1925
1925
  return (
1926
1926
  objContainer?.includeUids?.some((itemUid) => {
1927
1927
  const objectFloor = floorListData.find(
1928
1928
  (floorItem) => itemUid === floorItem.uid
1929
1929
  );
1930
1930
  return RemoteLoadFloorList.includes(
1931
1931
  objectFloor?.floorExtInfo?.moduleFlag
1932
1932
  );
1933
1933
  }) ?? false
1934
1934
  );
1935
1935
  floorListData,
1936
1936
  containerListData,
1937
1937
  exceptionReportFn?
1938
1938
  const unableIsvFloorListData = floorListData.filter(
1939
1939
  (floorItem) =>
1940
1940
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
1941
1941
  !isIsvFloorUseable(floorItem, exceptionReportFn)
1942
1942
  );
1943
1943
  const unableIsvFloorUidList = unableIsvFloorListData.map(
1944
1944
  (floorItem) => floorItem.uid
1945
1945
  );
1946
1946
  const unableIsvContainerListData = containerListData.filter(
1947
1947
  (item) =>
1948
1948
  item.includeUids &&
1949
1949
  item.includeUids.every(
1950
1950
  (itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1
1951
1951
  )
1952
1952
  );
1953
1953
  return unableIsvContainerListData;
1954
1954
  return -2;
1955
1955
  return customObj;
1956
1956
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl);
1957
1957
  let getParams = false;
1958
1958
  if (isOpenJdAppUrl(openAppUrl)) {
1959
1959
  try {
1960
1960
  getParams = openAppUrl.replace(
1961
1961
  /openApp\.jdMobile:\/\/virtual\?params=/i,
1962
1962
  ""
1963
1963
  );
1964
1964
  getParams = JSON.parse(String(getParams));
1965
1965
  } catch (e) {
1966
1966
  console.log(e);
1967
1967
  }
1968
1968
  }
1969
1969
  return getParams;
1970
1970
  const getLastParams = Object.assign({}, openParams);
1971
1971
  return `openapp.jdmobile://virtual?params=${JSON.stringify(getLastParams)}`;
1972
1972
  if (val === null || val === "" || typeof val === "undefined") {
1973
1973
  return true;
1974
1974
  }
1975
1975
  return false;
1976
1976
  const {
1977
1977
  moduleId = "none",
1978
1978
  entrance = "none",
1979
1979
  sourceType = "none",
1980
1980
  sourceValue = "none",
1981
1981
  } = params;
1982
1982
  if (isIosDevice) {
1983
1983
  return `${moduleId}#${entrance}`;
1984
1984
  } else if (isAndroidDevice) {
1985
1985
  return `${sourceType}#${sourceValue}`;
1986
1986
  }
1987
1987
  return "none#none";
1988
1988
  if (data && typeof data === "object") {
1989
1989
  let getOpenAppData = { ...data };
1990
1990
  try {
1991
1991
  const { sourceInfo, designerId, templateId, source } = getOpenAppData;
1992
1992
  if (designerId && templateId) {
1993
1993
  getOpenAppData = Object.assign({}, getOpenAppData, {
1994
1994
  sourceInfo: {
1995
1995
  entrance: "设计师预览",
1996
1996
  },
1997
1997
  });
1998
1998
  } else if (sourceInfo) {
1999
1999
  const { entrance } = sourceInfo;
2000
2000
  getOpenAppData.sourceInfo.entrance =
2001
2001
  entrance && entrance.length > 0 ? entrance : "其他";
2002
2002
  } else if (source && !sourceInfo) {
2003
2003
  if (typeof source === "object") {
2004
2004
  const { sourceType, entrance, sourceValue, moduleId } = source;
2005
2005
  getOpenAppData = Object.assign({}, getOpenAppData, {
2006
2006
  sourceInfo: {
2007
2007
  entrance: sourceType || entrance || "其他",
2008
2008
  moduleId: sourceValue || moduleId || "-100",
2009
2009
  },
2010
2010
  });
2011
2011
  } else {
2012
2012
  getOpenAppData = Object.assign({}, getOpenAppData, {
2013
2013
  sourceInfo: {
2014
2014
  entrance: source,
2015
2015
  },
2016
2016
  });
2017
2017
  }
2018
2018
  } else {
2019
2019
  getOpenAppData = Object.assign({}, getOpenAppData, {
2020
2020
  sourceInfo: {
2021
2021
  entrance: "其他",
2022
2022
  },
2023
2023
  });
2024
2024
  }
2025
2025
  } catch (e) {
2026
2026
  console.log(e);
2027
2027
  }
2028
2028
  return getOpenAppData;
2029
2029
  }
2030
2030
  return data;
2031
2031
  return displayObj;
2032
2032
  if (typeof input === "string") {
2033
2033
  try {
2034
2034
  return JSON.parse(input);
2035
2035
  } catch (e) {
2036
2036
  console.error("JSON解析失败", e);
2037
2037
  return {};
2038
2038
  }
2039
2039
  }
2040
2040
  return input || {};
2041
2041
  return false;
2042
2042
  isJdApp,
2043
2043
  isWxApp,
2044
2044
  isIosDevice,
2045
2045
  isAndroidDevice,
2046
2046
  isJdAndIosDevice,
2047
2047
  isJdAndAndroidDevice,
2048
2048
  isWxMin,
2049
2049
  isWxMinAndWxapp,
2050
2050
  isJdMin,
2051
2051
  isMin,
2052
2052
  isJdMinAndHarmony,
2053
2053
  isH5,
2054
2054
  isH5AndJdShopView,
2055
2055
  isImageOptimizeEnable,
2056
2056
  isChartH5,
2057
2057
  isH5AndJdShopViewNativeScroll,
2058
2058
  isH5AndJdShopViewH5Scroll,
2059
2059
  isH5AndJdShopH5CustomScrollView,
2060
2060
  isWxMiniH5View,
2061
2061
  sliceArrToChunkList,
2062
2062
  dealAddress,
2063
2063
  objectToUrlEncode,
2064
2064
  parseQueryUrlString,
2065
2065
  setLowSmallPicUrl,
2066
2066
  getJfsImage,
2067
2067
  getQualityImage,
2068
2068
  countStringify,
2069
2069
  setTaroStorage,
2070
2070
  getTaroStorageKeyValue,
2071
2071
  removeTaroStorageKey,
2072
2072
  clearTaroStorageKey,
2073
2073
  getSystemInfos,
2074
2074
  addHttps,
2075
2075
  dateFormat,
2076
2076
  throttle,
2077
2077
  lodashThrottle,
2078
2078
  debounce,
2079
2079
  getTelephone,
2080
2080
  rgbToHex,
2081
2081
  hexToRgb,
2082
2082
  getRandom,
2083
2083
  getWxAppCookieStr,
2084
2084
  pxTransformFromData,
2085
2085
  dealShopContentData,
2086
2086
  showSuccessToast,
2087
2087
  showFailToast,
2088
2088
  showNormalToast,
2089
2089
  showShopLoading,
2090
2090
  hideShopLoading,
2091
2091
  getAppChannelType,
2092
2092
  formatTabActiveMenuType,
2093
2093
  filterUrlQueryData,
2094
2094
  getAvifSupport,
2095
2095
  getWebpSupport,
2096
2096
  isMemberPage,
2097
2097
  sgmCustomReport,
2098
2098
  isOpenJdAppUrl,
2099
2099
  jdOpenAppParams,
2100
2100
  createJdOpenAppUrl,
2101
2101
  dealJdOpenAppData,
2102
2102
  isEmpty,
2103
2103
  getJdAppReportPageSource,
2104
2104
  isAppClassifyPage,
2105
2105
  getQualityImageNew,
2106
2106
  getQualityImageOld,
2107
2107
  isPc,
2108
2108
  ipLoc_djd,
2109
2109
  jdAppVersionCompare,
2110
2110
  dealNativePixelToCssPixel,
2111
2111
  isAppStowShop,