@conecli/cone-render 0.9.1-shop2.3 → 0.9.1-shop2.30

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 (113) 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/jssdk.ts +1 -0
  11. package/dist/common/pageType.ts +1 -0
  12. package/dist/common/sgmCustomCode.ts +1 -0
  13. package/dist/common/token/index.h5.ts +1 -1
  14. package/dist/common/token/token.jd.ts +1 -1
  15. package/dist/common/token/token.ts +1 -1
  16. package/dist/common/wxappApi.jd.ts +1 -0
  17. package/dist/components/ErrorBoundary.tsx +1 -1
  18. package/dist/components/base/CountDown/index.tsx +1 -1
  19. package/dist/components/base/CustomScrollView/index.jd.tsx +1 -0
  20. package/dist/components/base/CustomScrollView/index.module.scss +7 -0
  21. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  22. package/dist/components/base/CustomVideo/common.ts +1 -0
  23. package/dist/components/base/CustomVideo/index.tsx +1 -1
  24. package/dist/components/base/Dialog/index.module.scss +5 -0
  25. package/dist/components/base/Dialog/index.tsx +1 -1
  26. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  28. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  29. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  30. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  31. package/dist/components/base/InViewRender/index.tsx +1 -1
  32. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  33. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  34. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  35. package/dist/components/base/LazyLoadImage/index.h5.module.scss +23 -20
  36. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  37. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  38. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  39. package/dist/components/base/NetworkDataError/const.ts +1 -1
  40. package/dist/components/base/NetworkDataError/index.module.scss +7 -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.tsx +1 -1
  44. package/dist/components/base/Price/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 +32 -2
  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.tjapp.ts +1 -0
  78. package/dist/jumpEventReport/web.tjm.ts +1 -0
  79. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  80. package/dist/modules/ContainerFloorList/index.h5.module.scss +18 -1
  81. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  82. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  83. package/dist/open/api/device.ts +1 -1
  84. package/dist/open/api/environment.ts +1 -1
  85. package/dist/open/api/index.ts +1 -1
  86. package/dist/open/api/jump copy.ts +1 -1
  87. package/dist/open/api/request.ts +1 -1
  88. package/dist/open/api/shopMember.ts +1 -1
  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/sass/app.h5.scss +49 -3
  93. package/dist/sass/base.scss +57 -0
  94. package/dist/service/fetchGateway.ts +1 -1
  95. package/dist/service/http/colorSign.ts +1 -1
  96. package/dist/service/http/const.ts +1 -1
  97. package/dist/service/http/h5Http.ts +1 -0
  98. package/dist/service/http/index.h5.ts +1 -0
  99. package/dist/service/requestServer.h5.ts +1 -0
  100. package/dist/service/requestServer.ts +1 -1
  101. package/dist/utils/connectNativeJsBridge.ts +1 -1
  102. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  103. package/dist/utils/draExceptionAndProfile.ts +1 -1
  104. package/dist/utils/h5Utils.ts +1 -1
  105. package/dist/utils/index.h5.ts +1 -1
  106. package/dist/utils/index.ts +1 -1
  107. package/dist/utils/index.weapp.ts +1 -1
  108. package/dist/utils/jm-common.js +1 -1
  109. package/dist/utils/sgmCodeUtils.ts +1 -0
  110. package/dist/utils/taroRenderUtil.ts +1 -1
  111. package/dist/utils/utils.ts +1 -1
  112. package/package.json +1 -1
  113. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  nativePageShowToast, ToastAndroidType,
3
2
  ToastIosType,
4
3
  getAppChannelType, isAndroidDevice, isH5AndJdShopView, isChartH5,
5
4
  isH5AndJdShopViewNativeScroll, isIosDevice, isJdAndAndroidDevice, isJdAndIosDevice, isJdAndHarmonyDevice, isJdApp,
6
5
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
7
6
  sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll, isAppClassifyPage, isPc, ipLoc_djd
8
7
  addHttps,
9
8
  clearTaroStorageKey,
10
9
  countStringify,
11
10
  dateFormat,
