@conecli/cone-render 0.10.1-isv2.2 → 0.10.1-isv3.1

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 (123) hide show
  1. package/README.md +1 -1
  2. package/dist/api/index.ts +1 -1
  3. package/dist/common/accessibility.h5.ts +1 -0
  4. package/dist/common/accessibility.ts +1 -0
  5. package/dist/common/const.ts +1 -1
  6. package/dist/common/index.h5.ts +1 -1
  7. package/dist/common/index.jd.ts +1 -1
  8. package/dist/common/index.ts +1 -1
  9. package/dist/common/index.weapp.ts +1 -1
  10. package/dist/common/jdplayerSdk.weapp.tsx +1 -0
  11. package/dist/common/jssdk.ts +1 -1
  12. package/dist/common/jssdk.weapp.ts +1 -0
  13. package/dist/common/pageType.ts +1 -1
  14. package/dist/common/token/index.h5.ts +1 -1
  15. package/dist/common/token/token.jd.ts +1 -1
  16. package/dist/common/wxappApi.ascf.ts +1 -0
  17. package/dist/common/wxappApi.ts +1 -1
  18. package/dist/components/ErrorBoundary.tsx +1 -1
  19. package/dist/components/base/CommonFloorHead/index.module.scss +126 -111
  20. package/dist/components/base/CommonFloorHead/index.tsx +1 -1
  21. package/dist/components/base/CountDown/index.tsx +1 -1
  22. package/dist/components/base/CustomScrollView/index-back.tsx +1 -0
  23. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  24. package/dist/components/base/CustomVideo/index.tsx +1 -1
  25. package/dist/components/base/CustomVideo/index.weapp.tsx +1 -0
  26. package/dist/components/base/Dialog/index.module.scss +11 -0
  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.weapp.tsx +1 -0
  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.tsx +1 -1
  37. package/dist/components/base/MobileCommonHeader/index.tsx +1 -1
  38. package/dist/components/base/MobileCommonHeader/index.weapp.tsx +1 -0
  39. package/dist/components/base/NetworkDataError/const.ts +1 -1
  40. package/dist/components/base/NetworkDataError/index.module.scss +118 -72
  41. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  42. package/dist/components/base/Price/Base/index.module.scss +12 -0
  43. package/dist/components/base/Price/Base/index.tsx +1 -1
  44. package/dist/components/base/Price/Double/index.module.scss +25 -1
  45. package/dist/components/base/Price/Double/index.tsx +1 -1
  46. package/dist/components/base/ShopLeGaoTag/index.h5.module.scss +35 -0
  47. package/dist/components/base/ShopLeGaoTag/index.h5.tsx +1 -0
  48. package/dist/components/base/ShopLeGaoTag/index.module.scss +33 -0
  49. package/dist/components/base/ShopLeGaoTag/index.tsx +1 -0
  50. package/dist/components/debug/DebugLayout/index.module.scss +2 -2
  51. package/dist/components/floorItem.tsx +1 -1
  52. package/dist/components/floorItem.weapp.tsx +1 -1
  53. package/dist/components/isv/Floor/index.tsx +1 -1
  54. package/dist/components/remoteFloorItem.tsx +1 -1
  55. package/dist/config/env.ts +1 -1
  56. package/dist/interface/common.ts +1 -1
  57. package/dist/interface/component.ts +1 -1
  58. package/dist/interface/jumpEventReport.ts +1 -1
  59. package/dist/interface/service.ts +1 -1
  60. package/dist/jumpEventReport/base.ts +1 -1
  61. package/dist/jumpEventReport/const.ts +1 -1
  62. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  63. package/dist/jumpEventReport/index.h5.ts +1 -1
  64. package/dist/jumpEventReport/index.jd.ts +1 -1
  65. package/dist/jumpEventReport/index.weapp.ts +1 -1
  66. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  67. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  68. package/dist/jumpEventReport/logEventConfig.h5.ts +1 -0
  69. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  70. package/dist/jumpEventReport/web/report.ts +1 -1
  71. package/dist/jumpEventReport/web.base.ts +1 -1
  72. package/dist/jumpEventReport/web.jd.ts +1 -1
  73. package/dist/jumpEventReport/web.pc.ts +1 -1
  74. package/dist/jumpEventReport/web.tjm.ts +1 -1
  75. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  76. package/dist/language/en_US.json +395 -0
  77. package/dist/language/zh_CN.json +395 -0
  78. package/dist/language/zh_HK.json +395 -0
  79. package/dist/libs/openShopBridge.js +161 -0
  80. package/dist/libs/openShopBridge.min.js +1 -0
  81. package/dist/libs/taroAppReport.js +2 -2
  82. package/dist/modules/ContainerFloorList/index.h5.module.scss +80 -53
  83. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  84. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  85. package/dist/modules/DecorateContainerFloorList/index.weapp.tsx +1 -0
  86. package/dist/open/api/environment.ts +1 -1
  87. package/dist/open/api/shopMember.ts +1 -1
  88. package/dist/open/api/shopMember.weapp.ts +1 -0
  89. package/dist/open/api/track.ts +1 -1
  90. package/dist/open/api/util.ts +1 -1
  91. package/dist/open/components/index.ts +1 -1
  92. package/dist/open/index.ts +1 -1
  93. package/dist/sass/app.h5.scss +278 -224
  94. package/dist/sass/base.scss +8 -4
  95. package/dist/service/fetchGateway.ts +1 -1
  96. package/dist/service/fetchGateway.weapp.ts +1 -0
  97. package/dist/service/fetchJsonp.weapp.ts +1 -0
  98. package/dist/service/http/colorSign.ts +1 -1
  99. package/dist/service/http/const.ts +1 -1
  100. package/dist/service/http/h5Http.ts +1 -1
  101. package/dist/service/http/httpInterceptors.weapp.ts +1 -0
  102. package/dist/service/requestServer.h5.ts +1 -1
  103. package/dist/service/requestServer.ts +1 -1
  104. package/dist/service/requestServer.weapp.ts +1 -0
  105. package/dist/utils/connectNativeJsBridge.ts +1 -1
  106. package/dist/utils/h5Utils.ts +1 -1
  107. package/dist/utils/harmonyCallRouter.h5.ts +1 -0
  108. package/dist/utils/harmonyCallRouter.ts +0 -0
  109. package/dist/utils/index.h5.ts +1 -1
  110. package/dist/utils/index.ts +1 -1
  111. package/dist/utils/index.weapp.ts +1 -1
  112. package/dist/utils/jumpExtMapUtil.h5.ts +1 -0
  113. package/dist/utils/jumpExtMapUtil.ts +1 -0
  114. package/dist/utils/jumpExtMapUtil.weapp.ts +1 -0
  115. package/dist/utils/log.ts +1 -0
  116. package/dist/utils/sColor.ts +1 -0
  117. package/dist/utils/sColor.weapp.ts +1 -0
  118. package/dist/utils/utils.ts +1 -1
  119. package/dist/wxapp/common/address_api/address_api_v2.js +1 -0
  120. package/dist/wxapp/common/user_info.js +1 -1
  121. package/package.json +164 -141
  122. package/dist/jumpEventReport/web/wqshop.report.ts +0 -1
  123. package/dist/utils/priceUtils.js +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  UtilsInterFace
