@conecli/cone-render 0.10.1-beta.5 → 0.10.1-beta.6

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