@conecli/cone-render 0.9.1-shop2.4 → 0.9.1-shop2.40

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 (117) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/assets/icon_blue_info.svg +1 -0
  3. package/dist/common/const.ts +1 -1
  4. package/dist/common/environmentType.ts +1 -0
  5. package/dist/common/index.h5.ts +1 -1
  6. package/dist/common/index.jd.ts +1 -1
  7. package/dist/common/index.ts +1 -1
  8. package/dist/common/index.weapp.ts +1 -1
  9. package/dist/common/jdplayerSdk.ts +1 -0
  10. package/dist/common/pageType.ts +1 -1
  11. package/dist/common/sgmCustomCode.ts +1 -0
  12. package/dist/common/token/token.jd.ts +1 -1
  13. package/dist/common/token/token.ts +1 -1
  14. package/dist/common/wxappApi.jd.ts +1 -0
  15. package/dist/components/ErrorBoundary.tsx +1 -1
  16. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  17. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  18. package/dist/components/base/CountDown/index.module.scss +49 -44
  19. package/dist/components/base/CountDown/index.tsx +1 -1
  20. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  21. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  22. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  23. package/dist/components/base/CustomVideo/common.ts +1 -0
  24. package/dist/components/base/CustomVideo/index.tsx +1 -1
  25. package/dist/components/base/Dialog/index.module.scss +16 -0
  26. package/dist/components/base/Dialog/index.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.h5.module.scss +12 -2
  28. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  29. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  30. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  31. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  32. package/dist/components/base/InViewRender/index.tsx +1 -1
  33. package/dist/components/base/ItemViewExposureSmart/index.module.scss +2 -2
  34. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  35. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  36. package/dist/components/base/LazyLoadImage/index.h5.module.scss +23 -20
  37. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  38. package/dist/components/base/MobileCommonHeader/index.module.scss +8 -0
  39. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  40. package/dist/components/base/NetworkDataError/index.module.scss +3 -0
  41. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  42. package/dist/components/base/Price/Base/index.tsx +1 -1
  43. package/dist/components/base/Price/Double/index.module.scss +8 -0
  44. package/dist/components/base/Price/Double/index.tsx +1 -1
  45. package/dist/components/debug/DebugLayout/index.module.scss +67 -0
  46. package/dist/components/debug/DebugLayout/index.tsx +1 -0
  47. package/dist/components/debug/DebugLayout/utils.ts +1 -0
  48. package/dist/components/decorate/DecorateFloorModule/index.module.scss +11 -0
  49. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  50. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  51. package/dist/components/decorate/PlaceHolder/index.tsx +1 -1
  52. package/dist/components/floorItem.jd.tsx +1 -1
  53. package/dist/components/floorItem.tsx +1 -1
  54. package/dist/components/floorItem.weapp.tsx +1 -1
  55. package/dist/components/isv/Floor/index.tsx +1 -1
  56. package/dist/components/remoteFloorItem.tsx +1 -1
  57. package/dist/interface/common.ts +1 -1
  58. package/dist/interface/component.ts +1 -1
  59. package/dist/interface/jumpEventReport.ts +1 -1
  60. package/dist/interface/service.ts +1 -1
  61. package/dist/interface/utils.ts +1 -1
  62. package/dist/jumpEventReport/base.ts +1 -1
  63. package/dist/jumpEventReport/const.ts +1 -1
  64. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  65. package/dist/jumpEventReport/index.h5.ts +1 -1
  66. package/dist/jumpEventReport/index.jd.ts +1 -1
  67. package/dist/jumpEventReport/index.weapp.ts +1 -1
  68. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  69. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  70. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  71. package/dist/jumpEventReport/web/report.ts +1 -1
  72. package/dist/jumpEventReport/web.base.ts +1 -1
  73. package/dist/jumpEventReport/web.jd.ts +1 -1
  74. package/dist/jumpEventReport/web.jdb.ts +1 -1
  75. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  76. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  77. package/dist/jumpEventReport/web.pc.ts +1 -1
  78. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  79. package/dist/jumpEventReport/web.tjm.ts +1 -0
  80. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  81. package/dist/modules/ContainerFloorList/index.h5.module.scss +30 -1
  82. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  83. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  84. package/dist/open/api/device.ts +1 -1
  85. package/dist/open/api/environment.ts +1 -1
  86. package/dist/open/api/index.ts +1 -1
  87. package/dist/open/api/jump copy.ts +1 -1
  88. package/dist/open/api/request.ts +1 -1
  89. package/dist/open/api/shopMember.ts +1 -1
  90. package/dist/open/api/track.ts +1 -1
  91. package/dist/open/api/util.ts +1 -1
  92. package/dist/open/components/index.ts +1 -1
  93. package/dist/sass/app.h5.scss +274 -212
  94. package/dist/sass/base.scss +195 -137
  95. package/dist/service/fetchGateway.ts +1 -1
  96. package/dist/service/http/colorSign.ts +1 -1
  97. package/dist/service/http/const.ts +1 -1
  98. package/dist/service/http/h5Http.ts +1 -0
  99. package/dist/service/http/index.h5.ts +1 -0
  100. package/dist/service/requestServer.h5.ts +1 -0
  101. package/dist/service/requestServer.ts +1 -1
  102. package/dist/utils/connectNativeJsBridge.ts +1 -1
  103. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  104. package/dist/utils/draExceptionAndProfile.ts +1 -1
  105. package/dist/utils/h5Utils.ts +1 -1
  106. package/dist/utils/index.h5.ts +1 -1
  107. package/dist/utils/index.ts +1 -1
  108. package/dist/utils/index.weapp.ts +1 -1
  109. package/dist/utils/jm-common.js +1 -1
  110. package/dist/utils/jumpExtMapUtil.js +1 -0
  111. package/dist/utils/sColor.js +1 -0
  112. package/dist/utils/sgmCodeUtils.ts +1 -0
  113. package/dist/utils/taroRenderUtil.ts +1 -1
  114. package/dist/utils/utils.ts +1 -1
  115. package/package.json +26 -3
  116. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
  117. package/dist/utils/memberFormatUtils.js +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  SHOP_MENU_ID_TYPE,
3
2
  SHOP_MENU_ID_QUERY_NAME,
4
3
  SECTION_HOME_TAB_TYPE,
5
4
  SECTION_HOME_TAB_NAME_TYPE,
6
5
  SECTION_HOME_TAB_QUERY_TYPE,
7
6
  CHANNEL_TYPE,
8
7
  JDShopViewBusinessPathType,
9
8
  FloorModuleType,
10
9
  RemoteLoadFloorList,
11
10
  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
  exceptionReportFn
429
428
  if(getFloorData?.floorExtInfo?.floorLoadWay === 2){
430
429
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(getFloorData, exceptionReportFn)
431
430
  !getSysFloorToLoadTypeRes && (getFloorData.floorExtInfo.floorLoadWay = 1)
432
431
  }
433
432
  if(isProd && isWxMinAndWxapp){
434
433
  shopContentContainerListData = shopContentContainerListData.filter(
435
434
  (item) =>
436
435
  item.floors.length > 0 &&
437
436
  !isIsvContainer(item.containerId, shopContentFloorListData, shopContentContainerListData)
438
437
  )
439
438
  }
440
439
  shopContentContainerListData = [].concat(shopContentContainerListData)
441
440
  return {
442
441
  shopContentContainerListData,
443
442
  shopContentFloorListData,
444
443
  }
445
444
  const changeOpts = {
446
445
  title: '',
447
446
  icon: 'success',
448
447
  duration: 1500,
449
448
  mask: true,
450
449
  ...options,
451
450
  }
452
451
  if (changeOpts.title.length > 7) {
453
452
  showNormalToast(options)
454
453
  } else {
455
454
  Taro.showToast(changeOpts as any)
456
455
  }
457
456
  const changeOpts = {
458
457
  title: '',
459
458
  icon: 'error',
460
459
  duration: 1500,
461
460
  mask: true,
462
461
  ...options,
463
462
  }
464
463
  if (changeOpts.title.length > 7) {
465
464
  showNormalToast(options)
466
465
  } else {
467
466
  Taro.showToast(changeOpts as any)
468
467
  }
