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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/common/const.ts +1 -1
  2. package/dist/common/index.h5.ts +1 -1
  3. package/dist/common/index.jd.ts +1 -1
  4. package/dist/common/index.ts +1 -1
  5. package/dist/common/index.weapp.ts +1 -1
  6. package/dist/common/jssdk.ts +1 -0
  7. package/dist/common/pageType.ts +1 -0
  8. package/dist/common/token/index.h5.ts +1 -1
  9. package/dist/common/token/token.jd.ts +1 -1
  10. package/dist/components/base/CustomScrollView/index.tsx +1 -1
  11. package/dist/components/base/Exposure/index.h5.tsx +1 -1
  12. package/dist/components/base/ExposureSmart/index.h5.tsx +1 -1
  13. package/dist/components/base/ExposureSmart/index.tsx +1 -1
  14. package/dist/components/base/ExposureSmart/reporter.tsx +1 -1
  15. package/dist/components/base/InViewRender/index.tsx +1 -1
  16. package/dist/components/base/ItemViewExposureSmart/index.tsx +1 -1
  17. package/dist/components/base/LazyLoadImage/const.ts +1 -1
  18. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  19. package/dist/components/base/MobileCommonHeader/index.module.scss +9 -0
  20. package/dist/components/base/MobileCommonHeader/index.tsx +1 -0
  21. package/dist/components/base/NetworkDataError/const.ts +1 -1
  22. package/dist/components/base/NetworkDataError/index.module.scss +4 -0
  23. package/dist/components/base/NetworkDataError/index.tsx +1 -1
  24. package/dist/components/base/Price/Double/index.tsx +1 -1
  25. package/dist/components/base/Price/index.tsx +1 -1
  26. package/dist/components/decorate/DecorateFloorModule/index.module.scss +21 -2
  27. package/dist/components/decorate/DecorateFloorModule/index.tsx +1 -1
  28. package/dist/components/decorate/EmptyFloorModule/index.tsx +1 -1
  29. package/dist/components/isv/Floor/index.tsx +1 -1
  30. package/dist/components/remoteFloorItem.tsx +1 -1
  31. package/dist/interface/common.ts +1 -1
  32. package/dist/interface/component.ts +1 -1
  33. package/dist/jumpEventReport/const.ts +1 -1
  34. package/dist/jumpEventReport/createReportFloorData.ts +1 -1
  35. package/dist/jumpEventReport/index.h5.ts +1 -1
  36. package/dist/jumpEventReport/index.weapp.ts +1 -1
  37. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  38. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  39. package/dist/jumpEventReport/web/report.ts +1 -1
  40. package/dist/jumpEventReport/web.base.ts +1 -1
  41. package/dist/jumpEventReport/web.jd.ts +1 -1
  42. package/dist/jumpEventReport/web.jdb.ts +1 -1
  43. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  44. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  45. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  46. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  47. package/dist/open/api/environment.ts +1 -1
  48. package/dist/open/api/index.ts +1 -1
  49. package/dist/open/api/track.ts +1 -1
  50. package/dist/open/components/index.ts +1 -1
  51. package/dist/service/fetchGateway.ts +1 -1
  52. package/dist/service/http/const.ts +1 -1
  53. package/dist/service/requestServer.ts +1 -1
  54. package/dist/utils/connectNativeJsBridge.ts +1 -1
  55. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  56. package/dist/utils/h5Utils.ts +1 -1
  57. package/dist/utils/index.h5.ts +1 -1
  58. package/dist/utils/index.ts +1 -1
  59. package/dist/utils/index.weapp.ts +1 -1
  60. package/dist/utils/jm-common.js +1 -1
  61. package/dist/utils/utils.ts +1 -1
  62. package/package.json +1 -1
@@ -1 +1 @@
1
- import React, { useCallback, useEffect, useRef, useState } from 'react'
2
1
  getQualityImage,
3
2
  isH5AndJdShopView,
4
3
  isJdApp,
5
4
  isChartH5,
6
5
  isH5AndJdShopViewH5Scroll,
7
6
  getNativePageScrollRes,
8
7
  latestFromNativeMsgStorage,