12
11
  dealAddress,
13
12
  dealShopContentData as originDealShopContentData,
14
13
  debounce,
15
14
  filterUrlQueryData,
16
15
  formatTabActiveMenuType,
17
16
  getQualityImage,
18
17
  getTaroStorageKeyValue,
19
18
  getWxAppCookieStr,
20
19
  isH5,
21
20
  isJdMin,
22
21
  isWxMin,
23
22
  isWxMinAndWxapp,
24
23
  lodashThrottle,
25
24
  objectToUrlEncode,
26
25
  parseQueryUrlString,
27
26
  removeTaroStorageKey,
28
27
  setLowSmallPicUrl,
29
28
  setTaroStorage,
30
29
  showFailToast,
31
30
  showNormalToast,
32
31
  showSuccessToast,
33
32
  sliceArrToChunkList,
34
33
  throttle,
35
34
  windowWidth: window.innerWidth,
36
35
  containerWidth: buildType === BUILD_TYPE.CLASSIFY ? window.innerWidth - 100 : window.innerWidth,
37
36
  screenWidth: window.innerWidth,
38
37
  platform: '',
39
38
  model: '',
40
39
  system: '',
41
40
  getSystemInfo.windowWidth = getSystemInfo.screenWidth
42
41
  getSystemInfo['containerWidth'] = buildType === BUILD_TYPE.CLASSIFY ? getSystemInfo.screenWidth - 100 : getSystemInfo.screenWidth
43
42
  const params = Object.assign(
44
43
  {},
45
44
  {
46
45
  title: '',
47
46
  duration: 1500,
48
47
  },
49
48
  options,
50
49
  )
51
50
  params.duration = params.duration / 1000
52
51
  if (isJdApp && isH5AndJdShopView) {
53
52
  const showSuccessType = isIosDevice
54
53
  ? ToastIosType.SUCCESS
55
54
  : ToastAndroidType.SUCCESS
56
55
  const duration = isAndroidDevice ? 0 : params.duration
57
56
  nativePageShowToast(options.title, showSuccessType, duration)
58
57
  console.log('执行原生toast success')
59
58
  } else {
60
59
  showSuccessToast(options)
61
60
  }
62
61
  const params = Object.assign(
63
62
  {},
64
63
  {
65
64
  title: '',
66
65
  duration: 1500,
67
66
  },
68
67
  options,
69
68
  )
70
69
  params.duration = params.duration / 1000
71
70
  console.log(`isJdApp${isJdApp}`)
72
71
  if (isJdApp && isH5AndJdShopView) {
73
72
  const showSuccessType = isIosDevice
74
73
  ? ToastIosType.FAIL
75
74
  : ToastAndroidType.FAIL
76
75
  const duration = isAndroidDevice ? 0 : params.duration
77
76
  nativePageShowToast(options.title, showSuccessType, duration)
78
77
  console.log('执行原生toast fail')
79
78
  } else {
80
79
  console.log('执行H5 toast fail')
81
80
  showFailToast(options)
82
81
  }
83
82
  const params = Object.assign(
84
83
  {},
85
84
  {
86
85
  title: '',
87
86
  duration: 1500,
88
87
  },
89
88
  options,
90
89
  )
91
90
  params.duration = params.duration / 1000
92
91
  if (isJdApp) {
93
92
  const showSuccessType = isIosDevice
94
93
  ? ToastIosType.NORMAL
95
94
  : ToastAndroidType.NORMAL
96
95
  const duration = isAndroidDevice ? 0 : params.duration
97
96
  nativePageShowToast(options.title, showSuccessType, duration)
98
97
  } else {
99
98
  showNormalToast(options)
100
99
  }
101
100
  const createLoadingEle = document.createElement('div')
102
101
  createLoadingEle.id = 'J_shopLoading'
103
102
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
104
103
  createLoadingEle.innerHTML = `<div class='d-loading-content'>
105
104
  <span class='d-shop-loading-icon'></span>
106
105
  <p class='d-shop-text'>${text}</p>
107
106
  </div>`
