@conecli/cone-render 0.10.1-beta.5 → 0.10.1-beta.6

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 (57) 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 -1
  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/pageType.ts +1 -1
  9. package/dist/common/sgmCustomCode.ts +1 -1
  10. package/dist/components/base/CountDown/index.module.scss +49 -44
  11. package/dist/components/base/CountDown/index.tsx +1 -1
  12. package/dist/components/base/CustomVideo/common.ts +1 -0
  13. package/dist/components/base/CustomVideo/index.tsx +1 -1
  14. package/dist/components/base/LazyLoadImage/index.h5.module.scss +11 -6
  15. package/dist/components/base/LazyLoadImage/index.h5.tsx +1 -1
  16. package/dist/components/base/Price/Base/index.tsx +1 -1
  17. package/dist/components/base/Price/Double/index.module.scss +8 -0
  18. package/dist/components/base/Price/Double/index.tsx +1 -1
  19. package/dist/components/floorItem.tsx +1 -1
  20. package/dist/components/isv/Floor/index.tsx +1 -1
  21. package/dist/interface/component.ts +1 -1
  22. package/dist/interface/jumpEventReport.ts +1 -1
  23. package/dist/interface/service.ts +1 -1
  24. package/dist/jumpEventReport/base.ts +1 -1
  25. package/dist/jumpEventReport/index.jd.ts +1 -1
  26. package/dist/jumpEventReport/index.weapp.ts +1 -1
  27. package/dist/jumpEventReport/jdJumpJdApp.ts +1 -1
  28. package/dist/jumpEventReport/jumpUrlConfig/base.ts +1 -1
  29. package/dist/jumpEventReport/logEventConfig.ts +1 -1
  30. package/dist/jumpEventReport/web.base.ts +1 -1
  31. package/dist/jumpEventReport/web.jd.ts +1 -1
  32. package/dist/jumpEventReport/web.jdb.ts +1 -1
  33. package/dist/jumpEventReport/web.jdjch.ts +1 -1
  34. package/dist/jumpEventReport/web.jxwxapp.ts +1 -1
  35. package/dist/jumpEventReport/web.pc.ts +1 -1
  36. package/dist/jumpEventReport/web.tjapp.ts +1 -1
  37. package/dist/jumpEventReport/web.tjm.ts +1 -1
  38. package/dist/jumpEventReport/web.wxapp.ts +1 -1
  39. package/dist/modules/ContainerFloorList/index.h5.tsx +1 -1
  40. package/dist/modules/ContainerFloorList/index.tsx +1 -1
  41. package/dist/open/api/util.ts +1 -1
  42. package/dist/sass/base.scss +142 -141
  43. package/dist/service/fetchGateway.ts +1 -1
  44. package/dist/service/http/colorSign.ts +1 -1
  45. package/dist/service/http/h5Http.ts +1 -0
  46. package/dist/service/http/index.h5.ts +1 -0
  47. package/dist/service/requestServer.h5.ts +1 -0
  48. package/dist/service/requestServer.ts +1 -1
  49. package/dist/utils/connectNativeJsBridge.ts +1 -1
  50. package/dist/utils/connectNativeJsBridge.weapp.ts +1 -1
  51. package/dist/utils/h5Utils.ts +1 -1
  52. package/dist/utils/index.h5.ts +1 -1
  53. package/dist/utils/index.ts +1 -1
  54. package/dist/utils/index.weapp.ts +1 -1
  55. package/dist/utils/utils.ts +1 -1
  56. package/package.json +35 -29
  57. package/dist/utils/memberFormatUtils.js +0 -1
@@ -1 +1 @@
1
- import Taro from '@tarojs/taro'
2
1
  NETWORK_DATA_TYPE,
3
2
  TaroEventType,
4
3
  MINI_APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
5
4
  SHOP_TAB_CONTENT_BOTTOM,
6
5
  listData,
7
6
  num = LOAD_FLOOR_BATCH_NUM,
8
7
  let thisListData: ComponentInterFace.ContainerItemData[] | [] =
9
8
  listData.slice(0)
10
9
  const thisListDataLen = thisListData.length
11
10
  const res: any[] = []