9
8
  const {
10
9
  src,
11
10
  lazyLoad,
12
11
  imagRenderingSet,
13
12
  width,
14
13
  height,
15
14
  className,
16
15
  isSkuImage,
17
16
  hideErrorImage,
18
17
  style,
19
18
  backgroundColor,
20
19
  errorSrc,
21
20
  onLoad,
22
21
  onError,
23
22
  ...otherOption
24
23
  } = props
25
24
  getNetWorkType === NetWorkTypeQuality.default &&
26
25
  (getNetWorkType = taroJdBaseInfo.info.sysInfo.netWorkType)
27
26
  const [loadSuccess, setLoadSuccess] = useState(false)
28
27
  const [imageErrState, setImageErrState] = useState(false)
29
28
  const [componentShowState, setComponentShowState] = useState(false)
30
29
  const [imgSrc, setImgSrc] = useState(src)
31
30
  const componentLazyRef = useRef<HTMLElement | null>(null)
32
31
  const componentShowStateRef = useRef(false)
33
32
  const needShowHighVersion =
34
33
  isH5AndJdShopViewH5Scroll &&
35
34
  !(
36
35
  global.info.queryInfo?.downgraded &&
37
36
  global.info.queryInfo.downgraded === 'true'
38
37
  )
39
38
  const { ref, inView } = useInView({
40
39
  threshold: 0,
41
40
  triggerOnce: true,
42
41
  root: null,
43
42
  rootMargin: `0px 0px ${window.innerHeight * 0.5}px 0px`,
44
43
  })
45
44
  const imageError = useCallback(
46
45
  (e) => {
47
46
  console.log('图片加载错误', e)
48
47
  errorSrc && setImgSrc(errorSrc)
49
48
  hideErrorImage && setImageErrState(true)
50
49
  typeof onError === 'function' && onError(e, src, props)
51
50
  },
52
51
  [src],
53
52
  )
54
53
 
55
54
  const imageLoad = useCallback(
56
55
  (_src, event) => {
57
56
  setLoadSuccess(true)
58
57
  typeof onLoad === 'function' && onLoad(event, src, props)
59
58
  },
60
59
  [src],
61
60
  )
62
61
 
63
62
  const changeStyleIncludeWidthAndHeightAndBgColor = () => {
64
63
  const changeStyle = {}
65
64
  width && (changeStyle['width'] = width)
66
65
  height && (changeStyle['height'] = height)
67
66
  backgroundColor && (changeStyle['backgroundColor'] = backgroundColor)
68
67
  return changeStyle
69
68
  }
70
69
  useEffect(() => {
71
70
  if (needShowHighVersion) return
72
71
  const latestRes =
73
72
  latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
74
73
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
75
74
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
76
75
  !componentShowStateRef.current && dealPageScrollInfo(res)
77
76
  })
78
77
  }, [])
79
78
 
80
79
  const dealPageScrollInfo = (res) => {
81
80
  const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
82
81
  if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined')
83
82
  return
84
83
  if (componentLazyRef.current) {
85
84
  const eleClientRect = componentLazyRef.current.getBoundingClientRect()
86
85
  const getContainerHeightOffSetY = displayHeight * 1.5 + offSetY
87
86
  const eleOffsetTop = Math.ceil(eleClientRect.top)
88
87
  const eleOffsetHeight = Math.ceil(eleClientRect.height)
89
88
  if (!componentShowStateRef.current) {
90
89
  if (getContainerHeightOffSetY > eleOffsetTop) {
91
90
  componentShowStateRef.current = true
92
91
  setComponentShowState(true)
93
92
  }
94
93
  }
95
94
  }
96
95
  }
97
96
  <View
98
97
  ref={ componentLazyRef }
99
98
  className={classNames(
100
99
  imageStyle['d-app-lazy-image'],
101
100
  {
102
101
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
103
102
  },
104
103
  {
105
104
  [imageStyle['d-hide-image-error']]: imageErrState,
106
105
  },
107
106
  {
108
107
  [imageStyle['d-load-completed']]: loadSuccess,
109
108
  },
110
109
  {
111
110
  'd-imag-rendering-crisp-edges':
112
111
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
113
112
  imagRenderingSet,
114
113
  },
115
114
  'J_html5ImageBg',
116
115
  className,
117
116
  )}