3
2
  nativePageShowToast,
4
3
  ToastAndroidType,
5
4
  ToastIosType,
6
5
  stopNativeScrollEvent,
7
6
  getAppChannelType,
8
7
  isAndroidDevice,
9
8
  isH5AndJdShopView,
10
9
  isChartH5,
11
10
  isH5AndJdShopViewNativeScroll,
12
11
  isIosDevice,
13
12
  isJdAndAndroidDevice,
14
13
  isJdAndIosDevice,
15
14
  isJdApp,
16
15
  isWxApp,
17
16
  isWxMiniH5View,
18
17
  isJdAndHarmonyDevice,
19
18
  isH5AndJingGouMini,
20
19
  urlCookie,
21
20
  sgmCustomReport,
22
21
  draCustomReport,
23
22
  remoteCustomReport,
24
23
  draInterfaceCustomReport,
25
24
  draBusinessCustomReport,
26
25
  isMemberPage,
27
26
  isH5AndJdShopViewH5Scroll,
28
27
  isH5AndJdShopH5CustomScrollView,
29
28
  isAppClassifyPage,
30
29
  isAppHomeForMarketPage,
31
30
  isPc,
32
31
  ipLoc_djd,
33
32
  jdAppVersionCompare,
34
33
  isTjScence,
35
34
  isH5AdnJxMini,
36
35
  isTjM,
37
36
  isTjJxM,
38
37
  isTJApp,
39
38
  isH5AdnHaoWuJie,
40
39
  tjChannel,
41
40
  dealNativePixelToCssPixel,
42
41
  isAppStowShop,
43
42
  isJdAndroidX5Core,
44
43
  parseQueryUrlObj,
45
44
  isIpadDevice,
46
45
  isSupportHybridHttpRequest,
47
46
  isLanguageForEn,
48
47
  addHttps,
49
48
  clearTaroStorageKey,
50
49
  countStringify,
51
50
  dateFormat,
52
51
  dealAddress,
53
52
  dealShopContentData as originDealShopContentData,
54
53
  debounce,
55
54
  filterUrlQueryData,
56
55
  formatTabActiveMenuType,
57
56
  getAvifSupport,
58
57
  getWebpSupport,
59
58
  getTaroStorageKeyValue,
60
59
  getWxAppCookieStr,
61
60
  isH5,
62
61
  isMin,
63
62
  isJdMin,
64
63
  isWxMin,
65
64
  isWxMinAndWxapp,
66
65
  isJdMinAndHarmony,
67
66
  lodashThrottle,
68
67
  objectToUrlEncode,
69
68
  parseQueryUrlString,
70
69
  removeTaroStorageKey,
71
70
  setLowSmallPicUrl,
72
71
  setTaroStorage,
73
72
  showFailToast,
74
73
  showNormalToast,
75
74
  showSuccessToast,
76
75
  sliceArrToChunkList,
77
76
  throttle,
78
77
  getQualityImageNew,
79
78
  getQualityImageOld,
80
79
  isOpenJdAppUrl,
81
80
  jdOpenAppParams,
82
81
  createJdOpenAppUrl,
83
82
  isEmpty,
84
83
  getJdAppReportPageSource,
85
84
  dealJdOpenAppData,
86
85
  getBorderStyle,
87
86
  SgmCustomCode,
88
87
  } from '../common/sgmCustomCode'
89
88
  const getNum = Number(num)
90
89
  let _changeLayoutWidth = layoutWidth
91
90
  if (!_changeLayoutWidth) {
92
91
  _changeLayoutWidth =
93
92
  _ShopSystemInfo && _ShopSystemInfo?.windowWidth
94
93
  ? _ShopSystemInfo.windowWidth
95
94
  : Taro.getSystemInfoSync()?.windowWidth
96
95
  }
97
96
  return Math.round((getNum / widthSize) * _changeLayoutWidth)
98
97
  changeSize,
99
98
  designWidth = 750,
100
99
  systemInfo,
101
100
  const getRootFontSize =
102
101
  (40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth)) / 750
103
102
  const getRealRootFontSize =
104
103
  getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize
