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