118
117
  style={{
119
118
  ...style,
120
119
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
121
120
  >
122
121
  {(componentShowState || lazyLoad === false) && <img
123
122
  src={getQualityImage(
124
123
  imgSrc,
125
124
  taroJdBaseInfo.info.pageInfo.isVipShop
126
125
  ? NetWorkTypeQuality['perfect']
127
126
  : NetWorkTypeQuality[getNetWorkType],
128
127
  )}
129
128
  onLoad={imageLoad.bind(this, imgSrc)}
130
129
  onError={imageError}
131
130
  />}
132
131
  </View>
133
132
  ) : (
134
133
  <Image
135
134
  style={{
136
135
  ...style,
137
136
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
138
137
  }}
139
138
  className={classNames(
140
139
  imageStyle['d-lazy-image'],
141
140
  {
142
141
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
143
142
  },
144
143
  {
145
144
  [imageStyle['d-hide-image-error']]: imageErrState,
146
145
  },
147
146
  {
148
147
  [imageStyle['d-load-completed']]: loadSuccess,
149
148
  },
150
149
  {
151
150
  'd-imag-rendering-crisp-edges': imagRenderingSet,
152
151
  },
153
152
  className,
154
153
  )}
155
154
  src={getQualityImage(
156
155
  imgSrc,
157
156
  NetWorkTypeQuality[getNetWorkType],
158
157
  )}
159
158
  lazyLoad={isChartH5 ? false : lazyLoad}
160
159
  onError={imageError}
161
160
  onLoad={imageLoad.bind(this, imgSrc)}
162
161
  {...otherOption}
163
162
  />
164
163
  )
165
164
  lazyLoad: true,
166
165
  isSkuImage: false,
167
166
  hideErrorImage: false,
168
167
  imagRenderingSet: true,
169
168
  src: null,
170
169
  style: null,
171
170
  width: null,
172
171
  height: null,
173
172
  backgroundColor: null,
174
173
  className: null,
175
174
  errorSrc: null,
176
175
  onLoad: null,
177
176
  onError: null,
177
+ import React, { useCallback, useEffect, useRef, useState } from 'react'
178
178
  getQualityImage,
179
179
  isH5AndJdShopView,
180
180
  isJdApp,
181
181
  isChartH5,
182
182
  isH5AndJdShopViewH5Scroll,
183
183
  getNativePageScrollRes,
184
184
  latestFromNativeMsgStorage,
185
185
  const {
186
186
  src,
187
187
  lazyLoad,
188
188
  imagRenderingSet,
189
189
  width,
190
190
  height,
191
191
  className,
192
192
  isSkuImage,
193
193
  hideErrorImage,
194
194
  style,
195
195
  backgroundColor,
196
196
  errorSrc,
197
197
  onLoad,
198
198
  onError,
199
199
  ...otherOption
200
200
  } = props
201
201
  getNetWorkType === NetWorkTypeQuality.default &&
202
202
  (getNetWorkType = taroJdBaseInfo.info.sysInfo.netWorkType)
203
203
  const [loadSuccess, setLoadSuccess] = useState(false)
204
204
  const [imageErrState, setImageErrState] = useState(false)
205
205
  const [componentShowState, setComponentShowState] = useState(false)
206
206
  const [imgSrc, setImgSrc] = useState(src)
207
207
  const componentLazyRef = useRef<HTMLElement | null>(null)
208
208
  const componentShowStateRef = useRef(false)
209
209
  const needShowHighVersion =
210
210
  isH5AndJdShopViewH5Scroll &&
211
211
  !(
212
212
  global.info.queryInfo?.downgraded &&
213
213
  global.info.queryInfo.downgraded === 'true'
214
214
  )
215
215
  const imageError = useCallback(
216
216
  (e) => {
217
217
  console.log('图片加载错误', e)
218
218
  errorSrc && setImgSrc(errorSrc)
219
219
  hideErrorImage && setImageErrState(true)
220
220
  typeof onError === 'function' && onError(e, src, props)
221
221
  },
222
222
  [src],
223
223
  )
224
224
 
225
225
  const imageLoad = useCallback(
226
226
  (_src, event) => {
227
227
  setLoadSuccess(true)
228
228
  typeof onLoad === 'function' && onLoad(event, src, props)
229
229
  },
230
230
  [src],
231
231
  )
232
232
 
233
233
  const changeStyleIncludeWidthAndHeightAndBgColor = () => {
234
234
  const changeStyle = {}
235
235
  width && (changeStyle['width'] = width)
236
236
  height && (changeStyle['height'] = height)
237
237
  backgroundColor && (changeStyle['backgroundColor'] = backgroundColor)
238
238
  return changeStyle
239
239
  }
240
240
  useEffect(() => {
241
241
  if (needShowHighVersion) return
242
242
  const latestRes =
243
243
  latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
244
244
  !componentShowStateRef.current && dealPageScrollInfo(latestRes)
245
245
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL, (res) => {
246
246
  !componentShowStateRef.current && dealPageScrollInfo(res)
247
247
  })
248
248
  }, [])
