@conecli/cone-render 0.10.1-isv2.1 → 0.10.1-isv2.2

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