105
104
  return Math.ceil(
106
105
  (((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) *
107
106
  getRealRootFontSize,
108
107
  )
109
108
  console.log(
110
109
  '获取系统宽度systemInfo?.windowWidth',
111
110
  systemInfo?.windowWidth,
112
111
  'taroToTransformRoutimePXNumber(changeWidth)',
113
112
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
114
113
  )
115
114
  return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
116
115
  ? systemInfo?.windowWidth -
117
116
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
118
117
  : systemInfo?.windowWidth ?? 0
119
118
  const systemInfo = Taro.getSystemInfoSync()
120
119
  if (params && params?.pageWidth && params?.pageHeight) {
121
120
  systemInfo.windowWidth = params?.pageWidth
122
121
  systemInfo.windowHeight = params?.pageHeight
123
122
  console.warn("松果安卓app内获折叠屏信息重置系统信息宽度值",params,",systemInfo信息集合为",systemInfo)
124
123
  }else {
125
124
  if (isJdApp && isAndroidDevice && systemInfo) {
126
125
  const getWinWidth = window.innerWidth;
127
126
  const getWinHeight = window.innerHeight;
128
127
  const getScreenWidth = window.screen.width;
129
128
  const getScreenHeight = window.screen.height;
130
129
  const isLandscape = getScreenWidth >= getScreenHeight;
131
130
  const { windowWidth,windowHeight, screenWidth, screenHeight } = systemInfo
132
131
  if (windowWidth <= 0) {
133
132
  systemInfo.initWindowWidth = windowWidth;
134
133
  if(isLandscape){
135
134
  systemInfo.windowWidth = getScreenHeight
136
135
  systemInfo.windowHeight = getScreenWidth
137
136
  systemInfo.screenWidth = getScreenHeight
138
137
  systemInfo.screenHeight = getScreenWidth
139
138
  }else {
140
139
  systemInfo.windowWidth = getScreenWidth
141
140
  systemInfo.windowHeight = getScreenHeight
142
141
  systemInfo.screenWidth = getScreenWidth
143
142
  systemInfo.screenHeight = getScreenHeight
144
143
  }
145
144
  console.warn(`松果安卓app内获取系统信息宽度异常为小于等于0,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取窗口高度值${windowHeight},重置后的高度值${systemInfo.windowHeight}`)
146
145
  sgmCustomReport({
147
146
  type: 2,
148
147
  code: 'android_jdapp_width_error_info',
149
148
  msg: {
150
149
  title: `松果安卓app内获取系统信息宽度为小于等于0,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight}`,
151
150
  initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
152
151
  taroSysInfo: systemInfo
153
152
  }
154
153
  })
155
154
  }else {
156
155
  let _getChangeWinWidthState = false
157
156
  if( getWinWidth > 0 && windowWidth > 0 && windowWidth > getWinWidth){
158
157
  if(isLandscape){
159
158
  systemInfo.windowWidth = getScreenHeight
160
159
  systemInfo.windowHeight = getScreenWidth
161
160
  systemInfo.screenWidth = getScreenHeight
162
161
  systemInfo.screenHeight = getScreenWidth
163
162
  }else {
164
163
  systemInfo.windowWidth = getScreenWidth
165
164
  systemInfo.windowHeight = getScreenHeight
166
165
  systemInfo.screenWidth = getScreenWidth
167
166
  systemInfo.screenHeight = getScreenHeight
168
167
  }
169
168
  _getChangeWinWidthState = true
170
169
  }
171
170
  _getChangeWinWidthState && console.warn(`松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取屏幕宽度值${screenWidth},重置后的宽度值${systemInfo.screenWidth}`)
172
171
  _getChangeWinWidthState && sgmCustomReport({
173
172
  type: 2,
174
173
  code: 'android_jdapp_width_error_info',
175
174
  msg: {
176
175
  title: `松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight}`,
177
176
  initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
178
177
  taroSysInfo: systemInfo
179
178
  }
180
179
  })
181
180
  }
182
181
  }
183
182
  }
184
183
  systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo)
185
184
  console.warn('====获取系统信息=====', systemInfo)
186
185
  return systemInfo
187
186
  let result: boolean | null = null
188
187
  return function() {
189
188
  if (result === null) {
190
189
  const appVersionCheckPass = jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0
191
190
  if(!isJdApp){
192
191
  console.warn("🚗 ~~ file: utils.ts:191 站外H5默认打开图片优化~")
193
192
  isIgnoreOptimizeFromServer = true
194
193
  result = true
195
194
  return true
196
195
  }
197
196
  const enableAvifOptimize = appVersionCheckPass
198
197
  if(enableAvifOptimize){
199
198
  const configData = global.getDynamicConfig('avifSwitch')
200
199
  console.warn("🚗 ~~ file: utils.ts:196 ~~ global.getDynamicConfig ~~ buildType:", buildType)
201
200
  console.warn("🚗 ~~ file: utils.ts:197 ~~ global.getDynamicConfig ~~ configData:", configData)
202
201
  const { globalOn = true, ignoreOptimizeFromServer = false, page = {}, grayscale = {}, whiteList = [], blackList = [] } = configData || {}
203
202
  const {shopId = '0', venderId = '0'} = parseQueryUrlObj
204
203
  let imageEnableResult = true
205
204
  isIgnoreOptimizeFromServer = ignoreOptimizeFromServer
206
205
  console.warn("🚗 ~~ file: index.h5.ts:213 ~~ returnfunction ~~ grayscale[buildType]:", grayscale[buildType])
207
206
  if (blackList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
208
207
  imageEnableResult = false
209
208
  console.warn("🚗 ~~ file: utils.ts:198 命中黑名单~")
210
209
  }else if(whiteList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
211
210
  isIgnoreOptimizeFromServer = true
212
211
  imageEnableResult = true
213
212
  console.warn("🚗 ~~ file: utils.ts:205 命中白名单~")
214
213
  }else if(grayscale[buildType] && isInGrayscale(grayscale[buildType])){
215
214
  isIgnoreOptimizeFromServer = true
216
215
  imageEnableResult = true
217
216
  console.warn("🚗 ~~ file: utils.ts:214 命中灰度~")
218
217
  }else{
219
218
  imageEnableResult = globalOn === true || page[buildType] === true
220
219
  if(globalOn === true){
221
220
  isIgnoreOptimizeFromServer = true
222
221
  console.warn("🚗 ~~ file: utils.ts:220 走全局开关控制逻辑,开关已打开~")
223
222
  }else if(page[buildType] === true){
224
223
  console.warn("🚗 ~~ file: utils.ts:220 走页面开关控制逻辑,开关已打开~")
225
224
  }else{
226
225
  console.warn("🚗 ~~ file: utils.ts:220 走全局或页面开关控制逻辑,开关未打开!")
227
226
  }
228
227
  }
229
228
  result = imageEnableResult
230
229
  return imageEnableResult
231
230
  }else{
232
231
  result = false
233
232
  return false
234
233
  }
235
234
  } else {
236
235
  return result
237
236
  }
238
237
  }
239
238
  if(typeof options === 'object' && isImageOptimizeEnable()){
240
239
  return getQualityImageNew(imgUrl, options, isIgnoreOptimizeFromServer)
241
240
  }else{
242
241
  return getQualityImageOld(imgUrl, options)
243
242
  }
244
243
  const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
245
244
  windowWidth: window.innerWidth,
246
245
  containerWidth: getContainerWidth(buildType, {
247
246
  windowWidth: window.innerWidth,
248
247
  }),
249
248
  screenWidth: window.innerWidth,
250
249
  platform: '',
251
250
  model: '',
252
251
  system: '',
253
252
  }
254
253
  return getSystemInfo
255
254
  console.log('进入commonshowToast, 传入参数options为: ', options)
256
255
  const params = Object.assign(
257
256
  {},
258
257
  {
259
258
  title: '',
260
259
  duration: 1500,
261
260
  },
262
261
  options,
263
262
  )
264
263
  params.duration = params.duration / 1000
265
264
  if (isJdApp) {
266
265
  const showSuccessType = isIosDevice
267
266
  ? ToastIosType.SUCCESS
268
267
  : ToastAndroidType.SUCCESS
269
268
  const duration = isAndroidDevice ? 0 : params.duration
270
269
  nativePageShowToast(options.title, showSuccessType, duration)
271
270
  console.log('执行原生toast success')
272
271
  } else {
273
272
  showSuccessToast(options)
274
273
  }
275
274
  const params = Object.assign(
276
275
  {},
277
276
  {
278
277
  title: '',
279
278
  duration: 1500,
280
279
  },
281
280
  options,
282
281
  )
283
282
  params.duration = params.duration / 1000
284
283
  if (isJdApp) {
285
284
  const showSuccessType = isIosDevice
286
285
  ? ToastIosType.FAIL
287
286
  : ToastAndroidType.FAIL
288
287
  const duration = isAndroidDevice ? 0 : params.duration
289
288
  nativePageShowToast(options.title, showSuccessType, duration)
290
289
  console.log('执行原生toast fail')
291
290
  } else {
292
291
  console.log('执行H5 toast fail')
293
292
  showFailToast(options)
294
293
  }
295
294
  const params = Object.assign(
296
295
  {},
297
296
  {
298
297
  title: '',
299
298
  duration: 1500,
300
299
  },
301
300
  options,
302
301
  )
303
302
  params.duration = params.duration / 1000
304
303
  if (isJdApp) {
305
304
  const showSuccessType = isIosDevice ?
306
305
  ToastIosType.NORMAL :
307
306
  ToastAndroidType.NORMAL
308
307
  const duration = isAndroidDevice ? 0 : params.duration
309
308
  nativePageShowToast(options.title, showSuccessType, duration)
310
309
  } else {
311
310
  showNormalToast(options)
312
311
  }
313
312
  const createLoadingEle = document.createElement('div')
314
313
  createLoadingEle.id = 'J_shopLoading'