108
107
  const getEle = document.body ? document.body : document.getElementsByTagName('body')[0]
109
108
  console.log('获取getEle及append及appendChild方法', getEle, getEle?.append, getEle?.appendChild)
110
109
  getEle.appendChild(createLoadingEle)
111
110
  const getEle = document.getElementById('J_shopLoading')
112
111
  getEle && getEle.remove()
113
112
  num,
114
113
  widthSize = 375,
115
114
  layoutWidth = getSystemInfo.windowWidth,
116
115
  const getNum = Number(num)
117
116
  return Math.round((getNum / widthSize) * layoutWidth)
118
117
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getSystemInfo
119
118
  if (!systemInfo.system && window) {
120
119
  systemInfo.system = window.navigator.userAgent
121
120
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
122
121
  }
123
122
  const isIOS = !!systemInfo?.system.match(/ios/i)
124
123
  const isAndroid = !!systemInfo?.system.match(/android/i)
125
124
  systemInfo.navBarHeight = 0
126
125
  systemInfo.statusBarHeight = 0
127
126
  systemInfo.capsulePosition = null
128
127
  systemInfo.isIOS = isIOS
129
128
  systemInfo.isAndroid = isAndroid
130
129
  return systemInfo
131
130
  return originDealShopContentData(pageData, sgmCustomReport, isvdev)
132
131
  isJdApp,
133
132
  isWxApp,
134
133
  isIosDevice,
135
134
  isAndroidDevice,
136
135
  isJdAndIosDevice,
137
136
  isJdAndAndroidDevice,
138
137
  isJdAndHarmonyDevice,
139
138
  isWxMin,
140
139
  isWxMinAndWxapp,
141
140
  isJdMin,
142
141
  isH5,
143
142
  isH5AndJdShopView,
144
143
  isChartH5,
145
144
  isH5AndJdShopViewNativeScroll,
146
145
  isH5AndJdShopViewH5Scroll,
147
146
  isH5AndJingGouMini,
148
147
  isWxMiniH5View,
149
148
  urlCookie,
150
149
  sliceArrToChunkList,
151
150
  dealAddress,
152
151
  objectToUrlEncode,
153
152
  parseQueryUrlString,
154
153
  setLowSmallPicUrl,
155
154
  setTaroStorage,
156
155
  getTaroStorageKeyValue,
157
156
  removeTaroStorageKey,
158
157
  clearTaroStorageKey,
159
158
  getQualityImage,
160
159
  countStringify,
161
160
  getWxAppCookieStr,
162
161
  getSystemInfos,
163
162
  pxTransformFromData,
164
163
  dealShopContentDataAndReport as dealShopContentData,
165
164
  dateFormat,
166
165
  throttle,
167
166
  lodashThrottle,
168
167
  debounce,
169
168
  addHttps,
170
169
  commonShowSuccessToast as showSuccessToast,
171
170
  commonShowFailToast as showFailToast,
172
171
  commonShowNormalToast as showNormalToast,
173
172
  showShopLoading,
174
173
  hideShopLoading,
175
174
  getAppChannelType,
176
175
  formatTabActiveMenuType,
177
176
  filterUrlQueryData,
178
177
  sgmCustomReport,
179
178
  isMemberPage,
180
179
  memberFormatUtils,
181
180
  getFloorDataToDataDefines,
182
181
  isAppClassifyPage,
183
182
  isPc,
184
183
  ipLoc_djd,
184
+ import Taro from '@tarojs/taro'
185
185
  UtilsInterFace
186
186
  nativePageShowToast,
187
187
  ToastAndroidType,
188
188
  ToastIosType,
189
189
  stopNativeScrollEvent,
190
190
  getAppChannelType,
191
191
  isAndroidDevice,
192
192
  isH5AndJdShopView,
193
193
  isChartH5,
194
194
  isH5AndJdShopViewNativeScroll,
195
195
  isIosDevice,
196
196
  isJdAndAndroidDevice,
197
197
  isJdAndIosDevice,
198
198
  isJdApp,
199
199
  isWxApp,
