@conecli/cone-render 0.9.1-isv2.0 → 0.9.1-isv2.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 (102) hide show
  1. package/dist/api/index.ts +1 -1
  2. package/dist/common/const.ts +1 -1
  3. package/dist/common/environmentType.ts +1 -0
  4. package/dist/common/index.h5.ts +1 -1
  5. package/dist/common/index.jd.ts +1 -1
  6. package/dist/common/index.ts +1 -1
  7. package/dist/common/index.weapp.ts +1 -1
  8. package/dist/common/jdplayerSdk.ts +1 -0
  9. package/dist/common/jssdk.ts +1 -0
  10. package/dist/common/pageType.ts +1 -0
  11. package/dist/common/sgmCustomCode.ts +1 -0
  12. package/dist/common/token/index.h5.ts +1 -1
  13. package/dist/common/token/token.jd.ts +1 -1
  14. package/dist/common/token/token.ts +1 -1
  15. package/dist/common/wxappApi.jd.ts +1 -0
  16. package/dist/components/ErrorBoundary.tsx +1 -1
  17. package/dist/components/base/CommonFloorHead/index.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/index.tsx +1 -1
  23. package/dist/components/base/Dialog/index.module.scss +5 -0
  24. package/dist/components/base/Dialog/index.tsx +1 -1
  25. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  26. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  27. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  28. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  29. package/dist/components/base/InOrOutViewObserver/index.tsx +1 -1
  30. package/dist/components/base/InViewRender/index.tsx +1 -1
  31. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  32. package/dist/components/base/LazyLayoutLoad/index.tsx +1 -1
  33. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  34. package/dist/components/base/LazyLoadImage/index.h5.module.scss +20 -20
  35. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  36. package/dist/components/base/MobileCommonHeader/index.module.scss +17 -0
  37. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  38. package/dist/components/base/NetworkDataError/const.ts +1 -1
  39. package/dist/components/base/NetworkDataError/index.module.scss +4 -0
  40. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  41. package/dist/components/base/Price/Double/index.tsx +1 -1
  42. package/dist/components/base/Price/index.tsx +1 -1
  43. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  44. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  45. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  46. package/dist/components/floorItem.jd.tsx +1 -1
  47. package/dist/components/floorItem.tsx +1 -1
  48. package/dist/components/floorItem.weapp.tsx +1 -1
  49. package/dist/components/isv/Floor/index.tsx +1 -1
  50. package/dist/components/remoteFloorItem.tsx +1 -1
  51. package/dist/interface/common.ts +1 -1
  52. package/dist/interface/component.ts +1 -1
  53. package/dist/interface/jumpEventReport.ts +1 -1
  54. package/dist/interface/service.ts +1 -1
  55. package/dist/interface/utils.ts +1 -1
  56. package/dist/jumpEventReport/base.ts +1 -1
  57. package/dist/jumpEventReport/const.ts +1 -1
  58. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  59. package/dist/jumpEventReport/index.h5.ts +1 -1
  60. package/dist/jumpEventReport/index.jd.ts +1 -1
  61. package/dist/jumpEventReport/index.weapp.ts +1 -1
  62. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  63. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  64. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  65. package/dist/jumpEventReport/web/report.ts +1 -1
  66. package/dist/jumpEventReport/web.base.ts +1 -1
  67. package/dist/jumpEventReport/web.jd.ts +1 -1
  68. package/dist/jumpEventReport/web.jdb.ts +1 -1
  69. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  70. package/dist/jumpEventReport/web.jxwxapp.ts +1 -0
  71. package/dist/jumpEventReport/web.pc.ts +1 -0
  72. package/dist/jumpEventReport/web.tjapp.ts +1 -0
  73. package/dist/jumpEventReport/web.tjm.ts +1 -0
  74. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  75. package/dist/modules/ContainerFloorList/index.h5.module.scss +17 -1
  76. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  77. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  78. package/dist/open/api/environment.ts +1 -1
  79. package/dist/open/api/index.ts +1 -1
  80. package/dist/open/api/jump copy.ts +1 -1
  81. package/dist/open/api/request.ts +1 -1
  82. package/dist/open/api/shopMember.ts +1 -1
  83. package/dist/open/api/track.ts +1 -1
  84. package/dist/open/api/util.ts +1 -1
  85. package/dist/open/components/index.ts +1 -1
  86. package/dist/sass/app.h5.scss +44 -3
  87. package/dist/sass/base.scss +12 -0
  88. package/dist/service/fetchGateway.ts +1 -1
  89. package/dist/service/http/const.ts +1 -1
  90. package/dist/service/requestServer.ts +1 -1
  91. package/dist/utils/connectNativeJsBridge.ts +1 -1
  92. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  93. package/dist/utils/draExceptionAndProfile.ts +1 -1
  94. package/dist/utils/h5Utils.ts +1 -1
  95. package/dist/utils/index.h5.ts +1 -1
  96. package/dist/utils/index.ts +1 -1
  97. package/dist/utils/index.weapp.ts +1 -1
  98. package/dist/utils/jm-common.js +1 -1
  99. package/dist/utils/sgmCodeUtils.ts +1 -0
  100. package/dist/utils/utils.ts +1 -1
  101. package/package.json +1 -1
  102. package/dist/customHooks/useDocumentVisibilitychange.ts +0 -1