315
314
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
316
315
  createLoadingEle.innerHTML =
317
316
  `<div class='d-loading-content'>
318
317
  <span class='d-shop-loading-icon'></span>
319
318
  <p class='d-shop-text'>${text}</p>
320
319
  </div>`
321
320
  const getEle = document.body
322
321
  ? document.body
323
322
  : document.getElementsByTagName('body')[0]
324
323
  getEle.appendChild(createLoadingEle)
325
324
  const getEle = document.getElementById('J_shopLoading')
326
325
  getEle && getEle.remove()
327
326
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(
328
327
  params,
329
328
  )
330
329
  if (!systemInfo.system && window) {
331
330
  systemInfo.system = window.navigator.userAgent
332
331
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
333
332
  }
334
333
  const isIOS = !!systemInfo?.system.match(/ios/i)
335
334
  const isAndroid = !!systemInfo?.system.match(/android/i)
336
335
  systemInfo.navBarHeight = 0
337
336
  systemInfo.statusBarHeight = 0
338
337
  systemInfo.capsulePosition = null
339
338
  systemInfo.isIOS = isIOS
340
339
  systemInfo.isAndroid = isAndroid
341
340
  _ShopSystemInfo = systemInfo
342
341
  return systemInfo
343
342
  return originDealShopContentData(pageData, sgmCustomReport, isvdev)
344
343
  const numScale = Number(scale)
345
344
  if(isNaN(numScale)){
346
345
  console.warn(`The 'scale' parameter of the 'isInGrayscale' function is invalid! Expected a number, but received ${scale}`)
347
346
  return false
348
347
  }
349
348
  const { venderId } = global.info.queryInfo || {}
350
349
  const id = venderId
351
350
  if(!id && numScale !== 1){
352
351
  return false
353
352
  }
354
353
  const useScale = Math.max(0, Math.min(1, numScale))
355
354
  const isMatch = numScale === 1 || Math.floor(Number(id) % (1 / useScale)) === 0
356
355
  if(reportKey){
357
356
  sgmCustomReport({
358
357
  code: getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`),
359
358
  msg: '灰度调用',
360
359
  })
361
360
  console.log(`基于KEY[${reportKey}]的灰度调用1次~`, getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`))
362
361
  if(isMatch){
363
362
  sgmCustomReport({
364
363
  code: getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`),
365
364
  msg: '灰度命中',
366
365
  })
367
366
  console.log(`基于KEY[${reportKey}]的命中1次灰度!`, getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`))
368
367
  }
369
368
  }
370
369
  return isMatch
371
370
  isJdApp,
372
371
  isWxApp,
373
372
  isIosDevice,
374
373
  isAndroidDevice,
375
374
  isJdAndIosDevice,
376
375
  isJdAndAndroidDevice,
377
376
  isJdAndHarmonyDevice,
378
377
  isJdAndroidX5Core,
379
378
  isMin,
380
379
  isWxMin,
381
380
  isWxMinAndWxapp,
382
381
  isJdMinAndHarmony,
383
382
  isJdMin,
384
383
  isH5,
385
384
  isH5AndJdShopView,
386
385
  isChartH5,
387
386
  isH5AndJdShopViewNativeScroll,
388
387
  isH5AndJdShopViewH5Scroll,
389
388
  isH5AndJdShopH5CustomScrollView,
390
389
  isH5AndJingGouMini,
391
390
  isWxMiniH5View,
392
391
  urlCookie,
393
392
  sliceArrToChunkList,
394
393
  dealAddress,
395
394
  objectToUrlEncode,
396
395
  parseQueryUrlString,
397
396
  setLowSmallPicUrl,
398
397
  setTaroStorage,
399
398
  getTaroStorageKeyValue,
400
399
  removeTaroStorageKey,
401
400
  clearTaroStorageKey,
402
401
  getAvifSupport,
403
402
  getWebpSupport,
404
403
  getQualityImage,
405
404
  countStringify,
406
405
  getWxAppCookieStr,
407
406
  getSystemInfos,
408
407
  pxTransformFromData,
409
408
  dealShopContentDataAndReport as dealShopContentData,
410
409
  dateFormat,
411
410
  throttle,
412
411
  lodashThrottle,
413
412
  debounce,
414
413
  addHttps,
415
414
  commonShowSuccessToast as showSuccessToast,
416
415
  commonShowFailToast as showFailToast,
417
416
  commonShowNormalToast as showNormalToast,
418
417
  showShopLoading,
419
418
  hideShopLoading,
420
419
  stopNativeScrollEvent,
421
420
  getAppChannelType,
422
421
  formatTabActiveMenuType,
423
422
  filterUrlQueryData,
424
423
  sgmCustomReport,
425
424
  draCustomReport,
426
425
  remoteCustomReport,
427
426
  draInterfaceCustomReport,
428
427
  draBusinessCustomReport,
429
428
  isMemberPage,
430
429
  getFloorDataToDataDefines,
431
430
  isOpenJdAppUrl,
432
431
  jdOpenAppParams,
433
432
  createJdOpenAppUrl,
434
433
  isEmpty,
435
434
  getJdAppReportPageSource,
436
435
  isAppClassifyPage,
437
436
  isAppHomeForMarketPage,
438
437
  isImageOptimizeEnable,
439
438
  isPc,
440
439
  ipLoc_djd,
441
440
  isTjScence,
442
441
  isH5AdnJxMini,
443
442
  isTjM,
444
443
  isTjJxM,
445
444
  isTJApp,
446
445
  isH5AdnHaoWuJie,
447
446
  tjChannel,
448
447
  dealJdOpenAppData,
449
448
  jdAppVersionCompare,
450
449
  dealNativePixelToCssPixel,
451
450
  isAppStowShop,
452
451
  getSgmCustomCode,
453
452
  handleSgmCodeTaroVersion,
454
453
  isInGrayscale,
455
454
  isIpadDevice,
456
455
  getBorderStyle,
457
456
  isSupportHybridHttpRequest,
458
457
  isLanguageForEn
458
+ import Taro from '@tarojs/taro';
459
459
  stopNativeScrollEvent,
460
460
  getAppChannelType,
461
461
  isAndroidDevice,
462
462
  isHarmonyDevice,
463
463
  isH5AndJdShopView,
464
464
  isChartH5,
465
465
  isH5AndJdShopViewNativeScroll,
466
466
  isIosDevice,
467
467
  isJdAndAndroidDevice,
468
468
  isJdAndIosDevice,
469
469
  isJdApp,
470
470
  isWxApp,
471
471
  isWxMiniH5View,
472
472
  isJdAndHarmonyDevice,
473
473
  isNewHarmonyShop,
474
474
  isH5AndJingGouMini,
475
475
  urlCookie,
476
476
  draCustomReport,
477
477
  remoteCustomReport,
478
478
  draInterfaceCustomReport,
479
479
  draBusinessCustomReport,
480
480
  draBusinessCustomLogReport,
481
481
  isMemberPage,
482
482
  isAppHomePage,
483
483
  isH5AndJdShopViewH5Scroll,