200
200
  isWxMiniH5View,
201
201
  isJdAndHarmonyDevice,
202
202
  isH5AndJingGouMini,
203
203
  urlCookie,
204
204
  sgmCustomReport,
205
205
  draCustomReport,
206
206
  remoteCustomReport,
207
207
  draInterfaceCustomReport,
208
208
  draBusinessCustomReport,
209
209
  isMemberPage,
210
210
  isH5AndJdShopViewH5Scroll,
211
211
  isH5AndJdShopH5CustomScrollView,
212
212
  isAppClassifyPage,
213
213
  isAppHomeForMarketPage,
214
214
  isPc,
215
215
  ipLoc_djd,
216
216
  jdAppVersionCompare,
217
217
  isTjScence,
218
218
  isH5AdnJxMini,
219
219
  isTjM,
220
220
  isTjJxM,
221
221
  isTJApp,
222
222
  isH5AdnHaoWuJie,
223
223
  tjChannel,
224
224
  dealNativePixelToCssPixel,
225
225
  isAppStowShop,
226
226
  isJdAndroidX5Core,
227
227
  parseQueryUrlObj,
228
228
  isIpadDevice,
229
229
  isSupportHybridHttpRequest,
230
230
  addHttps,
231
231
  clearTaroStorageKey,
232
232
  countStringify,
233
233
  dateFormat,
234
234
  dealAddress,
235
235
  dealShopContentData as originDealShopContentData,
236
236
  debounce,
237
237
  filterUrlQueryData,
238
238
  formatTabActiveMenuType,
239
239
  getAvifSupport,
240
240
  getWebpSupport,
241
241
  getTaroStorageKeyValue,
242
242
  getWxAppCookieStr,
243
243
  isH5,
244
244
  isMin,
245
245
  isJdMin,
246
246
  isWxMin,
247
247
  isWxMinAndWxapp,
248
248
  isJdMinAndHarmony,
249
249
  lodashThrottle,
250
250
  objectToUrlEncode,
251
251
  parseQueryUrlString,
252
252
  removeTaroStorageKey,
253
253
  setLowSmallPicUrl,
254
254
  setTaroStorage,
255
255
  showFailToast,
256
256
  showNormalToast,
257
257
  showSuccessToast,
258
258
  sliceArrToChunkList,
259
259
  throttle,
260
260
  getQualityImageNew,
261
261
  getQualityImageOld,
262
262
  isOpenJdAppUrl,
263
263
  jdOpenAppParams,
264
264
  createJdOpenAppUrl,
265
265
  isEmpty,
266
266
  getJdAppReportPageSource,
267
267
  dealJdOpenAppData,
268
268
  getBorderStyle,
269
269
  SgmCustomCode,
270
270
  } from '../common/sgmCustomCode'
271
271
  const getNum = Number(num)
272
272
  let _changeLayoutWidth = layoutWidth
273
273
  if (!_changeLayoutWidth) {
274
274
  _changeLayoutWidth =
275
275
  _ShopSystemInfo && _ShopSystemInfo?.windowWidth
276
276
  ? _ShopSystemInfo.windowWidth
277
277
  : Taro.getSystemInfoSync()?.windowWidth
278
278
  }
279
279
  return Math.round((getNum / widthSize) * _changeLayoutWidth)
280
280
  changeSize,
281
281
  designWidth = 750,
282
282
  systemInfo,
283
283
  const getRootFontSize =
284
284
  (40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth)) / 750
285
285
  const getRealRootFontSize =
286
286
  getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize
287
287
  return Math.ceil(
288
288
  (((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) *
289
289
  getRealRootFontSize,
290
290
  )
291
291
  console.log(
292
292
  '获取系统宽度systemInfo?.windowWidth',
293
293
  systemInfo?.windowWidth,
294
294
  'taroToTransformRoutimePXNumber(changeWidth)',
295
295
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
296
296
  )
297
297
  return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
298
298
  ? systemInfo?.windowWidth -
299
299
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
300
300
  : systemInfo?.windowWidth ?? 0
301
301
  const systemInfo = Taro.getSystemInfoSync()
302
302
  if (params && params?.pageWidth && params?.pageHeight) {
303
303
  systemInfo.windowWidth = params?.pageWidth
304
304
  systemInfo.windowHeight = params?.pageHeight
305
305
  console.warn("松果安卓app内获折叠屏信息重置系统信息宽度值",params,",systemInfo信息集合为",systemInfo)
306
306
  }else {
307
307
  if (isJdApp && isAndroidDevice && systemInfo) {
308
308
  const getWinWidth = window.innerWidth;
309
309
  const getWinHeight = window.innerHeight;
310
310
  const getScreenWidth = window.screen.width;
311
311
  const getScreenHeight = window.screen.height;
312
312
  const isLandscape = getScreenWidth >= getScreenHeight;
313
313
  const { windowWidth,windowHeight, screenWidth, screenHeight } = systemInfo
314
314
  if (windowWidth <= 0) {
315
315
  systemInfo.initWindowWidth = windowWidth;
316
316
  if(isLandscape){
317
317
  systemInfo.windowWidth = getScreenHeight
318
318
  systemInfo.windowHeight = getScreenWidth
319
319
  systemInfo.screenWidth = getScreenHeight
320
320
  systemInfo.screenHeight = getScreenWidth
321
321
  }else {
322
322
  systemInfo.windowWidth = getScreenWidth
323
323
  systemInfo.windowHeight = getScreenHeight
324
324
  systemInfo.screenWidth = getScreenWidth
325
325
  systemInfo.screenHeight = getScreenHeight
326
326
  }
327
327
  console.warn(`松果安卓app内获取系统信息宽度异常为小于等于0,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取窗口高度值${windowHeight},重置后的高度值${systemInfo.windowHeight}`)
328
328
  sgmCustomReport({
329
329
  type: 2,
330
330
  code: 'android_jdapp_width_error_info',
331
331
  msg: {
332
332
  title: `松果安卓app内获取系统信息宽度为小于等于0,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight}`,
333
333
  initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
334
334
  taroSysInfo: systemInfo
335
335
  }
336
336
  })
337
337
  }else {
338
338
  let _getChangeWinWidthState = false
339
339
  if( getWinWidth > 0 && windowWidth > 0 && windowWidth > getWinWidth){
340
340
  if(isLandscape){
341
341
  systemInfo.windowWidth = getScreenHeight
342
342
  systemInfo.windowHeight = getScreenWidth
343
343
  systemInfo.screenWidth = getScreenHeight
344
344
  systemInfo.screenHeight = getScreenWidth
345
345
  }else {
346
346
  systemInfo.windowWidth = getScreenWidth
347
347
  systemInfo.windowHeight = getScreenHeight
348
348
  systemInfo.screenWidth = getScreenWidth
349
349
  systemInfo.screenHeight = getScreenHeight
350
350
  }
351
351
  _getChangeWinWidthState = true
352
352
  }
353
353
  _getChangeWinWidthState && console.warn(`松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,taro获取窗口宽度值${windowWidth},重置后的宽度值${systemInfo.windowWidth},taro获取屏幕宽度值${screenWidth},重置后的宽度值${systemInfo.screenWidth}`)
354
354
  _getChangeWinWidthState && sgmCustomReport({
355
355
  type: 2,
356
356
  code: 'android_jdapp_width_error_info',
357
357
  msg: {
358
358
  title: `松果安卓app内获取系统信息宽度异常,是否为横屏${isLandscape},进行重置,通过window获取的结果,getWinWidth:${getWinWidth},getScreenWidth: ${getScreenWidth},getWinHeight:${getWinHeight},getScreenHeight: ${getScreenHeight}`,
359
359
  initData: `Taro.getSystemInfo获取窗口宽度值${windowWidth},高度值${windowHeight},获取屏幕宽度值${screenWidth},高度值${screenHeight}`,
360
360
  taroSysInfo: systemInfo
361
361
  }
362
362
  })
363
363
  }
364
364
  }
365
365
  }
366
366
  systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo)
367
367
  console.warn('====获取系统信息=====', systemInfo)
368
368
  return systemInfo
369
369
  let result: boolean | null = null
370
370
  return function() {
371
371
  if (result === null) {
372
372
  const appVersionCheckPass = jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0
373
373
  if(!isJdApp){
374
374
  console.warn("🚗 ~~ file: utils.ts:191 站外H5默认打开图片优化~")
375
375
  isIgnoreOptimizeFromServer = true
376
376
  result = true
377
377
  return true
378
378
  }
379
379
  const enableAvifOptimize = appVersionCheckPass
380
380
  if(enableAvifOptimize){
381
381
  const configData = global.getDynamicConfig('avifSwitch')
382
382
  console.warn("🚗 ~~ file: utils.ts:196 ~~ global.getDynamicConfig ~~ buildType:", buildType)
383
383
  console.warn("🚗 ~~ file: utils.ts:197 ~~ global.getDynamicConfig ~~ configData:", configData)
384
384
  const { globalOn = true, ignoreOptimizeFromServer = false, page = {}, grayscale = {}, whiteList = [], blackList = [] } = configData || {}
385
385
  const {shopId = '0', venderId = '0'} = parseQueryUrlObj
386
386
  let imageEnableResult = true
387
387
  isIgnoreOptimizeFromServer = ignoreOptimizeFromServer
388
388
  console.warn("🚗 ~~ file: index.h5.ts:213 ~~ returnfunction ~~ grayscale[buildType]:", grayscale[buildType])
389
389
  if (blackList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
390
390
  imageEnableResult = false
391
391
  console.warn("🚗 ~~ file: utils.ts:198 命中黑名单~")
392
392
  }else if(whiteList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
393
393
  isIgnoreOptimizeFromServer = true
394
394
  imageEnableResult = true
395
395
  console.warn("🚗 ~~ file: utils.ts:205 命中白名单~")
396
396
  }else if(grayscale[buildType] && isInGrayscale(grayscale[buildType])){
397
397
  isIgnoreOptimizeFromServer = true
398
398
  imageEnableResult = true
399
399
  console.warn("🚗 ~~ file: utils.ts:214 命中灰度~")
400
400
  }else{
401
401
  imageEnableResult = globalOn === true || page[buildType] === true
402
402
  if(globalOn === true){
403
403
  isIgnoreOptimizeFromServer = true
404
404
  console.warn("🚗 ~~ file: utils.ts:220 走全局开关控制逻辑,开关已打开~")
405
405
  }else if(page[buildType] === true){
406
406
  console.warn("🚗 ~~ file: utils.ts:220 走页面开关控制逻辑,开关已打开~")
407
407
  }else{
408
408
  console.warn("🚗 ~~ file: utils.ts:220 走全局或页面开关控制逻辑,开关未打开!")
409
409
  }
410
410
  }
411
411
  result = imageEnableResult
412
412
  return imageEnableResult
413
413
  }else{
414
414
  result = false
415
415
  return false
416
416
  }
417
417
  } else {
418
418
  return result
419
419
  }
420
420
  }
421
421
  if(typeof options === 'object' && isImageOptimizeEnable()){
422
422
  return getQualityImageNew(imgUrl, options, isIgnoreOptimizeFromServer)
423
423
  }else{
424
424
  return getQualityImageOld(imgUrl, options)
425
425
  }
426
426
  const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
427
427
  windowWidth: window.innerWidth,
428
428
  containerWidth: getContainerWidth(buildType, {
429
429
  windowWidth: window.innerWidth,
430
430
  }),
431
431
  screenWidth: window.innerWidth,
432
432
  platform: '',
433
433
  model: '',
434
434
  system: '',
435
435
  }