12
11
  if (thisListDataLen) {
13
12
  if (thisListDataLen < num) {
14
13
  res.push(thisListData)
15
14
  } else {
16
15
  while (thisListData.length) {
17
16
  if (thisListData.length >= num) {
18
17
  res.push(thisListData.splice(0, num))
19
18
  } else {
20
19
  res.push(thisListData)
21
20
  thisListData = []
22
21
  }
23
22
  }
24
23
  }
25
24
  }
26
25
  return res
27
26
  containerFloorListData: ComponentInterFace.ContainerItemData[]
28
27
  className?: string
29
28
  sectionType?: string
30
29
  style?: object
31
30
  hasGoodsFeeds?: boolean
32
31
  miniScrollSelf?: boolean
33
32
  tabContentShowState?: boolean
34
33
  loadingEndComponentFn?: Function
35
34
  updateShopFloorDataFn?: Function
36
35
  builtInComponents?: Object
37
36
  changeScrollToLowerStateFn: Function | null
38
37
  changeLayoutScrollToTopFn?: Function
39
38
  triggerMiniLoadProductWithFilterFn?: Function
40
39
  const { windowHeight, actualNavBarHeight } = taroJdBaseInfo.info.sysInfo
41
40
  const {
42
41
  className,
43
42
  style,
44
43
  loadingEndComponentFn,
45
44
  hasGoodsFeeds,
46
45
  sectionType,
47
46
  tabContentShowState,
48
47
  containerFloorListData,
49
48
  updateShopFloorDataFn,
50
49
  changeScrollToLowerStateFn,
51
50
  changeLayoutScrollToTopFn,
52
51
  triggerMiniLoadProductWithFilterFn,
53
52
  builtInComponents,
54
53
  miniScrollSelf = false,
55
54
  } = props
56
55
  const [containerFloorListScrollTop, setContainerFloorListScrollTop] =
57
56
  useState(0)
58
57
  const loadMoreContainerFloorListDataRef = useRef({
59
58
  needFirstLoadState: true,
60
59
  loadingState: false,
61
60
  })
62
61
  const isFuncForChangeScrollToLowerStateFn =
63
62
  typeof changeScrollToLowerStateFn == 'function'
64
63
  const loadSectionTypeContainerFloorListRef = useRef<{
65
64
  [key: string]: ComponentInterFace.MiniLoadFloorListRef
66
65
  }>({
67
66
  [`${sectionType}`]: {
68
67
  index: 1,
69
68
  itemNum: 0,
70
69
  list: [],
71
70
  loadList: [],
72
71
  max: 1,
73
72
  },
74
73
  })
75
74
  const [containerFloorList, setContainerFloorList] = useState<
76
75
  ComponentInterFace.ContainerItemData[]
77
76
  >(() => {
78
77
 
79
78
  const getLoadDataArr = containerFloorListDataSpliceToPromise(
80
79
  containerFloorListData,
81
80
  )
82
81
  const getThisSectionTypeListData =
83
82
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
84
83
  getThisSectionTypeListData.list = getLoadDataArr
85
84
  getThisSectionTypeListData.itemNum = containerFloorListData.length
86
85
  getThisSectionTypeListData.max = getLoadDataArr.length
87
86
  console.log('获取加载数据总数据----' + sectionType, getLoadDataArr)
88
87
  const getThisLoadList = getLoadDataArr.shift()
89
88
  if (getThisLoadList) {
90
89
  getThisSectionTypeListData.loadList = getThisLoadList
91
90
  return getThisLoadList
92
91
  } else {
93
92
  return []
94
93
  }
95
94
  })
96
95
  useEffect(() => {
97
96
  if (containerFloorList.length > 0) {
98
97
  Taro.nextTick(() => {
99
98
  const getThisSectionTypeListData =
100
99
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
101
100
  console.log(
102
101
  `加载${sectionType}中第${getThisSectionTypeListData.index}批次${LOAD_FLOOR_BATCH_NUM}个模块完毕,共计${getThisSectionTypeListData.max}轮,楼层总计${getThisSectionTypeListData.itemNum}`,
103
102
  )
104
103
  loadMoreContainerFloorListDataRef.current.needFirstLoadState &&
105
104
  checkLoadFloorListLoadState().then((needLoadState) => {
106
105
  console.log('检查是否需要继续加载状态', needLoadState)
107
106
  if (needLoadState) {
108
107
  const getThisLoadList = getThisSectionTypeListData.list.shift()
109
108
  if (getThisLoadList) {
110
109
  getThisSectionTypeListData.index++
111
110
  const changeContainerList: ComponentInterFace.ContainerItemData[] =
112
111
  [...getThisSectionTypeListData.loadList, ...getThisLoadList]
113
112
  getThisSectionTypeListData.loadList = changeContainerList
114
113
  setContainerFloorList(changeContainerList)
115
114
  } else {
116
115
  Taro.hideLoading()
117
116
  loadMoreContainerFloorListDataRef.current.needFirstLoadState =
118
117
  false
119
118
  }
120
119
  } else {
121
120
  Taro.hideLoading()
122
121
  loadMoreContainerFloorListDataRef.current.needFirstLoadState =
123
122
  false
124
123
  }
125
124
  })
126
125
  })
127
126
  }
128
127
  }, [containerFloorList])