249
249
 
250
250
  const dealPageScrollInfo = (res) => {
251
251
  const { displayHeight, offSetY } = getNativePageScrollRes(res) || {}
252
252
  if (typeof displayHeight === 'undefined' || typeof offSetY === 'undefined')
253
253
  return
254
254
  if (componentLazyRef.current) {
255
255
  const eleClientRect = componentLazyRef.current.getBoundingClientRect()
256
256
  const getContainerHeightOffSetY = displayHeight * 1.5 + offSetY
257
257
  const eleOffsetTop = Math.ceil(eleClientRect.top)
258
258
  const eleOffsetHeight = Math.ceil(eleClientRect.height)
259
259
  if (!componentShowStateRef.current) {
260
260
  if (getContainerHeightOffSetY > eleOffsetTop) {
261
261
  componentShowStateRef.current = true
262
262
  setComponentShowState(true)
263
263
  }
264
264
  }
265
265
  }
266
266
  }
267
267
  <View
268
268
  ref={ componentLazyRef }
269
269
  className={classNames(
270
270
  imageStyle['d-app-lazy-image'],
271
271
  {
272
272
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
273
273
  },
274
274
  {
275
275
  [imageStyle['d-hide-image-error']]: imageErrState,
276
276
  },
277
277
  {
278
278
  [imageStyle['d-load-completed']]: loadSuccess,
279
279
  },
280
280
  {
281
281
  'd-imag-rendering-crisp-edges':
282
282
  !taroJdBaseInfo.info.pageInfo.isVipShop &&
283
283
  imagRenderingSet,
284
284
  },
285
285
  'J_html5ImageBg',
286
286
  className,
287
287
  )}