469
468
  Taro.showToast({
470
469
  title: '',
471
470
  icon: 'none',
472
471
  duration: 1500,
473
472
  mask: true,
474
473
  ...options,
475
474
  })
476
475
  return Taro.showLoading({
477
476
  title: text,
478
477
  })
479
478
  return new Promise(() => {
480
479
  Taro.nextTick(() => {
481
480
  setTimeout(() => {
482
481
  Taro.hideLoading(options)
483
482
  }, 300)
484
483
  })
485
484
  })
486
485
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
487
486
  const {
488
487
  tabActive = SECTION_HOME_TAB_NAME_TYPE[
489
488
  SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN
490
489
  ],
491
490
  sceneId,
492
491
  } = query
493
492
  let changeTabActive = tabActive
494
493
  if (sceneId) {
495
494
  if (isH5) {
496
495
  if (sceneId == '1002') {
497
496
  changeTabActive =
498
497
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
499
498
  }
500
499
  else if (sceneId == '1003') {
501
500
  changeTabActive =
502
501
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY]
503
502
  }
504
503
  } else if (isWxMinAndWxapp) {
505
504
  if (sceneId == '1001' || sceneId == '1002') {
506
505
  changeTabActive =
507
506
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT]
508
507
  }
509
508
  else if (sceneId == '1003') {
510
509
  changeTabActive =
511
510
  SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION]
512
511
  }
513
512
  }
514
513
  }
515
514
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
516
515
  return {
517
516
  menuType: SHOP_MENU_ID_TYPE.HOME,
518
517
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
519
518
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
520
519
  }
521
520
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
522
521
  return {
523
522
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
524
523
  tabActiveType: 0,
525
524
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
526
525
  }
527
526
  } else {
528
527
  return {
529
528
  menuType: SHOP_MENU_ID_TYPE.HOME,
530
529
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
531
530
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
532
531
  }
533
532
  }
534
533
  const deleteKeyList = [
535
534
  '$taroTimestamp',
536
535
  'cookie',
537
536
  'wdref',
538
537
  'navStart',
539
538
  'originOpts',
540
539
  'originParams',
541
540
  'originUrl',
542
541
  'referer',
543
542
  'stamp',
544
543
  ]
545
544
  let changeQueryData: any = { ...queryData }
546
545
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false
547
546
  const sceneQuery =
548
547
  qrCodeScene && typeof qrCodeScene == 'string'
549
548
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
550
549
  : {}
551
550
  changeQueryData = { ...changeQueryData, ...sceneQuery }
552
551
  deleteKeyList.forEach((key) => {
553
552
  changeQueryData[key] && delete changeQueryData[key]
554
553
  })
555
554
  changeQueryData['shopid'] &&
556
555
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
557
556
  delete changeQueryData['shopid']
558
557
  changeQueryData['venderid'] &&
559
558
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
560
559
  delete changeQueryData['venderid']
561
560
  changeQueryData['vendorId'] &&
562
561
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
563
562
  delete changeQueryData['vendorId']
564
563
  return changeQueryData
565
564
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult
566
565
  const modularPackResultObj = formatPackResult(modularPackResult)
567
566
  const bundleUrl = getBundleUrl(modularPackResultObj)
568
567
  const bundleFileName = getBundleFileName(modularPackResultObj)
569
568
  if (bundleUrl && bundleFileName) {
570
569
  isUsable = true
571
570
  }
572
571
  const objContainer = containerListData.find(
573
572
  (item) => item.containerId === containerId,
574
573
  )
575
574
  return (
576
575
  objContainer?.includeUids?.some((itemUid) => {
577
576
  const objectFloor = floorListData.find(
578
577
  (floorItem) => itemUid === floorItem.uid,
579
578
  )
580
579
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag)
581
580
  }) ?? false
582
581
  )
583
582
  floorListData,
584
583
  containerListData,
585
584
  exceptionReportFn?,
586
585
  const unableIsvFloorListData = floorListData.filter(
587
586
  (floorItem) =>
588
587
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
589
588
  !isIsvFloorUseable(floorItem, exceptionReportFn),
590
589
  )
591
590
  const unableIsvFloorUidList = unableIsvFloorListData.map(
592
591
  (floorItem) => floorItem.uid,
593
592
  )