129
128
 
130
129
  const checkLoadFloorListLoadState = () => {
131
130
  return new Promise((resolve) => {
132
131
  Taro.createSelectorQuery()
133
132
  .select('#J_shopContainerFloorList')
134
133
  .boundingClientRect(function (rect) {
135
134
  if (rect) {
136
135
  if (rect.height && rect.height < windowHeight + 100) {
137
136
  resolve(true)
138
137
  } else {
139
138
  resolve(false)
140
139
  }
141
140
  } else {
142
141
  resolve(true)
143
142
  }
144
143
  })
145
144
  .exec()
146
145
  })
147
146
  }
148
147
 
149
148
  const loadMoreContainerFloorList = (evt: any = false) => {
150
149
  const getThisSectionTypeListData =
151
150
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
152
151
  if (
153
152
  !loadMoreContainerFloorListDataRef.current.loadingState &&
154
153
  getThisSectionTypeListData.list.length > 0
155
154
  ) {
156
155
  loadMoreContainerFloorListDataRef.current.loadingState = true
157
156
  getThisSectionTypeListData.index++
158
157
  console.log(
159
158
  `当前即将加载${sectionType}中第${getThisSectionTypeListData.index}轮`,
160
159
  )
161
160
  const getThisLoadList = getThisSectionTypeListData.list.shift()
162
161
  if (getThisLoadList) {
163
162
  const changeFloorList = [
164
163
  ...getThisSectionTypeListData.loadList,
165
164
  ...getThisLoadList,
166
165
  ]
167
166
  getThisSectionTypeListData.loadList = changeFloorList
168
167
  loadMoreContainerFloorListDataRef.current.loadingState = false
169
168
  isFuncForChangeScrollToLowerStateFn && changeScrollToLowerStateFn(false)
170
169
  setContainerFloorList(changeFloorList)
171
170
  Taro.nextTick(() => {
172
171
  if (getThisSectionTypeListData.list.length == 0) {
173
172
  typeof triggerMiniLoadProductWithFilterFn == 'function' &&
174
173
  triggerMiniLoadProductWithFilterFn()
175
174
  }
176
175
  })
177
176
  } else {
178
177
  isFuncForChangeScrollToLowerStateFn && changeScrollToLowerStateFn(false)
179
178
  }
180
179
  }
181
180
  if (
182
181
  miniScrollSelf &&
183
182
  evt &&
184
183
  !loadMoreContainerFloorListDataRef.current.loadingState &&
185
184
  getThisSectionTypeListData.index >= getThisSectionTypeListData.max
186
185
  ) {
187
186
  pageScrollToLower(evt)
188
187
  }
189
188
  }
190
189
  useEffect(() => {
191
190
  if (!miniScrollSelf) {
192
191
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL_END, (tabActiveType) => {
193
192
  if (tabActiveType == sectionType && tabContentShowState) {
194
193
  loadMoreContainerFloorList()
195
194
  }
196
195
  })
197
196
  }
198
197
  }, [])
199
198
  const pageScrollToLower = useCallback((evt) => {
200
199
  console.log('触发滚动底部位置', evt.detail)
201
200
  Taro.eventCenter.trigger(TaroEventType.PAGE_SCROLL_END)
202
201
  }, [])
203
202
 
204
203
  const onScrollRecord = (event) => {
205
204
  const { detail } = event
206
205
  if (detail) {
207
206
  taroJdBaseInfo.info.pageInfo.miniScrollInfo = detail
208
207
  }
209
208
  }
