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

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 (111) 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/jssdk.ts +1 -1
  9. package/dist/common/pageType.ts +1 -1
  10. package/dist/common/sgmCustomCode.ts +1 -1
  11. package/dist/common/token/index.h5.ts +1 -1
  12. package/dist/common/token/token.jd.ts +1 -1
  13. package/dist/common/wxappApi.ts +1 -1
  14. package/dist/components/ErrorBoundary.tsx +1 -1
  15. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  16. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  17. package/dist/components/base/CountDown/index.module.scss +49 -44
  18. package/dist/components/base/CountDown/index.tsx +1 -1
  19. package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
  20. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  21. package/dist/components/base/CustomVideo/common.ts +1 -0
  22. package/dist/components/base/CustomVideo/index.tsx +1 -1
  23. package/dist/components/base/Dialog/index.module.scss +11 -0
  24. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  25. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  26. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  27. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  28. package/dist/components/base/InViewRender/index.tsx +1 -1
  29. package/dist/components/base/InViewRender/index.weapp.tsx +1 -1
  30. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  31. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  32. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  33. package/dist/components/base/LazyLayoutLoad/index.weapp.tsx +1 -1
  34. package/dist/components/base/LazyLoadImage/index.h5.module.scss +11 -3
  35. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.tsx +1 -1
  37. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  38. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  39. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  40. package/dist/components/base/Price/Base/index.tsx +1 -1
  41. package/dist/components/base/Price/Double/index.module.scss +8 -0
  42. package/dist/components/base/Price/Double/index.tsx +1 -1
  43. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  44. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  45. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  46. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  47. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  48. package/dist/components/floorItem.jd.tsx +1 -1
  49. package/dist/components/floorItem.tsx +1 -1
  50. package/dist/components/floorItem.weapp.tsx +1 -1
  51. package/dist/components/isv/Floor/index.tsx +1 -1
  52. package/dist/components/remoteFloorItem.tsx +1 -1
  53. package/dist/interface/common.ts +1 -1
  54. package/dist/interface/component.ts +1 -1
  55. package/dist/interface/jumpEventReport.ts +1 -1
  56. package/dist/interface/service.ts +1 -1
  57. package/dist/jumpEventReport/base.ts +1 -1
  58. package/dist/jumpEventReport/const.ts +1 -1
  59. package/dist/jumpEventReport/index.jd.ts +1 -1
  60. package/dist/jumpEventReport/index.weapp.ts +1 -1
  61. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  62. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  63. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  64. package/dist/jumpEventReport/web/report.ts +1 -1
  65. package/dist/jumpEventReport/web.base.ts +1 -1
  66. package/dist/jumpEventReport/web.jd.ts +1 -1
  67. package/dist/jumpEventReport/web.jdb.ts +1 -1
  68. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  69. package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
  70. package/dist/jumpEventReport/web.pc.ts +1 -1
  71. package/dist/jumpEventReport/web.tjapp.ts +1 -1
  72. package/dist/jumpEventReport/web.tjm.ts +1 -1
  73. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  74. package/dist/libs/taroAppReport.js +2 -2
  75. package/dist/modules/ContainerFloorList/index.h5.module.scss +66 -52
  76. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  77. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  78. package/dist/open/api/device.ts +1 -1
  79. package/dist/open/api/environment.ts +1 -1
  80. package/dist/open/api/request.ts +1 -1
  81. package/dist/open/api/shopMember.ts +1 -1
  82. package/dist/open/api/util.ts +1 -1
  83. package/dist/open/components/index.ts +1 -1
  84. package/dist/sass/app.h5.scss +275 -221
  85. package/dist/sass/base.scss +183 -137
  86. package/dist/service/fetchGateway.ts +1 -1
  87. package/dist/service/fetchGateway.weapp.ts +1 -0
  88. package/dist/service/http/colorSign.ts +1 -1
  89. package/dist/service/http/const.ts +1 -1
  90. package/dist/service/http/h5Http.ts +1 -0
  91. package/dist/service/http/index.h5.ts +1 -0
  92. package/dist/service/requestServer.h5.ts +1 -0
  93. package/dist/service/requestServer.ts +1 -1
  94. package/dist/service/requestServer.weapp.ts +1 -0
  95. package/dist/utils/connectNativeJsBridge.ts +1 -1
  96. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  97. package/dist/utils/h5Utils.ts +1 -1
  98. package/dist/utils/index.h5.ts +1 -1
  99. package/dist/utils/index.ts +1 -1
  100. package/dist/utils/index.weapp.ts +1 -1
  101. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  102. package/dist/utils/jumpExtMapUtil.ts +1 -0
  103. package/dist/utils/log.ts +1 -0
  104. package/dist/utils/sColor.js +1 -0
  105. package/dist/utils/sgmCodeUtils.ts +1 -1
  106. package/dist/utils/taroRenderUtil.ts +1 -1
  107. package/dist/utils/utils.ts +1 -1
  108. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  109. package/dist/wxapp/common/user_info.js +1 -1
  110. package/package.json +158 -135
  111. 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
  /ipad/i.test(system) || (/android/i.test(system) && !/mobi|mini|fennec/i.test(system));
1025
1025
  key: string,
1026
1026
  value: string | object,
1027
1027
  successBack?: any,
1028
1028
  failBack?: any,
1029
1029
  try {
1030
1030
  if (isH5 && window && !window.localStorage) {
1031
1031
  console.log(`setTaroStorage key:${key} window.localStorage不存在:`);
1032
1032
  return Promise.resolve(null);
1033
1033
  }
1034
1034
  return Taro.setStorage({
1035
1035
  key: key,
1036
1036
  data: value,
1037
1037
  success: successBack,
1038
1038
  fail: failBack,
1039
1039
  }).catch((e) => {
1040
1040
  console.log(`setTaroStorage key:${key} 报错:`, e);
1041
1041
  return null;
1042
1042
  });
1043
1043
  } catch (e) {
1044
1044
  console.log(`setTaroStorage key:${key} 报错:`, e);
1045
1045
  return Promise.resolve(null);
1046
1046
  }
1047
1047
  try {
1048
1048
  if (isH5 && window && !window.localStorage) {
1049
1049
  console.log(`getTaroStorageKeyValue key:${key} window.localStorage不存在:`);
1050
1050
  return Promise.resolve(null);
1051
1051
  }
1052
1052
  return Taro.getStorageSync(key);
1053
1053
  } catch (e) {
1054
1054
  console.log(`getTaroStorageKeyValue key:${key} 报错:`, e);
1055
1055
  return null;
1056
1056
  }