436
436
  return getSystemInfo
437
437
  console.log('进入commonshowToast, 传入参数options为: ', options)
438
438
  const params = Object.assign(
439
439
  {},
440
440
  {
441
441
  title: '',
442
442
  duration: 1500,
443
443
  },
444
444
  options,
445
445
  )
446
446
  params.duration = params.duration / 1000
447
447
  if (isJdApp) {
448
448
  const showSuccessType = isIosDevice
449
449
  ? ToastIosType.SUCCESS
450
450
  : ToastAndroidType.SUCCESS
451
451
  const duration = isAndroidDevice ? 0 : params.duration
452
452
  nativePageShowToast(options.title, showSuccessType, duration)
453
453
  console.log('执行原生toast success')
454
454
  } else {
455
455
  showSuccessToast(options)
456
456
  }
457
457
  const params = Object.assign(
458
458
  {},
459
459
  {
460
460
  title: '',
461
461
  duration: 1500,
462
462
  },
463
463
  options,
464
464
  )
465
465
  params.duration = params.duration / 1000
466
466
  if (isJdApp) {
467
467
  const showSuccessType = isIosDevice
468
468
  ? ToastIosType.FAIL
469
469
  : ToastAndroidType.FAIL
470
470
  const duration = isAndroidDevice ? 0 : params.duration
471
471
  nativePageShowToast(options.title, showSuccessType, duration)
472
472
  console.log('执行原生toast fail')
473
473
  } else {
474
474
  console.log('执行H5 toast fail')
475
475
  showFailToast(options)
476
476
  }