210
209
  const renderFloorItem = useCallback(
211
210
  (item, floorItem, floorIndex, containerLayoutLeftRightMargin) => {
212
211
  return (
213
212
  <View
214
213
  className={classNames(shopContainerListStyle['d-floor-item'])}
215
214
  id={`J_floor_${floorItem?.uid}`}
216
215
  key={floorItem.uid}
217
216
  data-floor-uid={floorItem?.uid}
218
217
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
219
218
  >
220
219
  <FloorListItem
221
220
  floorIndex={floorIndex}
222
221
  floorData={floorItem}
223
222
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
224
223
  containerBorderRadius={item?.borderRadius || 0}
225
224
  updateShopFloorDataFn={updateShopFloorDataFn}
226
225
  loadingEndComponentFn={loadingEndComponentFn}
227
226
  changeScrollToLowerStateFn={changeScrollToLowerStateFn}
228
227
  key={floorItem.uid}
229
228
  changeScrollTopFn={changeContainerFloorListScrollTop}
230
229
  builtInComponents={builtInComponents}
231
230
  />
232
231
  </View>
233
232
  )
234
233
  },
235
234
  [],
236
235
  )
237
236
  const changeContainerFloorListScrollTop = (top) => {
238
237
  if (miniScrollSelf) {
239
238
  setContainerFloorListScrollTop(top)
240
239
  } else {
241
240
  typeof changeLayoutScrollToTopFn == 'function' &&
242
241
  changeLayoutScrollToTopFn(top)
243
242
  }
244
243
  }
245
244
  const renderContainerList = () => {
246
245
  const listNum = containerFloorList.length || 0
247
246
  const getThisSectionTypeListData =
248
247
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
249
248
  return (
250
249
  <View id="J_shopContainerFloorList">
251
250
  {containerFloorListData && containerFloorListData.length > 0 ? (
252
251
  listNum > 0 && (
253
252
  <>
254
253
  {containerFloorList.map((item) => {
255
254
  const containerLayoutLeftRightMargin =
256
255
  (item.marginLeft || 0) + (item.marginRight || 0)
257
256
  const getContainerId = `J_container_${item.containerId}`
258
257
  const getContainerStyle = {
259
258
  marginBottom: item.marginBottom
260
259
  ? `${item.marginBottom}px`
261
260
  : 0,
262
261
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
263
262
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
264
263
  marginRight: item.marginRight ? `${item.marginRight}px` : 0,
265
264
  borderRadius: item.borderRadius
266
265
  ? `${item.borderRadius}px`
267
266
  : 0,
268
267
  }
269
268
  item.borderTopLeftRadius &&
270
269
  (getContainerStyle['borderTopLeftRadius'] =
271
270
  `${item.borderTopLeftRadius}px`)
272
271
  item.borderTopRightRadius &&
273
272
  (getContainerStyle['borderTopRightRadius'] =
274
273
  `${item.borderTopRightRadius}px`)
275
274
  item.borderBottomLeftRadius &&
276
275
  (getContainerStyle['borderBottomLeftRadius'] =
277
276
  `${item.borderBottomLeftRadius}px`)
278
277
  item.borderBottomRightRadius &&
279
278
  (getContainerStyle['borderBottomRightRadius'] =
280
279
  `${item.borderBottomRightRadius}px`)
281
280
  return (
282
281
  <View
283
282
  className={shopContainerListStyle['d-container-item']}
284
283
  id={getContainerId}
285
284
  key={item.containerId + item.key}
286
285
  style={getContainerStyle}
287
286
  >
288
287
  {item.floors.length > 0 && (
289
288
  <>
290
289
  {item.floors?.map((floorItem, floorIndex) => {
291
290
  return renderFloorItem(
292
291
  item,
293
292
  floorItem,
294
293
  floorIndex,
295
294
  containerLayoutLeftRightMargin,
296
295
  )
297
296
  })}
298
297
  </>
299
298
  )}
300
299
  </View>
301
300
  )
302
301
  })}
303
302
  {getThisSectionTypeListData.index <
304
303
  getThisSectionTypeListData.max && (
305
304
  <JdLoading localState={true} text="加载中..." />
306
305
  )}
307
306
  {!hasGoodsFeeds &&
308
307
  getThisSectionTypeListData.index >=
309
308
  getThisSectionTypeListData.max &&
310
309
  loadingEndComponentFn &&
311
310
  loadingEndComponentFn()}
312
311
  </>
313
312
  )
314
313
  ) : (
315
314
  <View
316
315
  className={shopContainerListStyle['d-container-list-no-data']}
317
316
  style={{
318
317
  height: `${
319
318
  windowHeight -
320
319
  actualNavBarHeight -
321
320
  MINI_APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT +
322
321
  SHOP_TAB_CONTENT_BOTTOM
323
322
  }px`,
324
323
  }}
325
324
  >
326
325
  <NetworkDataError
327
326
  netWorkShowType={NetWorkShowType.PART}
328
327
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
329
328
  refreshCallBackFn={updateShopFloorDataFn}
330
329
  />
331
330
  </View>
332
331
  )}
333
332
  </View>
334
333
  )
335
334
  }
