@conecli/cone-render 0.9.1-shop2.27 → 0.9.1-shop2.29

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
  changeQueryData["shopId"] && changeQueryData["shopId"] === 'undefined' && delete changeQueryData["shopId"];
814
813
  changeQueryData["venderId"] && changeQueryData["venderId"] === 'undefined' && delete changeQueryData["venderId"];
815
814
  return changeQueryData;
816
815
  let isUsable = false
817
816
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
818
817
  const modularPackResultObj = formatPackResult(modularPackResult)
819
818
  const bundleUrl = getBundleUrl(modularPackResultObj)
820
819
  const bundleFileName = getBundleFileName(modularPackResultObj)
821
820
  const taroVersion = getTaroVersion(modularPackResultObj)
822
821
  if (bundleUrl && bundleFileName) {
823
822
  isUsable = true;
824
823
  }
825
824
  if (!isUsable && typeof exceptionReportFn === 'function') {
826
825
  exceptionReportFn({
827
826
  code: `${NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG}${
828
827
  floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE
829
828
  ? SgmCustomCode.SYSTEMPDCMODULE_DATA
830
829
  : SgmCustomCode.REMOTEMODULE_DATA
831
830
  }`,
832
831
  msg: {
833
832
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
834
833
  floorIdx: floorData?.floorIdx,
835
834
  uid: floorData?.uid,
836
835
  shopId: floorData?.floorExtInfo?.shopId,
837
836
  moduleId: floorData?.moduleId,
838
837
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
839
838
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
840
839
  floorKind: floorData?.floorExtInfo?.floorKind,
841
840
  middleTemplateId: floorData?.middleTemplateId,
842
841
  modularPackResult: {
843
842
  bundleUrl,
844
843
  taroVersion,
845
844
  },
846
845
  },
847
846
  })
848
847
  }
849
848
  return isUsable
850
849
  const objContainer = containerListData.find(
851
850
  (item) => item.containerId === containerId
852
851
  );
853
852
  return (
854
853
  objContainer?.includeUids?.some((itemUid) => {
855
854
  const objectFloor = floorListData.find(
856
855
  (floorItem) => itemUid === floorItem.uid
857
856
  );
858
857
  return RemoteLoadFloorList.includes(
859
858
  objectFloor?.floorExtInfo?.moduleFlag
860
859
  );
861
860
  }) ?? false
862
861
  );
863
862
  floorListData,
864
863
  containerListData,
865
864
  exceptionReportFn?
866
865
  const unableIsvFloorListData = floorListData.filter(
867
866
  (floorItem) =>
868
867
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
869
868
  !isIsvFloorUseable(floorItem, exceptionReportFn)
870
869
  );
871
870
  const unableIsvFloorUidList = unableIsvFloorListData.map(
872
871
  (floorItem) => floorItem.uid
873
872
  );
874
873
  const unableIsvContainerListData = containerListData.filter(
875
874
  (item) =>
876
875
  item.includeUids &&
877
876
  item.includeUids.every(
878
877
  (itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1
879
878
  )
880
879
  );
881
880
  return unableIsvContainerListData;
882
881
  return -2;
883
882
  return customObj
884
883
  return customObj
885
884
  return customObj
886
885
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl)
887
886
  let getParams = false
888
887
  if (isOpenJdAppUrl(openAppUrl)) {
889
888
  try {
890
889
  getParams = openAppUrl.replace(
891
890
  /openApp\.jdMobile:\/\/virtual\?params=/i,
892
891
  ""
893
892
  );
894
893
  getParams = JSON.parse(String(getParams));
895
894
  } catch (e) {
896
895
  console.log(e);
897
896
  }
898
897
  }
899
898
  return getParams;
900
899
  const getLastParams = Object.assign({}, openParams)
901
900
  return `openapp.jdmobile://virtual?params=${JSON.stringify(getLastParams)}`
902
901
  if (val === null || val === "" || typeof val === "undefined") {
903
902
  return true;
904
903
  }
905
904
  return false;
906
905
  const {
907
906
  moduleId = "none",
908
907
  entrance = "none",
909
908
  sourceType = "none",
910
909
  sourceValue = "none",
911
910
  } = params;
912
911
  if (isIosDevice) {
913
912
  return `${moduleId}#${entrance}`;
914
913
  } else if (isAndroidDevice) {
915
914
  return `${sourceType}#${sourceValue}`;
916
915
  }
917
916
  return "none#none";
918
917
  if (data && typeof data === "object") {
919
918
  let getOpenAppData = { ...data };
920
919
  try {
921
920
  const { sourceInfo, designerId, templateId, source } = getOpenAppData;
922
921
  if (designerId && templateId) {
923
922
  getOpenAppData = Object.assign({}, getOpenAppData, {
924
923
  sourceInfo: {
925
924
  entrance: "设计师预览",
926
925
  },
927
926
  });
928
927
  } else if (sourceInfo) {
929
928
  const { entrance } = sourceInfo;
930
929
  getOpenAppData.sourceInfo.entrance =
931
930
  entrance && entrance.length > 0 ? entrance : "其他";
932
931
  } else if (source && !sourceInfo) {
933
932
  if (typeof source === "object") {
934
933
  const { sourceType, entrance, sourceValue, moduleId } = source;
935
934
  getOpenAppData = Object.assign({}, getOpenAppData, {
936
935
  sourceInfo: {
937
936
  entrance: sourceType || entrance || "其他",
938
937
  moduleId: sourceValue || moduleId || "-100",
939
938
  },
940
939
  });
941
940
  } else {
942
941
  getOpenAppData = Object.assign({}, getOpenAppData, {
943
942
  sourceInfo: {
944
943
  entrance: source,
945
944
  },
946
945
  });
947
946
  }
948
947
  } else {
949
948
  getOpenAppData = Object.assign({}, getOpenAppData, {
950
949
  sourceInfo: {
951
950
  entrance: "其他",
952
951
  },
953
952
  });
954
953
  }
955
954
  } catch (e) {
956
955
  console.log(e);
957
956
  }
958
957
  return getOpenAppData;
959
958
  }
960
959
  return data;
961
960
  return displayObj;
962
961
  if (typeof input === "string") {
963
962
  try {
964
963
  return JSON.parse(input);
965
964
  } catch (e) {
966
965
  console.error("JSON解析失败", e);
967
966
  return {};
968
967
  }
969
968
  }
970
969
  return input || {};
971
970
  return false
972
971
  isJdApp,
973
972
  isWxApp,
974
973
  isIosDevice,
975
974
  isAndroidDevice,
976
975
  isJdAndIosDevice,
977
976
  isJdAndAndroidDevice,
978
977
  isWxMin,
979
978
  isWxMinAndWxapp,
980
979
  isJdMin,
981
980
  isMin,
982
981
  isJdMinAndHarmony,
983
982
  isH5,
984
983
  isH5AndJdShopView,
985
984
  isImageOptimizeEnable,
986
985
  isChartH5,
987
986
  isH5AndJdShopViewNativeScroll,
988
987
  isH5AndJdShopViewH5Scroll,
989
988
  isH5AndJdShopH5CustomScrollView,
990
989
  isWxMiniH5View,
991
990
  sliceArrToChunkList,
992
991
  dealAddress,
