@conecli/cone-render 0.8.44 → 0.8.46-beta.0

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