336
335
  return miniScrollSelf ? (
337
336
  <ScrollView
338
337
  scrollY
339
338
  scrollTop={containerFloorListScrollTop}
340
339
  className={classNames(
341
340
  className,
342
341
  shopContainerListStyle['d-shop-container-list'],
343
342
  )}
344
343
  onScroll={onScrollRecord}
345
344
  lowerThreshold={windowHeight / 2}
346
345
  onScrollToLower={loadMoreContainerFloorList}
347
346
  style={style}
348
347
  >
349
348
  {tabContentShowState && renderContainerList()}
350
349
  </ScrollView>
351
350
  ) : (
352
351
  <View
353
352
  className={classNames(
354
353
  className,
355
354
  shopContainerListStyle['d-shop-container-list'],
356
355
  )}
357
356
  style={style}
358
357
  >
359
358
  {tabContentShowState && renderContainerList()}
360
359
  </View>
361
360
  )
361
+ import Taro from '@tarojs/taro'
362
362
  NETWORK_DATA_TYPE,
363
363
  TaroEventType,
364
364
  MINI_APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
365
365
  SHOP_TAB_CONTENT_BOTTOM,
366
366
  listData,
367
367
  num = LOAD_FLOOR_BATCH_NUM,
368
368
  let thisListData: ComponentInterFace.ContainerItemData[] | [] =
369
369
  listData.slice(0)
370
370
  const thisListDataLen = thisListData.length
371
371
  const res: any[] = []
372
372
  if (thisListDataLen) {
373
373
  if (thisListDataLen < num) {
374
374
  res.push(thisListData)
375
375
  } else {
376
376
  while (thisListData.length) {
377
377
  if (thisListData.length >= num) {
378
378
  res.push(thisListData.splice(0, num))
379
379
  } else {
380
380
  res.push(thisListData)
381
381
  thisListData = []
382
382
  }
383
383
  }
384
384
  }
385
385
  }
386
386
  return res
387
387
  containerFloorListData: ComponentInterFace.ContainerItemData[]
388
388
  className?: string
389
389
  sectionType?: string
390
390
  style?: object
391
391
  hasGoodsFeeds?: boolean
392
392
  miniScrollSelf?: boolean
393
393
  tabContentShowState?: boolean
394
394
  loadingEndComponentFn?: Function
395
395
  updateShopFloorDataFn?: Function
396
396
  builtInComponents?: Object
397
397
  changeScrollToLowerStateFn: Function | null
398
398
  changeLayoutScrollToTopFn?: Function
399
399
  triggerMiniLoadProductWithFilterFn?: Function
400
400
  const { windowHeight, actualNavBarHeight } = taroJdBaseInfo.info.sysInfo
401
401
  const {
402
402
  className,
403
403
  style,
404
404
  loadingEndComponentFn,
405
405
  hasGoodsFeeds,
406
406
  sectionType,
407
407
  tabContentShowState,
408
408
  containerFloorListData,
409
409
  updateShopFloorDataFn,
410
410
  changeScrollToLowerStateFn,
411
411
  changeLayoutScrollToTopFn,
412
412
  triggerMiniLoadProductWithFilterFn,
413
413
  builtInComponents,
414
414
  miniScrollSelf = false,
415
415
  } = props
416
416
  const [containerFloorListScrollTop, setContainerFloorListScrollTop] =
417
417
  useState(0)
418
418
  const loadMoreContainerFloorListDataRef = useRef({
419
419
  needFirstLoadState: true,
420
420
  loadingState: false,
421
421
  })
