@conecli/cone-render 0.9.1-shop2.7 → 0.9.1-shop2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -0
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/sgmCustomCode.ts +1 -0
  9. package/dist/common/token/token.ts +1 -1
  10. package/dist/common/wxappApi.jd.ts +1 -0
  11. package/dist/components/ErrorBoundary.tsx +1 -1
  12. package/dist/components/base/CountDown/index.tsx +1 -1
  13. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  14. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  15. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  16. package/dist/components/base/Dialog/index.module.scss +5 -0
  17. package/dist/components/base/Dialog/index.tsx +1 -1
  18. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  19. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  20. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  21. package/dist/components/floorItem.jd.tsx +1 -1
  22. package/dist/components/floorItem.weapp.tsx +1 -1
  23. package/dist/components/remoteFloorItem.tsx +1 -1
  24. package/dist/interface/common.ts +1 -1
  25. package/dist/interface/component.ts +1 -1
  26. package/dist/interface/jumpEventReport.ts +1 -1
  27. package/dist/interface/service.ts +1 -1
  28. package/dist/interface/utils.ts +1 -1
  29. package/dist/jumpEventReport/base.ts +1 -1
  30. package/dist/jumpEventReport/const.ts +1 -1
  31. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  32. package/dist/jumpEventReport/index.h5.ts +1 -1
  33. package/dist/jumpEventReport/index.jd.ts +1 -1
  34. package/dist/jumpEventReport/index.weapp.ts +1 -1
  35. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  36. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  37. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  38. package/dist/jumpEventReport/web/report.ts +1 -1
  39. package/dist/jumpEventReport/web.base.ts +1 -1
  40. package/dist/jumpEventReport/web.jd.ts +1 -1
  41. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  42. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  43. package/dist/jumpEventReport/web.tjm.ts +1 -0
  44. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  45. package/dist/open/api/environment.ts +1 -1
  46. package/dist/open/api/jump copy.ts +1 -1
  47. package/dist/open/api/shopMember.ts +1 -1
  48. package/dist/open/api/track.ts +1 -1
  49. package/dist/open/api/util.ts +1 -1
  50. package/dist/sass/app.h5.scss +39 -3
  51. package/dist/service/requestServer.ts +1 -1
  52. package/dist/utils/connectNativeJsBridge.ts +1 -1
  53. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  54. package/dist/utils/draExceptionAndProfile.ts +1 -1
  55. package/dist/utils/h5Utils.ts +1 -1
  56. package/dist/utils/index.h5.ts +1 -1
  57. package/dist/utils/index.ts +1 -1
  58. package/dist/utils/index.weapp.ts +1 -1
  59. package/dist/utils/jm-common.js +1 -1
  60. package/dist/utils/sgmCodeUtils.ts +1 -0
  61. package/dist/utils/utils.ts +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  SHOP_MENU_ID_TYPE,
3
2
  SHOP_MENU_ID_QUERY_NAME,
4
3
  SECTION_HOME_TAB_TYPE,
5
4
  SECTION_HOME_TAB_NAME_TYPE,
6
5
  SECTION_HOME_TAB_QUERY_TYPE,
7
6
  CHANNEL_TYPE,
8
7
  JDShopViewBusinessPathType,
9
8
  FloorModuleType,
10
9
  RemoteLoadFloorList,
11
10
  getBundleUrl,
12
11
  getBundleFileName,
13
12
  formatPackResult,
14
13
  const resultList: Array<any> = [],
15
14
  arrLen = arr.length
16
15
  if (arrLen) {
17
16
  if (arrLen > size) {
18
17
  for (let i = 0; i < arrLen; i = i + size) {
19
18
  resultList.push(arr.slice(i, i + size))
20
19
  }
21
20
  } else {
22
21
  resultList.push(arr)
23
22
  }
24
23
  }
25
24
  return resultList
26
25
  let _address = ids
27
26
  const _areaAreaSplit = ids.split('.')
28
27
  const _areaAreaSplit2 = ids.split('_')
29
28
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address
30
29
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address
31
30
  return _address
32
31
  const getValue = `${obj[key]}`.replace(/undefined/,'').replace(/null/,'')