477
477
  const params = Object.assign(
478
478
  {},
479
479
  {
480
480
  title: '',
481
481
  duration: 1500,
482
482
  },
483
483
  options,
484
484
  )
485
485
  params.duration = params.duration / 1000
486
486
  if (isJdApp) {
487
487
  const showSuccessType = isIosDevice ?
488
488
  ToastIosType.NORMAL :
489
489
  ToastAndroidType.NORMAL
490
490
  const duration = isAndroidDevice ? 0 : params.duration
491
491
  nativePageShowToast(options.title, showSuccessType, duration)
492
492
  } else {
493
493
  showNormalToast(options)
494
494
  }
495
495
  const createLoadingEle = document.createElement('div')
496
496
  createLoadingEle.id = 'J_shopLoading'
497
497
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
498
498
  createLoadingEle.innerHTML =
499
499
  `<div class='d-loading-content'>
500
500
  <span class='d-shop-loading-icon'></span>
501
501
  <p class='d-shop-text'>${text}</p>
502
502
  </div>`
503
503
  const getEle = document.body
504
504
  ? document.body
505
505
  : document.getElementsByTagName('body')[0]
506
506
  getEle.appendChild(createLoadingEle)
507
507
  const getEle = document.getElementById('J_shopLoading')
508
508
  getEle && getEle.remove()
509
509
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(
510
510
  params,
511
511
  )
512
512
  if (!systemInfo.system && window) {
513
513
  systemInfo.system = window.navigator.userAgent
514
514
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
515
515
  }
516
516
  const isIOS = !!systemInfo?.system.match(/ios/i)
517
517
  const isAndroid = !!systemInfo?.system.match(/android/i)
518
518
  systemInfo.navBarHeight = 0
519
519
  systemInfo.statusBarHeight = 0
520
520
  systemInfo.capsulePosition = null
521
521
  systemInfo.isIOS = isIOS
522
522
  systemInfo.isAndroid = isAndroid
523
523
  _ShopSystemInfo = systemInfo
524
524
  return systemInfo
525
525
  return originDealShopContentData(pageData, sgmCustomReport, isvdev)
526
526
  const numScale = Number(scale)
527
527
  if(isNaN(numScale)){
528
528
  console.warn(`The 'scale' parameter of the 'isInGrayscale' function is invalid! Expected a number, but received ${scale}`)
529
529
  return false
530
530
  }
531
531
  const { venderId } = global.info.queryInfo || {}
532
532
  const id = venderId
533
533
  if(!id && numScale !== 1){
534
534
  return false
535
535
  }
536
536
  const useScale = Math.max(0, Math.min(1, numScale))
537
537
  const isMatch = numScale === 1 || Math.floor(Number(id) % (1 / useScale)) === 0