422
422
  const isFuncForChangeScrollToLowerStateFn =
423
423
  typeof changeScrollToLowerStateFn == 'function'
424
424
  const loadSectionTypeContainerFloorListRef = useRef<{
425
425
  [key: string]: ComponentInterFace.MiniLoadFloorListRef
426
426
  }>({
427
427
  [`${sectionType}`]: {
428
428
  index: 1,
429
429
  itemNum: 0,
430
430
  list: [],
431
431
  loadList: [],
432
432
  max: 1,
433
433
  },
434
434
  })
435
435
  const [containerFloorList, setContainerFloorList] = useState<
436
436
  ComponentInterFace.ContainerItemData[]
437
437
  >(() => {
438
438
 
439
439
  const getLoadDataArr = containerFloorListDataSpliceToPromise(
440
440
  containerFloorListData,
441
441
  )
442
442
  const getThisSectionTypeListData =
443
443
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
444
444
  getThisSectionTypeListData.list = getLoadDataArr
445
445
  getThisSectionTypeListData.itemNum = containerFloorListData.length
446
446
  getThisSectionTypeListData.max = getLoadDataArr.length
447
447
  console.log('获取加载数据总数据----' + sectionType, getLoadDataArr)
448
448
  const getThisLoadList = getLoadDataArr.shift()
449
449
  if (getThisLoadList) {
450
450
  getThisSectionTypeListData.loadList = getThisLoadList
451
451
  return getThisLoadList
452
452
  } else {
453
453
  return []
454
454
  }
455
455
  })
456
456
  useEffect(() => {
457
457
  if (containerFloorList.length > 0) {
458
458
  Taro.nextTick(() => {
459
459
  const getThisSectionTypeListData =
460
460
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
461
461
  console.log(
462
462
  `加载${sectionType}中第${getThisSectionTypeListData.index}批次${LOAD_FLOOR_BATCH_NUM}个模块完毕,共计${getThisSectionTypeListData.max}轮,楼层总计${getThisSectionTypeListData.itemNum}`,
463
463
  )
464
464
  loadMoreContainerFloorListDataRef.current.needFirstLoadState &&
465
465
  checkLoadFloorListLoadState().then((needLoadState) => {
466
466
  console.log('检查是否需要继续加载状态', needLoadState)
467
467
  if (needLoadState) {
468
468
  const getThisLoadList = getThisSectionTypeListData.list.shift()
469
469
  if (getThisLoadList) {
470
470
  getThisSectionTypeListData.index++
471
471
  const changeContainerList: ComponentInterFace.ContainerItemData[] =
472
472
  [...getThisSectionTypeListData.loadList, ...getThisLoadList]
473
473
  getThisSectionTypeListData.loadList = changeContainerList
474
474
  setContainerFloorList(changeContainerList)
475
475
  } else {
476
476
  Taro.hideLoading()
477
477
  loadMoreContainerFloorListDataRef.current.needFirstLoadState =
478
478
  false
479
479
  }
480
480
  } else {
481
481
  Taro.hideLoading()
482
482
  loadMoreContainerFloorListDataRef.current.needFirstLoadState =
483
483
  false
484
484
  }
485
485
  })
486
486
  })
487
487
  }
488
488
  }, [containerFloorList])
489
489
 
490
490
  const checkLoadFloorListLoadState = () => {
491
491
  return new Promise((resolve) => {
492
492
  Taro.createSelectorQuery()
493
493
  .select('#J_shopContainerFloorList')
494
494
  .boundingClientRect(function (rect) {
495
495
  if (rect) {
496
496
  if (rect.height && rect.height < windowHeight + 100) {
497
497
  resolve(true)
498
498
  } else {
499
499
  resolve(false)
500
500
  }
501
501
  } else {
502
502
  resolve(true)
503
503
  }
504
504
  })
505
505
  .exec()
506
506
  })
507
507
  }
508
508
 