993
992
  objectToUrlEncode,
994
993
  parseQueryUrlString,
995
994
  setLowSmallPicUrl,
996
995
  getJfsImage,
997
996
  getQualityImage,
998
997
  countStringify,
999
998
  setTaroStorage,
1000
999
  getTaroStorageKeyValue,
1001
1000
  removeTaroStorageKey,
1002
1001
  clearTaroStorageKey,
1003
1002
  getSystemInfos,
1004
1003
  addHttps,
1005
1004
  dateFormat,
1006
1005
  throttle,
1007
1006
  lodashThrottle,
1008
1007
  debounce,
1009
1008
  getTelephone,
1010
1009
  rgbToHex,
1011
1010
  hexToRgb,
1012
1011
  getRandom,
1013
1012
  getWxAppCookieStr,
1014
1013
  pxTransformFromData,
1015
1014
  dealShopContentData,
1016
1015
  showSuccessToast,
1017
1016
  showFailToast,
1018
1017
  showNormalToast,
1019
1018
  showShopLoading,
1020
1019
  hideShopLoading,
1021
1020
  getAppChannelType,
1022
1021
  formatTabActiveMenuType,
1023
1022
  filterUrlQueryData,
1024
1023
  getAvifSupport,
1025
1024
  getWebpSupport,
1026
1025
  isMemberPage,
1027
1026
  sgmCustomReport,
1028
1027
  draCustomReport,
1029
1028
  remoteCustomReport,
1030
1029
  isOpenJdAppUrl,
1031
1030
  jdOpenAppParams,
1032
1031
  createJdOpenAppUrl,
1033
1032
  dealJdOpenAppData,
1034
1033
  isEmpty,
1035
1034
  getJdAppReportPageSource,
1036
1035
  isAppClassifyPage,
1037
1036
  getQualityImageNew,
1038
1037
  getQualityImageOld,
1039
1038
  isPc,
1040
1039
  ipLoc_djd,
1041
1040
  jdAppVersionCompare,
1042
1041
  dealNativePixelToCssPixel,
1043
1042
  isAppStowShop,
1044
1043
  isIpadDevice,
1044
+ import Taro from "@tarojs/taro";
1045
1045
  SHOP_MENU_ID_TYPE,
1046
1046
  SHOP_MENU_ID_QUERY_NAME,
1047
1047
  SECTION_HOME_TAB_TYPE,
1048
1048
  SECTION_HOME_TAB_NAME_TYPE,
1049
1049
  SECTION_HOME_TAB_QUERY_TYPE,
1050
1050
  CHANNEL_TYPE,
1051
1051
  JDShopViewBusinessPathType,
1052
1052
  FloorModuleType,
1053
1053
  RemoteLoadFloorList,
1054
1054
  FLOOR_KIND,
1055
1055
  getBundleUrl,
1056
1056
  getBundleFileName,
1057
1057
  formatPackResult,
1058
1058
  getTaroVersion,
1059
1059
  SgmCustomCode,
1060
1060
  NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG,
1061
1061
  key: string,
1062
1062
  value: string | object,
1063
1063
  successBack?: any,
1064
1064
  failBack?: any,
1065
1065
  try{
1066
1066
  if(isH5 && window && !window.localStorage){
1067
1067
  console.log(`setTaroStorage key:${key} window.localStorage不存在:`);
1068
1068
  return Promise.resolve(null);
1069
1069
  }
1070
1070
  return Taro.setStorage({
1071
1071
  key: key,
1072
1072
  data: value,
1073
1073
  success: successBack,
1074
1074
  fail: failBack,
1075
1075
  }).catch((e) => {
1076
1076
  console.log(`setTaroStorage key:${key} 报错:`, e);
1077
1077
  return null;
1078
1078
  });
1079
1079
  }
1080
1080
  catch(e){
1081
1081
  console.log(`setTaroStorage key:${key} 报错:`, e)
1082
1082
  return Promise.resolve(null)
1083
1083
  }
1084
1084
  try {
1085
1085
  if (isH5 && window && !window.localStorage) {
1086
1086
  console.log(
1087
1087
  `getTaroStorageKeyValue key:${key} window.localStorage不存在:`,
1088
1088
  )
1089
1089
  return Promise.resolve(null)
1090
1090
  }
1091
1091
  return Taro.getStorageSync(key)
1092
1092
  } catch (e) {
1093
1093
  console.log(`getTaroStorageKeyValue key:${key} 报错:`, e)
1094
1094
  return null
1095
1095
  }
1096
1096
  try {
1097
1097
  if (isH5 && window && !window.localStorage) {
1098
1098
  console.log(`removeTaroStorageKey key:${key} window.localStorage不存在:`)
1099
1099
  return Promise.resolve(null)
1100
1100
  }
1101
1101
  return Taro.removeStorage({
1102
1102
  key: key,
1103
1103
  }).catch(e => {
1104
1104
  console.log(`removeTaroStorageKey key:${key} 报错:`, e)
1105
1105
  })
1106
1106
  } catch (e) {
1107
1107
  console.log(`removeTaroStorageKey key:${key} 报错:`, e)
1108
1108
  }
1109
1109
  try {
1110
1110
  if (isH5 && window && !window.localStorage) {
1111
1111
  console.log(`clearTaroStorageKey window.localStorage不存在`)
1112
1112
  return Promise.resolve(null)
1113
1113
  }
1114
1114
  return Taro.clearStorage().catch(e => {
1115
1115
  console.log('clearTaroStorageKey报错:', e)
1116
1116
  })
1117
1117
  } catch (e) {
1118
1118
  console.log('clearTaroStorageKey报错:', e)
1119
1119
  }
1120
1120
  let hasChecked = false
1121
1121
  if (isH5) {
1122
1122
  const avifCache = getTaroStorageKeyValue(KEY_AVIF)
1123
1123
  if (avifCache === null || avifCache === '' || forceUpdate) {
1124
1124
  hasChecked = true
1125
1125
  const img = new Image()
1126
1126
  img.onload = function() {
1127
1127
  if (img.height > 0 && img.width > 0) {
1128
1128
  setTaroStorage(KEY_AVIF, '1')
1129
1129
  } else {
1130
1130
  setTaroStorage(KEY_AVIF, '0')
1131
1131
  }
1132
1132
  }
1133
1133
  img.onerror = () => {
1134
1134
  setTaroStorage(KEY_AVIF, '0')
1135
1135
  }
1136
1136
  img.src =
1137
1137
  'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A='
1138
1138
  }
1139
1139
  const webpCache = getTaroStorageKeyValue(KEY_WEBP)
1140
1140
  if (webpCache === null || webpCache === '' || forceUpdate) {
1141
1141
  hasChecked = true
1142
1142
  const img = new Image()
1143
1143
  img.onload = function() {
1144
1144
  if (img.height > 0 && img.width > 0) {
1145
1145
  setTaroStorage(KEY_WEBP, '1')
1146
1146
  } else {
1147
1147
  setTaroStorage(KEY_WEBP, '0')
1148
1148
  }
1149
1149
  }
1150
1150
  img.onerror = () => {
1151
1151
  setTaroStorage(KEY_WEBP, '0')
1152
1152
  }
1153
1153
  img.src =
1154
1154
  'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAUAmJaQAA3AA/vz0AAA='
1155
1155
  }
1156
1156
  }
