@conecli/cone-render 0.10.1-shop-beta.5 → 0.10.1-shop3.0

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