509
509
  const loadMoreContainerFloorList = (evt: any = false) => {
510
510
  const getThisSectionTypeListData =
511
511
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
512
512
  if (
513
513
  !loadMoreContainerFloorListDataRef.current.loadingState &&
514
514
  getThisSectionTypeListData.list.length > 0
515
515
  ) {
516
516
  loadMoreContainerFloorListDataRef.current.loadingState = true
517
517
  getThisSectionTypeListData.index++
518
518
  console.log(
519
519
  `当前即将加载${sectionType}中第${getThisSectionTypeListData.index}轮`,
520
520
  )
521
521
  const getThisLoadList = getThisSectionTypeListData.list.shift()
522
522
  if (getThisLoadList) {
523
523
  const changeFloorList = [
524
524
  ...getThisSectionTypeListData.loadList,
525
525
  ...getThisLoadList,
526
526
  ]
527
527
  getThisSectionTypeListData.loadList = changeFloorList
528
528
  loadMoreContainerFloorListDataRef.current.loadingState = false
529
529
  isFuncForChangeScrollToLowerStateFn && changeScrollToLowerStateFn(false)
530
530
  setContainerFloorList(changeFloorList)
531
531
  Taro.nextTick(() => {
532
532
  if (getThisSectionTypeListData.list.length == 0) {
533
533
  typeof triggerMiniLoadProductWithFilterFn == 'function' &&
534
534
  triggerMiniLoadProductWithFilterFn()
535
535
  }
536
536
  })
537
537
  } else {
538
538
  isFuncForChangeScrollToLowerStateFn && changeScrollToLowerStateFn(false)
539
539
  }
540
540
  }
541
541
  if (
542
542
  miniScrollSelf &&
543
543
  evt &&
544
544
  !loadMoreContainerFloorListDataRef.current.loadingState &&
545
545
  getThisSectionTypeListData.index >= getThisSectionTypeListData.max
546
546
  ) {
547
547
  pageScrollToLower(evt)
548
548
  }
549
549
  }
550
550
  useEffect(() => {
551
551
  if (!miniScrollSelf) {
552
552
  Taro.eventCenter.on(TaroEventType.PAGE_SCROLL_END, (tabActiveType) => {
553
553
  if (tabActiveType == sectionType && tabContentShowState) {
554
554
  loadMoreContainerFloorList()
555
555
  }
556
556
  })
557
557
  }
558
558
  }, [])
559
559
  const pageScrollToLower = useCallback((evt) => {
560
560
  console.log('触发滚动底部位置', evt.detail)
561
561
  Taro.eventCenter.trigger(TaroEventType.PAGE_SCROLL_END)
562
562
  }, [])
563
563
 
564
564
  const onScrollRecord = (event) => {
565
565
  const { detail } = event
566
566
  if (detail) {
567
567
  taroJdBaseInfo.info.pageInfo.miniScrollInfo = detail
568
568
  }
569
569
  }
570
570
  const renderFloorItem = useCallback(
571
571
  (
572
572
  item,
573
573
  floorItem,
574
574
  floorIndex,
575
575
  containerLayoutLeftRightMargin,
576
576
  borderStyle,
577
577
  ) => {
578
578
  return (
579
579
  <View
580
580
  className={classNames(shopContainerListStyle['d-floor-item'])}
581
581
  id={`J_floor_${floorItem?.uid}`}
582
582
  key={floorItem.uid}
583
583
  data-floor-uid={floorItem?.uid}
584
584
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
585
585
  style={borderStyle}
586
586
  >
587
587
  <FloorListItem
588
588
  floorIndex={floorIndex}
589
589
  floorData={floorItem}
590
590
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
591
591
  containerBorderRadius={borderStyle}
592
592
  updateShopFloorDataFn={updateShopFloorDataFn}
593
593
  loadingEndComponentFn={loadingEndComponentFn}
594
594
  changeScrollToLowerStateFn={changeScrollToLowerStateFn}
595
595
  key={floorItem.uid}
596
596
  changeScrollTopFn={changeContainerFloorListScrollTop}
597
597
  builtInComponents={builtInComponents}
598
598
  />
599
599
  </View>
600
600
  )
601
601
  },
602
602
  [],
603
603
  )
604
604
  const changeContainerFloorListScrollTop = (top) => {
605
605
  if (miniScrollSelf) {
606
606
  setContainerFloorListScrollTop(top)
607
607
  } else {
608
608
  typeof changeLayoutScrollToTopFn == 'function' &&
609
609
  changeLayoutScrollToTopFn(top)
610
610
  }
611
611
  }
