@conecli/cone-render 0.9.1-shop2.32 → 0.9.1-shop2.34

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