33
32
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`
34
33
  const result = {}
35
34
  if (
36
35
  !urlOrQueryStr ||
37
36
  ('string' !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
38
37
  ) {
39
38
  return result
40
39
  }
41
40
  if (urlOrQueryStr.indexOf('?') > -1) {
42
41
  const queryStr = urlOrQueryStr.split('?')
43
42
  const queryItemList =
44
43
  queryStr && queryStr.length > 1 ? queryStr[1].split('&') : []
45
44
  const queryItemListLen = queryItemList.length
46
45
  queryItemListLen > 0 &&
47
46
  queryItemList.forEach((item) => {
48
47
  const thisItemList = item.split('=')
49
48
  result[thisItemList[0]] = thisItemList[1]
50
49
  })
51
50
  } else {
52
51
  const queryItemList =
53
52
  urlOrQueryStr.indexOf('&') > -1
54
53
  ? urlOrQueryStr.split('&')
55
54
  : [urlOrQueryStr]
56
55
  const queryItemListLen = queryItemList.length
57
56
  queryItemListLen > 0 &&
58
57
  queryItemList.forEach((item) => {
59
58
  const thisItemList = item.split('=')
60
59
  result[thisItemList[0]] = thisItemList[1]
61
60
  })
62
61
  }
63
62
  return result
64
63
  url: string,
65
64
  size?: {
66
65
  w: number
67
66
  h: number
68
67
  },
69
68
  quality?: number,
70
69
  if (url && size) {
71
70
  const _w = Math.floor(size.w)
72
71
  const _h = Math.floor(size.h)
73
72
  if (url.match(/gif$/i)) {
74
73
  return url
75
74
  } else {
76
75
  if (_w > 0 && _h > 0) {
77
76
  url = url.replace('jfs/', `s${_w}x${_h}_jfs/`)
78
77
  }
79
78
  url += quality != null ? `!q${quality}.dpg` : '.dpg'
80
79
  }
81
80
  }
82
81
  return url
83
82
  url: string,
84
83
  jfsImgInfo: UtilsInterFace.getJfsImageInfo = {},
85
84
  if (url.match(/\.(jpg|png|dpg)$/i)) {
86
85
  const { width, height, quality } = jfsImgInfo
87
86
  if (typeof width === 'number' || typeof height === 'number') {
88
87
  url = url.replace(
89
88
  '/jfs/',
90
89
  `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`,
91
90
  )
92
91
  }
93
92
  if (
94
93
  typeof quality === 'number' &&
95
94
  quality > 0 &&
96
95
  quality < 100 &&
97
96
  url.match(/\.jpg$/i)
98
97
  ) {
99
98
  url += `!q${quality}.dpg`
100
99
  }
101
100
  }
102
101
  return addHttps(url)
103
102
  !imgUrl.match(
104
103
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
105
104
  )
106
105
  if(!imgUrl.includes('360buyimg.com')){
107
106
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
108
107
  }
109
108
  if(quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
110
109
  count: number,
111
110
  fixedNum = 2,
112
111
  unit = '万',
113
112
  maxNum = 10000,
114
113
  count = Number(count)
115
114
  if (count > maxNum) {
116
115
  return (count / maxNum).toFixed(fixedNum) + unit
117
116
  }
118
117
  return count
119
118
  key: string,
120
119
  value: string | object,
121
120
  successBack?: any,
122
121
  failBack?: any,
123
122
  return Taro.setStorage({
124
123
  key: key,
125
124
  data: value,
126
125
  success: successBack,
127
126
  fail: failBack,
128
127
  })
129
128
  return Taro.getStorageSync(key)
130
129
  return Taro.removeStorage({
131
130
  key: key,
132
131
  })
133
132
  return Taro.clearStorage()
134
133
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
135
134
  let gap = 0
136
135
  let width = 96
137
136
  if (systemInfo.platform === 'android') {
138
137
  gap = 8
139
138
  width = 96
140
139
  } else if (systemInfo.platform === 'devtools') {
141
140
  if (isIOS) {
142
141
  gap = 5.5
143
142
  } else {
144
143
  gap = 7.5
145
144
  }
146
145
  } else {
147
146
  gap = 4
148
147
  width = 88
149
148
  }
150
149
  rect = {
151
150
  bottom: systemInfo.statusBarHeight + gap + 32,
152
151
  height: 32,
153
152
  left: systemInfo.windowWidth - width - 10,
154
153
  right: systemInfo.windowWidth - 10,
155
154
  top: systemInfo.statusBarHeight + gap,
156
155
  width,
157
156
  }
158
157
  }
159
158
  const gap = rect.top - systemInfo.statusBarHeight
160
159
  systemInfo.navBarTopToStatusBar = gap
161
160
  systemInfo.navBarHeight = 2 * gap + rect.height
162
161
  systemInfo.capsulePosition = rect
163
162
  systemInfo.isIOS = isIOS
164
163
  systemInfo.isAndroid = isAndroid
165
164
  return systemInfo
166
165
  if (str.match(/^\/\//)) {
167
166
  str = 'https:' + str
168
167
  }
169
168
  return str
170
169
  dateTimeOrdate: Date | string | number | null,
171
170
  format = 'yyyy-MM-dd HH:mm:ss',
172
171
  noPadStart = {
173
172
  M: '0',
174
173
  d: '0',
175
174
  H: '0',
176
175
  m: '0',
177
176
  s: '0',
178
177
  },
179
178
  let dateResult = ''
180
179
  const padStarts = Object.assign(
181
180
  {
182
181
  M: '0',
183
182
  d: '0',
184
183
  H: '0',
185
184
  m: '0',
186
185
  s: '0',
187
186
  },
188
187
  noPadStart,
189
188
  )
190
189
  if (dateTimeOrdate) {
191
190
  let changeDateTimeOrdate = dateTimeOrdate
192
191
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate)
193
192
  if (getChangeDateTimeToNumber) {
194
193
  changeDateTimeOrdate = getChangeDateTimeToNumber
195
194
  } else {
196
195
  changeDateTimeOrdate = `${changeDateTimeOrdate}`.replace(/-/g, '/')
197
196
  }
198
197
  const nowDate =
199
198
  dateTimeOrdate instanceof Date
200
199
  ? dateTimeOrdate
201
200
  : new Date(changeDateTimeOrdate)
202
201
  const dateMap = {
203
202
  y: `${nowDate.getFullYear()}`,
204
203
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts['M']),
205
204
  d: `${nowDate.getDate()}`.padStart(2, padStarts['d']),
206
205
  H: `${nowDate.getHours()}`.padStart(2, padStarts['H']),
207
206
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts['m']),
208
207
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts['s']),
209
208
  }
210
209
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g')
211
210
  const regYear = new RegExp('y')
212
211
  dateResult = format.replace(regDate, (v) => {
213
212
  let changeValue = v
214
213
  if (regYear.test(changeValue)) {
215
214
  const thisYear = dateMap.y
216
215
  const subValueLen = 4 - changeValue.length
217
216
  changeValue = thisYear.substr(subValueLen)
218
217
  } else {
219
218
  const dateKey = v.substr(0, 1)
220
219
  changeValue = dateMap[dateKey]
221
220
  }
222
221
  return changeValue
223
222
  })
224
223
  }
225
224
  return dateResult
226
225
  let timer: any = null
227
226
  let startTime = Date.now()
228
227
  return function () {
229
228
  const curTime = Date.now()
230
229
  const remaining = delay - (curTime - startTime)
231
230
  const context = this
232
231
  const args = arguments
233
232
  clearTimeout(timer)
234
233
  if (remaining <= 0) {
235
234
  func.apply(context, args)
236
235
  startTime = Date.now()
237
236
  } else {
238
237
  timer = setTimeout(func, remaining)
239
238
  }
240
239
  }
241
240
  let context, args, result
242
241
  let timeout = null
243
242
  let previous = 0
244
243
  if (!options) options = {}
245
244
  const later = function () {
246
245
  previous = options.leading === false ? 0 : Date.now()
247
246
  timeout = null
248
247
  result = func.apply(context, args)
249
248
  if (!timeout) context = args = null
250
249
  }
251
250
  return function () {
252
251
  const now = Date.now()
253
252
  if (!previous && options.leading === false) previous = now
254
253
  const remaining = wait - (now - previous)
255
254
  context = this
256
255
  args = arguments
257
256
  if (remaining <= 0 || remaining > wait) {
258
257
  if (timeout) {
259
258
  clearTimeout(timeout)
260
259
  timeout = null
261
260
  }
262
261
  previous = now
263
262
  result = func.apply(context, args)
264
263
  if (!timeout) context = args = null
265
264
  } else if (!timeout && options.trailing !== false) {
266
265
  timeout = setTimeout(later, remaining)
267
266
  }
268
267
  return result
269
268
  }
270
269
  let timer: any = null
271
270
  return function () {
272
271
  const context: any = this
273
272
  const args = arguments
274
273
  timer && clearTimeout(timer)
275
274
  timer = setTimeout(function () {
276
275
  fn.apply(context, args)
277
276
  }, delay)
278
277
  }
279
278
  if (txt) {
280
279
  txt = txt.trim()
281
280
  const reg = new RegExp(/[\d-]+/)
282
281
  const res = reg.exec(txt)
283
282
  if (res && res.length > 0) {
284
283
  let tel = res[0]
285
284
  if (tel && delSeparator) {
286
285
  tel = tel.replace(/-/g, '')
287
286
  }
288
287
  return tel
289
288
  }
290
289
  }
291
290
  return ''
292
291
  if (rgb) {
293
292
  const reg = /^(rgb|RGB)/
294
293
  const color = rgb
295
294
  if (reg.test(color)) {
296
295
  let strHex = '#'
297
296
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',')
298
297
  for (let i = 0; i < colorArr.length; i++) {
299
298
  let hex = Number(colorArr[i]).toString(16)
300
299
  if (hex === '0') {
301
300
  hex += hex
302
301
  }
303
302
  strHex += hex
304
303
  }
305
304
  return strHex
306
305
  } else {
307
306
  return String(color)
308
307
  }
309
308
  } else {
310
309
  return ''
311
310
  }
312
311
  if (hex) {
313
312
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
314
313
  let color = hex.toLowerCase()
315
314
  if (reg.test(color)) {
316
315
  if (color.length === 4) {
317
316
  let colorNew = '#'
318
317
  for (let i = 1; i < 4; i += 1) {
319
318
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1))
320
319
  }
321
320
  color = colorNew
322
321
  }
323
322
  const colorChange: number[] = []
324
323
  for (let i = 1; i < 7; i += 2) {
325
324
  colorChange.push(parseInt('0x' + color.slice(i, i + 2)))
326
325
  }
327
326
  if (returnList) {
328
327
  return colorChange
329
328
  } else {
330
329
  return 'RGB(' + colorChange.join(',') + ')'
331
330
  }
332
331
  } else {
333
332
  return color
334
333
  }
335
334
  } else {
336
335
  return ''
337
336
  }
338
337
  n: number,
339
338
  m: number,
340
339
  filterNum: number | undefined = undefined,
341
340
  const c = m - n + 1
342
341
  const res = Math.floor(Math.random() * c + n)
343
342
  if (filterNum && filterNum == res) {
344
343
  console.log('随机数二次开始', res, filterNum)
345
344
  return getRandom(n, m, filterNum)
346
345
  } else {
347
346
  return res
348
347
  }
349
348
  wqCookieStr: string
350
349
  wqCookie: {
351
350
  pin?: string
352
351
  visitkey?: string
353
352
  [key: string]: any
354
353
  }
355
354
  const {
356
355
  jdpin,
357
356
  pinStatus,
358
357
  visitkey,
359
358
  unionid,
360
359
  skey,
361
360
  __jda,
362
361
  __jdv,
363
362
  __wga,
364
363
  wxapp_type,
365
364
  appType
366
365
  } = cookie
367
366
  const ret: string[] = []
368
367
  const getUserCookieObj = {}
369
368
  const createUseCookieArr = [
370
369
  jdpin,
371
370
  pinStatus,
372
371
  visitkey,
373
372
  unionid,
374
373
  skey,
375
374
  __jda,
376
375
  __jdv,
377
376
  __wga,
378
377
  wid,
379
378
  wq_skey,
380
379
  wq_uin,
381
380
  wq_auth_token,
382
381
  wxapp_scene,
383
382
  wq_unionid,
384
383
  wxapp_openid,
385
384
  wxapp_version,
386
385
  wxapp_type,
387
386
  appType
388
387
  name = name === 'jdpin' ? 'pin' : name;
389
388
  name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
390
389
  ret.push(`${name}=${encodeURIComponent(value)}`)
391
390
  getUserCookieObj[name] = value
392
391
  }
393
392
  })
394
393
  return {
395
394
  wqCookieStr: ret.join(';'),
396
395
  wqCookie: getUserCookieObj,
397
396
  }
398
397
  num,
399
398
  widthSize = 375,
400
399
  layoutWidth = windowWidth,
401
400
  const getNum = Number(num)
402
401
  return Math.round((getNum / widthSize) * layoutWidth)
403
402
  let checkState = false
404
403
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag
405
404
  if (couponFloorModuleType === FloorModuleType.COUPON) {
406
405
  try {
407
406
  const dataDefines = getFloorDataToDataDefines(floorData)
408
407
  const couponDataDefine = dataDefines
409
408
  ? dataDefines.filter((item) => {
410
409
  return item.type === 'coupon'
411
410
  })
412
411
  : [],
413
412
  couponList = couponDataDefine[0]?.nodeText?.data
414
413
  ? couponDataDefine[0]?.nodeText?.data
415
414
  : [],
416
415
  couponLength = couponList.length,
417
416
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
418
417
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
419
418
  : 0
420
419
  if (numShowPerLine === 0 && couponLength > 3) {
421
420
  checkState = true
422
421
  }
423
422
  } catch (e) {
424
423
  checkState = false
425
424
  }
426
425
  return checkState
427
426
  }
428
427
  containers = [],
429
428
  floors = [],
430
429
  clearFirstContaierMarginTop = false,
431
430
  isLuxuryShop = false,
432
431
  isShowNativeImmersivePlayer=false,
433
432
  screenHeight = null,
434
433
  screenWidth = null,
435
434
  bottomBarHeight= null
436
435
  } = pageData
437
436
  exceptionReportFn
438
437
  )
439
438
  if (getFloorData) {
440
439
  containerId: item.containerId,
441
440
  containerIndex: index,
442
441
  ...getFloorData,
443
442
  }
444
443
  if(getFloorData?.floorExtInfo?.floorLoadWay === 2){
445
444
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(getFloorData, exceptionReportFn)
446
445
  !getSysFloorToLoadTypeRes && (getFloorData.floorExtInfo.floorLoadWay = 1)
447
446
  }
448
447
  if(isProd && isWxMinAndWxapp){
449
448
  shopContentContainerListData = shopContentContainerListData.filter(
450
449
  (item) =>
451
450
  item.floors.length > 0 &&
452
451
  !isIsvContainer(item.containerId, shopContentFloorListData, shopContentContainerListData)
453
452
  )
454
453
  }
455
454
  shopContentContainerListData = [].concat(shopContentContainerListData)
456
455
  return {
457
456
  shopContentContainerListData,
458
457
  shopContentFloorListData,
459
458
  }
460
459
  const changeOpts = {
461
460
  title: '',
462
461
  icon: 'success',
463
462
  duration: 1500,
464
463
  mask: true,
465
464
  ...options,
466
465
  }
467
466
  if (changeOpts.title.length > 7) {
468
467
  showNormalToast(options)
469
468
  } else {
470
469
  Taro.showToast(changeOpts as any)
471
470
  }
472
471
  const changeOpts = {
473
472
  title: '',
474
473
  icon: 'error',
475
474
  duration: 1500,
476
475
  mask: true,
477
476
  ...options,
478
477
  }
479
478
  if (changeOpts.title.length > 7) {
480
479
  showNormalToast(options)
481
480
  } else {
482
481
  Taro.showToast(changeOpts as any)
483
482
  }
484
483
  Taro.showToast({
485
484
  title: '',
486
485
  icon: 'none',
487
486
  duration: 1500,
488
487
  mask: true,
489
488
  ...options,
490
489
  })
491
490
  return Taro.showLoading({
492
491
  title: text,
493
492
  })
494
493
  return new Promise(() => {
495
494
  Taro.nextTick(() => {
496
495
  setTimeout(() => {
497
496
  Taro.hideLoading(options)
498
497
  }, 300)
499
498
  })
500
499
  })
501
500
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
502
501
  const {
503
502
  tabActive = SECTION_HOME_TAB_NAME_TYPE[
504
503
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
505
504
  ],
506
505
  sceneId,
507
506
  } = query
508
507
  let changeTabActive = tabActive
509
508
  if (sceneId) {
510
509
  if (isH5) {
511
510
  if (sceneId == '1002') {
512
511
  changeTabActive =
513
512
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
514
513
  }
515
514
  else if (sceneId == '1003') {
516
515
  changeTabActive =
517
516
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY]
518
517
  }
519
518
  } else if (isWxMinAndWxapp) {
520
519
  if (sceneId == '1001' || sceneId == '1002') {
521
520
  changeTabActive =
522
521
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
523
522
  }
524
523
  else if (sceneId == '1003') {
525
524
  changeTabActive =
526
525
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]
527
526
  }
528
527
  }
529
528
  }
530
529
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
531
530
  return {
532
531
  menuType: SHOP_MENU_ID_TYPE.HOME,
533
532
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
534
533
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
535
534
  }
536
535
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
537
536
  return {
538
537
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
539
538
  tabActiveType: 0,
540
539
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
541
540
  }
542
541
  } else {
543
542
  return {
544
543
  menuType: SHOP_MENU_ID_TYPE.HOME,
545
544
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
546
545
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
547
546
  }
548
547
  }
549
548
  const deleteKeyList = [
550
549
  '$taroTimestamp',
551
550
  'cookie',
552
551
  'wdref',
553
552
  'navStart',
554
553
  'originOpts',
555
554
  'originParams',
556
555
  'originUrl',
557
556
  'referer',
558
557
  'stamp',
559
558
  ]
560
559
  let changeQueryData: any = { ...queryData }
561
560
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false
562
561
  const sceneQuery =
563
562
  qrCodeScene && typeof qrCodeScene == 'string'
564
563
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
565
564
  : {}
566
565
  changeQueryData = { ...changeQueryData, ...sceneQuery }
567
566
  deleteKeyList.forEach((key) => {
568
567
  changeQueryData[key] && delete changeQueryData[key]
569
568
  })
570
569
  changeQueryData['shopid'] &&
571
570
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
572
571
  delete changeQueryData['shopid']
573
572
  changeQueryData['venderid'] &&
574
573
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
575
574
  delete changeQueryData['venderid']
576
575
  changeQueryData['vendorId'] &&
577
576
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
578
577
  delete changeQueryData['vendorId']
579
578
  return changeQueryData
580
579
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
581
580
  const modularPackResultObj = formatPackResult(modularPackResult)
582
581
  const bundleUrl = getBundleUrl(modularPackResultObj)
583
582
  const bundleFileName = getBundleFileName(modularPackResultObj)
584
583
  if (bundleUrl && bundleFileName) {
585
584
  isUsable = true
586
585
  }
587
586
  const objContainer = containerListData.find(
588
587
  (item) => item.containerId === containerId,
589
588
  )
590
589
  return (
591
590
  objContainer?.includeUids?.some((itemUid) => {
592
591
  const objectFloor = floorListData.find(
593
592
  (floorItem) => itemUid === floorItem.uid,
594
593
  )
595
594
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
596
595
  }) ?? false
597
596
  )
598
597
  floorListData,
599
598
  containerListData,
600
599
  exceptionReportFn?,
601
600
  const unableIsvFloorListData = floorListData.filter(
602
601
  (floorItem) =>
603
602
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
604
603
  !isIsvFloorUseable(floorItem, exceptionReportFn),
605
604
  )
606
605
  const unableIsvFloorUidList = unableIsvFloorListData.map(
607
606
  (floorItem) => floorItem.uid,
608
607
  )
609
608
  const unableIsvContainerListData = containerListData.filter(
610
609
  (item) =>
611
610
  item.includeUids &&
612
611
  item.includeUids.every(
613
612
  (itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1,
614
613
  ),
615
614
  )
616
615
  return unableIsvContainerListData
617
616
  return -2
618
617
  return customObj
619
618
  if (data && typeof data === 'object') {
620
619
  let getOpenAppData = { ...data }
621
620
  try {
622
621
  const { sourceInfo, designerId, templateId, source } = getOpenAppData
623
622
  if (designerId && templateId) {
624
623
  getOpenAppData = Object.assign({}, getOpenAppData, {
625
624
  sourceInfo: {
626
625
  entrance: '设计师预览',
627
626
  },
628
627
  })
629
628
  } else if (sourceInfo) {
630
629
  const { entrance } = sourceInfo
631
630
  getOpenAppData.sourceInfo.entrance =
632
631
  entrance && entrance.length > 0 ? entrance : '其他'
633
632
  } else if (source && !sourceInfo) {
634
633
  if (typeof source === 'object') {
635
634
  const { sourceType, entrance, sourceValue, moduleId } = source
636
635
  getOpenAppData = Object.assign({}, getOpenAppData, {
637
636
  sourceInfo: {
638
637
  entrance: sourceType || entrance || '其他',
639
638
  moduleId: sourceValue || moduleId || '-100',
640
639
  },
641
640
  })
642
641
  } else {
643
642
  getOpenAppData = Object.assign({}, getOpenAppData, {
644
643
  sourceInfo: {
645
644
  entrance: source,
646
645
  },
647
646
  })
648
647
  }
649
648
  } else {
650
649
  getOpenAppData = Object.assign({}, getOpenAppData, {
651
650
  sourceInfo: {
652
651
  entrance: '其他',
653
652
  },
654
653
  })
655
654
  }
656
655
  } catch (e) {
657
656
  console.log(e)
658
657
  }
659
658
  return getOpenAppData
660
659
  }
661
660
  return data
662
661
  return displayObj
663
662
  isChartH5,
664
663
  isH5AndJdShopViewH5Scroll,
665
664
  isH5AndJdShopH5CustomScrollView,
666
665
  isMemberPage,
667
666
  isPc,
668
667
  ipLoc_djd,
669
668
  jdAppVersionCompare,
670
669
  dealNativePixelToCssPixel,
671
670
  isAppStowShop,
672
671
  dealJdOpenAppData
672
+ import Taro from '@tarojs/taro'
673
673
  SHOP_MENU_ID_TYPE,
674
674
  SHOP_MENU_ID_QUERY_NAME,
675
675
  SECTION_HOME_TAB_TYPE,
676
676
  SECTION_HOME_TAB_NAME_TYPE,
677
677
  SECTION_HOME_TAB_QUERY_TYPE,
678
678
  CHANNEL_TYPE,
679
679
  JDShopViewBusinessPathType,
680
680
  FloorModuleType,
681
681
  RemoteLoadFloorList,
682
682
  getBundleUrl,
683
683
  getBundleFileName,
684
684
  formatPackResult,
685
685
  const resultList: Array<any> = [],
686
686
  arrLen = arr.length
687
687
  if (arrLen) {
688
688
  if (arrLen > size) {
689
689
  for (let i = 0; i < arrLen; i = i + size) {
690
690
  resultList.push(arr.slice(i, i + size))
691
691
  }
692
692
  } else {
693
693
  resultList.push(arr)
694
694
  }
695
695
  }
696
696
  return resultList
697
697
  let _address = ids
698
698
  const _areaAreaSplit = ids.split('.')
699
699
  const _areaAreaSplit2 = ids.split('_')
700
700
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address
701
701
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address
702
702
  return _address
703
703
  const getValue = `${obj[key]}`.replace(/undefined/,'').replace(/null/,'')
704
704
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`
705
705
  const result = {}