484
484
  isH5AndJdShopH5CustomScrollView,
485
485
  isAppClassifyPage,
486
486
  isAppHomeForMarketPage,
487
487
  isPc,
488
488
  isPcClassifyPage,
489
489
  ipLoc_djd,
490
490
  jdAppVersionCompare,
491
491
  isTjScence,
492
492
  isH5AdnJxMini,
493
493
  isTjM,
494
494
  isTjJxM,
495
495
  isTJApp,
496
496
  isH5AdnHaoWuJie,
497
497
  tjChannel,
498
498
  dealNativePixelToCssPixel,
499
499
  isAppStowShop,
500
500
  isJdAndroidX5Core,
501
501
  parseQueryUrlObj,
502
502
  isIpadDevice,
503
503
  isTabletDevice,
504
504
  checkPadScreenOrientationIsLandscape,
505
505
  isSupportHybridHttpRequest,
506
506
  isLanguageForEn,
507
507
  sColor,
508
508
  isInJdShopView,
509
509
  isDongWebView,
510
510
  isLanguageForHk,
511
511
  languageNowType,
512
512
  isAscfApp,
513
513
  isInJdAppH5DebugMode,
514
514
  isJdLiteApp,
515
515
  isJdAppForNotMain,
516
516
  addHttps,
517
517
  clearTaroStorageKey,
518
518
  countStringify as h5CountStringify,
519
519
  dateFormat,
520
520
  dealAddress,
521
521
  dealShopContentData as originDealShopContentData,
522
522
  debounce,
523
523
  filterUrlQueryData,
524
524
  formatTabActiveMenuType,
525
525
  getAvifSupport,
526
526
  getWebpSupport,
527
527
  getTaroStorageKeyValue,
528
528
  getWxAppCookieStr,
529
529
  isH5,
530
530
  isMin,
531
531
  isJdMin,
532
532
  isWxMin,
533
533
  isWxMinAndWxapp,
534
534
  isJdMinAndHarmony,
535
535
  lodashThrottle,
536
536
  objectToUrlEncode,
537
537
  parseQueryUrlString,
538
538
  removeTaroStorageKey,
539
539
  setLowSmallPicUrl,
540
540
  setTaroStorage,
541
541
  showFailToast,
542
542
  showNormalToast,
543
543
  showSuccessToast,
544
544
  sliceArrToChunkList,
545
545
  throttle,
546
546
  getQualityImageNew,
547
547
  getQualityImageOld,
548
548
  isOpenJdAppUrl,
549
549
  jdOpenAppParams,
550
550
  createJdOpenAppUrl,
551
551
  isEmpty,
552
552
  getJdAppReportPageSource,
553
553
  dealJdOpenAppData,
554
554
  getBorderStyle,
555
555
  isInHarmonyBlacklistByModuleFlag,
556
556
  const getNum = Number(num);
557
557
  let _changeLayoutWidth = layoutWidth;
558
558
  if (!_changeLayoutWidth) {
559
559
  _changeLayoutWidth =
560
560
  _ShopSystemInfo && _ShopSystemInfo?.windowWidth
561
561
  ? _ShopSystemInfo.windowWidth
562
562
  : Taro.getSystemInfoSync()?.windowWidth;
563
563
  }
564
564
  return _ShopSystemInfo?.isJdTabletDevice && !layoutWidth
565
565
  ? Math.floor(getNum * (newFlexPad ? newFlexPadScale : 1.2 * (_changeLayoutWidth / 720)))
566
566
  : Math.round((getNum / widthSize) * _changeLayoutWidth);
567
567
  const getNum = Number(num);
568
568
  return newFlexPad
569
569
  ? Math.floor(getNum * newFlexPadScale)
570
570
  : pxTransformFromData(num, widthSize, layoutWidth);
571
571
  const getRootFontSize = newFlexPad
572
572
  ? 20 * newFlexPadScale
573
573
  : (40 * (systemInfo?.windowWidth ?? _ShopSystemInfo?.windowWidth ?? 375)) / 750;
574
574
  let getRealRootFontSize = getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize;
575
575
  if (_ShopSystemInfo?.isJdTabletDevice && !newFlexPad) {
576
576
  getRealRootFontSize = Math.floor(
577
577
  24 * ((systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth) / 720),
578
578
  );
579
579
  }