1157
1157
  return hasChecked
1158
1158
  const hasChecked = imageFormatSupport(false)
1159
1159
  if (!hasChecked) {
1160
1160
  setTimeout(imageFormatSupport, 5000)
1161
1161
  }
1162
1162
  const resultList: Array<any> = [],
1163
1163
  arrLen = arr.length
1164
1164
  if (arrLen) {
1165
1165
  if (arrLen > size) {
1166
1166
  for (let i = 0; i < arrLen; i = i + size) {
1167
1167
  resultList.push(arr.slice(i, i + size))
1168
1168
  }
1169
1169
  } else {
1170
1170
  resultList.push(arr)
1171
1171
  }
1172
1172
  }
1173
1173
  return resultList
1174
1174
  let _address = ids;
1175
1175
  const _areaAreaSplit = ids.split(".");
1176
1176
  const _areaAreaSplit2 = ids.split("_");
1177
1177
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address;
1178
1178
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address;
1179
1179
  return _address;
1180
1180
  let paramStr = ''
1181
1181
  obj &&
1182
1182
  Object.keys(obj).forEach((key, index) => {
1183
1183
  const getValue = `${obj[key]}`
1184
1184
  .replace(/undefined/, '')
1185
1185
  .replace(/null/, '')
1186
1186
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(
1187
1187
  getValue,
1188
1188
  )}`
1189
1189
  })
1190
1190
  return paramStr
1191
1191
  const result = {};
1192
1192
  if (
1193
1193
  !urlOrQueryStr ||
1194
1194
  ("string" !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
1195
1195
  ) {
1196
1196
  return result;
1197
1197
  }
1198
1198
  if (urlOrQueryStr.indexOf("?") > -1) {
1199
1199
  const queryStr = urlOrQueryStr.split("?");
1200
1200
  const queryItemList =
1201
1201
  queryStr && queryStr.length > 1 ? queryStr[1].split("&") : [];
1202
1202
  const queryItemListLen = queryItemList.length;
1203
1203
  queryItemListLen > 0 &&
1204
1204
  queryItemList.forEach(item => {
1205
1205
  const thisItemList = item.split('=')
1206
1206
  result[thisItemList[0]] = thisItemList[1]
1207
1207
  })
1208
1208
  } else {
1209
1209
  const queryItemList =
1210
1210
  urlOrQueryStr.indexOf("&") > -1
1211
1211
  ? urlOrQueryStr.split("&")
1212
1212
  : [urlOrQueryStr];
1213
1213
  const queryItemListLen = queryItemList.length;
1214
1214
  queryItemListLen > 0 &&
1215
1215
  queryItemList.forEach(item => {
1216
1216
  const thisItemList = item.split('=')
1217
1217
  result[thisItemList[0]] = thisItemList[1]
1218
1218
  })
1219
1219
  }
1220
1220
  return result;
1221
1221
  url: string,
1222
1222
  size?: {
1223
1223
  w: number;
1224
1224
  h: number;
1225
1225
  },
1226
1226
  quality?: number
1227
1227
  if (url && size) {
1228
1228
  const _w = Math.floor(size.w);
1229
1229
  const _h = Math.floor(size.h);
1230
1230
  if (url.match(/gif$/i)) {
1231
1231
  return url;
1232
1232
  } else {
1233
1233
  if (_w > 0 && _h > 0) {
1234
1234
  url = url.replace("jfs/", `s${_w}x${_h}_jfs/`);
1235
1235
  }
1236
1236
  url += quality != null ? `!q${quality}.dpg` : ".dpg";
1237
1237
  }
1238
1238
  }
1239
1239
  return url;
1240
1240
  url: string,
1241
1241
  jfsImgInfo: UtilsInterFace.getJfsImageInfo = {}
1242
1242
  if (url.match(/\.(jpg|png|dpg)$/i)) {
1243
1243
  const { width, height, quality } = jfsImgInfo;
1244
1244
  if (typeof width === "number" || typeof height === "number") {
1245
1245
  url = url.replace(
1246
1246
  "/jfs/",
1247
1247
  `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`
1248
1248
  );
1249
1249
  }
1250
1250
  if (
1251
1251
  typeof quality === "number" &&
1252
1252
  quality > 0 &&
1253
1253
  quality < 100 &&
1254
1254
  url.match(/\.jpg$/i)
1255
1255
  ) {
1256
1256
  url += `!q${quality}.dpg`;
1257
1257
  }
1258
1258
  }
1259
1259
  return addHttps(url);
1260
1260
  if (imgUrl) {
1261
1261
  if (
1262
1262
  !imgUrl.match(
1263
1263
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
1264
1264
  )
1265
1265
  ) {
1266
1266
  if (!imgUrl.includes('360buyimg.com')) {
1267
1267
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
1268
1268
  }
1269
1269
  if (quality != 100)
1270
1270
  imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
1271
1271
  }
1272
1272
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl
1273
1273
  }
1274
1274
  return imgUrl
1275
1275
  const result = value % step
1276
1276
  return result === 0 ? value : Math.ceil(value / step) * step
1277
1277
  const MAX = 3.5
1278
1278
  return Math.min(window?.devicePixelRatio ?? 2, MAX)
1279
1279
  isSkuImage: boolean
1280
1280
  size: number
1281
1281
  imgUrl: string,
1282
1282
  options: QualityOptions,
1283
1283
  isIgnoreOptimizeFromServer: boolean = false,
1284
1284
  if (!imgUrl) {
1285
1285
  console.error(
1286
1286
  'The input parameter imageUrl for the getQualityImage() cannot be empty!',
1287
1287
  )
1288
1288
  return imgUrl
1289
1289
  }
1290
1290
  if (isIgnoreOptimizeFromServer) {
1291
1291
  imgUrl = imgUrl.replace(/\.(jpe?g|png).*/, '.$1')
1292
1292
  }
1293
1293
  if (!/^((https?):)?\/\//.test(imgUrl)) {
1294
1294
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
1295
1295
  }
1296
1296
  const imgServerRegExp = /(img|m)\d{0,2}\.360buyimg\.com\/.*\.(jpe?g|png)/i
1297
1297
  if (!imgServerRegExp.test(imgUrl)) {
1298
1298
  return imgUrl
1299
1299
  }
1300
1300
  imgUrl = /^\/\//.test(imgUrl) ? `https:${imgUrl}` : imgUrl
1301
1301
  const { isSkuImage, size } = options || {}
1302
1302
  const needReduceSize = isSkuImage && size
1303
1303
  if (needReduceSize) {
1304
1304
  const devicePixelRatio = getDevicePixelRatio()
1305
1305
  const useWidth = getValueByStep(size * devicePixelRatio, 40)
1306
1306
  imgUrl = imgUrl.replace(/\/[^\/]*jfs\//, `/s${useWidth}x${useWidth}_jfs/`)
1307
1307
  }
1308
1308
  const needCompress = !global?.info?.pageInfo?.isVipShop
1309
1309
  const result = imgUrl.match(/\/\w+\.(jpe?g|png)$/)
1310
1310
  if (needCompress && result) {
1311
1311
  if (getAvifSupport() === '1') {
1312
1312
  imgUrl += '.avif'
1313
1313
  } else if (getWebpSupport() === '1') {
1314
1314
  imgUrl += '.webp'
1315
1315
  } else if (/jpe?g/.test(result[1])) {
1316
1316
  imgUrl += '!q80'
1317
1317
  }
1318
1318
  }
1319
1319
  if (needReduceSize) {
1320
1320
  imgUrl += '!z2'
1321
1321
  }
1322
1322
  return imgUrl
1323
1323
  if (imgUrl) {
1324
1324
  if (
1325
1325
  !imgUrl.match(
1326
1326
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
1327
1327
  )
1328
1328
  ) {
1329
1329
  if (!imgUrl.includes('360buyimg.com')) {
1330
1330
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
1331
1331
  }
1332
1332
  if (quality != 100)
1333
1333
  imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
1334
1334
  }
1335
1335
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl
1336
1336
  }
1337
1337
  return imgUrl
1338
1338
  return getTaroStorageKeyValue(KEY_AVIF) || '0'
1339
1339
  return getTaroStorageKeyValue(KEY_WEBP) || '0'
1340
1340
  count: number,
1341
1341
  fixedNum = 1,
1342
1342
  unit = '万',
1343
1343
  maxNum = 10000,
1344
1344
  count = Number(count)
1345
1345
  const getMaxNum = count > 100000000 ? 100000000 : maxNum
1346
1346
  const getUnit = count > 100000000 ? '亿' : unit
1347
1347
  if (count >= getMaxNum) {
1348
1348
  return (count / getMaxNum).toFixed(fixedNum) + getUnit
1349
1349
  }
1350
1350
  return count
1351
1351
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo || {
1352
1352
  platform: '',
1353
1353
  model: '',
1354
1354
  system: '',
1355
1355
  }
1356
1356
  const isIOS = !!systemInfo.system.match(/ios/i)
1357
1357
  const isAndroid = !!systemInfo.system.match(/android/i)
1358
1358
  if (!systemInfo.statusBarHeight) {
1359
1359
  systemInfo.statusBarHeight = screenHeight - windowHeight - 20
1360
1360
  systemInfo.navBarExtendHeight = 0
1361
1361
  } else {
1362
1362
  if (isIOS) {
1363
1363
  systemInfo.navBarExtendHeight = 4
1364
1364
  } else {
1365
1365
  systemInfo.navBarExtendHeight = 0
1366
1366
  }
1367
1367
  }
1368
1368
  let rect = Taro.getMenuButtonBoundingClientRect
1369
1369
  ? Taro.getMenuButtonBoundingClientRect()
1370
1370
  : null
1371
1371
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
1372
1372
  let gap = 0
1373
1373
  let width = 96
1374
1374
  if (systemInfo.platform === 'android') {
1375
1375
  gap = 8
1376
1376
  width = 96
1377
1377
  } else if (systemInfo.platform === 'devtools') {
1378
1378
  if (isIOS) {
1379
1379
  gap = 5.5
1380
1380
  } else {
1381
1381
  gap = 7.5
1382
1382
  }
1383
1383
  } else {
1384
1384
  gap = 4
1385
1385
  width = 88
1386
1386
  }
1387
1387
  rect = {
1388
1388
  bottom: systemInfo.statusBarHeight + gap + 32,
1389
1389
  height: 32,
1390
1390
  left: systemInfo.windowWidth - width - 10,
1391
1391
  right: systemInfo.windowWidth - 10,
1392
1392
  top: systemInfo.statusBarHeight + gap,
1393
1393
  width,
1394
1394
  }
1395
1395
  }
1396
1396
  const gap = rect.top - systemInfo.statusBarHeight
1397
1397
  systemInfo.navBarTopToStatusBar = gap
1398
1398
  systemInfo.navBarHeight = 2 * gap + rect.height
1399
1399
  systemInfo.capsulePosition = rect
1400
1400
  systemInfo.isIOS = isIOS
1401
1401
  systemInfo.isAndroid = isAndroid
1402
1402
  return systemInfo
1403
1403
  if (str.match(/^\/\//)) {
1404
1404
  str = "https:" + str;
1405
1405
  }
1406
1406
  return str;
1407
1407
  dateTimeOrdate: Date | string | number | null,
1408
1408
  format = "yyyy-MM-dd HH:mm:ss",
1409
1409
  noPadStart = {
1410
1410
  M: "0",
1411
1411
  d: "0",
1412
1412
  H: "0",
1413
1413
  m: "0",
1414
1414
  s: "0",
1415
1415
  }
1416
1416
  let dateResult = "";
1417
1417
  const padStarts = Object.assign(
1418
1418
  {
1419
1419
  M: "0",
1420
1420
  d: "0",
1421
1421
  H: "0",
1422
1422
  m: "0",
1423
1423
  s: "0",
1424
1424
  },
1425
1425
  noPadStart
1426
1426
  );
1427
1427
  if (dateTimeOrdate) {
1428
1428
  let changeDateTimeOrdate = dateTimeOrdate;
1429
1429
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate);
1430
1430
  if (getChangeDateTimeToNumber) {
1431
1431
  changeDateTimeOrdate = getChangeDateTimeToNumber;
1432
1432
  } else {
1433
1433
  changeDateTimeOrdate = `${changeDateTimeOrdate}`
1434
1434
  .replace(/-/g, '/')
1435
1435
  .replace(/\./g, '/')
1436
1436
  }
1437
1437
  const nowDate =
1438
1438
  dateTimeOrdate instanceof Date
1439
1439
  ? dateTimeOrdate
1440
1440
  : new Date(changeDateTimeOrdate);
1441
1441
  const dateMap = {
1442
1442
  y: `${nowDate.getFullYear()}`,
1443
1443
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts["M"]),
1444
1444
  d: `${nowDate.getDate()}`.padStart(2, padStarts["d"]),
1445
1445
  H: `${nowDate.getHours()}`.padStart(2, padStarts["H"]),
1446
1446
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts["m"]),
1447
1447
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts["s"]),
1448
1448
  };
1449
1449
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g')
1450
1450
  const regYear = new RegExp('y')
1451
1451
  dateResult = format.replace(regDate, v => {
1452
1452
  let changeValue = v
1453
1453
  if (regYear.test(changeValue)) {
1454
1454
  const thisYear = dateMap.y;
1455
1455
  const subValueLen = 4 - changeValue.length;
1456
1456
  changeValue = thisYear.substr(subValueLen);
1457
1457
  } else {
1458
1458
  const dateKey = v.substr(0, 1);
1459
1459
  changeValue = dateMap[dateKey];
1460
1460
  }
1461
1461
  return changeValue;
1462
1462
  });
1463
1463
  }
1464
1464
  return dateResult;
1465
1465
  let timer: any = null
1466
1466
  let startTime = Date.now()
1467
1467
  return function() {
1468
1468
  const curTime = Date.now()
1469
1469
  const remaining = delay - (curTime - startTime)
1470
1470
  const context = this;
1471
1471
  const args = arguments;
1472
1472
  clearTimeout(timer);
1473
1473
  if (remaining <= 0) {
1474
1474
  func.apply(context, args);
1475
1475
  startTime = Date.now();
1476
1476
  } else {
1477
1477
  timer = setTimeout(func, remaining);
1478
1478
  }
1479
1479
  };
1480
1480
  let context, args, result
1481
1481
  let timeout = null
1482
1482
  let previous = 0
1483
1483
  if (!options) options = {}
1484
1484
  const later = function() {
1485
1485
  previous = options.leading === false ? 0 : Date.now()
1486
1486
  timeout = null
1487
1487
  result = func.apply(context, args)
1488
1488
  if (!timeout) context = args = null
1489
1489
  }
1490
1490
  return function() {
1491
1491
  const now = Date.now()
1492
1492
  if (!previous && options.leading === false) previous = now
1493
1493
  const remaining = wait - (now - previous)
1494
1494
  context = this;
1495
1495
  args = arguments;
1496
1496
  if (remaining <= 0 || remaining > wait) {
1497
1497
  if (timeout) {
1498
1498
  clearTimeout(timeout);
1499
1499
  timeout = null;
1500
1500
  }
1501
1501
  previous = now;
1502
1502
  result = func.apply(context, args);
1503
1503
  if (!timeout) context = args = null;
1504
1504
  } else if (!timeout && options.trailing !== false) {
1505
1505
  timeout = setTimeout(later, remaining);
1506
1506
  }
1507
1507
  return result;
1508
1508
  };
1509
1509
  let timer: any = null;
1510
1510
  return function() {
1511
1511
  const context: any = this;
1512
1512
  const args = arguments;
1513
1513
  timer && clearTimeout(timer);
1514
1514
  timer = setTimeout(function() {
1515
1515
  fn.apply(context, args)
1516
1516
  }, delay)
1517
1517
  }
1518
1518
  if (txt) {
1519
1519
  txt = txt.trim();
1520
1520
  const reg = new RegExp(/[\d-]+/);
1521
1521
  const res = reg.exec(txt);
1522
1522
  if (res && res.length > 0) {
1523
1523
  let tel = res[0];
1524
1524
  if (tel && delSeparator) {
1525
1525
  tel = tel.replace(/-/g, "");
1526
1526
  }
1527
1527
  return tel;
1528
1528
  }
1529
1529
  }
1530
1530
  return "";
1531
1531
  if (rgb) {
1532
1532
  const reg = /^(rgb|RGB)/;
1533
1533
  const color = rgb;
1534
1534
  if (reg.test(color)) {
1535
1535
  let strHex = "#";
1536
1536
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
1537
1537
  for (let i = 0; i < colorArr.length; i++) {
1538
1538
  let hex = Number(colorArr[i]).toString(16);
1539
1539
  if (hex === "0") {
1540
1540
  hex += hex;
1541
1541
  }
1542
1542
  strHex += hex;
1543
1543
  }
1544
1544
  return strHex;
1545
1545
  } else {
1546
1546
  return String(color);
1547
1547
  }
1548
1548
  } else {
1549
1549
  return "";
1550
1550
  }
1551
1551
  if (hex) {
1552
1552
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
1553
1553
  let color = hex.toLowerCase();
1554
1554
  if (reg.test(color)) {
1555
1555
  if (color.length === 4) {
1556
1556
  let colorNew = "#";
1557
1557
  for (let i = 1; i < 4; i += 1) {
1558
1558
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
1559
1559
  }
1560
1560
  color = colorNew;
1561
1561
  }
1562
1562
  const colorChange: number[] = [];
1563
1563
  for (let i = 1; i < 7; i += 2) {
1564
1564
  colorChange.push(parseInt("0x" + color.slice(i, i + 2)));
1565
1565
  }
1566
1566
  if (returnList) {
1567
1567
  return colorChange;
1568
1568
  } else {
1569
1569
  return "RGB(" + colorChange.join(",") + ")";
1570
1570
  }
1571
1571
  } else {
1572
1572
  return color;
1573
1573
  }
1574
1574
  } else {
1575
1575
  return "";
1576
1576
  }
1577
1577
  n: number,
1578
1578
  m: number,
1579
1579
  filterNum: number | undefined = undefined
1580
1580
  const c = m - n + 1;
1581
1581
  const res = Math.floor(Math.random() * c + n);
1582
1582
  if (filterNum && filterNum == res) {
1583
1583
  console.log("随机数二次开始", res, filterNum);
1584
1584
  return getRandom(n, m, filterNum);
1585
1585
  } else {
1586
1586
  return res;
1587
1587
  }
1588
1588
  wqCookieStr: string;
1589
1589
  wqCookie: {
1590
1590
  pin?: string;
1591
1591
  visitkey?: string;
1592
1592
  [key: string]: any;
1593
1593
  };
1594
1594
  const {
1595
1595
  jdpin,
1596
1596
  pinStatus,
1597
1597
  visitkey,
1598
1598
  unionid,
1599
1599
  skey,
1600
1600
  __jda,
1601
1601
  __jdv,
1602
1602
  __wga,
1603
1603
  wid,
1604
1604
  wq_skey,
1605
1605
  wq_uin,
1606
1606
  wq_auth_token,
1607
1607
  wxapp_scene,
1608
1608
  wq_unionid,
1609
1609
  wxapp_openid,
1610
1610
  wxapp_version,
1611
1611
  wxapp_type,
1612
1612
  appType,
1613
1613
  } = cookie
1614
1614
  const ret: string[] = []
1615
1615
  const getUserCookieObj = {}
1616
1616
  const createUseCookieArr = [
1617
1617
  jdpin,
1618
1618
  pinStatus,
1619
1619
  visitkey,
1620
1620
  unionid,
1621
1621
  skey,
1622
1622
  __jda,
1623
1623
  __jdv,
1624
1624
  __wga,
1625
1625
  wid,
1626
1626
  wq_skey,
1627
1627
  wq_uin,
1628
1628
  wq_auth_token,
1629
1629
  wxapp_scene,
1630
1630
  wq_unionid,
1631
1631
  wxapp_openid,
1632
1632
  wxapp_version,
1633
1633
  wxapp_type,
1634
1634
  appType,
1635
1635
  ]
1636
1636
  createUseCookieArr.forEach(keyItem => {
1637
1637
  if (keyItem && keyItem['name']) {
1638
1638
  let { name, value } = keyItem
1639
1639
  name = name === 'jdpin' ? 'pin' : name
1640
1640
  name === 'pin' && ret.push(`pt_pin=${encodeURIComponent(value)}`)
1641
1641
  ret.push(`${name}=${encodeURIComponent(value)}`)
1642
1642
  getUserCookieObj[name] = value
1643
1643
  }
1644
1644
  });
1645
1645
  return {
1646
1646
  wqCookieStr: ret.join(";"),
1647
1647
  wqCookie: getUserCookieObj,
1648
1648
  };
1649
1649
  num,
1650
1650
  widthSize = 375,
1651
1651
  layoutWidth = windowWidth
1652
1652
  const getNum = Number(num);
1653
1653
  return Math.round((getNum / widthSize) * layoutWidth);
1654
1654
  let checkState = false
1655
1655
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag
1656
1656
  if (couponFloorModuleType === FloorModuleType.COUPON) {
1657
1657
  try {
1658
1658
  const dataDefines = getFloorDataToDataDefines(floorData);
1659
1659
  const couponDataDefine = dataDefines
1660
1660
  ? dataDefines.filter(item => {
1661
1661
  return item.type === 'coupon'
1662
1662
  })
1663
1663
  : [],
1664
1664
  couponList = couponDataDefine[0]?.nodeText?.data
1665
1665
  ? couponDataDefine[0]?.nodeText?.data
1666
1666
  : [],
1667
1667
  couponLength = couponList.length,
1668
1668
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
1669
1669
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
1670
1670
  : 0;
1671
1671
  if (numShowPerLine === 0 && couponLength > 3) {
1672
1672
  checkState = true;
1673
1673
  }
1674
1674
  } catch (e) {
1675
1675
  checkState = false;
1676
1676
  }
1677
1677
  return checkState;
1678
1678
  }
1679
1679
  const {
1680
1680
  containers = [],
1681
1681
  floors = [],
1682
1682
  clearFirstContaierMarginTop = false,
1683
1683
  } = pageData
1684
1684
  console.log('dealShopContentData:', pageData, 'isvdev:', isvdev)
1685
1685
  const getThisTimeKey = Date.now()
1686
1686
  let shopContentContainerListData = containers?.filter(
1687
1687
  item => (!isvdev && item.typeCode !== 'mShopHeader') || isvdev,
1688
1688
  )
1689
1689
  const shopContentFloorListData = floors?.filter(
1690
1690
  ({ floorPosition }) =>
1691
1691
  (!isvdev && floorPosition !== 'header' && floorPosition !== 'footer') ||
1692
1692
  isvdev,
1693
1693
  )
1694
1694
  const unableIsvContainerListData = getUnableIsvContainerListData(
1695
1695
  shopContentFloorListData,
1696
1696
  shopContentContainerListData,
1697
1697
  exceptionReportFn,
1698
1698
  )
1699
1699
  shopContentContainerListData.forEach((item, index) => {
1700
1700
  item.key = `${getThisTimeKey + index}`
1701
1701
  item.floors = []
1702
1702
  item.includeUids &&
1703
1703
  item.includeUids.forEach(floorUid => {
1704
1704
  const getFloorData = shopContentFloorListData.find(
1705
1705
  floorItem => floorItem.uid === floorUid,
1706
1706
  )
1707
1707
  if (getFloorData) {
1708
1708
  const changeFloorData = {
1709
1709
  containerId: item.containerId,
1710
1710
  containerIndex: index,
1711
1711
  ...getFloorData,
1712
1712
  }
1713
1713
  const getCheckMoreCouponState = checkCouponAndChangeContainerSetData(
1714
1714
  getFloorData,
1715
1715
  )
1716
1716
  if (getCheckMoreCouponState) {
1717
1717
  item.marginLeft && (item.marginLeft = 0)
1718
1718
  item.marginRight && (item.marginRight = 0)
1719
1719
  item.borderRadius && (item.borderRadius = 0)
1720
1720
  }
1721
1721
  if (getFloorData?.floorExtInfo?.floorLoadWay === 2) {
1722
1722
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(
1723
1723
  getFloorData,
1724
1724
  exceptionReportFn,
1725
1725
  )
1726
1726
  !getSysFloorToLoadTypeRes &&
1727
1727
  (getFloorData.floorExtInfo.floorLoadWay = 1)
1728
1728
  }
1729
1729
  item.floors.push(changeFloorData)
1730
1730
  }
1731
1731
  })
1732
1732
  if (
1733
1733
  ((!isvdev && index === 0) || (isvdev && index === 1)) &&
1734
1734
  item?.containerPosition == 'content' &&
1735
1735
  item?.marginBottom > 0 &&
1736
1736
  !clearFirstContaierMarginTop
1737
1737
  ) {
1738
1738
  item.marginTop = item.marginBottom
1739
1739
  }
1740
1740
  })
1741
1741
  shopContentContainerListData = shopContentContainerListData.filter(
1742
1742
  item =>
1743
1743
  item.floors.length > 0 &&
1744
1744
  unableIsvContainerListData.every(
1745
1745
  containerItem => containerItem.containerId != item.containerId,
1746
1746
  ),
1747
1747
  )
1748
1748
  console.log(
1749
1749
  'dealShopContentData isWxMinAndWxapp:',
1750
1750
  isWxMinAndWxapp,
1751
1751
  'weappJumpToH5:',
1752
1752
  pageData?.homeExtInfo?.weappJumpToH5,
1753
1753
  )
1754
1754
  if (isProd && isWxMinAndWxapp) {
1755
1755
  shopContentContainerListData = shopContentContainerListData.filter(
1756
1756
  item =>
1757
1757
  item.floors.length > 0 &&
1758
1758
  !isIsvContainer(
1759
1759
  item.containerId,
1760
1760
  shopContentFloorListData,
1761
1761
  shopContentContainerListData,
1762
1762
  ),
1763
1763
  )
1764
1764
  }
1765
1765
  shopContentContainerListData = [].concat(shopContentContainerListData);
1766
1766
  return {
1767
1767
  shopContentContainerListData,
1768
1768
  shopContentFloorListData,
1769
1769
  };
1770
1770
  const changeOpts = {
1771
1771
  title: "",
1772
1772
  icon: "success",
1773
1773
  duration: 1500,
1774
1774
  mask: true,
1775
1775
  ...options,
1776
1776
  };
1777
1777
  if (changeOpts.title.length > 7) {
1778
1778
  showNormalToast(options);
1779
1779
  } else {
1780
1780
  Taro.showToast(changeOpts as any);
1781
1781
  }
1782
1782
  const changeOpts = {
1783
1783
  title: "",
1784
1784
  icon: "error",
1785
1785
  duration: 1500,
1786
1786
  mask: true,
1787
1787
  ...options,
1788
1788
  };
1789
1789
  if (changeOpts.title.length > 7) {
1790
1790
  showNormalToast(options);
1791
1791
  } else {
1792
1792
  Taro.showToast(changeOpts as any);
1793
1793
  }
1794
1794
  Taro.showToast({
1795
1795
  title: "",
1796
1796
  icon: "none",
1797
1797
  duration: 1500,
1798
1798
  mask: true,
1799
1799
  ...options,
1800
1800
  });
1801
1801
  return Taro.showLoading({
1802
1802
  title: text,
1803
1803
  });
1804
1804
  return new Promise(() => {
1805
1805
  Taro.nextTick(() => {
1806
1806
  setTimeout(() => {
1807
1807
  Taro.hideLoading(options);
1808
1808
  }, 300);
1809
1809
  });
1810
1810
  });
1811
1811
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
1812
1812
  const {
1813
1813
  tabActive = SECTION_HOME_TAB_NAME_TYPE[
1814
1814
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
1815
1815
  ],
1816
1816
  sceneId,
1817
1817
  } = query;
1818
1818
  let changeTabActive = tabActive;
1819
1819
  if (sceneId) {
1820
1820
  if (isH5) {
1821
1821
  if (sceneId == "1002") {
1822
1822
  changeTabActive =
1823
1823
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1824
1824
  }
1825
1825
  else if (sceneId == "1003") {
1826
1826
  changeTabActive =
1827
1827
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY];
1828
1828
  }
1829
1829
  } else if (isWxMinAndWxapp) {
1830
1830
  if (sceneId == "1001" || sceneId == "1002") {
1831
1831
  changeTabActive =
1832
1832
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1833
1833
  }
1834
1834
  else if (sceneId == "1003") {
1835
1835
  changeTabActive =
1836
1836
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION];
1837
1837
  }
1838
1838
  }
1839
1839
  }
1840
1840
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
1841
1841
  return {
1842
1842
  menuType: SHOP_MENU_ID_TYPE.HOME,
1843
1843
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
1844
1844
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
1845
1845
  };
1846
1846
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
1847
1847
  return {
1848
1848
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
1849
1849
  tabActiveType: 0,
1850
1850
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
1851
1851
  };
1852
1852
  } else {
1853
1853
  return {
1854
1854
  menuType: SHOP_MENU_ID_TYPE.HOME,
1855
1855
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
1856
1856
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
1857
1857
  };
1858
1858
  }
1859
1859
  const deleteKeyList = [
1860
1860
  '$taroTimestamp',
1861
1861
  'cookie',
1862
1862
  'wdref',
1863
1863
  'navStart',
1864
1864
  'originOpts',
1865
1865
  'originParams',
1866
1866
  'originUrl',
1867
1867
  'referer',
1868
1868
  'stamp',
1869
1869
  'hybrid',
1870
1870
  'sr',
1871
1871
  'navh',
1872
1872
  'stath',
1873
1873
  ]
1874
1874
  let changeQueryData: any = { ...queryData }
1875
1875
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false;
1876
1876
  const sceneQuery =
1877
1877
  qrCodeScene && typeof qrCodeScene == "string"
1878
1878
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
1879
1879
  : {}
1880
1880
  changeQueryData = { ...changeQueryData, ...sceneQuery }
1881
1881
  deleteKeyList.forEach(key => {
1882
1882
  changeQueryData[key] && delete changeQueryData[key]
1883
1883
  })
1884
1884
  changeQueryData['shopid'] &&
1885
1885
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
1886
1886
  delete changeQueryData['shopid']
1887
1887
  changeQueryData['venderid'] &&
1888
1888
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
1889
1889
  delete changeQueryData['venderid']
1890
1890
  changeQueryData['vendorId'] &&
1891
1891
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
1892
1892
  delete changeQueryData['vendorId']
1893
1893
  changeQueryData['shopId'] &&
1894
1894
  changeQueryData['shopId'] === 'undefined' &&
1895
1895
  delete changeQueryData['shopId']
1896
1896
  changeQueryData['venderId'] &&
1897
1897
  changeQueryData['venderId'] === 'undefined' &&
1898
1898
  delete changeQueryData['venderId']
1899
1899
  return changeQueryData
1900
1900
  let isUsable = false
1901
1901
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
1902
1902
  const modularPackResultObj = formatPackResult(modularPackResult)
1903
1903
  const bundleUrl = getBundleUrl(modularPackResultObj)
1904
1904
  const bundleFileName = getBundleFileName(modularPackResultObj)
1905
1905
  const taroVersion = getTaroVersion(modularPackResultObj)
1906
1906
  if (bundleUrl && bundleFileName) {
1907
1907
  isUsable = true;
1908
1908
  }
1909
1909
  if (!isUsable && typeof exceptionReportFn === 'function') {
1910
1910
  exceptionReportFn({
1911
1911
  code: `${NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG}${
1912
1912
  floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE
1913
1913
  ? SgmCustomCode.SYSTEMPDCMODULE_DATA
1914
1914
  : SgmCustomCode.REMOTEMODULE_DATA
1915
1915
  }`,
1916
1916
  msg: {
1917
1917
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
1918
1918
  floorIdx: floorData?.floorIdx,
1919
1919
  uid: floorData?.uid,
1920
1920
  shopId: floorData?.floorExtInfo?.shopId,
1921
1921
  moduleId: floorData?.moduleId,
1922
1922
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
1923
1923
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
1924
1924
  floorKind: floorData?.floorExtInfo?.floorKind,
1925
1925
  middleTemplateId: floorData?.middleTemplateId,
1926
1926
  modularPackResult: {
1927
1927
  bundleUrl,
1928
1928
  taroVersion,
1929
1929
  },
1930
1930
  },
1931
1931
  })
1932
1932
  }
1933
1933
  return isUsable
1934
1934
  const objContainer = containerListData.find(
1935
1935
  item => item.containerId === containerId,
1936
1936
  )
1937
1937
  return (
1938
1938
  objContainer?.includeUids?.some(itemUid => {
1939
1939
  const objectFloor = floorListData.find(
1940
1940
  floorItem => itemUid === floorItem.uid,
1941
1941
  )
1942
1942
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
1943
1943
  }) ?? false
1944
1944
  );
1945
1945
  floorListData,
1946
1946
  containerListData,
1947
1947
  exceptionReportFn?
1948
1948
  const unableIsvFloorListData = floorListData.filter(
1949
1949
  floorItem =>
1950
1950
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
1951
1951
  !isIsvFloorUseable(floorItem, exceptionReportFn)
1952
1952
  );
1953
1953
  const unableIsvFloorUidList = unableIsvFloorListData.map(
1954
1954
  floorItem => floorItem.uid,
1955
1955
  )
1956
1956
  const unableIsvContainerListData = containerListData.filter(
1957
1957
  item =>
1958
1958
  item.includeUids &&
1959
1959
  item.includeUids.every(
1960
1960
  itemUid => unableIsvFloorUidList.indexOf(itemUid) != -1,
1961
1961
  ),
1962
1962
  )
1963
1963
  return unableIsvContainerListData;
1964
1964
  return -2;
1965
1965
  return customObj
1966
1966
  return customObj
1967
1967
  return customObj
1968
1968
  return customObj
1969
1969
  return customObj
1970
1970
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl)
1971
1971
  let getParams = false
1972
1972
  if (isOpenJdAppUrl(openAppUrl)) {
1973
1973
  try {
1974
1974
  getParams = openAppUrl.replace(
1975
1975
  /openApp\.jdMobile:\/\/virtual\?params=/i,
1976
1976
  ""
1977
1977
  );
1978
1978
  getParams = JSON.parse(String(getParams));
1979
1979
  } catch (e) {
1980
1980
  console.log(e);
1981
1981
  }
1982
1982
  }
1983
1983
  return getParams;
1984
1984
  const getLastParams = Object.assign({}, openParams)
1985
1985
  return `openapp.jdmobile://virtual?params=${JSON.stringify(getLastParams)}`
1986
1986
  if (val === null || val === '' || typeof val === 'undefined') {
1987
1987
  return true
1988
1988
  }
1989
1989
  return false;
1990
1990
  const {
1991
1991
  moduleId = "none",
1992
1992
  entrance = "none",
1993
1993
  sourceType = "none",
1994
1994
  sourceValue = "none",
1995
1995
  } = params;
1996
1996
  if (isIosDevice) {
1997
1997
  return `${moduleId}#${entrance}`;
1998
1998
  } else if (isAndroidDevice) {
1999
1999
  return `${sourceType}#${sourceValue}`;
2000
2000
  }
2001
2001
  return "none#none";
2002
2002
  if (data && typeof data === 'object') {
2003
2003
  let getOpenAppData = { ...data }
2004
2004
  try {
2005
2005
  const { sourceInfo, designerId, templateId, source } = getOpenAppData;
2006
2006
  if (designerId && templateId) {
2007
2007
  getOpenAppData = Object.assign({}, getOpenAppData, {
2008
2008
  sourceInfo: {
2009
2009
  entrance: "设计师预览",
2010
2010
  },
2011
2011
  });
2012
2012
  } else if (sourceInfo) {
2013
2013
  const { entrance } = sourceInfo;
2014
2014
  getOpenAppData.sourceInfo.entrance =
2015
2015
  entrance && entrance.length > 0 ? entrance : "其他";
2016
2016
  } else if (source && !sourceInfo) {
2017
2017
  if (typeof source === "object") {
2018
2018
  const { sourceType, entrance, sourceValue, moduleId } = source;
2019
2019
  getOpenAppData = Object.assign({}, getOpenAppData, {
2020
2020
  sourceInfo: {
2021
2021
  entrance: sourceType || entrance || "其他",
2022
2022
  moduleId: sourceValue || moduleId || "-100",
2023
2023
  },
2024
2024
  });
2025
2025
  } else {
2026
2026
  getOpenAppData = Object.assign({}, getOpenAppData, {
2027
2027
  sourceInfo: {
2028
2028
  entrance: source,
2029
2029
  },
2030
2030
  });
2031
2031
  }
2032
2032
  } else {
2033
2033
  getOpenAppData = Object.assign({}, getOpenAppData, {
2034
2034
  sourceInfo: {
2035
2035
  entrance: "其他",
2036
2036
  },
2037
2037
  });
2038
2038
  }
2039
2039
  } catch (e) {
2040
2040
  console.log(e);
2041
2041
  }
2042
2042
  return getOpenAppData;
2043
2043
  }
2044
2044
  return data;
2045
2045
  return displayObj
2046
2046
  if (typeof input === 'string') {
2047
2047
  try {
2048
2048
  return JSON.parse(input)
2049
2049
  } catch (e) {
2050
2050
  console.error('JSON解析失败', e)
2051
2051
  return {}
2052
2052
  }
2053
2053
  }
2054
2054
  return input || {}
2055
2055
  return false
2056
2056
  const borderStyle: { [key: string]: any } = {}
2057
2057
  if (item?.borderRadius) {
2058
2058
  let borderTopRadius = 0
2059
2059
  let borderBottomRadius = 0
2060
2060
  if (index === 0) {
2061
2061
  borderTopRadius = item.borderRadius
2062
2062
  borderBottomRadius =
2063
2063
  floorDataLen === 1 || item?.marginBottom !== 0 ? item.borderRadius : 0
2064
2064
  } else if (index === floorDataLen - 1) {
2065
2065
  borderTopRadius =
2066
2066
  floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius
2067
2067
  borderBottomRadius = item.borderRadius
2068
2068
  } else {
2069
2069
  borderTopRadius =
2070
2070
  floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius
2071
2071
  borderBottomRadius = item?.marginBottom === 0 ? 0 : item.borderRadius
2072
2072
  }
2073
2073
  borderStyle.borderTopLeftRadius = item?.borderTopLeftRadius ? `${item?.borderTopLeftRadius}px` : `${borderTopRadius}px`
2074
2074
  borderStyle.borderTopRightRadius = item?.borderTopRightRadius ? `${item?.borderTopRightRadius}px` : `${borderTopRadius}px`
2075
2075
  borderStyle.borderBottomLeftRadius = `${borderBottomRadius}px`
2076
2076
  borderStyle.borderBottomRightRadius = `${borderBottomRadius}px`
2077
2077
  borderStyle.borderTopLeftRadius = borderStyle?.borderTopLeftRadius || '0px';
2078
2078
  borderStyle.borderTopRightRadius = borderStyle?.borderTopRightRadius || '0px';
2079
2079
  borderStyle.borderBottomRightRadius = borderStyle?.borderBottomRightRadius || '0px';
2080
2080
  borderStyle.borderBottomLeftRadius = borderStyle?.borderBottomLeftRadius || '0px';
2081
2081
  return borderStyle
2082
2082
  isJdApp,
2083
2083
  isWxApp,
2084
2084
  isIosDevice,
2085
2085
  isAndroidDevice,
2086
2086
  isJdAndIosDevice,
2087
2087
  isJdAndAndroidDevice,
2088
2088
  isWxMin,
2089
2089
  isWxMinAndWxapp,
2090
2090
  isJdMin,
2091
2091
  isMin,
2092
2092
  isJdMinAndHarmony,
2093
2093
  isH5,
2094
2094
  isH5AndJdShopView,
2095
2095
  isImageOptimizeEnable,
2096
2096
  isChartH5,
2097
2097
  isH5AndJdShopViewNativeScroll,
2098
2098
  isH5AndJdShopViewH5Scroll,
2099
2099
  isH5AndJdShopH5CustomScrollView,
2100
2100
  isWxMiniH5View,
2101
2101
  sliceArrToChunkList,
2102
2102
  dealAddress,
2103
2103
  objectToUrlEncode,
2104
2104
  parseQueryUrlString,
2105
2105
  setLowSmallPicUrl,
2106
2106
  getJfsImage,
2107
2107
  getQualityImage,
2108
2108
  countStringify,
2109
2109
  setTaroStorage,
2110
2110
  getTaroStorageKeyValue,
2111
2111
  removeTaroStorageKey,
2112
2112
  clearTaroStorageKey,
2113
2113
  getSystemInfos,
2114
2114
  addHttps,
2115
2115
  dateFormat,
2116
2116
  throttle,
2117
2117
  lodashThrottle,
2118
2118
  debounce,
2119
2119
  getTelephone,
2120
2120
  rgbToHex,
2121
2121
  hexToRgb,
2122
2122
  getRandom,
2123
2123
  getWxAppCookieStr,
2124
2124
  pxTransformFromData,
2125
2125
  dealShopContentData,
2126
2126
  showSuccessToast,
2127
2127
  showFailToast,
2128
2128
  showNormalToast,
2129
2129
  showShopLoading,
2130
2130
  hideShopLoading,
2131
2131
  getAppChannelType,
2132
2132
  formatTabActiveMenuType,
2133
2133
  filterUrlQueryData,
2134
2134
  getAvifSupport,
2135
2135
  getWebpSupport,
2136
2136
  isMemberPage,
2137
2137
  sgmCustomReport,
2138
2138
  draCustomReport,
2139
2139
  remoteCustomReport,
2140
2140
  draInterfaceCustomReport,
2141
2141
  draBusinessCustomReport,
2142
2142
  isOpenJdAppUrl,
2143
2143
  jdOpenAppParams,
2144
2144
  createJdOpenAppUrl,
2145
2145
  dealJdOpenAppData,
2146
2146
  isEmpty,
2147
2147
  getJdAppReportPageSource,
2148
2148
  isAppClassifyPage,
2149
2149
  getQualityImageNew,
2150
2150
  getQualityImageOld,
2151
2151
  isPc,
2152
2152
  ipLoc_djd,
2153
2153
  jdAppVersionCompare,
2154
2154
  dealNativePixelToCssPixel,
2155
2155
  isAppStowShop,
2156
2156
  isIpadDevice,
2157
2157
  getBorderStyle,