@@ -1 +1 @@
1
- import {
2
1
  isApp,
3
2
  isIOS,
4
3
  getAppVersion,
5
4
  version,
6
5
  getUUID,
7
6
  getUrlQuery,
8
7
  assign,
9
8
  isString,
10
9
  isObject,
11
10
  serialize,
12
11
  isAndroid, versionCompare,
13
12
  CHANNEL_TYPE,
14
13
  JDShopViewBusinessPathType,
15
14
  JDShopViewBusinessPathList,
16
15
  SECTION_HOME_TAB_NAME_TYPE,
17
16
  SECTION_HOME_TAB_TYPE,
18
17
  parseQueryUrlString(window?.location?.href ?? ''),
19
18
  try {
20
19
  return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
21
20
  } catch (e) {
22
21
  return {}
23
22
  }
24
23
  isWxMiniH5View && urlCookie['wxapp_type'] == '1'
25
24
  if (isJdApp) {
26
25
  isIosDevice
27
26
  ? e && e.stopPropagation()
28
27
  : androidDeviceStopNativeScrollEvent(state)
29
28
  }
30
29
  isJdApp &&
31
30
  isAndroidDevice &&
32
31
  window?.JdAndroid &&
33
32
  window?.JdAndroid.requestEvent(state)
34
33
  if (isH5AndJdShopView) {
35
34
  return (
36
35
  CHANNEL_TYPE[currentChannel] ||
37
36
  CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
38
37
  )
39
38
  }
40
39
  return null
41
40
  isH5 && ['/app/home', '/app/classify', '/member/shopcard'].includes(urlPathname)
42
41
  const getCustomObj = {
43
42
  type: 1,
44
43
  code: 'all',
45
44
  cost1: 1,
46
45
  ...customObj
47
46
  }
48
47
  try {
49
48
  window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
50
49
  } catch (e) {}
50
+ import {
51
51
  isApp,
52
52
  isIOS,
53
53
  getAppVersion,
54
54
  version,
55
55
  getUUID,
56
56
  getUrlQuery,
57
57
  assign,
58
58
  isString,
59
59
  isObject,
60
60
  serialize,
61
61
  isAndroid,
62
62
  versionCompare,
63
63
  CHANNEL_TYPE,
64
64
  JDShopViewBusinessPathType,
65
65
  JDShopViewBusinessPathList,
66
66
  SECTION_HOME_TAB_NAME_TYPE,
67
67
  SECTION_HOME_TAB_TYPE,
68
68
  parseQueryUrlObj,
69
69
  if (window?.__sgm__) {
70
70
  resolve(true)
71
71
  } else {
72
72
  if (isSgmReadyError) {
73
73
  console.log("当前sgm初始化失败")
74
74
  reject(false)
75
75
  } else {
76
76
  ready('__sgm__', 2000).then(() => {
77
77
  isSgmReadyError = false
78
78
  console.log("当前sgm初始化成功")
79
79
  resolve(true)
80
80
  }).catch(() => {
81
81
  isSgmReadyError = true
82
82
  console.log("当前sgm初始化失败")
83
83
  reject(false)
84
84
  })
85
85
  }
86
86
  }
87
87
  try {
88
88
  return JSON.parse(decodeURIComponent(getUrlQuery('cookie')))
89
89
  } catch (e) {
90
90
  return {}
91
91
  }
92
92
  isWxMiniH5View && urlCookie['wxapp_type'] == '1'
93
93
  if (isH5AdnJxMini) {
94
94
  return 'jxxcx'
95
95
  } else if (isTJApp) {
96
96
  return 'tjapp'
97
97
  } else if (isTjM) {
98
98
  return 'tjm'
99
99
  } else if (isTjJxM) {
100
100
  return 'jxh5'
101
101
  }
102
102
  return ''
103
103
  if (isJdApp) {
104
104
  isIosDevice
105
105
  ? e && e.stopPropagation()
106
106
  : androidDeviceStopNativeScrollEvent(state)
107
107
  }
108
108
  isJdApp &&
109
109
  isAndroidDevice &&
110
110
  window?.JdAndroid &&
111
111
  window?.JdAndroid.requestEvent(state)
112
112
  if (isH5AndJdShopView) {
113
113
  return (
114
114
  CHANNEL_TYPE[currentChannel] ||
115
115
  CHANNEL_TYPE[JDShopViewBusinessPathType.HOME]
116
116
  )
117
117
  }
118
118
  return null
119
119
  isH5 && isJdApp && ['/app/home', '/app/classify', '/member/shopcard','/favorite/list', '/favorite/home'].includes(urlPathname)
120
120
  isH5 && isJdApp && !['/app/home'].includes(urlPathname)
121
121
  return isJdApp ? versionCompare(nowVersion, compareVersion) : -2
122
122
  getSgmReadyPromise().then(() => {
123
123
  if (
124
124
  customObj.hasOwnProperty('code') &&
125
125
  customObj.code.indexOf(NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG) !== -1
126
126
  ) {
127
127
  const originCode = customObj.code.substring(
128
128
  NO_ENVIRONMENT_AND_PAGE_TYPE_FLAG.length,
129
129
  customObj.code.length,
130
130
  )
131
131
  customObj['code'] = getSgmCustomCode(originCode)
132
132
  }
133
133
  const getCustomObj = {
134
134
  type: 1,
135
135
  code: 'all',
136
136
  cost1: 1,
137
137
  ...customObj
138
138
  }
139
139
  try {
140
140
  window.__sgm__.custom(getCustomObj, '9HwAEg@fTtWBB3EnwA5VgLT')
141
141
  } catch (e) {
142
142
  console.log("当前sgm上报异常, 原始数据为",JSON.stringify(customObj))
143
143
  }
144
144
  }).catch(() => {
145
145
  console.error("当前页面sgm加载异常,无法进行异常上报, 原始数据为",JSON.stringify(customObj))
146
146
  })
147
147
  if(isJdAndAndroidDevice && typeof displayObj === 'object'){
148
148
  const deviceRatio = window?.devicePixelRatio
149
149
  Object.keys(displayObj).forEach(key => {
150
150
  if(key === 'nativeHeaderHeight'){
151
151
  displayObj[key] = Math.ceil(displayObj[key] / (deviceRatio * deviceRatio) - 2)
152
152
  }else {
153
153
  displayObj[key] = Math.ceil(displayObj[key] / deviceRatio)
154
154
  }
155
155
  })
156
156
  }
157
157
  return displayObj
@@ -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, isJdApp,
6
5
  isWxApp, isWxMiniH5View, isH5AndJingGouMini, urlCookie,
7
6
  sgmCustomReport, isMemberPage, isH5AndJdShopViewH5Scroll, isAppClassifyPage
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
  isWxMin,
139
138
  isWxMinAndWxapp,
140
139
  isJdMin,
141
140
  isH5,
142
141
  isH5AndJdShopView,
143
142
  isChartH5,
144
143
  isH5AndJdShopViewNativeScroll,
145
144
  isH5AndJdShopViewH5Scroll,
146
145
  isH5AndJingGouMini,
147
146
  isWxMiniH5View,
148
147
  urlCookie,
149
148
  sliceArrToChunkList,
150
149
  dealAddress,
151
150
  objectToUrlEncode,
152
151
  parseQueryUrlString,
153
152
  setLowSmallPicUrl,
154
153
  setTaroStorage,
155
154
  getTaroStorageKeyValue,
156
155
  removeTaroStorageKey,
157
156
  clearTaroStorageKey,
158
157
  getQualityImage,
159
158
  countStringify,
160
159
  getWxAppCookieStr,
161
160
  getSystemInfos,
162
161
  pxTransformFromData,
163
162
  dealShopContentDataAndReport as dealShopContentData,
164
163
  dateFormat,
165
164
  throttle,
166
165
  lodashThrottle,
167
166
  debounce,
168
167
  addHttps,
169
168
  commonShowSuccessToast as showSuccessToast,
170
169
  commonShowFailToast as showFailToast,
171
170
  commonShowNormalToast as showNormalToast,
172
171
  showShopLoading,
173
172
  hideShopLoading,
174
173
  getAppChannelType,
175
174
  formatTabActiveMenuType,
176
175
  filterUrlQueryData,
177
176
  sgmCustomReport,
178
177
  isMemberPage,
179
178
  memberFormatUtils,
180
179
  getFloorDataToDataDefines,
181
180
  isAppClassifyPage
181
+ import Taro from '@tarojs/taro'
182
182
  UtilsInterFace
183
183
  nativePageShowToast,
184
184
  ToastAndroidType,
185
185
  ToastIosType,
186
186
  getAppChannelType,
187
187
  isAndroidDevice,
188
188
  isH5AndJdShopView,
189
189
  isChartH5,
190
190
  isH5AndJdShopViewNativeScroll,
191
191
  isIosDevice,
192
192
  isJdAndAndroidDevice,
193
193
  isJdAndIosDevice,
194
194
  isJdApp,
195
195
  isWxApp,
196
196
  isWxMiniH5View,
197
197
  isJdAndHarmonyDevice,
198
198
  isH5AndJingGouMini,
199
199
  urlCookie,
200
200
  sgmCustomReport,
201
201
  isMemberPage,
202
202
  isH5AndJdShopViewH5Scroll,
203
203
  isH5AndJdShopH5CustomScrollView,
204
204
  isAppClassifyPage,
205
205
  isPc,
206
206
  ipLoc_djd,
207
207
  jdAppVersionCompare,
208
208
  isTjScence,
209
209
  isH5AdnJxMini,
210
210
  isTjM,
211
211
  isTjJxM,
212
212
  isTJApp,
213
213
  isH5AdnHaoWuJie,
214
214
  tjChannel,
215
215
  dealNativePixelToCssPixel,
216
216
  isAppStowShop,
217
217
  isJdAndroidX5Core,
218
218
  parseQueryUrlObj,
219
219
  addHttps,
220
220
  clearTaroStorageKey,
221
221
  countStringify,
222
222
  dateFormat,
223
223
  dealAddress,
224
224
  dealShopContentData as originDealShopContentData,
225
225
  debounce,
226
226
  filterUrlQueryData,
227
227
  formatTabActiveMenuType,
228
228
  getAvifSupport,
229
229
  getWebpSupport,
230
230
  getTaroStorageKeyValue,
231
231
  getWxAppCookieStr,
232
232
  isH5,
233
233
  isMin,
234
234
  isJdMin,
235
235
  isWxMin,
236
236
  isWxMinAndWxapp,
237
237
  isJdMinAndHarmony,
238
238
  lodashThrottle,
239
239
  objectToUrlEncode,
240
240
  parseQueryUrlString,
241
241
  removeTaroStorageKey,
242
242
  setLowSmallPicUrl,
243
243
  setTaroStorage,
244
244
  showFailToast,
245
245
  showNormalToast,
246
246
  showSuccessToast,
247
247
  sliceArrToChunkList,
248
248
  throttle,
249
249
  getQualityImageNew,
250
250
  getQualityImageOld,
251
251
  isOpenJdAppUrl,
252
252
  jdOpenAppParams,
253
253
  createJdOpenAppUrl,
254
254
  isEmpty,
255
255
  getJdAppReportPageSource,
256
256
  dealJdOpenAppData,
257
257
  const getNum = Number(num)
258
258
  let _changeLayoutWidth = layoutWidth
259
259
  if (!_changeLayoutWidth) {
260
260
  _changeLayoutWidth =
261
261
  _ShopSystemInfo && _ShopSystemInfo?.windowWidth
262
262
  ? _ShopSystemInfo.windowWidth
263
263
  : Taro.getSystemInfoSync()?.windowWidth
264
264
  }
265
265
  return Math.round((getNum / widthSize) * _changeLayoutWidth)
266
266
  changeSize,
267
267
  designWidth = 750,
268
268
  systemInfo,
269
269
  const getRootFontSize =
270
270
  (40 * (systemInfo?.windowWidth ?? _ShopSystemInfo.windowWidth)) / 750
271
271
  const getRealRootFontSize =
272
272
  getRootFontSize > 40 ? 40 : getRootFontSize < 20 ? 20 : getRootFontSize
273
273
  return Math.ceil(
274
274
  (((parseInt(String(changeSize), 10) / 40) * 750) / designWidth) *
275
275
  getRealRootFontSize,
276
276
  )
277
277
  console.log(
278
278
  '获取系统宽度systemInfo?.windowWidth',
279
279
  systemInfo?.windowWidth,
280
280
  'taroToTransformRoutimePXNumber(changeWidth)',
281
281
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo),
282
282
  )
283
283
  return buildType === BUILD_TYPE.CLASSIFY && systemInfo?.windowWidth
284
284
  ? systemInfo?.windowWidth -
285
285
  taroToTransformRoutimePXNumber(changeWidth, 750, systemInfo)
286
286
  : systemInfo?.windowWidth ?? 0
287
287
  const systemInfo = Taro.getSystemInfoSync()
288
288
  if (params && params?.pageWidth && params?.pageHeight) {
289
289
  systemInfo.windowWidth = params?.pageWidth
290
290
  systemInfo.windowHeight = params?.pageHeight
291
291
  }
292
292
  systemInfo['containerWidth'] = getContainerWidth(buildType, systemInfo)
293
293
  console.warn('====获取系统信息=====', systemInfo)
294
294
  return systemInfo
295
295
  const appVersionCheckPass = jdAppVersionCompare(MPAAS_CONFIG_APP_VERSION) >= 0
296
296
  const supportBuildType = /app-view|app-member|app-classify|member-home/
297
297
  const scopeCheckPass = supportBuildType.test(buildType || '')
298
298
  const enableAvifOptimize = appVersionCheckPass && scopeCheckPass
299
299
  if(enableAvifOptimize){
300
300
  const configData = global.getDynamicConfig('avifSwitch')
301
301
  if(!hasOutputLog){
302
302
  console.warn("🚗 ~~ file: utils.ts:187 ~~ isImageOptimizeEnable ~~ enableAvifOptimize:", enableAvifOptimize, ' appVersionCheckPass:', appVersionCheckPass, ' scopeCheckPass:', scopeCheckPass)
303
303
  console.warn("🚗 ~~ file: utils.ts:188 ~~ global.getDynamicConfig ~~ configData:", configData)
304
304
  }
305
305
  const { globalOn = true, ignoreOptimizeFromServer = false, page = {}, whiteList = [], blackList = [] } = configData || {}
306
306
  const {shopId = '0', venderId = '0'} = parseQueryUrlObj
307
307
  let imageEnableResult = true
308
308
  isIgnoreOptimizeFromServer = ignoreOptimizeFromServer
309
309
  if (blackList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
310
310
  imageEnableResult = false
311
311
  if(!hasOutputLog){
312
312
  console.warn("🚗 ~~ file: utils.ts:198 命中黑名单!")
313
313
  }
314
314
  }else if(whiteList.find(item => item.sId === Number(shopId) || item.vId === Number(venderId))){
315
315
  imageEnableResult = true
316
316
  if(!hasOutputLog){
317
317
  console.warn("🚗 ~~ file: utils.ts:205 命中白名单!")
318
318
  }
319
319
  }else{
320
320
  imageEnableResult = globalOn === true || page[buildType] === true
321
321
  if(!hasOutputLog){
322
322
  console.warn("🚗 ~~ file: utils.ts:211 走全局开关+页面开关控制逻辑,开关结果:", imageEnableResult)
323
323
  }
324
324
  }
325
325
  if(!hasOutputLog){
326
326
  hasOutputLog = true
327
327
  }
328
328
  return imageEnableResult
329
329
  }else{
330
330
  return false
331
331
  }
332
332
  if(typeof options === 'object' && isImageOptimizeEnable()){
333
333
  return getQualityImageNew(imgUrl, options, isIgnoreOptimizeFromServer)
334
334
  }else{
335
335
  return getQualityImageOld(imgUrl, options)
336
336
  }
337
337
  const getSystemInfo = getSystemAndContainerWidthInfo(params) || {
338
338
  windowWidth: window.innerWidth,
339
339
  containerWidth: getContainerWidth(buildType, {
340
340
  windowWidth: window.innerWidth,
341
341
  }),
342
342
  screenWidth: window.innerWidth,
343
343
  platform: '',
344
344
  model: '',
345
345
  system: '',
346
346
  }
347
347
  if (isJdApp && isAndroidDevice && getSystemInfo.windowWidth <= 0) {
348
348
  getSystemInfo.windowWidth = getSystemInfo.screenWidth
349
349
  getSystemInfo['containerWidth'] = getContainerWidth(
350
350
  buildType,
351
351
  getSystemInfo,
352
352
  )
353
353
  }
354
354
  return getSystemInfo
355
355
  console.log('进入commonshowToast, 传入参数options为: ', options)
356
356
  const params = Object.assign(
357
357
  {},
358
358
  {
359
359
  title: '',
360
360
  duration: 1500,
361
361
  },
362
362
  options,
363
363
  )
364
364
  params.duration = params.duration / 1000
365
365
  if (isJdApp) {
366
366
  const showSuccessType = isIosDevice
367
367
  ? ToastIosType.SUCCESS
368
368
  : ToastAndroidType.SUCCESS
369
369
  const duration = isAndroidDevice ? 0 : params.duration
370
370
  nativePageShowToast(options.title, showSuccessType, duration)
371
371
  console.log('执行原生toast success')
372
372
  } else {
373
373
  showSuccessToast(options)
374
374
  }
375
375
  const params = Object.assign(
376
376
  {},
377
377
  {
378
378
  title: '',
379
379
  duration: 1500,
380
380
  },
381
381
  options,
382
382
  )
383
383
  params.duration = params.duration / 1000
384
384
  if (isJdApp) {
385
385
  const showSuccessType = isIosDevice
386
386
  ? ToastIosType.FAIL
387
387
  : ToastAndroidType.FAIL
388
388
  const duration = isAndroidDevice ? 0 : params.duration
389
389
  nativePageShowToast(options.title, showSuccessType, duration)
390
390
  console.log('执行原生toast fail')
391
391
  } else {
392
392
  console.log('执行H5 toast fail')
393
393
  showFailToast(options)
394
394
  }
395
395
  const params = Object.assign(
396
396
  {},
397
397
  {
398
398
  title: '',
399
399
  duration: 1500,
400
400
  },
401
401
  options,
402
402
  )
403
403
  params.duration = params.duration / 1000
404
404
  if (isJdApp) {
405
405
  const showSuccessType = isIosDevice ?
406
406
  ToastIosType.NORMAL :
407
407
  ToastAndroidType.NORMAL
408
408
  const duration = isAndroidDevice ? 0 : params.duration
409
409
  nativePageShowToast(options.title, showSuccessType, duration)
410
410
  } else {
411
411
  showNormalToast(options)
412
412
  }
413
413
  const createLoadingEle = document.createElement('div')
414
414
  createLoadingEle.id = 'J_shopLoading'
415
415
  createLoadingEle.className = `d-shop-loading flexible-center-box ${customClassName}`
416
416
  createLoadingEle.innerHTML =
417
417
  `<div class='d-loading-content'>
418
418
  <span class='d-shop-loading-icon'></span>
419
419
  <p class='d-shop-text'>${text}</p>
420
420
  </div>`
421
421
  const getEle = document.body
422
422
  ? document.body
423
423
  : document.getElementsByTagName('body')[0]
424
424
  getEle.appendChild(createLoadingEle)
425
425
  const getEle = document.getElementById('J_shopLoading')
426
426
  getEle && getEle.remove()
427
427
  const systemInfo: UtilsInterFace.taroGetSystemInfoSyncRes = getReviseSystemInfo(
428
428
  params,
429
429
  )
430
430
  if (!systemInfo.system && window) {
431
431
  systemInfo.system = window.navigator.userAgent
432
432
  systemInfo.isChrome = !!systemInfo?.system.match(/chrome/i)
433
433
  }
434
434
  const isIOS = !!systemInfo?.system.match(/ios/i)
435
435
  const isAndroid = !!systemInfo?.system.match(/android/i)
436
436
  systemInfo.navBarHeight = 0
437
437
  systemInfo.statusBarHeight = 0
438
438
  systemInfo.capsulePosition = null
439
439
  systemInfo.isIOS = isIOS
440
440
  systemInfo.isAndroid = isAndroid
441
441
  _ShopSystemInfo = systemInfo
442
442
  return systemInfo
443
443
  return originDealShopContentData(pageData, sgmCustomReport, isvdev)
444
444
  isJdApp,
445
445
  isWxApp,
446
446
  isIosDevice,
447
447
  isAndroidDevice,
448
448
  isJdAndIosDevice,
449
449
  isJdAndAndroidDevice,
450
450
  isJdAndHarmonyDevice,
451
451
  isJdAndroidX5Core,
452
452
  isMin,
453
453
  isWxMin,
454
454
  isWxMinAndWxapp,
455
455
  isJdMinAndHarmony,
456
456
  isJdMin,
457
457
  isH5,
458
458
  isH5AndJdShopView,
459
459
  isChartH5,
460
460
  isH5AndJdShopViewNativeScroll,
461
461
  isH5AndJdShopViewH5Scroll,
462
462
  isH5AndJdShopH5CustomScrollView,
463
463
  isH5AndJingGouMini,
464
464
  isWxMiniH5View,
465
465
  urlCookie,
466
466
  sliceArrToChunkList,
467
467
  dealAddress,
468
468
  objectToUrlEncode,
469
469
  parseQueryUrlString,
470
470
  setLowSmallPicUrl,
471
471
  setTaroStorage,
472
472
  getTaroStorageKeyValue,
473
473
  removeTaroStorageKey,
474
474
  clearTaroStorageKey,
475
475
  getAvifSupport,
476
476
  getWebpSupport,
477
477
  getQualityImage,
478
478
  countStringify,
479
479
  getWxAppCookieStr,
480
480
  getSystemInfos,
481
481
  pxTransformFromData,
482
482
  dealShopContentDataAndReport as dealShopContentData,
483
483
  dateFormat,
484
484
  throttle,
485
485
  lodashThrottle,
486
486
  debounce,
487
487
  addHttps,
488
488
  commonShowSuccessToast as showSuccessToast,
489
489
  commonShowFailToast as showFailToast,
490
490
  commonShowNormalToast as showNormalToast,
491
491
  showShopLoading,
492
492
  hideShopLoading,
493
493
  getAppChannelType,
494
494
  formatTabActiveMenuType,
495
495
  filterUrlQueryData,
496
496
  sgmCustomReport,
497
497
  isMemberPage,
498
498
  getFloorDataToDataDefines,
499
499
  isOpenJdAppUrl,
500
500
  jdOpenAppParams,
501
501
  createJdOpenAppUrl,
502
502
  isEmpty,
503
503
  getJdAppReportPageSource,
504
504
  isAppClassifyPage,
505
505
  isImageOptimizeEnable,
506
506
  isPc,
507
507
  ipLoc_djd,
508
508
  isTjScence,
509
509
  isH5AdnJxMini,
510
510
  isTjM,
511
511
  isTjJxM,
512
512
  isTJApp,
513
513
  isH5AdnHaoWuJie,
514
514
  tjChannel,
515
515
  dealJdOpenAppData,
516
516
  jdAppVersionCompare,
517
517
  dealNativePixelToCssPixel,
518
518
  isAppStowShop,
519
519
  getSgmCustomCode