612
612
  const renderContainerList = () => {
613
613
  const listNum = containerFloorList.length || 0
614
614
  const getThisSectionTypeListData =
615
615
  loadSectionTypeContainerFloorListRef.current[`${sectionType}`]
616
616
  return (
617
617
  <View id="J_shopContainerFloorList">
618
618
  {containerFloorListData && containerFloorListData.length > 0 ? (
619
619
  listNum > 0 && (
620
620
  <>
621
621
  {containerFloorList.map((item, index) => {
622
622
  const containerLayoutLeftRightMargin =
623
623
  (item.marginLeft || 0) + (item.marginRight || 0)
624
624
  const getContainerId = `J_container_${item.containerId}`
625
625
  const borderStyle = getBorderStyle(
626
626
  item,
627
627
  index,
628
628
  containerFloorList,
629
629
  listNum,
630
630
  )
631
631
  if (index === listNum - 1) item.marginBottom = 8
632
632
  return (
633
633
  <View
634
634
  className={shopContainerListStyle['d-container-item']}
635
635
  id={getContainerId}
636
636
  key={item.containerId + item.key}
637
637
  style={{
638
638
  marginBottom: item.marginBottom
639
639
  ? `${item.marginBottom}px`
640
640
  : 0,
641
641
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
642
642
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
643
643
  marginRight: item.marginRight
644
644
  ? `${item.marginRight}px`
645
645
  : 0,
646
646
  borderTopLeftRadius:
647
647
  borderStyle?.borderTopLeftRadius || `0px`,
648
648
  borderTopRightRadius:
649
649
  borderStyle?.borderTopRightRadiu || `0px`,
650
650
  borderBottomLeftRadius:
651
651
  borderStyle?.borderBottomLeftRadius || `0px`,
652
652
  borderBottomRightRadius:
653
653
  borderStyle?.borderBottomRightRadius || `0px`,
654
654
  }}
655
655
  >
656
656
  {item.floors.length > 0 && (
657
657
  <>
658
658
  {item.floors?.map((floorItem, floorIndex) => {
659
659
  return renderFloorItem(
660
660
  item,
661
661
  floorItem,
662
662
  floorIndex,
663
663
  containerLayoutLeftRightMargin,
664
664
  borderStyle,
665
665
  )
666
666
  })}
667
667
  </>
668
668
  )}
669
669
  </View>
670
670
  )
671
671
  })}
672
672
  {getThisSectionTypeListData.index <
673
673
  getThisSectionTypeListData.max && (
674
674
  <JdLoading localState={true} text="加载中..." />
675
675
  )}
676
676
  {!hasGoodsFeeds &&
677
677
  getThisSectionTypeListData.index >=
678
678
  getThisSectionTypeListData.max &&
679
679
  loadingEndComponentFn &&
680
680
  loadingEndComponentFn()}
681
681
  </>
682
682
  )
683
683
  ) : (
684
684
  <View
685
685
  className={shopContainerListStyle['d-container-list-no-data']}
686
686
  style={{
687
687
  height: `${
688
688
  windowHeight -
689
689
  actualNavBarHeight -
690
690
  MINI_APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT +
691
691
  SHOP_TAB_CONTENT_BOTTOM
692
692
  }px`,
693
693
  }}
694
694
  >
695
695
  <NetworkDataError
696
696
  netWorkShowType={NetWorkShowType.PART}
697
697
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
698
698
  refreshCallBackFn={updateShopFloorDataFn}
699
699
  />
700
700
  </View>
701
701
  )}
702
702
  </View>
703
703
  )
704
704
  }
705
705
  return miniScrollSelf ? (
706
706
  <ScrollView
707
707
  scrollY
708
708
  scrollTop={containerFloorListScrollTop}
709
709
  className={classNames(
710
710
  className,
711
711
  shopContainerListStyle['d-shop-container-list'],
712
712
  )}
713
713
  onScroll={onScrollRecord}
714
714
  lowerThreshold={windowHeight / 2}
715
715
  onScrollToLower={loadMoreContainerFloorList}
716
716
  style={style}
717
717
  >
718
718
  {tabContentShowState && renderContainerList()}
719
719
  </ScrollView>
720
720
  ) : (
721
721
  <View
722
722
  className={classNames(
723
723
  className,
724
724
  shopContainerListStyle['d-shop-container-list'],
725
725
  )}
726
726
  style={style}
727
727
  >
728
728
  {tabContentShowState && renderContainerList()}
729
729
  </View>
730
730
  )