@conecli/cone-render 0.9.1-shop2.30 → 0.9.1-shop2.31

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