@conecli/cone-render 0.9.1-shop2.26 → 0.9.1-shop2.28

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