594
593
  const unableIsvContainerListData = containerListData.filter(
595
594
  (item) =>
596
595
  item.includeUids &&
597
596
  item.includeUids.every(
598
597
  (itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1,
599
598
  ),
600
599
  )
601
600
  return unableIsvContainerListData
602
601
  return -2
603
602
  return customObj
604
603
  if (data && typeof data === 'object') {
605
604
  let getOpenAppData = { ...data }
606
605
  try {
607
606
  const { sourceInfo, designerId, templateId, source } = getOpenAppData
608
607
  if (designerId && templateId) {
609
608
  getOpenAppData = Object.assign({}, getOpenAppData, {
610
609
  sourceInfo: {
611
610
  entrance: '设计师预览',
612
611
  },
613
612
  })
614
613
  } else if (sourceInfo) {
615
614
  const { entrance } = sourceInfo
616
615
  getOpenAppData.sourceInfo.entrance =
617
616
  entrance && entrance.length > 0 ? entrance : '其他'
618
617
  } else if (source && !sourceInfo) {
619
618
  if (typeof source === 'object') {
620
619
  const { sourceType, entrance, sourceValue, moduleId } = source
621
620
  getOpenAppData = Object.assign({}, getOpenAppData, {
622
621
  sourceInfo: {
623
622
  entrance: sourceType || entrance || '其他',
624
623
  moduleId: sourceValue || moduleId || '-100',
625
624
  },
626
625
  })
627
626
  } else {
628
627
  getOpenAppData = Object.assign({}, getOpenAppData, {
629
628
  sourceInfo: {
630
629
  entrance: source,
631
630
  },
632
631
  })
633
632
  }
634
633
  } else {
635
634
  getOpenAppData = Object.assign({}, getOpenAppData, {
636
635
  sourceInfo: {
637
636
  entrance: '其他',
638
637
  },
639
638
  })
640
639
  }
641
640
  } catch (e) {
642
641
  console.log(e)
643
642
  }
644
643
  return getOpenAppData
645
644
  }
646
645
  return data
647
646
  isChartH5,
648
647
  isH5AndJdShopViewH5Scroll,
649
648
  isH5AndJdShopH5CustomScrollView,
650
649
  isMemberPage,
651
650
  isPc,
652
651
  ipLoc_djd,
653
652
  jdAppVersionCompare,
654
653
  dealJdOpenAppData
654
+ import Taro from '@tarojs/taro';
655
655
  SHOP_MENU_ID_TYPE,
656
656
  SHOP_MENU_ID_QUERY_NAME,
657
657
  SECTION_HOME_TAB_TYPE,
658
658
  SECTION_HOME_TAB_NAME_TYPE,
659
659
  SECTION_HOME_TAB_QUERY_TYPE,
660
660
  CHANNEL_TYPE,
661
661
  JDShopViewBusinessPathType,
662
662
  FloorModuleType,
663
663
  RemoteLoadFloorList,
664
664
  FLOOR_KIND,
665
665
  getBundleUrl,
666
666
  getBundleFileName,
667
667
  formatPackResult,
668
668
  getTaroVersion,
669
669
  /ipad/i.test(system) || (/android/i.test(system) && !/mobi|mini|fennec/i.test(system));
670
670
  isTablet: isJdTabletDevice,
671
671
  isLandscape: false,
672
672
  key: string,
673
673
  value: string | object,
674
674
  successBack?: any,
675
675
  failBack?: any,
676
676
  try {
677
677
  if (isH5 && window && !window.localStorage) {
678
678
  console.log(`setTaroStorage key:${key} window.localStorage不存在:`);
679
679
  return Promise.resolve(null);
680
680
  }
681
681
  return Taro.setStorage({
682
682
  key: key,
683
683
  data: value,
684
684
  success: successBack,
685
685
  fail: failBack,
686
686
  }).catch((e) => {
687
687
  console.log(`setTaroStorage key:${key} 报错:`, e);
688
688
  return null;
689
689
  });
690
690
  } catch (e) {
691
691
  console.log(`setTaroStorage key:${key} 报错:`, e);
692
692
  return Promise.resolve(null);
693
693
  }
694
694
  try {
695
695
  if (isH5 && window && !window.localStorage) {
696
696
  console.log(`getTaroStorageKeyValue key:${key} window.localStorage不存在:`);
697
697
  return Promise.resolve(null);
698
698
  }
699
699
  return Taro.getStorageSync(key);
700
700
  } catch (e) {
701
701
  console.log(`getTaroStorageKeyValue key:${key} 报错:`, e);
702
702
  return null;
703
703
  }
704
704
  try {
705
705
  if (isH5 && window && !window.localStorage) {
706
706
  console.log(`removeTaroStorageKey key:${key} window.localStorage不存在:`);
707
707
  return Promise.resolve(null);
708
708
  }
709
709
  return Taro.removeStorage({
710
710
  key: key,
711
711
  }).catch((e) => {
712
712
  console.log(`removeTaroStorageKey key:${key} 报错:`, e);
713
713
  });
714
714
  } catch (e) {
715
715
  console.log(`removeTaroStorageKey key:${key} 报错:`, e);
716
716
  }
717
717
  try {
718
718
  if (isH5 && window && !window.localStorage) {
719
719
  console.log(`clearTaroStorageKey window.localStorage不存在`);
720
720
  return Promise.resolve(null);
721
721
  }
722
722
  return Taro.clearStorage().catch((e) => {
723
723
  console.log('clearTaroStorageKey报错:', e);
724
724
  });
725
725
  } catch (e) {
726
726
  console.log('clearTaroStorageKey报错:', e);
727
727
  }
728
728
  let hasChecked = false;
729
729
  if (isH5) {
730
730
  const avifCache = getTaroStorageKeyValue(KEY_AVIF);
731
731
  if (avifCache === null || avifCache === '' || forceUpdate) {
732
732
  hasChecked = true;
733
733
  const img = new Image();
734
734
  img.onload = function () {
735
735
  if (img.height > 0 && img.width > 0) {
736
736
  setTaroStorage(KEY_AVIF, '1');
737
737
  } else {
738
738
  setTaroStorage(KEY_AVIF, '0');
739
739
  }
740
740
  };
741
741
  img.onerror = () => {
742
742
  setTaroStorage(KEY_AVIF, '0');
743
743
  };
744
744
  img.src =
745
745
  'data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=';
746
746
  }
747
747
  const webpCache = getTaroStorageKeyValue(KEY_WEBP);
748
748
  if (webpCache === null || webpCache === '' || forceUpdate) {
749
749
  hasChecked = true;
750
750
  const img = new Image();
751
751
  img.onload = function () {
752
752
  if (img.height > 0 && img.width > 0) {
753
753
  setTaroStorage(KEY_WEBP, '1');
754
754
  } else {
755
755
  setTaroStorage(KEY_WEBP, '0');
756
756
  }
757
757
  };
758
758
  img.onerror = () => {
759
759
  setTaroStorage(KEY_WEBP, '0');
760
760
  };
761
761
  img.src =
762
762
  'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAUAmJaQAA3AA/vz0AAA=';
763
763
  }
764
764
  }
765
765
  return hasChecked;
766
766
  const hasChecked = imageFormatSupport(false);
767
767
  if (!hasChecked) {
768
768
  setTimeout(imageFormatSupport, 5000);
769
769
  }
770
770
  const resultList: Array<any> = [],
771
771
  arrLen = arr.length;
772
772
  if (arrLen) {
773
773
  if (arrLen > size) {
774
774
  for (let i = 0; i < arrLen; i = i + size) {
775
775
  resultList.push(arr.slice(i, i + size));
776
776
  }
777
777
  } else {
778
778
  resultList.push(arr);
779
779
  }
780
780
  }
781
781
  return resultList;
782
782
  let _address = ids;
783
783
  const _areaAreaSplit = ids.split('.');
784
784
  const _areaAreaSplit2 = ids.split('_');
785
785
  _address = _areaAreaSplit.length === 2 ? _areaAreaSplit[0] : _address;
786
786
  _address = _areaAreaSplit2.length === 3 ? `${_areaAreaSplit2}_0` : _address;
787
787
  return _address;
788
788
  let paramStr = '';
789
789
  obj &&
790
790
  Object.keys(obj).forEach((key, index) => {
791
791
  const getValue = `${obj[key]}`.replace(/undefined/, '').replace(/null/, '');
792
792
  paramStr += `${index === 0 ? '' : '&'}${key}=${encodeURIComponent(getValue)}`;
793
793
  });
794
794
  return paramStr;
795
795
  const result = {};
796
796
  if (
797
797
  !urlOrQueryStr ||
798
798
  ('string' !== typeof urlOrQueryStr && String !== urlOrQueryStr.constructor)
799
799
  ) {
800
800
  return result;
801
801
  }
802
802
  if (urlOrQueryStr.indexOf('?') > -1) {
803
803
  const queryStr = urlOrQueryStr.split('?');
804
804
  const queryItemList = queryStr && queryStr.length > 1 ? queryStr[1].split('&') : [];
805
805
  const queryItemListLen = queryItemList.length;
806
806
  queryItemListLen > 0 &&
807
807
  queryItemList.forEach((item) => {
808
808
  const thisItemList = item.split('=');
809
809
  result[thisItemList[0]] = thisItemList[1];
810
810
  });
811
811
  } else {
812
812
  const queryItemList =
813
813
  urlOrQueryStr.indexOf('&') > -1 ? urlOrQueryStr.split('&') : [urlOrQueryStr];
814
814
  const queryItemListLen = queryItemList.length;
815
815
  queryItemListLen > 0 &&
816
816
  queryItemList.forEach((item) => {
817
817
  const thisItemList = item.split('=');
818
818
  result[thisItemList[0]] = thisItemList[1];
819
819
  });
820
820
  }
821
821
  return result;
822
822
  url: string,
823
823
  size?: {
824
824
  w: number;
825
825
  h: number;
826
826
  },
827
827
  quality?: number,
828
828
  if (url && size) {
829
829
  const _w = Math.floor(size.w);
830
830
  const _h = Math.floor(size.h);
831
831
  if (url.match(/gif$/i)) {
832
832
  return url;
833
833
  } else {
834
834
  if (_w > 0 && _h > 0) {
835
835
  url = url.replace('jfs/', `s${_w}x${_h}_jfs/`);
836
836
  }
837
837
  url += quality != null ? `!q${quality}.dpg` : '.dpg';
838
838
  }
839
839
  }
840
840
  return url;
841
841
  if (url.match(/\.(jpg|png|dpg)$/i)) {
842
842
  const { width, height, quality } = jfsImgInfo;
843
843
  if (typeof width === 'number' || typeof height === 'number') {
844
844
  url = url.replace('/jfs/', `/s${Math.floor(width || 0)}x${Math.floor(height || 0)}_jfs/`);
845
845
  }
846
846
  if (typeof quality === 'number' && quality > 0 && quality < 100 && url.match(/\.jpg$/i)) {
847
847
  url += `!q${quality}.dpg`;
848
848
  }
849
849
  }
850
850
  return addHttps(url);
851
851
  if (imgUrl) {
852
852
  if (
853
853
  !imgUrl.match(
854
854
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|(imgcps\.jd\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
855
855
  )
856
856
  ) {
857
857
  if (!imgUrl.includes('360buyimg.com')) {
858
858
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
859
859
  }
860
860
  if (quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`;
861
861
  }
862
862
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
863
863
  }
864
864
  return imgUrl;
865
865
  const result = value % step;
866
866
  return result === 0 ? value : Math.ceil(value / step) * step;
867
867
  const MAX = 3.5;
868
868
  return Math.min(window?.devicePixelRatio ?? 2, MAX);
869
869
  isSkuImage: boolean;
870
870
  size: number;
871
871
  imgUrl: string,
872
872
  options: QualityOptions,
873
873
  isIgnoreOptimizeFromServer: boolean = false,
874
874
  if (!imgUrl) {
875
875
  console.error('The input parameter imageUrl for the getQualityImage() cannot be empty!');
876
876
  return imgUrl;
877
877
  }
878
878
  if (isIgnoreOptimizeFromServer) {
879
879
  imgUrl = imgUrl.replace(/\.(jpe?g|png).*/, '.$1');
880
880
  }
881
881
  if (!/^((https?):)?\/\//.test(imgUrl)) {
882
882
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
883
883
  }
884
884
  const imgServerRegExp = /(img|m)\d{0,2}\.360buyimg\.com\/.*\.(jpe?g|png)/i;
885
885
  if (!imgServerRegExp.test(imgUrl)) {
886
886
  return imgUrl;
887
887
  }
888
888
  imgUrl = /^\/\//.test(imgUrl) ? `https:${imgUrl}` : imgUrl;
889
889
  const { isSkuImage, size } = options || {};
890
890
  const needReduceSize = isSkuImage && size;
891
891
  if (needReduceSize) {
892
892
  const devicePixelRatio = getDevicePixelRatio();
893
893
  const useWidth = getValueByStep(size * devicePixelRatio, 40);
894
894
  imgUrl = imgUrl.replace(/\/[^\/]*jfs\//, `/s${useWidth}x${useWidth}_jfs/`);
895
895
  }
896
896
  const needCompress = !global?.info?.pageInfo?.isVipShop;
897
897
  const result = imgUrl.match(/\/\w+\.(jpe?g|png)$/);
898
898
  if (needCompress && result) {
899
899
  if (getAvifSupport() === '1') {
900
900
  imgUrl += '.avif';
901
901
  } else if (getWebpSupport() === '1') {
902
902
  imgUrl += '.webp';
903
903
  } else if (/jpe?g/.test(result[1])) {
904
904
  imgUrl += '!q80';
905
905
  }
906
906
  }
907
907
  if (needReduceSize) {
908
908
  imgUrl += '!z2';
909
909
  }
910
910
  return imgUrl;
911
911
  if (imgUrl) {
912
912
  if (
913
913
  !imgUrl.match(
914
914
  /(storage\.360buyimg\.com)|(jdcloud-oss\.com)|((\w+)\.300hu\.com)|(thirdwx\.qlogo\.cn)|(!q)|gif|dpg$/i,
915
915
  )
916
916
  ) {
917
917
  if (!imgUrl.includes('360buyimg.com')) {
918
918
  imgUrl = '//m.360buyimg.com/cms/' + imgUrl;
919
919
  }
920
920
  if (quality != 100) imgUrl += /\.png/.test(imgUrl) ? '.dpg' : `!q${quality}`;
921
921
  }
922
922
  imgUrl = imgUrl.match(/^\/\//) ? `https:${imgUrl}` : imgUrl;
923
923
  }
924
924
  return imgUrl;
925
925
  return getTaroStorageKeyValue(KEY_AVIF) || '0';
926
926
  return getTaroStorageKeyValue(KEY_WEBP) || '0';
927
927
  count: number,
928
928
  fixedNum = 1,
929
929
  unit = '万',
930
930
  maxNum = 10000,
931
931
  count = Number(count);
932
932
  const getMaxNum = count > 100000000 ? 100000000 : maxNum;
933
933
  const getUnit = count > 100000000 ? '亿' : unit;
934
934
  if (count >= getMaxNum) {
935
935
  return (count / getMaxNum).toFixed(fixedNum) + getUnit;
936
936
  }
937
937
  return count;
938
938
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo || {
939
939
  platform: '',
940
940
  model: '',
941
941
  system: '',
942
942
  };
943
943
  const isIOS = !!systemInfo.system.match(/ios/i);
944
944
  const isAndroid = !!systemInfo.system.match(/android/i);
945
945
  if (!systemInfo.statusBarHeight) {
946
946
  systemInfo.statusBarHeight = screenHeight - windowHeight - 20;
947
947
  systemInfo.navBarExtendHeight = 0;
948
948
  } else {
949
949
  if (isIOS) {
950
950
  systemInfo.navBarExtendHeight = 4;
951
951
  } else {
952
952
  systemInfo.navBarExtendHeight = 0;
953
953
  }
954
954
  }
955
955
  let rect = Taro.getMenuButtonBoundingClientRect ? Taro.getMenuButtonBoundingClientRect() : null;
956
956
  if (!rect || !rect.width || !rect.top || !rect.left || !rect.height) {
957
957
  let gap = 0;
958
958
  let width = 96;
959
959
  if (systemInfo.platform === 'android') {
960
960
  gap = 8;
961
961
  width = 96;
962
962
  } else if (systemInfo.platform === 'devtools') {
963
963
  if (isIOS) {
964
964
  gap = 5.5;
965
965
  } else {
966
966
  gap = 7.5;
967
967
  }
968
968
  } else {
969
969
  gap = 4;
970
970
  width = 88;
971
971
  }
972
972
  rect = {
973
973
  bottom: systemInfo.statusBarHeight + gap + 32,
974
974
  height: 32,
975
975
  left: systemInfo.windowWidth - width - 10,
976
976
  right: systemInfo.windowWidth - 10,
977
977
  top: systemInfo.statusBarHeight + gap,
978
978
  width,
979
979
  };
980
980
  }
981
981
  const gap = rect.top - systemInfo.statusBarHeight;
982
982
  systemInfo.navBarTopToStatusBar = gap;
983
983
  systemInfo.navBarHeight = 2 * gap + rect.height;
984
984
  systemInfo.capsulePosition = rect;
985
985
  systemInfo.isIOS = isIOS;
986
986
  systemInfo.isAndroid = isAndroid;
987
987
  return systemInfo;
988
988
  if (str.match(/^\/\//)) {
989
989
  str = 'https:' + str;
990
990
  }
991
991
  return str;
992
992
  dateTimeOrdate: Date | string | number | null,
993
993
  format = 'yyyy-MM-dd HH:mm:ss',
994
994
  noPadStart = {
995
995
  M: '0',
996
996
  d: '0',
997
997
  H: '0',
998
998
  m: '0',
999
999
  s: '0',
1000
1000
  },
1001
1001
  let dateResult = '';
1002
1002
  const padStarts = Object.assign(
1003
1003
  {
1004
1004
  M: '0',
1005
1005
  d: '0',
1006
1006
  H: '0',
1007
1007
  m: '0',
1008
1008
  s: '0',
1009
1009
  },
1010
1010
  noPadStart,
1011
1011
  );
1012
1012
  if (dateTimeOrdate) {
1013
1013
  let changeDateTimeOrdate = dateTimeOrdate;
1014
1014
  const getChangeDateTimeToNumber = Number(changeDateTimeOrdate);
1015
1015
  if (getChangeDateTimeToNumber) {
1016
1016
  changeDateTimeOrdate = getChangeDateTimeToNumber;
1017
1017
  } else {
1018
1018
  changeDateTimeOrdate = `${changeDateTimeOrdate}`.replace(/-/g, '/').replace(/\./g, '/');
1019
1019
  }
1020
1020
  const nowDate =
1021
1021
  dateTimeOrdate instanceof Date ? dateTimeOrdate : new Date(changeDateTimeOrdate);
1022
1022
  const dateMap = {
1023
1023
  y: `${nowDate.getFullYear()}`,
1024
1024
  M: `${nowDate.getMonth() + 1}`.padStart(2, padStarts['M']),
1025
1025
  d: `${nowDate.getDate()}`.padStart(2, padStarts['d']),
1026
1026
  H: `${nowDate.getHours()}`.padStart(2, padStarts['H']),
1027
1027
  m: `${nowDate.getMinutes()}`.padStart(2, padStarts['m']),
1028
1028
  s: `${nowDate.getSeconds()}`.padStart(2, padStarts['s']),
1029
1029
  };
1030
1030
  const regDate = new RegExp('y+|M+|d+|H+|m+|s+', 'g');
1031
1031
  const regYear = new RegExp('y');
1032
1032
  dateResult = format.replace(regDate, (v) => {
1033
1033
  let changeValue = v;
1034
1034
  if (regYear.test(changeValue)) {
1035
1035
  const thisYear = dateMap.y;
1036
1036
  const subValueLen = 4 - changeValue.length;
1037
1037
  changeValue = thisYear.substr(subValueLen);
1038
1038
  } else {
1039
1039
  const dateKey = v.substr(0, 1);
1040
1040
  changeValue = dateMap[dateKey];
1041
1041
  }
1042
1042
  return changeValue;
1043
1043
  });
1044
1044
  }
1045
1045
  return dateResult;
1046
1046
  let timer: any = null;
1047
1047
  let startTime = Date.now();
1048
1048
  return function () {
1049
1049
  const curTime = Date.now();
1050
1050
  const remaining = delay - (curTime - startTime);
1051
1051
  const context = this;
1052
1052
  const args = arguments;
1053
1053
  clearTimeout(timer);
1054
1054
  if (remaining <= 0) {
1055
1055
  func.apply(context, args);
1056
1056
  startTime = Date.now();
1057
1057
  } else {
1058
1058
  timer = setTimeout(func, remaining);
1059
1059
  }
1060
1060
  };
1061
1061
  let context, args, result;
1062
1062
  let timeout = null;
1063
1063
  let previous = 0;
1064
1064
  if (!options) options = {};
1065
1065
  const later = function () {
1066
1066
  previous = options.leading === false ? 0 : Date.now();
1067
1067
  timeout = null;
1068
1068
  result = func.apply(context, args);
1069
1069
  if (!timeout) context = args = null;
1070
1070
  };
1071
1071
  return function () {
1072
1072
  const now = Date.now();
1073
1073
  if (!previous && options.leading === false) previous = now;
1074
1074
  const remaining = wait - (now - previous);
1075
1075
  context = this;
1076
1076
  args = arguments;
1077
1077
  if (remaining <= 0 || remaining > wait) {
1078
1078
  if (timeout) {
1079
1079
  clearTimeout(timeout);
1080
1080
  timeout = null;
1081
1081
  }
1082
1082
  previous = now;
1083
1083
  result = func.apply(context, args);
1084
1084
  if (!timeout) context = args = null;
1085
1085
  } else if (!timeout && options.trailing !== false) {
1086
1086
  timeout = setTimeout(later, remaining);
1087
1087
  }
1088
1088
  return result;
1089
1089
  };
1090
1090
  let timer: any = null;
1091
1091
  return function () {
1092
1092
  const context: any = this;
1093
1093
  const args = arguments;
1094
1094
  timer && clearTimeout(timer);
1095
1095
  timer = setTimeout(function () {
1096
1096
  fn.apply(context, args);
1097
1097
  }, delay);
1098
1098
  };
1099
1099
  if (txt) {
1100
1100
  txt = txt.trim();
1101
1101
  const reg = new RegExp(/[\d-]+/);
1102
1102
  const res = reg.exec(txt);
1103
1103
  if (res && res.length > 0) {
1104
1104
  let tel = res[0];
1105
1105
  if (tel && delSeparator) {
1106
1106
  tel = tel.replace(/-/g, '');
1107
1107
  }
1108
1108
  return tel;
1109
1109
  }
1110
1110
  }
1111
1111
  return '';
1112
1112
  if (rgb) {
1113
1113
  const reg = /^(rgb|RGB)/;
1114
1114
  const color = rgb;
1115
1115
  if (reg.test(color)) {
1116
1116
  let strHex = '#';
1117
1117
  const colorArr = color.replace(/(?:\(|\)|rgb|RGB)*/g, '').split(',');
1118
1118
  for (let i = 0; i < colorArr.length; i++) {
1119
1119
  let hex = Number(colorArr[i]).toString(16);
1120
1120
  if (hex === '0') {
1121
1121
  hex += hex;
1122
1122
  }
1123
1123
  strHex += hex;
1124
1124
  }
1125
1125
  return strHex;
1126
1126
  } else {
1127
1127
  return String(color);
1128
1128
  }
1129
1129
  } else {
1130
1130
  return '';
1131
1131
  }
1132
1132
  if (hex) {
1133
1133
  const reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
1134
1134
  let color = hex.toLowerCase();
1135
1135
  if (reg.test(color)) {
1136
1136
  if (color.length === 4) {
1137
1137
  let colorNew = '#';
1138
1138
  for (let i = 1; i < 4; i += 1) {
1139
1139
  colorNew += color.slice(i, i + 1).concat(color.slice(i, i + 1));
1140
1140
  }
1141
1141
  color = colorNew;
1142
1142
  }
1143
1143
  const colorChange: number[] = [];
1144
1144
  for (let i = 1; i < 7; i += 2) {
1145
1145
  colorChange.push(parseInt('0x' + color.slice(i, i + 2)));
1146
1146
  }
1147
1147
  if (returnList) {
1148
1148
  return colorChange;
1149
1149
  } else {
1150
1150
  return 'RGB(' + colorChange.join(',') + ')';
1151
1151
  }
1152
1152
  } else {
1153
1153
  return color;
1154
1154
  }
1155
1155
  } else {
1156
1156
  return '';
1157
1157
  }
1158
1158
  const c = m - n + 1;
1159
1159
  const res = Math.floor(Math.random() * c + n);
1160
1160
  if (filterNum && filterNum == res) {
1161
1161
  console.log('随机数二次开始', res, filterNum);
1162
1162
  return getRandom(n, m, filterNum);
1163
1163
  } else {
1164
1164
  return res;
1165
1165
  }
1166
1166
  wqCookieStr: string;
1167
1167
  wqCookie: {
1168
1168
  pin?: string;
1169
1169
  visitkey?: string;
1170
1170
  [key: string]: any;
1171
1171
  };
1172
1172
 
1173
1173
  const {
1174
1174
  jdpin,
1175
1175
  pinStatus,
1176
1176
  visitkey,
1177
1177
  unionid,
1178
1178
  skey,
1179
1179
  __jda,
1180
1180
  __jdv,
1181
1181
  __wga,
1182
1182
  wid,
1183
1183
  wq_skey,
1184
1184
  wq_uin,
1185
1185
  wq_auth_token,
1186
1186
  wxapp_scene,
1187
1187
  wq_unionid,
1188
1188
  wxapp_openid,
1189
1189
  wxapp_version,
1190
1190
  wxapp_type,
1191
1191
  appType,
1192
1192
  } = cookie;
1193
1193
  const ret: string[] = [];
1194
1194
  const getUserCookieObj = {};
1195
1195
  const createUseCookieArr = [
1196
1196
  jdpin,
1197
1197
  pinStatus,
1198
1198
  visitkey,
1199
1199
  unionid,
1200
1200
  skey,
1201
1201
  __jda,
1202
1202
  __jdv,
1203
1203
  __wga,
1204
1204
  wid,
1205
1205
  wq_skey,
1206
1206
  wq_uin,
1207
1207
  wq_auth_token,
1208
1208
  wxapp_scene,
1209
1209
  wq_unionid,
1210
1210
  wxapp_openid,
1211
1211
  wxapp_version,
1212
1212
  wxapp_type,
1213
1213
  appType,
1214
1214
  ];
1215
1215
 
1216
1216
  createUseCookieArr.forEach((keyItem) => {
1217
1217
  if (keyItem && keyItem['name']) {
1218
1218
  let { name, value } = keyItem;
1219
1219
  name = name === 'jdpin' ? 'pin' : name;
1220
1220
  name === 'pin' && ret.push(`pt_pin=${encodeURIComponent(value)}`);
1221
1221
  ret.push(`${name}=${encodeURIComponent(value)}`);
1222
1222
  getUserCookieObj[name] = value;
1223
1223
  }
1224
1224
  });
1225
1225
  return {
1226
1226
  wqCookieStr: ret.join(';'),
1227
1227
  wqCookie: getUserCookieObj,
1228
1228
  };
1229
1229
  const getLayoutWidth = layoutWidth || global.info?.sysInfo?.windowWidth || windowWidth;
1230
1230
  const getNum = Number(num);
1231
1231
  return Math.round((getNum / widthSize) * getLayoutWidth);
1232
1232
  let checkState = false;
1233
1233
  const couponFloorModuleType = floorData?.floorExtInfo?.moduleFlag;
1234
1234
  if (couponFloorModuleType === FloorModuleType.COUPON) {
1235
1235
  try {
1236
1236
  const dataDefines = getFloorDataToDataDefines(floorData);
1237
1237
  const couponDataDefine = dataDefines
1238
1238
  ? dataDefines.filter((item) => {
1239
1239
  return item.type === 'coupon';
1240
1240
  })
1241
1241
  : [],
1242
1242
  couponList = couponDataDefine[0]?.nodeText?.data ? couponDataDefine[0]?.nodeText?.data : [],
1243
1243
  couponLength = couponList.length,
1244
1244
  numShowPerLine = couponDataDefine[0]?.nodeText?.numShowPerLine
1245
1245
  ? couponDataDefine[0]?.nodeText?.numShowPerLine
1246
1246
  : 0;
1247
1247
  if (numShowPerLine === 0 && couponLength > 3) {
1248
1248
  checkState = true;
1249
1249
  }
1250
1250
  } catch (e) {
1251
1251
  checkState = false;
1252
1252
  }
1253
1253
  return checkState;
1254
1254
  }
1255
1255
  const {
1256
1256
  containers = [],
1257
1257
  floors = [],
1258
1258
  clearFirstContaierMarginTop = false,
1259
1259
  } = pageData;
1260
1260
  console.log('dealShopContentData:', pageData, 'isvdev:', isvdev);
1261
1261
  const getThisTimeKey = Date.now();
1262
1262
  let shopContentContainerListData = containers?.filter(
1263
1263
  (item) => (!isvdev && item.typeCode !== 'mShopHeader') || isvdev,
1264
1264
  );
1265
1265
  const shopContentFloorListData = floors?.filter(
1266
1266
  ({ floorPosition }) =>
1267
1267
  (!isvdev && floorPosition !== 'header' && floorPosition !== 'footer') || isvdev,
1268
1268
  );
1269
1269
  const unableIsvContainerListData = getUnableIsvContainerListData(
1270
1270
  shopContentFloorListData,
1271
1271
  shopContentContainerListData,
1272
1272
  exceptionReportFn,
1273
1273
  );
1274
1274
  shopContentContainerListData.forEach((item, index) => {
1275
1275
  item.key = `${getThisTimeKey + index}`;
1276
1276
  item.floors = [];
1277
1277
  item.includeUids &&
1278
1278
  item.includeUids.forEach((floorUid) => {
1279
1279
  const getFloorData = shopContentFloorListData.find(
1280
1280
  (floorItem) => floorItem.uid === floorUid,
1281
1281
  );
1282
1282
  if (getFloorData) {
1283
1283
  const changeFloorData = {
1284
1284
  containerId: item.containerId,
1285
1285
  containerIndex: index,
1286
1286
  ...getFloorData,
1287
1287
  };
1288
1288
  const getCheckMoreCouponState = checkCouponAndChangeContainerSetData(getFloorData);
1289
1289
  if (getCheckMoreCouponState) {
1290
1290
  item.marginLeft && (item.marginLeft = 0);
1291
1291
  item.marginRight && (item.marginRight = 0);
1292
1292
  item.borderRadius && (item.borderRadius = 0);
1293
1293
  }
1294
1294
  if (getFloorData?.floorExtInfo?.floorLoadWay === 2) {
1295
1295
  const getSysFloorToLoadTypeRes = isIsvFloorUseable(getFloorData, exceptionReportFn);
1296
1296
  !getSysFloorToLoadTypeRes && (getFloorData.floorExtInfo.floorLoadWay = 1);
1297
1297
  }
1298
1298
  item.floors.push(changeFloorData);
1299
1299
  }
1300
1300
  });
1301
1301
  if (
1302
1302
  ((!isvdev && index === 0) || (isvdev && index === 1)) &&
1303
1303
  item?.containerPosition == 'content' &&
1304
1304
  item?.marginBottom > 0 &&
1305
1305
  !clearFirstContaierMarginTop
1306
1306
  ) {
1307
1307
  item.marginTop = item.marginBottom;
1308
1308
  }
1309
1309
  });
1310
1310
  shopContentContainerListData = shopContentContainerListData.filter(
1311
1311
  (item) =>
1312
1312
  item.floors.length > 0 &&
1313
1313
  unableIsvContainerListData.every(
1314
1314
  (containerItem) => containerItem.containerId != item.containerId,
1315
1315
  ),
1316
1316
  );
1317
1317
  console.log(
1318
1318
  'dealShopContentData isWxMinAndWxapp:',
1319
1319
  isWxMinAndWxapp,
1320
1320
  'weappJumpToH5:',
1321
1321
  pageData?.homeExtInfo?.weappJumpToH5,
1322
1322
  );
1323
1323
  if (isProd && isWxMinAndWxapp) {
1324
1324
  shopContentContainerListData = shopContentContainerListData.filter(
1325
1325
  (item) =>
1326
1326
  item.floors.length > 0 &&
1327
1327
  !isIsvContainer(item.containerId, shopContentFloorListData, shopContentContainerListData),
1328
1328
  );
1329
1329
  }
1330
1330
  shopContentContainerListData = [].concat(shopContentContainerListData);
1331
1331
  return {
1332
1332
  shopContentContainerListData,
1333
1333
  shopContentFloorListData,
1334
1334
  };
1335
1335
  const changeOpts = {
1336
1336
  title: '',
1337
1337
  icon: 'success',
1338
1338
  duration: 1500,
1339
1339
  mask: true,
1340
1340
  ...options,
1341
1341
  };
1342
1342
  if (changeOpts.title.length > 7) {
1343
1343
  showNormalToast(options);
1344
1344
  } else {
1345
1345
  Taro.showToast(changeOpts as any);
1346
1346
  }
1347
1347
  const changeOpts = {
1348
1348
  title: '',
1349
1349
  icon: 'error',
1350
1350
  duration: 1500,
1351
1351
  mask: true,
1352
1352
  ...options,
1353
1353
  };
1354
1354
  if (changeOpts.title.length > 7) {
1355
1355
  showNormalToast(options);
1356
1356
  } else {
1357
1357
  Taro.showToast(changeOpts as any);
1358
1358
  }
1359
1359
  Taro.showToast({
1360
1360
  title: '',
1361
1361
  icon: 'none',
1362
1362
  duration: 1500,
1363
1363
  mask: true,
1364
1364
  ...options,
1365
1365
  });
1366
1366
  return Taro.showLoading({
1367
1367
  title: text,
1368
1368
  });
1369
1369
  return new Promise(() => {
1370
1370
  Taro.nextTick(() => {
1371
1371
  setTimeout(() => {
1372
1372
  Taro.hideLoading(options);
1373
1373
  }, 300);
1374
1374
  });
1375
1375
  });
1376
1376
  return CHANNEL_TYPE[JDShopViewBusinessPathType.HOME];
1377
1377
  const {
1378
1378
  tabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN],
1379
1379
  sceneId,
1380
1380
  } = query;
1381
1381
  let changeTabActive = tabActive;
1382
1382
  if (sceneId) {
1383
1383
  if (isH5) {
1384
1384
  if (sceneId == '1002') {
1385
1385
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1386
1386
  }
1387
1387
  else if (sceneId == '1003') {
1388
1388
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_ACTIVITY];
1389
1389
  }
1390
1390
  } else if (isWxMinAndWxapp) {
1391
1391
  if (sceneId == '1001' || sceneId == '1002') {
1392
1392
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PRODUCT];
1393
1393
  }
1394
1394
  else if (sceneId == '1003') {
1395
1395
  changeTabActive = SECTION_HOME_TAB_NAME_TYPE[SECTION_HOME_TAB_TYPE.HOME_PROMOTION];
1396
1396
  }
1397
1397
  }
1398
1398
  }
1399
1399
  if (SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]) {
1400
1400
  return {
1401
1401
  menuType: SHOP_MENU_ID_TYPE.HOME,
1402
1402
  tabActiveType: SECTION_HOME_TAB_QUERY_TYPE[changeTabActive],
1403
1403
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_QUERY_TYPE[changeTabActive]}`,
1404
1404
  };
1405
1405
  } else if (SHOP_MENU_ID_QUERY_NAME[changeTabActive]) {
1406
1406
  return {
1407
1407
  menuType: SHOP_MENU_ID_QUERY_NAME[changeTabActive],
1408
1408
  tabActiveType: 0,
1409
1409
  queryMenuTabActiveStr: `${SHOP_MENU_ID_QUERY_NAME[changeTabActive]}@0`,
1410
1410
  };
1411
1411
  } else {
1412
1412
  return {
1413
1413
  menuType: SHOP_MENU_ID_TYPE.HOME,
1414
1414
  tabActiveType: SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN,
1415
1415
  queryMenuTabActiveStr: `${SHOP_MENU_ID_TYPE.HOME}@${SECTION_HOME_TAB_TYPE.HOME_WELL_CHOSEN}`,
1416
1416
  };
1417
1417
  }
1418
1418
  const deleteKeyList = [
1419
1419
  '$taroTimestamp',
1420
1420
  'cookie',
1421
1421
  'wdref',
1422
1422
  'navStart',
1423
1423
  'originOpts',
1424
1424
  'originParams',
1425
1425
  'originUrl',
1426
1426
  'referer',
1427
1427
  'stamp',
1428
1428
  'hybrid',
1429
1429
  'sr',
1430
1430
  'navh',
1431
1431
  'stath',
1432
1432
  ];
1433
1433
  let changeQueryData: any = { ...queryData };
1434
1434
  const qrCodeScene = changeQueryData?.scene ? changeQueryData?.scene : false;
1435
1435
  const sceneQuery =
1436
1436
  qrCodeScene && typeof qrCodeScene === 'string'
1437
1437
  ? parseQueryUrlString(decodeURIComponent(qrCodeScene))
1438
1438
  : {};
1439
1439
  changeQueryData = { ...changeQueryData, ...sceneQuery };
1440
1440
  deleteKeyList.forEach((key) => {
1441
1441
  changeQueryData[key] && delete changeQueryData[key];
1442
1442
  });
1443
1443
  changeQueryData['shopid'] &&
1444
1444
  (changeQueryData['shopId'] = changeQueryData['shopid']) &&
1445
1445
  delete changeQueryData['shopid'];
1446
1446
  changeQueryData['venderid'] &&
1447
1447
  (changeQueryData['venderId'] = changeQueryData['venderid']) &&
1448
1448
  delete changeQueryData['venderid'];
1449
1449
  changeQueryData['vendorId'] &&
1450
1450
  (changeQueryData['venderId'] = changeQueryData['vendorId']) &&
1451
1451
  delete changeQueryData['vendorId'];
1452
1452
  changeQueryData['shopId'] &&
1453
1453
  changeQueryData['shopId'] === 'undefined' &&
1454
1454
  delete changeQueryData['shopId'];
1455
1455
  changeQueryData['venderId'] &&
1456
1456
  changeQueryData['venderId'] === 'undefined' &&
1457
1457
  delete changeQueryData['venderId'];
1458
1458
  return changeQueryData;
1459
1459
  let isUsable = false;
1460
1460
  const modularPackResult = floorData?.floorExtInfo?.modularPackResult;
1461
1461
  const modularPackResultObj = formatPackResult(modularPackResult);
1462
1462
  const bundleUrl = getBundleUrl(modularPackResultObj);
1463
1463
  const bundleFileName = getBundleFileName(modularPackResultObj);
1464
1464
  const taroVersion = getTaroVersion(modularPackResultObj);
1465
1465
  if (bundleUrl && bundleFileName) {
1466
1466
  isUsable = true;
1467
1467
  }
1468
1468
  if (!isUsable && typeof exceptionReportFn === 'function') {
1469
1469
  exceptionReportFn({
1470
1470
  code: `${NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG}${
1471
1471
  floorData?.floorExtInfo?.floorKind === FLOOR_KIND.PDC_SYSTEM_MODULE
1472
1472
  ? SgmCustomCode.SYSTEMPDCMODULE_DATA
1473
1473
  : SgmCustomCode.REMOTEMODULE_DATA
1474
1474
  }`,
1475
1475
  msg: {
1476
1476
  msg: `店铺h5楼层隐藏不显示。原因:模块数据不完备,楼层过滤。`,
1477
1477
  floorIdx: floorData?.floorIdx,
1478
1478
  uid: floorData?.uid,
1479
1479
  shopId: floorData?.floorExtInfo?.shopId,
1480
1480
  moduleId: floorData?.moduleId,
1481
1481
  moduleDesignerType: floorData?.floorExtInfo?.moduleDesignerType,
1482
1482
  floorLoadWay: floorData?.floorExtInfo?.floorLoadWay,
1483
1483
  floorKind: floorData?.floorExtInfo?.floorKind,
1484
1484
  middleTemplateId: floorData?.middleTemplateId,
1485
1485
  modularPackResult: {
1486
1486
  bundleUrl,
1487
1487
  taroVersion,
1488
1488
  },
1489
1489
  },
1490
1490
  });
1491
1491
  }
1492
1492
  return isUsable;
1493
1493
  const objContainer = containerListData.find((item) => item.containerId === containerId);
1494
1494
  return (
1495
1495
  objContainer?.includeUids?.some((itemUid) => {
1496
1496
  const objectFloor = floorListData.find((floorItem) => itemUid === floorItem.uid);
1497
1497
  return RemoteLoadFloorList.includes(objectFloor?.floorExtInfo?.moduleFlag);
1498
1498
  }) ?? false
1499
1499
  );
1500
1500
  const unableIsvFloorListData = floorListData.filter(
1501
1501
  (floorItem) =>
1502
1502
  RemoteLoadFloorList.includes(floorItem?.floorExtInfo?.moduleFlag) &&
1503
1503
  !isIsvFloorUseable(floorItem, exceptionReportFn),
1504
1504
  );
1505
1505
  const unableIsvFloorUidList = unableIsvFloorListData.map((floorItem) => floorItem.uid);
1506
1506
  const unableIsvContainerListData = containerListData.filter(
1507
1507
  (item) =>
1508
1508
  item.includeUids &&
1509
1509
  item.includeUids.every((itemUid) => unableIsvFloorUidList.indexOf(itemUid) != -1),
1510
1510
  );
1511
1511
  return unableIsvContainerListData;
1512
1512
  console.log('暂无对应渠道比较', compareVersion, nowVersion);
1513
1513
  return -2;
1514
1514
  return customObj;
1515
1515
  return customObj;
1516
1516
  return customObj;
1517
1517
  return customObj;
1518
1518
  return customObj;
1519
1519
  return /openApp\.jdMobile:\/\/virtual\?params=/i.test(openAppUrl);
1520
1520
  let getParams = false;
1521
1521
  if (isOpenJdAppUrl(openAppUrl)) {
1522
1522
  try {
1523
1523
  getParams = openAppUrl.replace(/openApp\.jdMobile:\/\/virtual\?params=/i, '');
1524
1524
  getParams = JSON.parse(String(getParams));
1525
1525
  } catch (e) {
1526
1526
  console.log(e);
1527
1527
  }
1528
1528
  }
1529
1529
  return getParams;
1530
1530
  const getLastParams = Object.assign({}, openParams);
1531
1531
  return `openapp.jdmobile://virtual?params=${JSON.stringify(getLastParams)}`;
1532
1532
  if (val === null || val === '' || typeof val === 'undefined') {
1533
1533
  return true;
1534
1534
  }
1535
1535
  return false;
1536
1536
  const {
1537
1537
  moduleId = 'none',
1538
1538
  entrance = 'none',
1539
1539
  sourceType = 'none',
1540
1540
  sourceValue = 'none',
1541
1541
  } = params;
1542
1542
  if (isIosDevice) {
1543
1543
  return `${moduleId}#${entrance}`;
1544
1544
  } else if (isAndroidDevice) {
1545
1545
  return `${sourceType}#${sourceValue}`;
1546
1546
  }
1547
1547
  return 'none#none';
1548
1548
  if (data && typeof data === 'object') {
1549
1549
  let getOpenAppData = { ...data };
1550
1550
  try {
1551
1551
  const { sourceInfo, designerId, templateId, source } = getOpenAppData;
1552
1552
  if (designerId && templateId) {
1553
1553
  getOpenAppData = Object.assign({}, getOpenAppData, {
1554
1554
  sourceInfo: {
1555
1555
  entrance: '设计师预览',
1556
1556
  },
1557
1557
  });
1558
1558
  } else if (sourceInfo) {
1559
1559
  const { entrance } = sourceInfo;
1560
1560
  getOpenAppData.sourceInfo.entrance = entrance && entrance.length > 0 ? entrance : '其他';
1561
1561
  } else if (source && !sourceInfo) {
1562
1562
  if (typeof source === 'object') {
1563
1563
  const { sourceType, entrance, sourceValue, moduleId } = source;
1564
1564
  getOpenAppData = Object.assign({}, getOpenAppData, {
1565
1565
  sourceInfo: {
1566
1566
  entrance: sourceType || entrance || '其他',
1567
1567
  moduleId: sourceValue || moduleId || '-100',
1568
1568
  },
1569
1569
  });
1570
1570
  if (sourceType === 'shop_from_product_detail' && sourceValue) {
1571
1571
  getOpenAppData.sourceSku = sourceValue;
1572
1572
  }
1573
1573
  } else {
1574
1574
  getOpenAppData = Object.assign({}, getOpenAppData, {
1575
1575
  sourceInfo: {
1576
1576
  entrance: source,
1577
1577
  },
1578
1578
  });
1579
1579
  }
1580
1580
  } else {
1581
1581
  getOpenAppData = Object.assign({}, getOpenAppData, {
1582
1582
  sourceInfo: {
1583
1583
  entrance: '其他',
1584
1584
  },
1585
1585
  });
1586
1586
  }
1587
1587
  } catch (e) {
1588
1588
  console.log(e);
1589
1589
  }
1590
1590
  return getOpenAppData;
1591
1591
  }
1592
1592
  return data;
1593
1593
  return displayObj;
1594
1594
  if (typeof input === 'string') {
1595
1595
  try {
1596
1596
  return JSON.parse(input);
1597
1597
  } catch (e) {
1598
1598
  console.error('JSON解析失败', e);
1599
1599
  return {};
1600
1600
  }
1601
1601
  }
1602
1602
  return input || {};
1603
1603
  return false;
1604
1604
  const borderStyle: { [key: string]: any } = {};
1605
1605
  if (item?.borderRadius) {
1606
1606
  let borderTopRadius = 0;
1607
1607
  let borderBottomRadius = 0;
1608
1608
  if (index === 0) {
1609
1609
  borderTopRadius = item.borderRadius;
1610
1610
  borderBottomRadius = floorDataLen === 1 || item?.marginBottom !== 0 ? item.borderRadius : 0;
1611
1611
  } else if (index === floorDataLen - 1) {
1612
1612
  borderTopRadius = floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius;
1613
1613
  borderBottomRadius = item.borderRadius;
1614
1614
  } else {
1615
1615
  borderTopRadius = floorData[index - 1]?.marginBottom === 0 ? 0 : item.borderRadius;
1616
1616
  borderBottomRadius = item?.marginBottom === 0 ? 0 : item.borderRadius;
1617
1617
  }
1618
1618
  borderStyle.borderTopLeftRadius = item?.borderTopLeftRadius
1619
1619
  ? `${item?.borderTopLeftRadius}px`
1620
1620
  : `${borderTopRadius}px`;
1621
1621
  borderStyle.borderTopRightRadius = item?.borderTopRightRadius
1622
1622
  ? `${item?.borderTopRightRadius}px`
1623
1623
  : `${borderTopRadius}px`;
1624
1624
  borderStyle.borderBottomLeftRadius = `${borderBottomRadius}px`;
1625
1625
  borderStyle.borderBottomRightRadius = `${borderBottomRadius}px`;
1626
1626
  } else {
1627
1627
  borderStyle.borderTopLeftRadius = borderStyle?.borderTopLeftRadius || '0px';
1628
1628
  borderStyle.borderTopRightRadius = borderStyle?.borderTopRightRadius || '0px';
1629
1629
  borderStyle.borderBottomRightRadius = borderStyle?.borderBottomRightRadius || '0px';
1630
1630
  borderStyle.borderBottomLeftRadius = borderStyle?.borderBottomLeftRadius || '0px';
1631
1631
  }
1632
1632
  return borderStyle;
1633
1633
  return customObj;
1634
1634
  isJdApp,
1635
1635
  isWxApp,
1636
1636
  isIosDevice,
1637
1637
  isAndroidDevice,
1638
1638
  isJdAndIosDevice,
1639
1639
  isJdAndAndroidDevice,
1640
1640
  isWxMin,
1641
1641
  isWxMinAndWxapp,
1642
1642
  isJdMin,
1643
1643
  isMin,
1644
1644
  isJdMinAndHarmony,
1645
1645
  isH5,
1646
1646
  isH5AndJdShopView,
1647
1647
  isImageOptimizeEnable,
1648
1648
  isChartH5,
1649
1649
  isH5AndJdShopViewNativeScroll,
1650
1650
  isH5AndJdShopViewH5Scroll,
1651
1651
  isH5AndJdShopH5CustomScrollView,
1652
1652
  isWxMiniH5View,
1653
1653
  sliceArrToChunkList,
1654
1654
  dealAddress,
1655
1655
  objectToUrlEncode,
1656
1656
  parseQueryUrlString,
1657
1657
  setLowSmallPicUrl,
1658
1658
  getJfsImage,
1659
1659
  getQualityImage,
1660
1660
  countStringify,
1661
1661
  setTaroStorage,
1662
1662
  getTaroStorageKeyValue,
1663
1663
  removeTaroStorageKey,
1664
1664
  clearTaroStorageKey,
1665
1665
  getSystemInfos,
1666
1666
  addHttps,
1667
1667
  dateFormat,
1668
1668
  throttle,
1669
1669
  lodashThrottle,
1670
1670
  debounce,
1671
1671
  getTelephone,
1672
1672
  rgbToHex,
1673
1673
  hexToRgb,
1674
1674
  getRandom,
1675
1675
  getWxAppCookieStr,
1676
1676
  pxTransformFromData,
1677
1677
  dealShopContentData,
1678
1678
  showSuccessToast,
1679
1679
  showFailToast,
1680
1680
  showNormalToast,
1681
1681
  showShopLoading,
1682
1682
  hideShopLoading,
1683
1683
  getAppChannelType,
1684
1684
  formatTabActiveMenuType,
1685
1685
  filterUrlQueryData,
1686
1686
  getAvifSupport,
1687
1687
  getWebpSupport,
1688
1688
  isMemberPage,
1689
1689
  sgmCustomReport,
1690
1690
  draCustomReport,
1691
1691
  remoteCustomReport,
1692
1692
  draInterfaceCustomReport,
1693
1693
  draBusinessCustomReport,
1694
1694
  isOpenJdAppUrl,
1695
1695
  jdOpenAppParams,
1696
1696
  createJdOpenAppUrl,
1697
1697
  dealJdOpenAppData,
1698
1698
  isEmpty,
1699
1699
  getJdAppReportPageSource,
1700
1700
  isAppClassifyPage,
1701
1701
  getQualityImageNew,
1702
1702
  getQualityImageOld,
1703
1703
  isPc,
1704
1704
  ipLoc_djd,
1705
1705
  jdAppVersionCompare,
1706
1706
  dealNativePixelToCssPixel,
1707
1707
  isAppStowShop,
1708
1708
  isIpadDevice,
1709
1709
  getBorderStyle,
1710
1710
  isLanguageForEn,
1711
1711
  sColor,
1712
1712
  draInterfaceDSMCustomReport,
1713
1713
  isTabletDevice,
1714
1714
  isJdTabletDevice,
1715
1715
  jdTabletDeviceInfo,