580
580
  return Math.ceil(
581
581
  (((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) * getRealRootFontSize,
582
582
  );
583
583
  console.log(
584
584
  '获取系统宽度systemInfo?.windowWidth',
585
585
  systemInfo?.windowWidth,
586
586
  'taroToTransformRoutimePXNumber(changeWidth)',
587
587
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
588
588
  );
589
589
  return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
590
590
  ? systemInfo?.windowWidth - taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
591
591
  : systemInfo?.windowWidth ?? 0;
592
592
  const systemInfo = _ShopSystemInfo || Taro.getSystemInfoSync();
593
593
  console.log(
594
594
  '获取系统宽度systemInfo?.windowWidth',
595
595
  systemInfo?.windowWidth,
596
596
  'taroToTransformRoutimePXNumber(changeWidth)',
597
597
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
598
598
  );
599
599
  const containerWidth =
600
600
  isClassify && systemInfo?.windowWidth
601
601
  ? systemInfo?.windowWidth - taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
602
602
  : systemInfo?.windowWidth ?? 0;
603
603
  if (global?.info?.sysInfo) {
604
604
  global.info.sysInfo['containerWidth'] = containerWidth;
605
605
  }
606
606
  return newFlexPad
607
607
  ? Math.min(rootEleWidth, window.screen.height) >= 600
608
608
  : isJdApp &&
609
609
  (parseQueryUrlObj['device'] === 'tablet' ||
610
610
  Math.min(rootEleWidth, window.screen.height) >= 720);
611
611
  const systemInfo: any = Taro.getSystemInfoSync();
612
612
  if (params && params?.pageWidth && params?.pageHeight) {
613
613
  systemInfo.windowWidth = params?.pageWidth;
614
614
  systemInfo.windowHeight = params?.pageHeight;
615
615
  console.warn('松果app内获取重置系统信息宽度值', params, ',systemInfo信息集合为', systemInfo);
616
616
  } else {
617
617
  if (isPc) {
618
618
  systemInfo.windowWidth = 375;
619
619
  } else {
620
620
  const getWinWidth = window.innerWidth;
621
621
  const getWinHeight = window.innerHeight;
622
622
  const getScreenWidth = window.screen.width;
623
623
  const getScreenHeight = window.screen.height;
624
624
  const getRootEleInitWidth = params?.rootEleInitWidth || 0;
625
625
  const isReplaceSystemWidth = params?.replaceSystemWidth || false;
626
626
  systemInfo.isJdTabletDevice = checkIsJdTabletDevice(getRootEleInitWidth);
627
627
  systemInfo.isJdTabletLandscape =
628
628
  systemInfo.isJdTabletDevice &&
629
629
  checkPadScreenOrientationIsLandscape(getRootEleInitWidth, getScreenWidth, getScreenHeight);
630
630
  if (!systemInfo.isJdTabletDevice && isReplaceSystemWidth) {
631
631
  if (systemInfo?.windowWidth <= 0) {
632
632
  systemInfo.windowWidth = Math.min(getRootEleInitWidth, getScreenWidth);
633
633
  systemInfo.windowHeight = getScreenHeight;
634
634
  console.warn(
635
635
  '====初始化获取当前设备不是pad,但是触发屏幕宽高最小值600,系统获取宽度为0,进行重置系统宽度为根元素宽度与屏幕宽度最小值====',
636
636
  systemInfo.windowWidth,
637
637
  'getRootEleInitWidth',
638
638
  getRootEleInitWidth,
639
639
  'getScreenWidth',
640
640
  getScreenWidth,
641
641
  'getScreenHeight',
642
642
  getScreenHeight,
643
643
  );
644
644
  draBusinessCustomReport({
645
645
  eventName: 'business',
646
646
  errorName: 'jdapp_pad_width_error_info',
647
647
  errorMessage: `松果app内获取当前设备不是pad,触发屏幕宽高最小值600,系统信息宽度为0,进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
648
648
  extraData: JSON.stringify({
649
649
  isJdApp,
650
650
  isAndroidDevice,
651
651
  getScreenWidth,
652
652
  getScreenHeight,
653
653
  getWinWidth,
654
654
  getWinHeight,
655
655
  getRootEleInitWidth,
656
656
  }),
657
657
  });
658
658
  }
659
659
  } else {
660
660
  if (isJdApp && isAndroidDevice && !systemInfo.isJdTabletDevice && systemInfo) {
661
661
  const isLandscape = getScreenWidth >= getScreenHeight;
662
662
  const { windowWidth, windowHeight, screenWidth, screenHeight } = systemInfo;
663
663
  if (windowWidth <= 0) {
664
664
  systemInfo.initWindowWidth = windowWidth;
665
665
  if (isLandscape) {
666
666
  systemInfo.windowWidth = getScreenHeight;
667
667
  systemInfo.windowHeight = getScreenWidth;
668
668
  systemInfo.screenWidth = getScreenHeight;
669
669
  systemInfo.screenHeight = getScreenWidth;
670
670
  } else {
671
671
  systemInfo.windowWidth = getScreenWidth;
672
672
  systemInfo.windowHeight = getScreenHeight;
673
673
  systemInfo.screenWidth = getScreenWidth;
674
674
  systemInfo.screenHeight = getScreenHeight;
675
675
  }
676
676
  console.warn(
677
677
  `松果安卓app内获取系统信息宽度异常为小于等于0,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取窗口高度值${windowHeight},重置后的高度值${systemInfo.windowHeight},根元素宽度值${getRootEleInitWidth}`,
678
678
  );
679
679
  draBusinessCustomReport({
680
680
  eventName: 'UIInteract',
681
681
  errorName: 'android_jdapp_width_error_info',
682
682
  errorMessage: `松果安卓app内获取系统信息宽度为小于等于0,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
683
683
  extraData: JSON.stringify({
684
684
  isJdApp,
685
685
  initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
686
686
  getScreenWidth,
687
687
  getScreenHeight,
688
688
  getWinWidth,
689
689
  getWinHeight,
690
690
  getRootEleInitWidth,
691
691
  }),
692
692
  });
693
693
  } else {
694
694
  let _getChangeWinWidthState = false;
695
695
  if (getWinWidth > 0 && windowWidth > 0 && windowWidth > getWinWidth) {
696
696
  if (isLandscape) {
697
697
  systemInfo.windowWidth = getScreenHeight;
698
698
  systemInfo.windowHeight = getScreenWidth;
699
699
  systemInfo.screenWidth = getScreenHeight;
700
700
  systemInfo.screenHeight = getScreenWidth;
701
701
  } else {
702
702
  systemInfo.windowWidth = getScreenWidth;
703
703
  systemInfo.windowHeight = getScreenHeight;
704
704
  systemInfo.screenWidth = getScreenWidth;
705
705
  systemInfo.screenHeight = getScreenHeight;
706
706
  }
707
707
  _getChangeWinWidthState = true;
708
708
  }
709
709
  _getChangeWinWidthState &&
710
710
  console.warn(
711
711
  `松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取屏幕宽度值${screenWidth},重置后的宽度值${systemInfo.screenWidth}`,
712
712
  );
713
713
  if (_getChangeWinWidthState) {
714
714
  draBusinessCustomReport({
715
715
  eventName: 'business',
716
716
  errorName: 'android_jdapp_width_error_info_2',
717
717
  errorMessage: `松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight},根元素宽度值:${getRootEleInitWidth}`,
718
718
  extraData: JSON.stringify({
719
719
  isJdApp,
720
720
  initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
721
721
  getScreenWidth,
722
722
  getScreenHeight,
723
723
  getWinWidth,
724
724
  getWinHeight,
725
725
  getRootEleInitWidth,
726
726
  }),
727
727
  });
728
728
  }
729
729
  }
730
730
  }
731
731
  }
732
732
 
733
733
  if (systemInfo.isJdTabletDevice) {
734
734
  systemInfo.windowWidth = Math.min(getRootEleInitWidth, getScreenWidth, getScreenHeight);
735
735
  systemInfo.windowHeight = Math.max(getScreenWidth, getScreenHeight);
736
736
  if (systemInfo.isJdTabletLandscape) {
737
737
  const getRenderCenterState = window?.PAGE_DATA?.businessData?.fitPadCenterRenderLowVersion
738
738
  ? jdAppVersionCompare(window.PAGE_DATA.businessData.fitPadCenterRenderLowVersion) < 0
739
739
  : false;
740
740
  if (getRenderCenterState && window?.PAGE_DATA) {
741
741
  window.PAGE_DATA.isFitJdPadRenderCenter = true;
742
742
  }
743
743
  if (window?.PAGE_DATA?.isFitJdPadRenderCenter) {
744
744
  systemInfo.windowWidth = Math.min(getRootEleInitWidth, getScreenWidth, getScreenHeight);
745
745
  systemInfo.windowHeight = Math.max(
746
746
  getRootEleInitWidth,
747
747
  getScreenWidth,
748
748
  getScreenHeight,
749
749
  );
750
750
  } else {
751
751
  systemInfo.windowWidth = Math.max(getRootEleInitWidth, getScreenWidth, getScreenHeight);
752
752
  systemInfo.windowHeight = Math.min(
753
753
  getRootEleInitWidth,
754
754
  getScreenWidth,
755
755
  getScreenHeight,
756
756
  );
757
757
  }
758
758
  }
759
759
  console.warn(
760
760
  '====初始化获取当前设备是否是平板设备,是否横屏====',
761
761
  systemInfo.isJdTabletDevice,
762
762
  systemInfo.isJdTabletLandscape,
763
763
  '屏幕信息',
764
764
  window.screen,
765
765
  'getScreenWidth',
766
766
  getScreenWidth,
767
767
  'getScreenHeight',
768
768
  getScreenHeight,
769
769
  'getRootEleInitWidth',
770
770
  getRootEleInitWidth,
771
771
  '当前是否要求居中展示,居中展示那么宽高值要对调',
772
772
  window?.PAGE_DATA?.isFitJdPadRenderCenter,
773
773
  '当前pad最终展示的窗口宽度',
774
774
  systemInfo.windowWidth,
775
775
  );
776
776
  }
777
777
  }
778
778
  }
779
779
  systemInfo['newFlexPad'] = newFlexPad;
780
780
  systemInfo['newFlexLargePad'] = newFlexPad && systemInfo.windowWidth >= 840;
781
781
  systemInfo['newFlexPadScale'] = newFlexPadScale;
782
782
  systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo);
