@conecli/cone-render 0.10.1-shop3.8 → 0.10.1-shop3.80

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