@conecli/cone-render 0.9.1-shop2.36 → 0.9.1-shop2.38

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