783
783
  console.warn('====获取系统信息=====', systemInfo);
784
784
  return systemInfo;
785
785
  let result: boolean | null = null;
786
786
  return function () {
787
787
  if (result === null) {
788
788
  const appVersionCheckPass = jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0;
789
789
  if (!isJdApp) {
790
790
  console.warn('🚗 ~~ file: utils.ts:191 站外H5默认打开图片优化~');
791
791
  isIgnoreOptimizeFromServer = true;
792
792
  result = true;
793
793
  return true;
794
794
  }
795
795
  const enableAvifOptimize = appVersionCheckPass;
796
796
  if (enableAvifOptimize) {
797
797
  const configData = global?.getDynamicConfig('avifSwitch');
798
798
  const {
799
799
  globalOn = true,
800
800
  ignoreOptimizeFromServer = false,
801
801
  page = {},
802
802
  grayscale = {},
803
803
  whiteList = [],
804
804
  blackList = [],
805
805
  } = configData || {};
806
806
  const { shopId = '0', venderId = '0' } = parseQueryUrlObj;
807
807
  let imageEnableResult = true;
808
808
  isIgnoreOptimizeFromServer = ignoreOptimizeFromServer;
809
809
  if (
810
810
  blackList.find((item) => item.sId === Number(shopId) || item.vId === Number(venderId))
811
811
  ) {
812
812
  imageEnableResult = false;
813
813
  } else if (
814
814
  whiteList.find((item) => item.sId === Number(shopId) || item.vId === Number(venderId))
815
815
  ) {
816
816
  isIgnoreOptimizeFromServer = true;
817
817
  imageEnableResult = true;
818
818
  } else if (grayscale[buildType] && isInGrayscale(grayscale[buildType])) {
819
819
  isIgnoreOptimizeFromServer = true;
820
820
  imageEnableResult = true;
821
821
  } else {
822
822
  imageEnableResult = globalOn === true || page[buildType] === true;
823
823
  if (globalOn === true) {
824
824
  isIgnoreOptimizeFromServer = true;
825
825
  } else if (page[buildType] === true) {
826
826
  } else {
827
827
  }
828
828
  }
829
829
  result = imageEnableResult;
830
830
  return imageEnableResult;
831
831
  } else {
832
832
  result = false;
833
833
  return false;
834
834
  }
835
835
  } else {
836
836
  return result;
837
837
  }
838
838
  };
839
839
  if (typeof options === 'object' && isImageOptimizeEnable()) {
840
840
  return getQualityImageNew(imgUrl, options, isIgnoreOptimizeFromServer);
841
841
  } else {
842
842
  return getQualityImageOld(imgUrl, options);
843
843
  }
844
844
  const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
845
845
  windowWidth: window.innerWidth,
846
846
  containerWidth: getContainerWidth(buildType, {
847
847
  windowWidth: window.innerWidth,
848
848
  }),
849
849
  screenWidth: window.innerWidth,
850
850
  platform: '',
851
851
  model: '',
852
852
  system: '',
853
853
  };
854
854
  return getSystemInfo;
855
855
  const params = Object.assign(
856
856
  {},
857
857
  {
858
858
  title: '',
859
859
  duration: 1500,
860
860
  },
861
861
  options,
862
862
  );
863
863
  params.duration = params.duration / 1000;
864
864
  if (
865
865
  isJdApp &&
866
866
  !isJdAppForNotMain &&
867
867
  !isJdAndHarmonyDevice &&
868
868
  !window?.PAGE_DATA?.businessData?.hideNativeToast
869
869
  ) {
870
870
  const showSuccessType = isIosDevice ? ToastIosType.SUCCESS : ToastAndroidType.SUCCESS;
871
871
  const duration = isAndroidDevice ? 0 : params.duration;
872
872
  nativePageShowToast(options.title, showSuccessType, duration);
873
873
  console.log('执行原生toast success');
874
874
  } else {
875
875
  showSuccessToast(options);
876
876
  }
877
877
  const params = Object.assign(
878
878
  {},
879
879
  {
880
880
  title: '',
881
881
  duration: 1500,
882
882
  },
883
883
  options,
884
884
  );
885
885
  params.duration = params.duration / 1000;
886
886
  if (isJdApp && !isJdAppForNotMain && !window?.PAGE_DATA?.businessData?.hideNativeToast) {
887
887
  const showSuccessType = isIosDevice ? ToastIosType.FAIL : ToastAndroidType.FAIL;
888
888
  const duration = isAndroidDevice ? 0 : params.duration;
889
889
  nativePageShowToast(options.title, showSuccessType, duration);
890
890
  console.log('执行原生toast fail');
891
891
  } else {
892
892
  console.log('执行H5 toast fail');
893
893
  showFailToast(options);
894
894
  }
895
895
  const params = Object.assign(
896
896
  {},
897
897
  {
898
898
  title: '',
899
899
  duration: 1500,
900
900
  },
901
901
  options,
902
902
  );
903
903
  params.duration = params.duration / 1000;
904
904
  if (isJdApp && !isJdAppForNotMain && !window?.PAGE_DATA?.businessData?.hideNativeToast) {
905
905
  const showSuccessType = isIosDevice ? ToastIosType.NORMAL : ToastAndroidType.NORMAL;
906
906
  const duration = isAndroidDevice ? 0 : params.duration;
907
907
  nativePageShowToast(options.title, showSuccessType, duration);
908
908
  } else {
909
909
  showNormalToast(options);
910
910
  }
911
911
  if (isLanguageForEn) {
912
912
  count = Number(count);
913
913
  if (count >= 1000000000) {
914
914
  return (count / 1000000000).toFixed(fixedNum) + 'B';
915
915
  } else if (count >= 1000000) {
916
916
  return (count / 1000000).toFixed(fixedNum) + 'M';
917
917
  } else if (count >= 1000) {
918
918
  return (count / 1000).toFixed(fixedNum) + 'K';
919
919
  } else {
920
920
  return count;
921
921
  }
922
922
  } else {
923
923
  return h5CountStringify(count, fixedNum, unit, maxNum);
924
924
  }
925
925
  const createLoadingEle = document.createElement('div');
926
926
  createLoadingEle.id = 'J_shopLoading';
927
927
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`;
928
928
  createLoadingEle.innerHTML = `<div class='d-loading-content'>
929
929
  <span class='d-shop-loading-icon'></span>
930
930
  <p class='d-shop-text'>${text}</p>