706
706
  if (
707
707
  !urlOrQueryStr ||
708
708
  ('string' !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
709
709
  ) {
710
710
  return result
711
711
  }
712
712
  if (urlOrQueryStr.indexOf('?') > -1) {
713
713
  const queryStr = urlOrQueryStr.split('?')
714
714
  const queryItemList =
715
715
  queryStr && queryStr.length > 1 ? queryStr[1].split('&') : []
716
716
  const queryItemListLen = queryItemList.length
717
717
  queryItemListLen > 0 &&
718
718
  queryItemList.forEach((item) => {
719
719
  const thisItemList = item.split('=')
720
720
  result[thisItemList[0]] = thisItemList[1]
721
721
  })
722
722
  } else {
723
723
  const queryItemList =
724
724
  urlOrQueryStr.indexOf('&') > -1
725
725
  ? urlOrQueryStr.split('&')
726
726
  : [urlOrQueryStr]
727
727
  const queryItemListLen = queryItemList.length
728
728
  queryItemListLen > 0 &&
729
729
  queryItemList.forEach((item) => {
730
730
  const thisItemList = item.split('=')
731
731
  result[thisItemList[0]] = thisItemList[1]
732
732
  })
733
733
  }
734
734
  return result
735
735
  url: string,
736
736
  size?: {
737
737
  w: number
738
738
  h: number
739
739
  },
740
740
  quality?: number,
741
741
  if (url && size) {
742
742
  const _w = Math.floor(size.w)
743
743
  const _h = Math.floor(size.h)
744
744
  if (url.match(/gif$/i)) {
745
745
  return url
746
746
  } else {
747
747
  if (_w > 0 && _h > 0) {
748
748
  url = url.replace('jfs/', `s${_w}x${_h}_jfs/`)
749
749
  }
750
750
  url += quality != null ? `!q${quality}.dpg` : '.dpg'
751
751
  }
752
752
  }
753
753
  return url
754
754
  url: string,
755
755
  jfsImgInfo: UtilsInterFace.getJfsImageInfo = {},
756
756
  if (url.match(/\.(jpg|png|dpg)$/i)) {
757
757
  const { width, height, quality } = jfsImgInfo
758
758
  if (typeof width === 'number' || typeof height === 'number') {
759
759
  url = url.replace(
760
760
  '/jfs/',
761
761
  `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`,
762
762
  )
763
763
  }
764
764
  if (
765
765
  typeof quality === 'number' &&
766
766
  quality > 0 &&
767
767
  quality < 100 &&
768
768
  url.match(/\.jpg$/i)
769
769
  ) {
770
770
  url += `!q${quality}.dpg`
771
771
  }
772
772
  }
773
773
  return addHttps(url)
774
774
  !imgUrl.match(
775
775
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
776
776
  )
777
777
  if(!imgUrl.includes('360buyimg.com')){
778
778
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl
779
779
  }
780
780
  if(quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`
781
781
  count: number,
782
782
  fixedNum = 2,
783
783
  unit = '万',
784
784
  maxNum = 10000,
785
785
  count = Number(count)
786
786
  if (count > maxNum) {
787
787
  return (count / maxNum).toFixed(fixedNum) + unit
788
788
  }
789
789
  return count
790
790
  key: string,
791
791
  value: string | object,
792
792
  successBack?: any,
793
793
  failBack?: any,
794
794
  return Taro.setStorage({
795
795
  key: key,
796
796
  data: value,
797
797
  success: successBack,
798
798
  fail: failBack,
799
799
  })
800
800
  return Taro.getStorageSync(key)
801
801
  return Taro.removeStorage({
802
802
  key: key,
803
803
  })
804
804
  return Taro.clearStorage()
805
805
  if (str.match(/^\/\//)) {
806
806
  str = 'https:' + str
807
807
  }
808
808
  return str
809
809
  dateTimeOrdate: Date | string | number | null,
810
810
  format = 'yyyy-MM-dd HH:mm:ss',
811
811
  noPadStart = {
812
812
  M: '0',
813
813
  d: '0',
814
814
  H: '0',
815
815
  m: '0',
816
816
  s: '0',
817
817
  },
818
818
  let dateResult = ''
819
819
  const padStarts = Object.assign(
820
820
  {
821
821
  M: '0',
822
822
  d: '0',
823
823
  H: '0',
824
824
  m: '0',
825
825
  s: '0',
826
826
  },
827
827
  noPadStart,
828
828
  )
829
829
  if (dateTimeOrdate) {
830
830
  let changeDateTimeOrdate = dateTimeOrdate
831
831
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate)
832
832
  if (getChangeDateTimeToNumber) {
833
833
  changeDateTimeOrdate = getChangeDateTimeToNumber
834
834
  } else {
835
835
  changeDateTimeOrdate = `${changeDateTimeOrdate}`.replace(/-/g, '/').replace(/\./g, '/')
836
836
  }
837
837
  const nowDate =
838
838
  dateTimeOrdate instanceof Date
839
839
  ? dateTimeOrdate
840
840
  : new Date(changeDateTimeOrdate)
841
841
  const dateMap = {
842
842
  y: `${nowDate.getFullYear()}`,
843
843
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts['M']),
844
844
  d: `${nowDate.getDate()}`.padStart(2, padStarts['d']),
845
845
  H: `${nowDate.getHours()}`.padStart(2, padStarts['H']),
846
846
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts['m']),
847
847
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts['s']),
848
848
  }
849
849
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g')
850
850
  const regYear = new RegExp('y')
851
851
  dateResult = format.replace(regDate, (v) => {
852
852
  let changeValue = v
853
853
  if (regYear.test(changeValue)) {
854
854
  const thisYear = dateMap.y
855
855
  const subValueLen = 4 - changeValue.length
856
856
  changeValue = thisYear.substr(subValueLen)
857
857
  } else {
858
858
  const dateKey = v.substr(0, 1)
859
859
  changeValue = dateMap[dateKey]
860
860
  }
861
861
  return changeValue
862
862
  })
863
863
  }
864
864
  return dateResult
865
865
  let timer: any = null
866
866
  let startTime = Date.now()
867
867
  return function () {
868
868
  const curTime = Date.now()
869
869
  const remaining = delay - (curTime - startTime)
870
870
  const context = this
871
871
  const args = arguments
872
872
  clearTimeout(timer)
873
873
  if (remaining <= 0) {
874
874
  func.apply(context, args)
875
875
  startTime = Date.now()
876
876
  } else {
877
877
  timer = setTimeout(func, remaining)
878
878
  }
879
879
  }
880
880
  let context, args, result
881
881
  let timeout = null
882
882
  let previous = 0
883
883
  if (!options) options = {}
884
884
  const later = function () {
885
885
  previous = options.leading === false ? 0 : Date.now()
886
886
  timeout = null
887
887
  result = func.apply(context, args)
888
888
  if (!timeout) context = args = null
889
889
  }
890
890
  return function () {
891
891
  const now = Date.now()
892
892
  if (!previous && options.leading === false) previous = now
893
893
  const remaining = wait - (now - previous)
894
894
  context = this
895
895
  args = arguments
896
896
  if (remaining <= 0 || remaining > wait) {
897
897
  if (timeout) {
898
898
  clearTimeout(timeout)
899
899
  timeout = null
900
900
  }
901
901
  previous = now
902
902
  result = func.apply(context, args)
903
903
  if (!timeout) context = args = null
904
904
  } else if (!timeout && options.trailing !== false) {
905
905
  timeout = setTimeout(later, remaining)
906
906
  }
907
907
  return result
908
908
  }
909
909
  let timer: any = null
910
910
  return function () {
911
911
  const context: any = this
912
912
  const args = arguments
913
913
  timer && clearTimeout(timer)
914
914
  timer = setTimeout(function () {
915
915
  fn.apply(context, args)
916
916
  }, delay)
917
917
  }
918
918
  if (txt) {
919
919
  txt = txt.trim()
920
920
  const reg = new RegExp(/[\d-]+/)
921
921
  const res = reg.exec(txt)
922
922
  if (res && res.length > 0) {
923
923
  let tel = res[0]
924
924
  if (tel && delSeparator) {
925
925
  tel = tel.replace(/-/g, '')
926
926
  }
927
927
  return tel
928
928
  }
929
929
  }
930
930
  return ''
931
931
  if (rgb) {
932
932
  const reg = /^(rgb|RGB)/
933
933
  const color = rgb
934
934
  if (reg.test(color)) {
935
935
  let strHex = '#'
936
936
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',')
937
937
  for (let i = 0; i < colorArr.length; i++) {
938
938
  let hex = Number(colorArr[i]).toString(16)
939
939
  if (hex === '0') {
940
940
  hex += hex
941
941
  }
942
942
  strHex += hex
943
943
  }
944
944
  return strHex
945
945
  } else {
946
946
  return String(color)
947
947
  }
948
948
  } else {
949
949
  return ''
950
950
  }
951
951
  if (hex) {
952
952
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/
953
953
  let color = hex.toLowerCase()
954
954
  if (reg.test(color)) {
955
955
  if (color.length === 4) {
956
956
  let colorNew = '#'
957
957
  for (let i = 1; i < 4; i += 1) {
958
958
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1))
959
959
  }
960
960
  color = colorNew
961
961
  }
962
962
  const colorChange: number[] = []
963
963
  for (let i = 1; i < 7; i += 2) {
964
964
  colorChange.push(parseInt('0x' + color.slice(i, i + 2)))
965
965
  }
966
966
  if (returnList) {
967
967
  return colorChange
968
968
  } else {
969
969
  return 'RGB(' + colorChange.join(',') + ')'
970
970
  }
971
971
  } else {
972
972
  return color
973
973
  }
974
974
  } else {
975
975
  return ''
976
976
  }
977
977
  n: number,
978
978
  m: number,
979
979
  filterNum: number | undefined = undefined,
980
980
  const c = m - n + 1
981
981
  const res = Math.floor(Math.random() * c + n)
982
982
  if (filterNum && filterNum == res) {
983
983
  console.log('随机数二次开始', res, filterNum)
984
984
  return getRandom(n, m, filterNum)
985
985
  } else {
986
986
  return res
987
987
  }
988
988
  wqCookieStr: string
989
989
  wqCookie: {
990
990
  pin?: string
991
991
  visitkey?: string
992
992
  [key: string]: any
993
993
  }
994
994
  const {
995
995
  jdpin,
996
996
  pinStatus,
997
997
  visitkey,
998
998
  unionid,
999
999
  skey,
1000
1000
  __jda,
1001
1001
  __jdv,
1002
1002
  __wga,
1003
1003
  wxapp_type,
1004
1004
  appType
1005
1005
  } = cookie
1006
1006
  const ret: string[] = []
1007
1007
  const getUserCookieObj = {}
1008
1008
  const createUseCookieArr = [
1009
1009
  jdpin,
1010
1010
  pinStatus,
1011
1011
  visitkey,
1012
1012
  unionid,
1013
1013
  skey,
1014
1014
  __jda,
1015
1015
  __jdv,
1016
1016
  __wga,
1017
1017
  wid,
1018
1018
  wq_skey,
1019
1019
  wq_uin,
1020
1020
  wq_auth_token,
1021
1021
  wxapp_scene,
1022
1022
  wq_unionid,
1023
1023
  wxapp_openid,
1024
1024
  wxapp_version,
1025
1025
  wxapp_type,
1026
1026
  appType
1027
1027
  name = name === 'jdpin' ? 'pin' : name;
1028
1028
  name === 'pin' && (ret.push(`pt_pin=${encodeURIComponent(value)}`))
1029
1029
  ret.push(`${name}=${encodeURIComponent(value)}`)
1030
1030
  getUserCookieObj[name] = value
1031
1031
  }
1032
1032
  })
1033
1033
  return {
1034
1034
  wqCookieStr: ret.join(';'),
1035
1035
  wqCookie: getUserCookieObj,
1036
1036
  }
1037
1037
  num,
1038
1038
  widthSize = 375,
1039
1039
  layoutWidth = windowWidth,
1040
1040
  const getNum = Number(num)
1041
1041
  return Math.round((getNum / widthSize) * layoutWidth)
1042
1042
  let checkState = false
1043
1043
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag
1044
1044
  if (couponFloorModuleType === FloorModuleType.COUPON) {
1045
1045
  try {
1046
1046
  const dataDefines = getFloorDataToDataDefines(floorData)
1047
1047
  const couponDataDefine = dataDefines
1048
1048
  ? dataDefines.filter((item) => {
1049
1049
  return item.type === 'coupon'
1050
1050
  })
1051
1051
  : [],
1052
1052
  couponList = couponDataDefine[0]?.nodeText?.data
1053
1053
  ? couponDataDefine[0]?.nodeText?.data
1054
1054
  : [],
1055
1055
  couponLength = couponList.length,
1056
1056
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
1057
1057
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
1058
1058
  : 0
1059
1059
  if (numShowPerLine === 0 && couponLength > 3) {
1060
1060
  checkState = true
1061
1061
  }
1062
1062
  } catch (e) {
1063
1063
  checkState = false
1064
1064
  }
1065
1065
  return checkState
1066
1066
  }
1067
1067
  containers = [],
1068
1068
  floors = [],
1069
1069
  clearFirstContaierMarginTop = false,
1070
1070
  isLuxuryShop = false,
1071
1071
  isShowNativeImmersivePlayer=false,
1072
1072
  screenHeight = null,
1073
1073
  screenWidth = null,
1074
1074
  bottomBarHeight= null
1075
1075
  } = pageData
1076
1076
  exceptionReportFn
1077
1077
  )
1078
1078
  if (getFloorData) {
1079
1079
  containerId: item.containerId,
1080
1080
  containerIndex: index,
1081
1081
  ...getFloorData,
1082
1082
  }
1083
1083
  if(getFloorData?.floorExtInfo?.floorLoadWay === 2){
1084
1084
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(getFloorData, exceptionReportFn)
1085
1085
  !getSysFloorToLoadTypeRes && (getFloorData.floorExtInfo.floorLoadWay = 1)
1086
1086
  }
1087
1087
  if(isProd && isWxMinAndWxapp){
1088
1088
  shopContentContainerListData = shopContentContainerListData.filter(
1089
1089
  (item) =>
1090
1090
  item.floors.length > 0 &&
1091
1091
  !isIsvContainer(item.containerId, shopContentFloorListData, shopContentContainerListData)
1092
1092
  )
1093
1093
  }
1094
1094
  shopContentContainerListData = [].concat(shopContentContainerListData)
1095
1095
  return {
1096
1096
  shopContentContainerListData,
1097
1097
  shopContentFloorListData,
1098
1098
  }
1099
1099
  const changeOpts = {
1100
1100
  title: '',
1101
1101
  icon: 'success',
1102
1102
  duration: 1500,
1103
1103
  mask: true,
1104
1104
  ...options,
1105
1105
  }
1106
1106
  if (changeOpts.title.length > 7) {
1107
1107
  showNormalToast(options)
1108
1108
  } else {
1109
1109
  Taro.showToast(changeOpts as any)
1110
1110
  }
1111
1111
  const changeOpts = {
1112
1112
  title: '',
1113
1113
  icon: 'error',
1114
1114
  duration: 1500,
1115
1115
  mask: true,
1116
1116
  ...options,
1117
1117
  }
1118
1118
  if (changeOpts.title.length > 7) {
1119
1119
  showNormalToast(options)
1120
1120
  } else {
1121
1121
  Taro.showToast(changeOpts as any)
1122
1122
  }
1123
1123
  Taro.showToast({
1124
1124
  title: '',
1125
1125
  icon: 'none',
1126
1126
  duration: 1500,
1127
1127
  mask: true,
1128
1128
  ...options,
1129
1129
  })
1130
1130
  return Taro.showLoading({
1131
1131
  title: text,
1132
1132
  })
1133
1133
  return new Promise(() => {
1134
1134
  Taro.nextTick(() => {
1135
1135
  setTimeout(() => {
1136
1136
  Taro.hideLoading(options)
1137
1137
  }, 300)
1138
1138
  })
1139
1139
  })
1140
1140
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
1141
1141
  const {
1142
1142
  tabActive = SECTION_HOME_TAB_NAME_TYPE[
1143
1143
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
1144
1144
  ],
1145
1145
  sceneId,
1146
1146
  } = query
1147
1147
  let changeTabActive = tabActive
1148
1148
  if (sceneId) {
1149
1149
  if (isH5) {
1150
1150
  if (sceneId == '1002') {
1151
1151
  changeTabActive =
1152
1152
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
1153
1153
  }
1154
1154
  else if (sceneId == '1003') {
1155
1155
  changeTabActive =
1156
1156
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY]
1157
1157
  }
1158
1158
  } else if (isWxMinAndWxapp) {
1159
1159
  if (sceneId == '1001' || sceneId == '1002') {
1160
1160
  changeTabActive =
1161
1161
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
1162
1162
  }
1163
1163
  else if (sceneId == '1003') {
1164
1164
  changeTabActive =
1165
1165
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]
1166
1166
  }
1167
1167
  }
1168
1168
  }
1169
1169
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
1170
1170
  return {
1171
1171
  menuType: SHOP_MENU_ID_TYPE.HOME,
1172
1172
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
1173
1173
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
1174
1174
  }
1175
1175
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
1176
1176
  return {
1177
1177
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
1178
1178
  tabActiveType: 0,
1179
1179
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
1180
1180
  }
1181
1181
  } else {
1182
1182
  return {
1183
1183
  menuType: SHOP_MENU_ID_TYPE.HOME,
1184
1184
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
1185
1185
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
1186
1186
  }
1187
1187
  }
1188
1188
  const deleteKeyList = [
1189
1189
  '$taroTimestamp',
1190
1190
  'cookie',
1191
1191
  'wdref',
1192
1192
  'navStart',
1193
1193
  'originOpts',
1194
1194
  'originParams',
1195
1195
  'originUrl',
1196
1196
  'referer',
1197
1197
  'stamp',
1198
1198
  ]
1199
1199
  let changeQueryData: any = { ...queryData }
1200
1200
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false
1201
1201
  const sceneQuery =
1202
1202
  qrCodeScene && typeof qrCodeScene == 'string'
1203
1203
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
1204
1204
  : {}
1205
1205
  changeQueryData = { ...changeQueryData, ...sceneQuery }
1206
1206
  deleteKeyList.forEach((key) => {
1207
1207
  changeQueryData[key] && delete changeQueryData[key]
1208
1208
  })
1209
1209
  changeQueryData['shopid'] &&
1210
1210
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
1211
1211
  delete changeQueryData['shopid']
1212
1212
  changeQueryData['venderid'] &&
1213
1213
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
1214
1214
  delete changeQueryData['venderid']
1215
1215
  changeQueryData['vendorId'] &&
1216
1216
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
1217
1217
  delete changeQueryData['vendorId']
1218
1218
  return changeQueryData
1219
1219
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
1220
1220
  const modularPackResultObj = formatPackResult(modularPackResult)
1221
1221
  const bundleUrl = getBundleUrl(modularPackResultObj)
1222
1222
  const bundleFileName = getBundleFileName(modularPackResultObj)
1223
1223
  if (bundleUrl && bundleFileName) {
1224
1224
  isUsable = true
1225
1225
  }
1226
1226
  floorIdx: floorData?.floorIdx,
1227
1227
  uid: floorData?.uid,
1228
1228
  shopId: floorData?.floorExtInfo?.shopId,
1229
1229
  moduleId: floorData?.moduleId,
1230
1230
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
1231
1231
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
1232
1232
  floorKind: floorData?.floorExtInfo?.floorKind,
1233
1233
  middleTemplateId: floorData?.middleTemplateId,
1234
1234
  modularPackResult: modularPackResult,
1235
1235
  const objContainer = containerListData.find(
1236
1236
  (item) => item.containerId === containerId,
1237
1237
  )
1238
1238
  return (
1239
1239
  objContainer?.includeUids?.some((itemUid) => {
1240
1240
  const objectFloor = floorListData.find(
1241
1241
  (floorItem) => itemUid === floorItem.uid,
1242
1242
  )
1243
1243
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
1244
1244
  }) ?? false
1245
1245
  )
1246
1246
  floorListData,
1247
1247
  containerListData,
1248
1248
  exceptionReportFn?,
1249
1249
  const unableIsvFloorListData = floorListData.filter(
1250
1250
  (floorItem) =>
1251
1251
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
1252
1252
  !isIsvFloorUseable(floorItem, exceptionReportFn),
1253
1253
  )
1254
1254
  const unableIsvFloorUidList = unableIsvFloorListData.map(
1255
1255
  (floorItem) => floorItem.uid,
1256
1256
  )
1257
1257
  const unableIsvContainerListData = containerListData.filter(
1258
1258
  (item) =>
1259
1259
  item.includeUids &&
1260
1260
  item.includeUids.every(
1261
1261
  (itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1,
1262
1262
  ),
1263
1263
  )
1264
1264
  return unableIsvContainerListData
1265
1265
  return -2
1266
1266
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl)
1267
1267
  let getParams = false
1268
1268
  if (isOpenJdAppUrl(openAppUrl)) {
1269
1269
  try {
1270
1270
  getParams = openAppUrl.replace(
1271
1271
  /openApp\.jdMobile:\/\/virtual\?params=/i,
1272
1272
  '',
1273
1273
  )
1274
1274
  getParams = JSON.parse(String(getParams))
1275
1275
  } catch (e) {
1276
1276
  console.log(e)
1277
1277
  }
1278
1278
  }
1279
1279
  return getParams
1280
1280
  return `openapp.jdmobile://virtual?params=${JSON.stringify(Object.assign({}, openParams))}`
1281
1281
  if (val === null || val === '' || typeof val === 'undefined') {
1282
1282
  return true
1283
1283
  }
1284
1284
  return false
1285
1285
  const {
1286
1286
  moduleId = 'none',
1287
1287
  entrance = 'none',
1288
1288
  sourceType = 'none',
1289
1289
  sourceValue = 'none',
1290
1290
  } = params
1291
1291
  if (isIosDevice) {
1292
1292
  return `${moduleId}#${entrance}`
1293
1293
  } else if (isAndroidDevice) {
1294
1294
  return `${sourceType}#${sourceValue}`
1295
1295
  }
1296
1296
  return 'none#none'
1297
1297
  if (data && typeof data === 'object') {
1298
1298
  let getOpenAppData = { ...data }
1299
1299
  try {
1300
1300
  const { sourceInfo, designerId, templateId, source } = getOpenAppData
1301
1301
  if (designerId && templateId) {
1302
1302
  getOpenAppData = Object.assign({}, getOpenAppData, {
1303
1303
  sourceInfo: {
1304
1304
  entrance: '设计师预览',
1305
1305
  },
1306
1306
  })
1307
1307
  } else if (sourceInfo) {
1308
1308
  const { entrance } = sourceInfo
1309
1309
  getOpenAppData.sourceInfo.entrance =
1310
1310
  entrance && entrance.length > 0 ? entrance : '其他'
1311
1311
  } else if (source && !sourceInfo) {
1312
1312
  if (typeof source === 'object') {
1313
1313
  const { sourceType, entrance, sourceValue, moduleId } = source
1314
1314
  getOpenAppData = Object.assign({}, getOpenAppData, {
1315
1315
  sourceInfo: {
1316
1316
  entrance: sourceType || entrance || '其他',
1317
1317
  moduleId: sourceValue || moduleId || '-100',
1318
1318
  },
1319
1319
  })
1320
1320
  } else {
1321
1321
  getOpenAppData = Object.assign({}, getOpenAppData, {
1322
1322
  sourceInfo: {
1323
1323
  entrance: source,
1324
1324
  },
1325
1325
  })
1326
1326
  }
1327
1327
  } else {
1328
1328
  getOpenAppData = Object.assign({}, getOpenAppData, {
1329
1329
  sourceInfo: {
1330
1330
  entrance: '其他',
1331
1331
  },
1332
1332
  })
1333
1333
  }
1334
1334
  } catch (e) {
1335
1335
  console.log(e)
1336
1336
  }
1337
1337
  return getOpenAppData
1338
1338
  }
1339
1339
  return data
1340
1340
  return displayObj
1341
1341
  isMin,
1342
1342
  isJdMinAndHarmony,
1343
1343
  isChartH5,
1344
1344
  isH5AndJdShopViewH5Scroll,
1345
1345
  isH5AndJdShopH5CustomScrollView,
1346
1346
  isMemberPage,
1347
1347
  sgmCustomReport,
1348
1348
  isOpenJdAppUrl,
1349
1349
  jdOpenAppParams,
1350
1350
  createJdOpenAppUrl,
1351
1351
  dealJdOpenAppData,
1352
1352
  isEmpty,
1353
1353
  getJdAppReportPageSource,
1354
1354
  isPc,
1355
1355
  ipLoc_djd,
1356
1356
  jdAppVersionCompare,
1357
1357
  dealNativePixelToCssPixel,
1358
1358
  isAppStowShop