1057
1057
  try {
1058
1058
  if (isH5 && window && !window.localStorage) {
1059
1059
  console.log(`removeTaroStorageKey key:${key} window.localStorage不存在:`);
1060
1060
  return Promise.resolve(null);
1061
1061
  }
1062
1062
  return Taro.removeStorage({
1063
1063
  key: key,
1064
1064
  }).catch((e) => {
1065
1065
  console.log(`removeTaroStorageKey key:${key} 报错:`, e);
1066
1066
  });
1067
1067
  } catch (e) {
1068
1068
  console.log(`removeTaroStorageKey key:${key} 报错:`, e);
1069
1069
  }
1070
1070
  try {
1071
1071
  if (isH5 && window && !window.localStorage) {
1072
1072
  console.log(`clearTaroStorageKey window.localStorage不存在`);
1073
1073
  return Promise.resolve(null);
1074
1074
  }
1075
1075
  return Taro.clearStorage().catch((e) => {
1076
1076
  console.log('clearTaroStorageKey报错:', e);
1077
1077
  });
1078
1078
  } catch (e) {
1079
1079
  console.log('clearTaroStorageKey报错:', e);
1080
1080
  }
1081
1081
  let hasChecked = false;
1082
1082
  if (isH5) {
1083
1083
  const avifCache = getTaroStorageKeyValue(KEY_AVIF);
1084
1084
  if (avifCache === null || avifCache === '' || forceUpdate) {
1085
1085
  hasChecked = true;
1086
1086
  const img = new Image();
1087
1087
  img.onload = function () {
1088
1088
  if (img.height > 0 && img.width > 0) {
1089
1089
  setTaroStorage(KEY_AVIF, '1');
1090
1090
  } else {
1091
1091
  setTaroStorage(KEY_AVIF, '0');
1092
1092
  }
1093
1093
  };
1094
1094
  img.onerror = () => {
1095
1095
  setTaroStorage(KEY_AVIF, '0');
1096
1096
  };
1097
1097
  img.src =
1098
1098
  'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=';
1099
1099
  }
1100
1100
  const webpCache = getTaroStorageKeyValue(KEY_WEBP);
1101
1101
  if (webpCache === null || webpCache === '' || forceUpdate) {
1102
1102
  hasChecked = true;
1103
1103
  const img = new Image();
1104
1104
  img.onload = function () {
1105
1105
  if (img.height > 0 && img.width > 0) {
1106
1106
  setTaroStorage(KEY_WEBP, '1');
1107
1107
  } else {
1108
1108
  setTaroStorage(KEY_WEBP, '0');
1109
1109
  }
1110
1110
  };
1111
1111
  img.onerror = () => {
1112
1112
  setTaroStorage(KEY_WEBP, '0');
1113
1113
  };
1114
1114
  img.src =
1115
1115
  'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAUAmJaQAA3AA/vz0AAA=';
1116
1116
  }
1117
1117
  }
1118
1118
  return hasChecked;
1119
1119
  const hasChecked = imageFormatSupport(false);
1120
1120
  if (!hasChecked) {
1121
1121
  setTimeout(imageFormatSupport, 5000);
1122
1122
  }
1123
1123
  const resultList: Array<any> = [],
1124
1124
  arrLen = arr.length;
1125
1125
  if (arrLen) {
1126
1126
  if (arrLen > size) {
1127
1127
  for (let i = 0; i < arrLen; i = i + size) {
1128
1128
  resultList.push(arr.slice(i, i + size));
1129
1129
  }
1130
1130
  } else {
1131
1131
  resultList.push(arr);
1132
1132
  }
1133
1133
  }
1134
1134
  return resultList;
1135
1135
  let _address = ids;
1136
1136
  const _areaAreaSplit = ids.split('.');
1137
1137
  const _areaAreaSplit2 = ids.split('_');
1138
1138
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address;
1139
1139
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address;
1140
1140
  return _address;
1141
1141
  let paramStr = '';
1142
1142
  obj &&
1143
1143
  Object.keys(obj).forEach((key, index) => {
1144
1144
  const getValue = `${obj[key]}`.replace(/undefined/, '').replace(/null/, '');
1145
1145
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`;
1146
1146
  });
1147
1147
  return paramStr;
1148
1148
  const result = {};
1149
1149
  if (
1150
1150
  !urlOrQueryStr ||
1151
1151
  ('string' !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
1152
1152
  ) {
1153
1153
  return result;
1154
1154
  }
1155
1155
  if (urlOrQueryStr.indexOf('?') > -1) {
1156
1156
  const queryStr = urlOrQueryStr.split('?');
1157
1157
  const queryItemList = queryStr && queryStr.length > 1 ? queryStr[1].split('&') : [];
1158
1158
  const queryItemListLen = queryItemList.length;
1159
1159
  queryItemListLen > 0 &&
1160
1160
  queryItemList.forEach((item) => {
1161
1161
  const thisItemList = item.split('=');
1162
1162
  result[thisItemList[0]] = thisItemList[1];
1163
1163
  });
1164
1164
  } else {
1165
1165
  const queryItemList =
1166
1166
  urlOrQueryStr.indexOf('&') > -1 ? urlOrQueryStr.split('&') : [urlOrQueryStr];
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
  }
1174
1174
  return result;
1175
1175
  url: string,
1176
1176
  size?: {
1177
1177
  w: number;
1178
1178
  h: number;
1179
1179
  },
1180
1180
  quality?: number,
1181
1181
  if (url && size) {
1182
1182
  const _w = Math.floor(size.w);
1183
1183
  const _h = Math.floor(size.h);
1184
1184
  if (url.match(/gif$/i)) {
1185
1185
  return url;
1186
1186
  } else {
1187
1187
  if (_w > 0 && _h > 0) {
1188
1188
  url = url.replace('jfs/', `s${_w}x${_h}_jfs/`);
1189
1189
  }
1190
1190
  url += quality != null ? `!q${quality}.dpg` : '.dpg';
1191
1191
  }
1192
1192
  }
1193
1193
  return url;
1194
1194
  if (url.match(/\.(jpg|png|dpg)$/i)) {
1195
1195
  const { width, height, quality } = jfsImgInfo;
1196
1196
  if (typeof width === 'number' || typeof height === 'number') {
1197
1197
  url = url.replace('/jfs/', `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`);
1198
1198
  }
1199
1199
  if (typeof quality === 'number' && quality > 0 && quality < 100 && url.match(/\.jpg$/i)) {
1200
1200
  url += `!q${quality}.dpg`;
1201
1201
  }
1202
1202
  }
1203
1203
  return addHttps(url);
1204
1204
  if (imgUrl) {
1205
1205
  if (
1206
1206
  !imgUrl.match(
1207
1207
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
1208
1208
  )
1209
1209
  ) {
1210
1210
  if (!imgUrl.includes('360buyimg.com')) {
1211
1211
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
1212
1212
  }
1213
1213
  if (quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`;
1214
1214
  }
1215
1215
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
1216
1216
  }