931
931
  </div>`;
932
932
  const getEle = document.body ? document.body : document.getElementsByTagName('body')[0];
933
933
  getEle.appendChild(createLoadingEle);
934
934
  const getEle = document.getElementById('J_shopLoading');
935
935
  getEle && getEle.remove();
936
936
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(params);
937
937
  if (!systemInfo.system && window) {
938
938
  systemInfo.system = window.navigator.userAgent;
939
939
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i);
940
940
  }
941
941
  const isIOS = !!systemInfo?.system.match(/ios/i);
942
942
  const isAndroid = !!systemInfo?.system.match(/android/i);
943
943
  systemInfo.navBarHeight = 0;
944
944
  systemInfo.statusBarHeight = 0;
945
945
  systemInfo.capsulePosition = null;
946
946
  systemInfo.isIOS = isIOS;
947
947
  systemInfo.isAndroid = isAndroid;
948
948
  _ShopSystemInfo = systemInfo;
949
949
  return systemInfo;
950
950
  const result = originDealShopContentData(pageData, draBusinessCustomReport, isvdev);
951
951
  if (isJdAndHarmonyDevice && isNewHarmonyShop) {
952
952
  result.shopContentContainerListData = result.shopContentContainerListData.filter(
953
953
  (item) =>
954
954
  item.floors.length > 0 &&
955
955
  !isInHarmonyBlacklistByModuleFlag(item.containerId, result.shopContentContainerListData),
956
956
  );
957
957
  }
958
958
  return result;
959
959
  const numScale = Number(scale);
960
960
  if (isNaN(numScale)) {
961
961
  console.warn(
962
962
  `The 'scale' parameter of the 'isInGrayscale' function is invalid! Expected a number, but received ${scale}`,
963
963
  );
964
964
  return false;
965
965
  }
966
966
  const { venderId } = global.info.queryInfo || {};
967
967
  const id = venderId;
968
968
  if (!id && numScale !== 1) {
969
969
  return false;
970
970
  }
971
971
  const useScale = Math.max(0, Math.min(1, numScale));
972
972
  const isMatch = numScale === 1 || Math.floor(Number(id) % (1 / useScale)) === 0;
973
973
  if (reportKey) {
974
974
  console.log(
975
975
  `基于KEY[${reportKey}]的灰度调用1次~`,
976
976
  getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`),
977
977
  );
978
978
  if (isMatch) {
979
979
  console.log(
980
980
  `基于KEY[${reportKey}]的命中1次灰度!`,
981
981
  getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`),
982
982
  );
983
983
  }
984
984
  }
985
985
  return isMatch;
986
986
  isJdApp,
987
987
  isWxApp,
988
988
  isIosDevice,
989
989
  isAndroidDevice,
990
990
  isHarmonyDevice,
991
991
  isJdAndIosDevice,
992
992
  isJdAndAndroidDevice,
993
993
  isJdAndHarmonyDevice,
994
994
  isNewHarmonyShop,
995
995
  isJdAndroidX5Core,
996
996
  isMin,
997
997
  isWxMin,
998
998
  isWxMinAndWxapp,
999
999
  isJdMinAndHarmony,
1000
1000
  isJdMin,
1001
1001
  isH5,
1002
1002
  isH5AndJdShopView,
1003
1003
  isChartH5,
1004
1004
  isAppHomePage,
1005
1005
  isH5AndJdShopViewNativeScroll,
1006
1006
  isH5AndJdShopViewH5Scroll,
1007
1007
  isH5AndJdShopH5CustomScrollView,
1008
1008
  isH5AndJingGouMini,
1009
1009
  isWxMiniH5View,
1010
1010
  isAscfApp,
1011
1011
  urlCookie,
1012
1012
  sliceArrToChunkList,
1013
1013
  dealAddress,
1014
1014
  objectToUrlEncode,
1015
1015
  parseQueryUrlString,
1016
1016
  setLowSmallPicUrl,
1017
1017
  setTaroStorage,
1018
1018
  getTaroStorageKeyValue,
1019
1019
  removeTaroStorageKey,
1020
1020
  clearTaroStorageKey,
1021
1021
  getAvifSupport,
1022
1022
  getWebpSupport,
1023
1023
  getQualityImage,
1024
1024
  formatCountForUnit as countStringify,
1025
1025
  getWxAppCookieStr,
1026
1026
  getSystemInfos,
1027
1027
  pxTransformFromData,
1028
1028
  fontStylePxTransformFromData,
1029
1029
  dealShopContentDataAndReport as dealShopContentData,
1030
1030
  dateFormat,
1031
1031
  throttle,
1032
1032
  lodashThrottle,
1033
1033
  debounce,
1034
1034
  addHttps,
1035
1035
  commonShowSuccessToast as showSuccessToast,
1036
1036
  commonShowFailToast as showFailToast,
1037
1037
  commonShowNormalToast as showNormalToast,
1038
1038
  showShopLoading,
1039
1039
  hideShopLoading,
1040
1040
  stopNativeScrollEvent,
1041
1041
  getAppChannelType,
1042
1042
  formatTabActiveMenuType,
1043
1043
  filterUrlQueryData,
1044
1044
  draCustomReport,
1045
1045
  remoteCustomReport,
1046
1046
  draInterfaceCustomReport,
1047
1047
  draBusinessCustomReport,
1048
1048
  draBusinessCustomLogReport,
1049
1049
  isMemberPage,
1050
1050
  getFloorDataToDataDefines,
1051
1051
  isOpenJdAppUrl,
1052
1052
  jdOpenAppParams,
1053
1053
  createJdOpenAppUrl,
1054
1054
  isEmpty,
1055
1055
  getJdAppReportPageSource,
1056
1056
  isAppClassifyPage,
1057
1057
  isAppHomeForMarketPage,
1058
1058
  isImageOptimizeEnable,
1059
1059
  isPc,
1060
1060
  isPcClassifyPage,
1061
1061
  ipLoc_djd,
1062
1062
  isTjScence,
1063
1063
  isH5AdnJxMini,
1064
1064
  isTjM,
1065
1065
  isTjJxM,
1066
1066
  isTJApp,
1067
1067
  isH5AdnHaoWuJie,
1068
1068
  tjChannel,
1069
1069
  dealJdOpenAppData,
1070
1070
  jdAppVersionCompare,
1071
1071
  dealNativePixelToCssPixel,
1072
1072
  isAppStowShop,
1073
1073
  getSgmCustomCode,
1074
1074
  handleSgmCodeTaroVersion,
1075
1075
  isInGrayscale,
1076
1076
  isIpadDevice,
1077
1077
  getBorderStyle,
1078
1078
  isSupportHybridHttpRequest,
1079
1079
  isLanguageForEn,
1080
1080
  sColor,
1081
1081
  isTabletDevice,
1082
1082
  taroToTransformRoutimePXNumber,
1083
1083
  updateContainerWidth,
1084
1084
  isInJdShopView,
1085
1085
  isDongWebView,
1086
1086
  isLanguageForHk,
1087
1087
  languageNowType,
1088
1088
  isInJdAppH5DebugMode,
1089
1089
  isJdLiteApp,
1090
1090
  isJdAppForNotMain,