288
288
  style={{
289
289
  ...style,
290
290
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
291
291
  >
292
292
  {(componentShowState || lazyLoad === false) && <img
293
293
  src={getQualityImage(
294
294
  imgSrc,
295
295
  taroJdBaseInfo.info.pageInfo.isVipShop
296
296
  ? NetWorkTypeQuality['perfect']
297
297
  : NetWorkTypeQuality[getNetWorkType],
298
298
  )}
299
299
  onLoad={imageLoad.bind(this, imgSrc)}
300
300
  onError={imageError}
301
301
  />}
302
302
  </View>
303
303
  ) : (
304
304
  <Image
305
305
  style={{
306
306
  ...style,
307
307
  ...changeStyleIncludeWidthAndHeightAndBgColor(),
308
308
  }}
309
309
  className={classNames(
310
310
  imageStyle['d-lazy-image'],
311
311
  {
312
312
  [imageStyle['d-lazy-sku-image']]: isSkuImage,
313
313
  },
314
314
  {
315
315
  [imageStyle['d-hide-image-error']]: imageErrState,
316
316
  },
317
317
  {
318
318
  [imageStyle['d-load-completed']]: loadSuccess,
319
319
  },
320
320
  {
321
321
  'd-imag-rendering-crisp-edges': imagRenderingSet,
322
322
  },
323
323
  className,
324
324
  )}
325
325
  src={getQualityImage(
326
326
  imgSrc,
327
327
  NetWorkTypeQuality[getNetWorkType],
328
328
  )}
329
329
  lazyLoad={isChartH5 ? false : lazyLoad}
330
330
  onError={imageError}
331
331
  onLoad={imageLoad.bind(this, imgSrc)}
332
332
  {...otherOption}
333
333
  />
334
334
  )
335
335
  lazyLoad: true,
336
336
  isSkuImage: false,
337
337
  hideErrorImage: false,
338
338
  imagRenderingSet: true,
339
339
  src: null,
340
340
  style: null,
341
341
  width: null,
342
342
  height: null,
343
343
  backgroundColor: null,
344
344
  className: null,
345
345
  errorSrc: null,
346
346
  onLoad: null,
347
347
  onError: null,
@@ -0,0 +1,9 @@
1
+
2
+ .d-mobile-header-layout {
3
+ position: relative;
4
+ z-index: 12;
5
+ .d-mobile-common-tip,
6
+ .d-mobile-common-header {
7
+ position: relative;
8
+ }
9
+ }
@@ -0,0 +1 @@
1
+ import React, { useEffect, useContext, useState } from 'react'
2
  const { title, openAppParams, style, hasCommonHeader = true, hasDownloadTips = true, headerParams } = props
1
3
  useEffect(() => {
2
4
  hasCommonHeader && initCommonHeader()
3
5
  hasDownloadTips && initDownloadAppLayerConfigData()
4
6
  }, [])
5
7
  const initCommonHeader = () => {
6
8
  if (window?.MCommonHeaderBottom) {
7
9
  const mchb = new MCommonHeaderBottom()
8
10
  const headerArg = {
9
11
  moduleName: 'shop',
10
12
  hrederId: 'm_common_header',
11
13
  title,
12
14
  stype: 1,
13
15
  onClickJdkey: function () {
14
16
  console.log('==>m_common_header jdkey click.')
15
17
  },
16
18
  ...headerParams
17
19
  }
18
20
  mchb.header(headerArg)
19
21
  }
20
22
  }
21
23
  const initDownloadAppLayerConfigData = () => {
22
24
  const getEle = document.getElementById('m_common_tip')
23
25
  getEle &&
24
26
  window.$ &&
25
27
  window.$.downloadAppLayerConfigData &&
26
28
  window.$.downloadAppLayerConfigData({
27
29
  tipId: 'm_common_tip',
28
30
  M_sourceFrom: 'jshop',
29
31
  bottom: 74,
30
32
  onClickTipX: () => {
31
33
  Taro.eventCenter.trigger(
32
34
  TaroEventType.DOWN_LOAD_APP_CLOSE_CHANGE,
33
35
  true,
34
36
  )
35
37
  },
36
38
  downloadAppPlugIn: {
37
39
  M_sourceFrom: 'jshop',
38
40
  openAppBtnId: 'download_openapp',
39
41
  downAppURl: '//conecli.com/downloadApp/download.html?channel=jd-m',
40
42
  inteneUrl: 'openapp.jdmobile://virtual?',
41
43
  inteneUrlParams: {
42
44
  category: 'jump',
43
45
  des: 'jshopMain',
44
46
  shopId: `${global.info.queryInfo.shopId || ''}`,
45
47
  venderId: `${global.info.queryInfo.venderId || ''}`,
46
48
  sourceType: global.info.queryInfo?.sourceType || 'M-H5',
47
49
  sourceValue: global.info.queryInfo?.sourceValue || 'Mshop',
48
50
  ...openAppParams,
49
51
  },
50
52
  },
51
53
  })
52
54
  }
53
55
  return !isWxMiniH5View && !isJdApp ? (
54
56
  <View
55
57
  className={mobileCommonHeaderStyle['d-mobile-header-layout']}
56
58
  style={style}
57
59
  >
58
60
  <View
59
61
  id="m_common_tip"
60
62
  className={mobileCommonHeaderStyle['d-mobile-common-tip']}
61
63
  />
62
64
  {hasCommonHeader && (
63
65
  <View
64
66
  id="m_common_header"
65
67
  className={mobileCommonHeaderStyle['d-mobile-common-header']}
66
68
  />
67
69
  )}
68
70
  </View>
69
71
  ) : null
70
72
  title: '店铺',
71
73
  openAppParams: {},
@@ -1 +1 @@
1
- import { NETWORK_DATA_TYPE } from '../../../common/const'
2
1
  [NETWORK_DATA_TYPE.NO_NET_WORK]: '网络连接已断开',
3
2
  [NETWORK_DATA_TYPE.DATA_ERROR]: '数据加载失败',
4
3
  [NETWORK_DATA_TYPE.NO_DATA]: '你访问的内容飞到太空了',
5
4
  [NETWORK_DATA_TYPE.RISK]: '活动太火爆',
6
5
  [NETWORK_DATA_TYPE.NO_NET_WORK]: '请检查您的网络设置',
7
6
  [NETWORK_DATA_TYPE.DATA_ERROR]: '请稍后重试',
8
7
  [NETWORK_DATA_TYPE.NO_DATA]: '',
9
8
  [NETWORK_DATA_TYPE.RISK]: '页面加载失败,请稍后再试',
10
9
  NETWORK_DATA_TYPE.NO_NET_WORK,
11
10
  NETWORK_DATA_TYPE.DATA_ERROR,
12
11
  NETWORK_DATA_TYPE.NO_DATA,
13
12
  NETWORK_DATA_TYPE.RISK,
14
13
  No_Data_Bmall:'no-data-bmall',
14
+ import { NETWORK_DATA_TYPE } from '../../../common/const'
15
15
  [NETWORK_DATA_TYPE.NO_NET_WORK]: '网络连接已断开',
16
16
  [NETWORK_DATA_TYPE.DATA_ERROR]: '数据加载失败',
17
17
  [NETWORK_DATA_TYPE.NO_DATA]: '你访问的内容飞到太空了',
18
18
  [NETWORK_DATA_TYPE.RISK]: '活动太火爆',
19
19
  [NETWORK_DATA_TYPE.NO_NET_WORK]: '请检查您的网络设置',
20
20
  [NETWORK_DATA_TYPE.DATA_ERROR]: '请稍后重试',
21
21
  [NETWORK_DATA_TYPE.NO_DATA]: '',
22
22
  [NETWORK_DATA_TYPE.RISK]: '页面加载失败,请稍后再试',
23
23
  NETWORK_DATA_TYPE.NO_NET_WORK,
24
24
  NETWORK_DATA_TYPE.DATA_ERROR,
25
25
  NETWORK_DATA_TYPE.NO_DATA,
26
26
  NETWORK_DATA_TYPE.RISK,
27
27
  No_Data_Bmall:'no-data-bmall',
@@ -50,6 +50,10 @@
50
50
  .d-no-data-tip-1 {
51
51
  background-image: url('https://img14.360buyimg.com/imagetools/jfs/t1/152550/40/8432/21643/5fc9cae0E5391a506/523da679188ff687.png');
52
52
  }
53
+
54
+ .d-no-data-tip-2 {
55
+ background-image: url('https://img11.360buyimg.com/imagetools/jfs/t1/142705/35/17776/5911/5fd1e62dE4fbc2300/3ee1d4160db1dac6.png');
56
+ }
53
57
  .d-no-network-err-tip {
54
58
  background-image: url('https://img14.360buyimg.com/imagetools/jfs/t1/146556/1/17745/7493/5fd1e62dE86e86669/96f5c91befa8e991.png');
55
59
  }
@@ -1 +1 @@
1
- import { Button, View } from '@tarojs/components'
2
1
  NetWorkErrorSubTip,
3
2
  subMessage,
4
3
  backgroundColorWhite,
5
4
  const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
6
5
  const useErrorSubTip = subMessage? subMessage: NetWorkErrorSubTip[netWorkDataType]
7
6
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
8
7
  const maxHeight = latestRes.displayHeight || 546
9
8
  style={{maxHeight: isMemberPage ? '100vh' : maxHeight}}
10
9
  {useErrorSubTip? <View className={netWorkErrorStyle['d-error-sub-tip']}>{useErrorSubTip}</View>: null}
11
10
  <Button
12
11
  onClick={refershInitData}
13
12
  className={classNames(
14
13
  netWorkErrorStyle['d-opt-btn'],
15
14
  'd-button-no-border',
16
15
  )}
17
16
  plain
18
17
  size="mini"
19
18
  >
20
19
  重新加载
21
20
  </Button>
22
21
  )}