1217
1217
  return imgUrl;
1218
1218
  const result = value % step;
1219
1219
  return result === 0 ? value : Math.ceil(value / step) * step;
1220
1220
  const MAX = 3.5;
1221
1221
  return Math.min(window?.devicePixelRatio ?? 2, MAX);
1222
1222
  isSkuImage: boolean;
1223
1223
  size: number;
1224
1224
  imgUrl: string,
1225
1225
  options: QualityOptions,
1226
1226
  isIgnoreOptimizeFromServer: boolean = false,
1227
1227
  if (!imgUrl) {
1228
1228
  console.error('The input parameter imageUrl for the getQualityImage() cannot be empty!');
1229
1229
  return imgUrl;
1230
1230
  }
1231
1231
  if (isIgnoreOptimizeFromServer) {
1232
1232
  imgUrl = imgUrl.replace(/\.(jpe?g|png).*/, '.$1');
1233
1233
  }
1234
1234
  if (!/^((https?):)?\/\//.test(imgUrl)) {
1235
1235
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
1236
1236
  }
1237
1237
  const imgServerRegExp = /(img|m)\d{0,2}\.360buyimg\.com\/.*\.(jpe?g|png)/i;
1238
1238
  if (!imgServerRegExp.test(imgUrl)) {
1239
1239
  return imgUrl;
1240
1240
  }
1241
1241
  imgUrl = /^\/\//.test(imgUrl) ? `https:${imgUrl}` : imgUrl;
1242
1242
  const { isSkuImage, size } = options || {};
1243
1243
  const needReduceSize = isSkuImage && size;