538
538
  if(reportKey){
539
539
  sgmCustomReport({
540
540
  code: getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`),
541
541
  msg: '灰度调用',
542
542
  })
543
543
  console.log(`基于KEY[${reportKey}]的灰度调用1次~`, getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_invoke`))
544
544
  if(isMatch){
545
545
  sgmCustomReport({
546
546
  code: getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`),
547
547
  msg: '灰度命中',
548
548
  })
549
549
  console.log(`基于KEY[${reportKey}]的命中1次灰度!`, getSgmCustomCode(`${SgmCustomCode.GRAYSCALE}_${reportKey}_hit`))
550
550
  }
551
551
  }
552
552
  return isMatch
553
553
  isJdApp,
554
554
  isWxApp,
555
555
  isIosDevice,
556
556
  isAndroidDevice,
557
557
  isJdAndIosDevice,
558
558
  isJdAndAndroidDevice,
559
559
  isJdAndHarmonyDevice,
560
560
  isJdAndroidX5Core,
561
561
  isMin,
562
562
  isWxMin,
563
563
  isWxMinAndWxapp,
564
564
  isJdMinAndHarmony,
565
565
  isJdMin,
566
566
  isH5,
567
567
  isH5AndJdShopView,
568
568
  isChartH5,
569
569
  isH5AndJdShopViewNativeScroll,
570
570
  isH5AndJdShopViewH5Scroll,
571
571
  isH5AndJdShopH5CustomScrollView,
572
572
  isH5AndJingGouMini,
573
573
  isWxMiniH5View,
574
574
  urlCookie,
575
575
  sliceArrToChunkList,
576
576
  dealAddress,
577
577
  objectToUrlEncode,
578
578
  parseQueryUrlString,
579
579
  setLowSmallPicUrl,
580
580
  setTaroStorage,
581
581
  getTaroStorageKeyValue,
582
582
  removeTaroStorageKey,
583
583
  clearTaroStorageKey,
584
584
  getAvifSupport,
585
585
  getWebpSupport,
586
586
  getQualityImage,
587
587
  countStringify,
588
588
  getWxAppCookieStr,
589
589
  getSystemInfos,
590
590
  pxTransformFromData,
591
591
  dealShopContentDataAndReport as dealShopContentData,
592
592
  dateFormat,
593
593
  throttle,
594
594
  lodashThrottle,
595
595
  debounce,
596
596
  addHttps,
597
597
  commonShowSuccessToast as showSuccessToast,
598
598
  commonShowFailToast as showFailToast,
599
599
  commonShowNormalToast as showNormalToast,
600
600
  showShopLoading,
601
601
  hideShopLoading,
602
602
  stopNativeScrollEvent,
603
603
  getAppChannelType,
604
604
  formatTabActiveMenuType,
605
605
  filterUrlQueryData,
606
606
  sgmCustomReport,
607
607
  draCustomReport,
608
608
  remoteCustomReport,
609
609
  draInterfaceCustomReport,
610
610
  draBusinessCustomReport,
611
611
  isMemberPage,
612
612
  getFloorDataToDataDefines,
613
613
  isOpenJdAppUrl,
614
614
  jdOpenAppParams,
615
615
  createJdOpenAppUrl,
616
616
  isEmpty,
617
617
  getJdAppReportPageSource,
618
618
  isAppClassifyPage,
619
619
  isAppHomeForMarketPage,
620
620
  isImageOptimizeEnable,
621
621
  isPc,
622
622
  ipLoc_djd,
623
623
  isTjScence,
624
624
  isH5AdnJxMini,
625
625
  isTjM,
626
626
  isTjJxM,
627
627
  isTJApp,
628
628
  isH5AdnHaoWuJie,
629
629
  tjChannel,
630
630
  dealJdOpenAppData,
631
631
  jdAppVersionCompare,
632
632
  dealNativePixelToCssPixel,
633
633
  isAppStowShop,
634
634
  getSgmCustomCode,
635
635
  handleSgmCodeTaroVersion,
636
636
  isInGrayscale,
637
637
  isIpadDevice,
638
638
  getBorderStyle,
639
639
  isSupportHybridHttpRequest,