23
22
  subMessage: '',
23
+ import { Button, View } from '@tarojs/components'
24
24
  NetWorkErrorList,
25
25
  NetWorkErrorTip,
26
26
  NetWorkErrorSubTip,
27
27
  NetWorkShowType,
28
28
  NetWork_Image_Type,
29
29
  const {
30
30
  className,
31
31
  message,
32
32
  subMessage,
33
33
  btnLabel,
34
34
  backgroundColorWhite,
35
35
  netWorkDataType,
36
36
  netWorkShowType,
37
37
  netWorkImageType,
38
38
  refreshCallBackFn,
39
39
  viewMaxHeight
40
40
  } = props
41
41
  const refershInitData = useCallback(() => {
42
42
  refreshCallBackFn && refreshCallBackFn(true)
43
43
  }, [])
44
44
  const useErrorTip = message != '' ? message : NetWorkErrorTip[netWorkDataType]
45
45
  const useErrorSubTip = subMessage
46
46
  ? subMessage
47
47
  : NetWorkErrorSubTip[netWorkDataType]
48
48
  const latestRes = latestFromNativeMsgStorage[TaroEventType.PAGE_SCROLL] || {}
49
49
  const maxHeight = latestRes.displayHeight || 546
50
50
  return NetWorkErrorList.includes(netWorkDataType as NETWORK_DATA_TYPE) ? (
51
51
  <View
52
52
  style={{ maxHeight: viewMaxHeight !== '' ? viewMaxHeight : isMemberPage ? '100vh' : maxHeight }}
53
53
  className={classNames(
54
54
  netWorkErrorStyle['d-shop-network'],
55
55
  {
56
56
  [netWorkErrorStyle['d-shop-network-white']]: backgroundColorWhite,
57
57
  },
58
58
  {
59
59
  [netWorkErrorStyle['d-shop-network-part']]:
60
60
  netWorkShowType === NetWorkShowType.PART,
61
61
  },
62
62
  {
63
63
  [netWorkErrorStyle['d-network-jd-shop-view']]: isH5AndJdShopView,
64
64
  },
65
65
  'flexible-center-box',
66
66
  className,
67
67
  )}
68
68
  >
69
69
  <View className={classNames(netWorkErrorStyle['d-error-content'],'d-error-content')}>
70
70
  <View
71
71
  className={classNames(
72
72
  netWorkErrorStyle['d-error-type'],
73
73
  netWorkErrorStyle[`d-${netWorkDataType}`],
74
74
  netWorkErrorStyle[`d-${netWorkImageType}`],
75
75
  'd-error-type'
76
76
  )}
77
77
  />
78
78
  <View className={classNames(netWorkErrorStyle['d-error-tip'],'d-error-tip')}>
79
79
  {useErrorTip}
80
80
  </View>
81
81
  {useErrorSubTip ? <View className={classNames(netWorkErrorStyle['d-error-sub-tip'],'d-error-sub-tip')}>{useErrorSubTip}</View> : null}
82
82
  <View className={'flexible-horizontal-center-box'}>
83
83
  {refreshCallBackFn && (
84
84
  <Button
85
85
  onClick={refershInitData}
86
86
  className={classNames(
87
87
  netWorkErrorStyle['d-opt-btn'],
88
88
  'd-button-no-border',
89
89
  'd-opt-btn'
90
90
  )}
91
91
  plain
92
92
  size="mini"
93
93
  >
94
94
  {btnLabel}
95
95
  </Button>
96
96
  )}
97
97
  </View>
98
98
  </View>
99
99
  </View>
100
100
  ) : null
101
101
  className: '',
102
102
  message: '',
103
103
  subMessage: '',
104
104
  btnLabel: '重新加载',
105
105
  backgroundColorWhite: false,
106
106
  netWorkDataType: NETWORK_DATA_TYPE.NORMAL,
107
107
  netWorkImageType: NetWork_Image_Type.No_Data_Default_Tip,
108
108
  netWorkShowType: NetWorkShowType.FULL,
109
109
  refreshCallBackFn: null,
110
110
  viewMaxHeight: ''