1244
1244
  if (needReduceSize) {
1245
1245
  const devicePixelRatio = getDevicePixelRatio();
1246
1246
  const useWidth = getValueByStep(size * devicePixelRatio, 40);
1247
1247
  imgUrl = imgUrl.replace(/\/[^\/]*jfs\//, `/s${useWidth}x${useWidth}_jfs/`);
1248
1248
  }
1249
1249
  const needCompress = !global?.info?.pageInfo?.isVipShop;
1250
1250
  const result = imgUrl.match(/\/\w+\.(jpe?g|png)$/);
1251
1251
  if (needCompress && result) {
1252
1252
  if (getAvifSupport() === '1') {
1253
1253
  imgUrl += '.avif';
1254
1254
  } else if (getWebpSupport() === '1') {
1255
1255
  imgUrl += '.webp';
1256
1256
  } else if (/jpe?g/.test(result[1])) {
1257
1257
  imgUrl += '!q80';
1258
1258
  }
1259
1259
  }
1260
1260
  if (needReduceSize) {
1261
1261
  imgUrl += '!z2';
1262
1262
  }
1263
1263
  return imgUrl;
1264
1264
  if (imgUrl) {
1265
1265
  if (
1266
1266
  !imgUrl.match(
1267
1267
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
1268
1268
  )
1269
1269
  ) {
1270
1270
  if (!imgUrl.includes('360buyimg.com')) {
1271
1271
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
1272
1272
  }
1273
1273
  if (quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`;
1274
1274
  }
1275
1275
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
1276
1276
  }
1277
1277
  return imgUrl;
1278
1278
  return getTaroStorageKeyValue(KEY_AVIF) || '0';
1279
1279
  return getTaroStorageKeyValue(KEY_WEBP) || '0';
1280
1280
  count: number,
1281
1281
  fixedNum = 1,
1282
1282
  unit = '万',
1283
1283
  maxNum = 10000,
1284
1284
  count = Number(count);
1285
1285
  const getMaxNum = count > 100000000 ? 100000000 : maxNum;
1286
1286
  const getUnit = count > 100000000 ? '亿' : unit;
1287
1287
  if (count >= getMaxNum) {
1288
1288
  return (count / getMaxNum).toFixed(fixedNum) + getUnit;
1289
1289
  }
1290
1290
  return count;
1291
1291
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo || {
1292
1292
  platform: '',
1293
1293
  model: '',
1294
1294
  system: '',
1295
1295
  };
1296
1296
  const isIOS = !!systemInfo.system.match(/ios/i);
1297
1297
  const isAndroid = !!systemInfo.system.match(/android/i);
1298
1298
  if (!systemInfo.statusBarHeight) {
1299
1299
  systemInfo.statusBarHeight = screenHeight - windowHeight - 20;
1300
1300
  systemInfo.navBarExtendHeight = 0;
1301
1301
  } else {
1302
1302
  if (isIOS) {
1303
1303
  systemInfo.navBarExtendHeight = 4;
1304
1304
  } else {
1305
1305
  systemInfo.navBarExtendHeight = 0;
1306
1306
  }
1307
1307
  }
1308
1308
  let rect = Taro.getMenuButtonBoundingClientRect ? Taro.getMenuButtonBoundingClientRect() : null;
1309
1309
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
1310
1310
  let gap = 0;
1311
1311
  let width = 96;
1312
1312
  if (systemInfo.platform === 'android') {
1313
1313
  gap = 8;
1314
1314
  width = 96;
1315
1315
  } else if (systemInfo.platform === 'devtools') {
1316
1316
  if (isIOS) {
1317
1317
  gap = 5.5;
1318
1318
  } else {
1319
1319
  gap = 7.5;
1320
1320
  }
1321
1321
  } else {
1322
1322
  gap = 4;
1323
1323
  width = 88;
1324
1324
  }
1325
1325
  rect = {
1326
1326
  bottom: systemInfo.statusBarHeight + gap + 32,
1327
1327
  height: 32,
1328
1328
  left: systemInfo.windowWidth - width - 10,
1329
1329
  right: systemInfo.windowWidth - 10,
1330
1330
  top: systemInfo.statusBarHeight + gap,
1331
1331
  width,
1332
1332
  };
1333
1333
  }
1334
1334
  const gap = rect.top - systemInfo.statusBarHeight;
1335
1335
  systemInfo.navBarTopToStatusBar = gap;
1336
1336
  systemInfo.navBarHeight = 2 * gap + rect.height;
1337
1337
  systemInfo.capsulePosition = rect;
1338
1338
  systemInfo.isIOS = isIOS;
1339
1339
  systemInfo.isAndroid = isAndroid;
1340
1340
  return systemInfo;
1341
1341
  if (str.match(/^\/\//)) {
1342
1342
  str = 'https:' + str;
1343
1343
  }
1344
1344
  return str;
1345
1345
  dateTimeOrdate: Date | string | number | null,
1346
1346
  format = 'yyyy-MM-dd HH:mm:ss',
1347
1347
  noPadStart = {
1348
1348
  M: '0',
1349
1349
  d: '0',
1350
1350
  H: '0',
1351
1351
  m: '0',
1352
1352
  s: '0',
1353
1353
  },
1354
1354
  let dateResult = '';
1355
1355
  const padStarts = Object.assign(
1356
1356
  {
1357
1357
  M: '0',
1358
1358
  d: '0',
1359
1359
  H: '0',
1360
1360
  m: '0',
1361
1361
  s: '0',
1362
1362
  },
1363
1363
  noPadStart,
1364
1364
  );
1365
1365
  if (dateTimeOrdate) {
1366
1366
  let changeDateTimeOrdate = dateTimeOrdate;
1367
1367
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate);
1368
1368
  if (getChangeDateTimeToNumber) {
1369
1369
  changeDateTimeOrdate = getChangeDateTimeToNumber;
1370
1370
  } else {
1371
1371
  changeDateTimeOrdate = `${changeDateTimeOrdate}`.replace(/-/g, '/').replace(/\./g, '/');
1372
1372
  }
1373
1373
  const nowDate =
1374
1374
  dateTimeOrdate instanceof Date ? dateTimeOrdate : new Date(changeDateTimeOrdate);
1375
1375
  const dateMap = {
1376
1376
  y: `${nowDate.getFullYear()}`,
1377
1377
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts['M']),
1378
1378
  d: `${nowDate.getDate()}`.padStart(2, padStarts['d']),
1379
1379
  H: `${nowDate.getHours()}`.padStart(2, padStarts['H']),
1380
1380
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts['m']),
1381
1381
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts['s']),
1382
1382
  };
1383
1383
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g');
1384
1384
  const regYear = new RegExp('y');
1385
1385
  dateResult = format.replace(regDate, (v) => {
1386
1386
  let changeValue = v;
1387
1387
  if (regYear.test(changeValue)) {
1388
1388
  const thisYear = dateMap.y;
1389
1389
  const subValueLen = 4 - changeValue.length;
1390
1390
  changeValue = thisYear.substr(subValueLen);
1391
1391
  } else {
1392
1392
  const dateKey = v.substr(0, 1);
1393
1393
  changeValue = dateMap[dateKey];
1394
1394
  }
1395
1395
  return changeValue;
1396
1396
  });
1397
1397
  }
1398
1398
  return dateResult;
1399
1399
  let timer: any = null;
1400
1400
  let startTime = Date.now();
1401
1401
  return function () {
1402
1402
  const curTime = Date.now();
1403
1403
  const remaining = delay - (curTime - startTime);
1404
1404
  const context = this;
1405
1405
  const args = arguments;
1406
1406
  clearTimeout(timer);
1407
1407
  if (remaining <= 0) {
1408
1408
  func.apply(context, args);
1409
1409
  startTime = Date.now();
1410
1410
  } else {
1411
1411
  timer = setTimeout(func, remaining);
1412
1412
  }
1413
1413
  };
1414
1414
  let context, args, result;
1415
1415
  let timeout = null;
1416
1416
  let previous = 0;
1417
1417
  if (!options) options = {};
1418
1418
  const later = function () {
1419
1419
  previous = options.leading === false ? 0 : Date.now();
1420
1420
  timeout = null;
1421
1421
  result = func.apply(context, args);
1422
1422
  if (!timeout) context = args = null;
1423
1423
  };
1424
1424
  return function () {
1425
1425
  const now = Date.now();
1426
1426
  if (!previous && options.leading === false) previous = now;
1427
1427
  const remaining = wait - (now - previous);
1428
1428
  context = this;
1429
1429
  args = arguments;
1430
1430
  if (remaining <= 0 || remaining > wait) {
1431
1431
  if (timeout) {
1432
1432
  clearTimeout(timeout);
1433
1433
  timeout = null;
1434
1434
  }
1435
1435
  previous = now;
1436
1436
  result = func.apply(context, args);
1437
1437
  if (!timeout) context = args = null;
1438
1438
  } else if (!timeout && options.trailing !== false) {
1439
1439
  timeout = setTimeout(later, remaining);
1440
1440
  }
1441
1441
  return result;
1442
1442
  };
1443
1443
  let timer: any = null;
1444
1444
  return function () {
1445
1445
  const context: any = this;
1446
1446
  const args = arguments;
1447
1447
  timer && clearTimeout(timer);
1448
1448
  timer = setTimeout(function () {
1449
1449
  fn.apply(context, args);
1450
1450
  }, delay);
1451
1451
  };
1452
1452
  if (txt) {
1453
1453
  txt = txt.trim();
1454
1454
  const reg = new RegExp(/[\d-]+/);
1455
1455
  const res = reg.exec(txt);
1456
1456
  if (res && res.length > 0) {
1457
1457
  let tel = res[0];
1458
1458
  if (tel && delSeparator) {
1459
1459
  tel = tel.replace(/-/g, '');
1460
1460
  }
1461
1461
  return tel;
1462
1462
  }
1463
1463
  }
1464
1464
  return '';
1465
1465
  if (rgb) {
1466
1466
  const reg = /^(rgb|RGB)/;
1467
1467
  const color = rgb;
1468
1468
  if (reg.test(color)) {
1469
1469
  let strHex = '#';
1470
1470
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
1471
1471
  for (let i = 0; i < colorArr.length; i++) {
1472
1472
  let hex = Number(colorArr[i]).toString(16);
1473
1473
  if (hex === '0') {
1474
1474
  hex += hex;
1475
1475
  }
1476
1476
  strHex += hex;
1477
1477
  }
1478
1478
  return strHex;
1479
1479
  } else {
1480
1480
  return String(color);
1481
1481
  }
1482
1482
  } else {
1483
1483
  return '';
1484
1484
  }
1485
1485
  if (hex) {
1486
1486
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
1487
1487
  let color = hex.toLowerCase();
1488
1488
  if (reg.test(color)) {
1489
1489
  if (color.length === 4) {
1490
1490
  let colorNew = '#';
1491
1491
  for (let i = 1; i < 4; i += 1) {
1492
1492
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
1493
1493
  }
1494
1494
  color = colorNew;
1495
1495
  }
1496
1496
  const colorChange: number[] = [];
1497
1497
  for (let i = 1; i < 7; i += 2) {
1498
1498
  colorChange.push(parseInt('0x' + color.slice(i, i + 2)));
1499
1499
  }
1500
1500
  if (returnList) {
1501
1501
  return colorChange;
1502
1502
  } else {
1503
1503
  return 'RGB(' + colorChange.join(',') + ')';
1504
1504
  }
1505
1505
  } else {
1506
1506
  return color;
1507
1507
  }
1508
1508
  } else {
1509
1509
  return '';
1510
1510
  }
1511
1511
  const c = m - n + 1;
1512
1512
  const res = Math.floor(Math.random() * c + n);
1513
1513
  if (filterNum && filterNum == res) {
1514
1514
  console.log('随机数二次开始', res, filterNum);
1515
1515
  return getRandom(n, m, filterNum);
1516
1516
  } else {
1517
1517
  return res;
1518
1518
  }
1519
1519
  wqCookieStr: string;
1520
1520
  wqCookie: {
1521
1521
  pin?: string;
1522
1522
  visitkey?: string;
1523
1523
  [key: string]: any;
1524
1524
  };
1525
1525
 
1526
1526
  const {
1527
1527
  jdpin,
1528
1528
  pinStatus,
1529
1529
  visitkey,
1530
1530
  unionid,
1531
1531
  skey,
1532
1532
  __jda,
1533
1533
  __jdv,
1534
1534
  __wga,
1535
1535
  wid,
1536
1536
  wq_skey,
1537
1537
  wq_uin,
1538
1538
  wq_auth_token,
1539
1539
  wxapp_scene,
1540
1540
  wq_unionid,
1541
1541
  wxapp_openid,
1542
1542
  wxapp_version,
1543
1543
  wxapp_type,
1544
1544
  appType,
1545
1545
  lbs_addr,
1546
1546
  } = cookie;
1547
1547
  const ret: string[] = [];
1548
1548
  const getUserCookieObj = {};
1549
1549
  const createUseCookieArr = [
1550
1550
  jdpin,
1551
1551
  pinStatus,
1552
1552
  visitkey,
1553
1553
  unionid,
1554
1554
  skey,
1555
1555
  __jda,
1556
1556
  __jdv,
1557
1557
  __wga,
1558
1558
  wid,
1559
1559
  wq_skey,
1560
1560
  wq_uin,
1561
1561
  wq_auth_token,
1562
1562
  wxapp_scene,
1563
1563
  wq_unionid,
1564
1564
  wxapp_openid,
1565
1565
  wxapp_version,
1566
1566
  wxapp_type,
1567
1567
  appType,
1568
1568
  lbs_addr,
1569
1569
  ];
1570
1570
 
1571
1571
  createUseCookieArr.forEach((keyItem) => {
1572
1572
  if (keyItem && keyItem['name']) {
1573
1573
  let { name, value } = keyItem;
1574
1574
  name = name === 'jdpin' ? 'pin' : name;
1575
1575
  name === 'pin' && ret.push(`pt_pin=${encodeURIComponent(value)}`);
1576
1576
  ret.push(`${name}=${encodeURIComponent(value)}`);
1577
1577
  getUserCookieObj[name] = value;
1578
1578
  }
1579
1579
  });
1580
1580
  return {
1581
1581
  wqCookieStr: ret.join(';'),
1582
1582
  wqCookie: getUserCookieObj,
1583
1583
  };
1584
1584
  const getLayoutWidth = layoutWidth || global.info?.sysInfo?.windowWidth || windowWidth;
1585
1585
  const getNum = Number(num);
1586
1586
  return Math.round((getNum / widthSize) * getLayoutWidth);
1587
1587
  let checkState = false;
1588
1588
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag;
1589
1589
  if (couponFloorModuleType === FloorModuleType.COUPON) {
1590
1590
  try {
1591
1591
  const dataDefines = getFloorDataToDataDefines(floorData);
1592
1592
  const couponDataDefine = dataDefines
1593
1593
  ? dataDefines.filter((item) => {
1594
1594
  return item.type === 'coupon';
1595
1595
  })
1596
1596
  : [],
1597
1597
  couponList = couponDataDefine[0]?.nodeText?.data ? couponDataDefine[0]?.nodeText?.data : [],
1598
1598
  couponLength = couponList.length,
1599
1599
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
1600
1600
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
1601
1601
  : 0;
1602
1602
  if (numShowPerLine === 0 && couponLength > 3) {
1603
1603
  checkState = true;
1604
1604
  }
1605
1605
  } catch (e) {
1606
1606
  checkState = false;
1607
1607
  }
1608
1608
  return checkState;
1609
1609
  }
1610
1610
  const {
1611
1611
  containers = [],
1612
1612
  floors = [],
1613
1613
  clearFirstContaierMarginTop = false,
1614
1614
  } = pageData;
1615
1615
  console.log('dealShopContentData:', pageData, 'isvdev:', isvdev);
1616
1616
  const getThisTimeKey = Date.now();
1617
1617
  let shopContentContainerListData = containers?.filter(
1618
1618
  (item) => (!isvdev && item.typeCode !== 'mShopHeader') || isvdev,
1619
1619
  );
1620
1620
  const shopContentFloorListData = floors?.filter(
1621
1621
  ({ floorPosition }) =>
1622
1622
  (!isvdev && floorPosition !== 'header' && floorPosition !== 'footer') || isvdev,
1623
1623
  );
1624
1624
  const unableIsvContainerListData = getUnableIsvContainerListData(
1625
1625
  shopContentFloorListData,
1626
1626
  shopContentContainerListData,
1627
1627
  exceptionReportFn,
1628
1628
  );
1629
1629
  shopContentContainerListData.forEach((item, index) => {
1630
1630
  item.key = `${getThisTimeKey + index}`;
1631
1631
  item.floors = [];
1632
1632
  item.includeUids &&
1633
1633
  item.includeUids.forEach((floorUid) => {
1634
1634
  const getFloorData = shopContentFloorListData.find(
1635
1635
  (floorItem) => floorItem.uid === floorUid,
1636
1636
  );
1637
1637
  if (getFloorData) {
1638
1638
  const changeFloorData = {
1639
1639
  containerId: item.containerId,
1640
1640
  containerIndex: index,
1641
1641
  ...getFloorData,
1642
1642
  };
1643
1643
  const getCheckMoreCouponState = checkCouponAndChangeContainerSetData(getFloorData);
1644
1644
  if (getCheckMoreCouponState) {
1645
1645
  item.marginLeft && (item.marginLeft = 0);
1646
1646
  item.marginRight && (item.marginRight = 0);
1647
1647
  item.borderRadius && (item.borderRadius = 0);
1648
1648
  }
1649
1649
  if (getFloorData?.floorExtInfo?.floorLoadWay === 2) {
1650
1650
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(getFloorData, exceptionReportFn);
1651
1651
  !getSysFloorToLoadTypeRes && (getFloorData.floorExtInfo.floorLoadWay = 1);
1652
1652
  }
1653
1653
  item.floors.push(changeFloorData);
1654
1654
  }
1655
1655
  });
1656
1656
  if (
1657
1657
  ((!isvdev && index === 0) || (isvdev && index === 1)) &&
1658
1658
  item?.containerPosition == 'content' &&
1659
1659
  item?.marginBottom > 0 &&
1660
1660
  !clearFirstContaierMarginTop
1661
1661
  ) {
1662
1662
  item.marginTop = item.marginBottom;
1663
1663
  }
1664
1664
  });
1665
1665
  shopContentContainerListData = shopContentContainerListData.filter(
1666
1666
  (item) =>
1667
1667
  item.floors.length > 0 &&
1668
1668
  unableIsvContainerListData.every(
1669
1669
  (containerItem) => containerItem.containerId != item.containerId,
1670
1670
  ),
1671
1671
  );
1672
1672
  console.log(
1673
1673
  'dealShopContentData isWxMinAndWxapp:',
1674
1674
  isWxMinAndWxapp,
1675
1675
  'weappJumpToH5:',
1676
1676
  pageData?.homeExtInfo?.weappJumpToH5,
1677
1677
  );
1678
1678
  if (isProd && isWxMinAndWxapp) {
1679
1679
  shopContentContainerListData = shopContentContainerListData.filter(
1680
1680
  (item) =>
1681
1681
  item.floors.length > 0 &&
1682
1682
  !isIsvContainer(item.containerId, shopContentFloorListData, shopContentContainerListData),
1683
1683
  );
1684
1684
  }
1685
1685
  shopContentContainerListData = [].concat(shopContentContainerListData);
1686
1686
  return {
1687
1687
  shopContentContainerListData,
1688
1688
  shopContentFloorListData,
1689
1689
  };
1690
1690
  const changeOpts = {
1691
1691
  title: '',
1692
1692
  icon: 'success',
1693
1693
  duration: 1500,
1694
1694
  mask: true,
1695
1695
  ...options,
1696
1696
  };
1697
1697
  if (changeOpts.title.length > 7) {
1698
1698
  showNormalToast(options);
1699
1699
  } else {
1700
1700
  Taro.showToast(changeOpts as any);
1701
1701
  }
1702
1702
  const changeOpts = {
1703
1703
  title: '',
1704
1704
  icon: 'error',
1705
1705
  duration: 1500,
1706
1706
  mask: true,
1707
1707
  ...options,
1708
1708
  };
1709
1709
  if (changeOpts.title.length > 7) {
1710
1710
  showNormalToast(options);
1711
1711
  } else {
1712
1712
  Taro.showToast(changeOpts as any);
1713
1713
  }
1714
1714
  Taro.showToast({
1715
1715
  title: '',
1716
1716
  icon: 'none',
1717
1717
  duration: 1500,
1718
1718
  mask: true,
1719
1719
  ...options,
1720
1720
  });
1721
1721
  return Taro.showLoading({
1722
1722
  title: text,
1723
1723
  });
1724
1724
  return new Promise(() => {
1725
1725
  Taro.nextTick(() => {
1726
1726
  setTimeout(() => {
1727
1727
  Taro.hideLoading(options);
1728
1728
  }, 300);
1729
1729
  });
1730
1730
  });
1731
1731
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
1732
1732
  const {
1733
1733
  tabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN],
1734
1734
  sceneId,
1735
1735
  } = query;
1736
1736
  let changeTabActive = tabActive;
1737
1737
  if (sceneId) {
1738
1738
  if (isH5) {
1739
1739
  if (sceneId == '1002') {
1740
1740
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1741
1741
  }
1742
1742
  else if (sceneId == '1003') {
1743
1743
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY];
1744
1744
  }
1745
1745
  } else if (isWxMinAndWxapp) {
1746
1746
  if (sceneId == '1001' || sceneId == '1002') {
1747
1747
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1748
1748
  }
1749
1749
  else if (sceneId == '1003') {
1750
1750
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION];
1751
1751
  }
1752
1752
  }
1753
1753
  }
1754
1754
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
1755
1755
  return {
1756
1756
  menuType: SHOP_MENU_ID_TYPE.HOME,
1757
1757
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
1758
1758
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
1759
1759
  };
1760
1760
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
1761
1761
  return {
1762
1762
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
1763
1763
  tabActiveType: 0,
1764
1764
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
1765
1765
  };
1766
1766
  } else {
1767
1767
  return {
1768
1768
  menuType: SHOP_MENU_ID_TYPE.HOME,
1769
1769
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
1770
1770
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
1771
1771
  };
1772
1772
  }
1773
1773
  const deleteKeyList = [
1774
1774
  '$taroTimestamp',
1775
1775
  'cookie',
1776
1776
  'wdref',
1777
1777
  'navStart',
1778
1778
  'originOpts',
1779
1779
  'originParams',
1780
1780
  'originUrl',
1781
1781
  'referer',
1782
1782
  'stamp',
1783
1783
  'hybrid',
1784
1784
  'sr',
1785
1785
  'navh',
1786
1786
  'stath',
1787
1787
  ];
1788
1788
  let changeQueryData: any = { ...queryData };
1789
1789
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false;
1790
1790
  const sceneQuery =
1791
1791
  qrCodeScene && typeof qrCodeScene === 'string'
1792
1792
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
1793
1793
  : {};
1794
1794
  changeQueryData = { ...changeQueryData, ...sceneQuery };
1795
1795
  deleteKeyList.forEach((key) => {
1796
1796
  changeQueryData[key] && delete changeQueryData[key];
1797
1797
  });
1798
1798
  changeQueryData['shopid'] &&
1799
1799
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
1800
1800
  delete changeQueryData['shopid'];
1801
1801
  changeQueryData['venderid'] &&
1802
1802
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
1803
1803
  delete changeQueryData['venderid'];
1804
1804
  changeQueryData['vendorId'] &&
1805
1805
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
1806
1806
  delete changeQueryData['vendorId'];
1807
1807
  changeQueryData['shopId'] &&
1808
1808
  changeQueryData['shopId'] === 'undefined' &&
1809
1809
  delete changeQueryData['shopId'];
1810
1810
  changeQueryData['venderId'] &&
1811
1811
  changeQueryData['venderId'] === 'undefined' &&
1812
1812
  delete changeQueryData['venderId'];
1813
1813
  return changeQueryData;
1814
1814
  let isUsable = false;
1815
1815
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult;
1816
1816
  const modularPackResultObj = formatPackResult(modularPackResult);
1817
1817
  const bundleUrl = getBundleUrl(modularPackResultObj);
1818
1818
  const bundleFileName = getBundleFileName(modularPackResultObj);
1819
1819
  const taroVersion = getTaroVersion(modularPackResultObj);
1820
1820
  if (bundleUrl && bundleFileName) {
1821
1821
  isUsable = true;
1822
1822
  }
1823
1823
  if (!isUsable && typeof exceptionReportFn === 'function') {
1824
1824
  exceptionReportFn({
1825
1825
  code: `${NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG}${
1826
1826
  floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE
1827
1827
  ? SgmCustomCode.SYSTEMPDCMODULE_DATA
1828
1828
  : SgmCustomCode.REMOTEMODULE_DATA
1829
1829
  }`,
1830
1830
  msg: {
1831
1831
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
1832
1832
  floorIdx: floorData?.floorIdx,
1833
1833
  uid: floorData?.uid,
1834
1834
  shopId: floorData?.floorExtInfo?.shopId,
1835
1835
  moduleId: floorData?.moduleId,
1836
1836
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
1837
1837
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
1838
1838
  floorKind: floorData?.floorExtInfo?.floorKind,
1839
1839
  middleTemplateId: floorData?.middleTemplateId,
1840
1840
  modularPackResult: {
1841
1841
  bundleUrl,
1842
1842
  taroVersion,
1843
1843
  },
1844
1844
  },
1845
1845
  });
1846
1846
  }
1847
1847
  return isUsable;
1848
1848
  const objContainer = containerListData.find((item) => item.containerId === containerId);
1849
1849
  return (
1850
1850
  objContainer?.includeUids?.some((itemUid) => {
1851
1851
  const objectFloor = floorListData.find((floorItem) => itemUid === floorItem.uid);
1852
1852
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag);
1853
1853
  }) ?? false
1854
1854
  );
1855
1855
  const unableIsvFloorListData = floorListData.filter(
1856
1856
  (floorItem) =>
1857
1857
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
1858
1858
  !isIsvFloorUseable(floorItem, exceptionReportFn),
1859
1859
  );
1860
1860
  const unableIsvFloorUidList = unableIsvFloorListData.map((floorItem) => floorItem.uid);
1861
1861
  const unableIsvContainerListData = containerListData.filter(
1862
1862
  (item) =>
1863
1863
  item.includeUids &&
1864
1864
  item.includeUids.every((itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1),
1865
1865
  );
1866
1866
  return unableIsvContainerListData;
1867
1867
  console.log('暂无对应渠道比较', compareVersion, nowVersion);
1868
1868
  return -2;
1869
1869
  return customObj;
1870
1870
  return customObj;
1871
1871
  return customObj;
1872
1872
  return customObj;
1873
1873
  return customObj;
1874
1874
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl);
1875
1875
  let getParams = false;
1876
1876
  if (isOpenJdAppUrl(openAppUrl)) {
1877
1877
  try {
1878
1878
  getParams = openAppUrl.replace(/openApp\.jdMobile:\/\/virtual\?params=/i, '');
1879
1879
  getParams = JSON.parse(String(getParams));
1880
1880
  } catch (e) {
1881
1881
  console.log(e);
1882
1882
  }
1883
1883
  }
1884
1884
  return getParams;
1885
1885
  const getLastParams = Object.assign({}, openParams);
1886
1886
  return `openapp.jdmobile://virtual?params=${JSON.stringify(getLastParams)}`;
1887
1887
  if (val === null || val === '' || typeof val === 'undefined') {
1888
1888
  return true;
1889
1889
  }
1890
1890
  return false;
1891
1891
  const {
1892
1892
  moduleId = 'none',
1893
1893
  entrance = 'none',
1894
1894
  sourceType = 'none',
1895
1895
  sourceValue = 'none',
1896
1896
  } = params;
1897
1897
  if (isIosDevice) {
1898
1898
  return `${moduleId}#${entrance}`;
1899
1899
  } else if (isAndroidDevice) {
1900
1900
  return `${sourceType}#${sourceValue}`;
1901
1901
  }
1902
1902
  return 'none#none';
1903
1903
  if (data && typeof data === 'object') {
1904
1904
  let getOpenAppData = { ...data };
1905
1905
  try {
1906
1906
  const { sourceInfo, designerId, templateId, source } = getOpenAppData;
1907
1907
  if (designerId && templateId) {
1908
1908
  getOpenAppData = Object.assign({}, getOpenAppData, {
1909
1909
  sourceInfo: {
1910
1910
  entrance: '设计师预览',
1911
1911
  },
1912
1912
  });
1913
1913
  } else if (sourceInfo) {
1914
1914
  const { entrance } = sourceInfo;
1915
1915
  getOpenAppData.sourceInfo.entrance = entrance && entrance.length > 0 ? entrance : '其他';
1916
1916
  } else if (source && !sourceInfo) {
1917
1917
  if (typeof source === 'object') {
1918
1918
  const { sourceType, entrance, sourceValue, moduleId } = source;
1919
1919
  getOpenAppData = Object.assign({}, getOpenAppData, {
1920
1920
  sourceInfo: {
1921
1921
  entrance: sourceType || entrance || '其他',
1922
1922
  moduleId: sourceValue || moduleId || '-100',
1923
1923
  },
1924
1924
  });
1925
1925
  if (sourceType === 'shop_from_product_detail' && sourceValue) {
1926
1926
  getOpenAppData.sourceSku = sourceValue;
1927
1927
  }
1928
1928
  } else {
1929
1929
  getOpenAppData = Object.assign({}, getOpenAppData, {
1930
1930
  sourceInfo: {
1931
1931
  entrance: source,
1932
1932
  },
1933
1933
  });
1934
1934
  }
1935
1935
  } else {
1936
1936
  getOpenAppData = Object.assign({}, getOpenAppData, {
1937
1937
  sourceInfo: {
1938
1938
  entrance: '其他',
1939
1939
  },
1940
1940
  });
1941
1941
  }
1942
1942
  } catch (e) {
1943
1943
  console.log(e);
1944
1944
  }
1945
1945
  return getOpenAppData;
1946
1946
  }
1947
1947
  return data;
1948
1948
  return displayObj;
1949
1949
  if (typeof input === 'string') {
1950
1950
  try {
1951
1951
  return JSON.parse(input);
1952
1952
  } catch (e) {
1953
1953
  console.error('JSON解析失败', e);
1954
1954
  return {};
1955
1955
  }
1956
1956
  }
1957
1957
  return input || {};
1958
1958
  return false;
1959
1959
  const borderStyle: { [key: string]: any } = {};
1960
1960
  if (item?.borderRadius) {
1961
1961
  let borderTopRadius = 0;
1962
1962
  let borderBottomRadius = 0;
1963
1963
  if (index === 0) {
1964
1964
  borderTopRadius = item.borderRadius;
1965
1965
  borderBottomRadius = floorDataLen === 1 || item?.marginBottom !== 0 ? item.borderRadius : 0;
1966
1966
  } else if (index === floorDataLen - 1) {
1967
1967
  borderTopRadius = floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius;
1968
1968
  borderBottomRadius = item.borderRadius;
1969
1969
  } else {
1970
1970
  borderTopRadius = floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius;
1971
1971
  borderBottomRadius = item?.marginBottom === 0 ? 0 : item.borderRadius;
1972
1972
  }
1973
1973
  borderStyle.borderTopLeftRadius = item?.borderTopLeftRadius
1974
1974
  ? `${item?.borderTopLeftRadius}px`
1975
1975
  : `${borderTopRadius}px`;
1976
1976
  borderStyle.borderTopRightRadius = item?.borderTopRightRadius
1977
1977
  ? `${item?.borderTopRightRadius}px`
1978
1978
  : `${borderTopRadius}px`;
1979
1979
  borderStyle.borderBottomLeftRadius = `${borderBottomRadius}px`;
1980
1980
  borderStyle.borderBottomRightRadius = `${borderBottomRadius}px`;
1981
1981
  } else {
1982
1982
  borderStyle.borderTopLeftRadius = borderStyle?.borderTopLeftRadius || '0px';
1983
1983
  borderStyle.borderTopRightRadius = borderStyle?.borderTopRightRadius || '0px';
1984
1984
  borderStyle.borderBottomRightRadius = borderStyle?.borderBottomRightRadius || '0px';
1985
1985
  borderStyle.borderBottomLeftRadius = borderStyle?.borderBottomLeftRadius || '0px';
1986
1986
  }
1987
1987
  return borderStyle;
1988
1988
  return customObj;
1989
1989
  isJdApp,
1990
1990
  isWxApp,
1991
1991
  isIosDevice,
1992
1992
  isAndroidDevice,
1993
1993
  isJdAndIosDevice,
1994
1994
  isJdAndAndroidDevice,
1995
1995
  isWxMin,
1996
1996
  isWxMinAndWxapp,
1997
1997
  isJdMin,
1998
1998
  isMin,
1999
1999
  isJdMinAndHarmony,
2000
2000
  isH5,
2001
2001
  isH5AndJdShopView,
2002
2002
  isImageOptimizeEnable,
2003
2003
  isChartH5,
2004
2004
  isH5AndJdShopViewNativeScroll,
2005
2005
  isH5AndJdShopViewH5Scroll,
2006
2006
  isH5AndJdShopH5CustomScrollView,
2007
2007
  isWxMiniH5View,
2008
2008
  sliceArrToChunkList,
2009
2009
  dealAddress,
2010
2010
  objectToUrlEncode,
2011
2011
  parseQueryUrlString,
2012
2012
  setLowSmallPicUrl,
2013
2013
  getJfsImage,
2014
2014
  getQualityImage,
2015
2015
  countStringify,
2016
2016
  setTaroStorage,
2017
2017
  getTaroStorageKeyValue,
2018
2018
  removeTaroStorageKey,
2019
2019
  clearTaroStorageKey,
2020
2020
  getSystemInfos,
2021
2021
  addHttps,
2022
2022
  dateFormat,
2023
2023
  throttle,
2024
2024
  lodashThrottle,
2025
2025
  debounce,
2026
2026
  getTelephone,
2027
2027
  rgbToHex,
2028
2028
  hexToRgb,
2029
2029
  getRandom,
2030
2030
  getWxAppCookieStr,
2031
2031
  pxTransformFromData,
2032
2032
  dealShopContentData,
2033
2033
  showSuccessToast,
2034
2034
  showFailToast,
2035
2035
  showNormalToast,
2036
2036
  showShopLoading,
2037
2037
  hideShopLoading,
2038
2038
  getAppChannelType,
2039
2039
  formatTabActiveMenuType,
2040
2040
  filterUrlQueryData,
2041
2041
  getAvifSupport,
2042
2042
  getWebpSupport,
2043
2043
  isMemberPage,
2044
2044
  sgmCustomReport,
2045
2045
  draCustomReport,
2046
2046
  remoteCustomReport,
2047
2047
  draInterfaceCustomReport,
2048
2048
  draBusinessCustomReport,
2049
2049
  isOpenJdAppUrl,
2050
2050
  jdOpenAppParams,
2051
2051
  createJdOpenAppUrl,
2052
2052
  dealJdOpenAppData,
2053
2053
  isEmpty,
2054
2054
  getJdAppReportPageSource,
2055
2055
  isAppClassifyPage,
2056
2056
  getQualityImageNew,
2057
2057
  getQualityImageOld,
2058
2058
  isPc,
2059
2059
  ipLoc_djd,
2060
2060
  jdAppVersionCompare,
2061
2061
  dealNativePixelToCssPixel,
2062
2062
  isAppStowShop,
2063
2063
  isIpadDevice,
2064
2064
  getBorderStyle,
2065
2065
  isLanguageForEn,
2066
2066
  sColor,
2067
2067
  draInterfaceDSMCustomReport,
2068
2068
  isTabletDevice,