@conecli/cone-render 0.10.1-shop-beta.43 → 0.10.1-shop-beta.45

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.
@@ -1 +1 @@
1
- import React from 'react';
2
1
  NETWORK_DATA_TYPE,
3
2
  M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
4
3
  APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
5
4
  window.navigator.userAgent.includes('jdappPuppeteer') && window.loadPuppeteerPageLocalData;
6
5
  memberBaseInfo?: {
7
6
  shopId?: string;
8
7
  venderId?: string;
9
8
  channel?: string;
10
9
  venderType?: string;
11
10
  showDefaultModule?: boolean;
12
11
  customerLevel?: string;
13
12
  isUserForMember?: boolean;
14
13
  isLv0?: boolean;
15
14
  levelZeroMenuUrl?: string;
16
15
  totalRefresh?: functionType;
17
16
  callOpenCardPopPage?: functionType;
18
17
  };
19
18
  source?: string;
20
19
  containerFloorListData: ComponentInterFace.ContainerItemData[];
21
20
  extendInfoData?: object;
22
21
  className?: string;
23
22
  containerItemClass?: object;
24
23
  style?: object;
25
24
  hasGoodsFeeds?: boolean;
26
25
  builtInComponents?: object;
27
26
  loadingEndComponentFn?: functionType;
28
27
  sectionType?: string;
29
28
  updateShopFloorDataFn?: functionType;
30
29
  updateContainerFloorListDataFn?: functionType;
31
30
  refreshFloorListDataFn?: functionType;
32
31
  refreshFloorListDataBtnLabel?: string;
33
32
  customErrorIsvFloorModule?: React.ReactElement;
34
33
  componentExtend?: React.ReactElement;
35
34
  luxuryFixedIndex?: number;
36
35
  isContainerListHasMarginBottom?: boolean;
37
36
  switchConfig?: {
38
37
  [key: string]: any;
39
38
  };
40
39
  const { windowHeight, screenHeight } = taroJdBaseInfo.info.sysInfo;
41
40
  const {
42
41
  source,
43
42
  className,
44
43
  style,
45
44
  memberBaseInfo,
46
45
  containerItemClass = null,
47
46
  containerFloorListData,
48
47
  extendInfoData,
49
48
  builtInComponents,
50
49
  loadingEndComponentFn,
51
50
  sectionType,
52
51
  updateShopFloorDataFn,
53
52
  updateContainerFloorListDataFn,
54
53
  refreshFloorListDataFn,
55
54
  refreshFloorListDataBtnLabel,
56
55
  customErrorIsvFloorModule,
57
56
  luxuryFixedIndex = -1,
58
57
  isContainerListHasMarginBottom,
59
58
  switchConfig,
60
59
  } = props;
61
60
  const emptyFloorListHidden = switchConfig?.emptyFloorListHidden || false;
62
61
  const isSageShop = taroJdBaseInfo.info?.pageInfo?.isSageShop;
63
62
  const isHasMarginBottom = isContainerListHasMarginBottom ?? !isSageShop;
64
63
 
65
64
  const hasLiveForSageShop =
66
65
  isSageShop && taroJdBaseInfo.info?.pageInfo?.isJdShowNativeImmersivePlayer;
67
66
 
68
67
  const renderFloorItem = (
69
68
  item,
70
69
  floorItem,
71
70
  floorIndex,
72
71
  containerLayoutLeftRightMargin,
73
72
  lazyLoadState = false,
74
73
  index,
75
74
  borderStyle,
76
75
  ) => {
77
76
  return (
78
77
  <View
79
78
  className={classNames(shopContainerListStyle['d-floor-item'])}
80
79
  data-floor-uid={floorItem?.uid}
81
80
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
82
81
  data-lazy-load={lazyLoadState}
83
82
  key={floorItem.uid}
84
83
  id={`J_floor_${floorItem.uid}`}
85
84
  style={borderStyle}
86
85
  >
87
86
  {isChartH5 && (
88
87
  <View
89
88
  className={shopContainerListStyle['d-floor-chart-item']}
90
89
  id={`J_chart_floor_${floorItem?.uid}`}
91
90
  data-floor-uid={floorItem?.uid}
92
91
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
93
92
  />
94
93
  )}
95
94
  <FloorListItem
96
95
  memberBaseInfo={memberBaseInfo}
97
96
  source={source}
98
97
  floorIndex={floorIndex}
99
98
  floorData={floorItem}
100
99
  containerIndex={index}
101
100
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
102
101
  containerBorderRadius={borderStyle}
103
102
  updateShopFloorDataFn={updateShopFloorDataFn}
104
103
  loadingEndComponentFn={loadingEndComponentFn}
105
104
  extendInfoData={
106
105
  passExtendInfoModuleWhiteList.includes(floorItem?.floorExtInfo?.moduleFlag)
107
106
  ? extendInfoData
108
107
  : undefined
109
108
  }
110
109
  key={floorItem.uid}
111
110
  builtInComponents={builtInComponents}
112
111
  updateContainerFloorListDataFn={updateContainerFloorListDataFn}
113
112
  customErrorIsvFloorModule={customErrorIsvFloorModule}
114
113
  />
115
114
  {index === luxuryFixedIndex ? props.children : null}
116
115
  {floorItem?.inspectResult === '1' && (
117
116
  <View className={shopContainerListStyle['d-floor-inspect-mask']} />
118
117
  )}
119
118
  </View>
120
119
  );
121
120
  };
122
121
 
123
122
  const getFloorSetHeight = (item) => {
124
123
  const getHeight = item?.floorExtInfo?.floorHeight
125
124
  ? Number(item?.floorExtInfo?.floorHeight)
126
125
  : 200;
127
126
  return getHeight > 0 ? getHeight : 200;
128
127
  };
129
128
  const containerFloorListDataLen = containerFloorListData.length;
130
129
 
131
130
  const getNoDataContainerHeight = () => {
132
131
  const getWindowHeight = windowHeight > 10 ? windowHeight : screenHeight;
133
132
  const changeHeight = hasLiveForSageShop
134
133
  ? getWindowHeight
135
134
  : getWindowHeight -
136
135
  (isJdApp
137
136
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
138
137
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT);
139
138
  return {
140
139
  height: `${changeHeight}px`,
141
140
  };
142
141
  };
143
142
  return (
144
143
  <View
145
144
  id="J_shopContainerFloorList"
146
145
  className={classNames(
147
146
  className,
148
147
  shopContainerListStyle['d-shop-container-list'],
149
148
  isHasMarginBottom
150
149
  ? shopContainerListStyle['d-container-list-with-margin-bottom']
151
150
  : shopContainerListStyle['d-container-list-no-margin-bottom'],
152
151
  )}
153
152
  style={style}
154
153
  >
155
154
  {containerFloorListDataLen > 0 ? (
156
155
  <>
157
156
  {containerFloorListData.map((item, index) => {
158
157
  const containerLayoutLeftRightMargin = (item.marginLeft || 0) + (item.marginRight || 0);
159
158
  const getContainerId = `J_container_${item.containerId}`;
160
159
  const borderStyle = getBorderStyle(
161
160
  item,
162
161
  index,
163
162
  containerFloorListData,
164
163
  containerFloorListDataLen,
165
164
  );
166
165
  return (
167
166
  <React.Fragment key={item.containerId + index}>
168
167
  {item.addLuxuryStyle ? (
169
168
  <View className={shopContainerListStyle['d-luxury-header']} />
170
169
  ) : null}
171
170
  {item.addLuxuryBackupStyle ? (
172
171
  <View
173
172
  style={{
174
173
  height: taroJdBaseInfo?.info?.sysInfo?.jdNativeHeaderHeight + 'px',
175
174
  }}
176
175
  className={shopContainerListStyle['d-luxury-header-black']}
177
176
  />
178
177
  ) : null}
179
178
  {typeof item?.renderExtendComponent === 'function'
180
179
  ? item?.renderExtendComponent(item?.floorExtendData)
181
180
  : null}
182
181
  <View
183
182
  className={classNames(
184
183
  shopContainerListStyle['d-container-item'],
185
184
  containerItemClass,
186
185
  )}
187
186
  id={getContainerId}
188
187
  key={item.containerId}
189
188
  data-container-id={item?.containerId}
190
189
  data-container-type={item?.typeCode}
191
190
  data-container-index={index}
192
191
  style={{
193
192
  marginBottom: item.marginBottom ? `${item.marginBottom}px` : 0,
194
193
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
195
194
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
196
195
  marginRight: item.marginRight ? `${item.marginRight}px` : 0,
197
196
  borderTopLeftRadius: borderStyle?.borderTopLeftRadius || `0px`,
198
197
  borderTopRightRadius: borderStyle?.borderTopRightRadiu || `0px`,
199
198
  borderBottomLeftRadius: borderStyle?.borderBottomLeftRadius || `0px`,
200
199
  borderBottomRightRadius: borderStyle?.borderBottomRightRadius || `0px`,
201
200
  '--container-layout-left-right-margin': `${containerLayoutLeftRightMargin}px`,
202
201
  }}
203
202
  >
204
203
  {typeof item?.insertContainerStartComponent === 'function'
205
204
  ? item?.insertContainerStartComponent(item)
206
205
  : null}
207
206
  {item.floors &&
208
207
  item.floors.length > 0 &&
209
208
  item.floors?.map((floorItem, floorIndex) => {
210
209
  return index > lazyLoadStartIndex ? (
211
210
  <LazyLayoutLoad
212
211
  key={item.containerId}
213
212
  sectionType={sectionType}
214
213
  containerId={getContainerId}
215
214
  height={getFloorSetHeight(floorItem)}
216
215
  floorData={floorItem}
217
216
  >
218
217
  {renderFloorItem(
219
218
  item,
220
219
  floorItem,
221
220
  floorIndex,
222
221
  containerLayoutLeftRightMargin,
223
222
  true,
224
223
  index,
225
224
  borderStyle,
226
225
  )}
227
226
  </LazyLayoutLoad>
228
227
  ) : (
229
228
  renderFloorItem(
230
229
  item,
231
230
  floorItem,
232
231
  floorIndex,
233
232
  containerLayoutLeftRightMargin,
234
233
  false,
235
234
  index,
236
235
  borderStyle,
237
236
  )
238
237
  );
239
238
  })}
240
239
  </View>
241
240
  </React.Fragment>
242
241
  );
243
242
  })}
244
243
  </>
245
244
  ) : !emptyFloorListHidden ? (
246
245
  <View
247
246
  className={classNames(shopContainerListStyle['d-container-list-no-data'], {
248
247
  [shopContainerListStyle['d-sage-shop-no-data']]: hasLiveForSageShop,
249
248
  })}
250
249
  style={getNoDataContainerHeight()}
251
250
  >
252
251
  <NetworkDataError
253
252
  netWorkShowType={NetWorkShowType.PART}
254
253
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
255
254
  backgroundColorWhite={hasLiveForSageShop}
256
255
  refreshCallBackFn={refreshFloorListDataFn ? refreshFloorListDataFn : null}
257
256
  btnLabel={refreshFloorListDataBtnLabel || ''}
258
257
  />
259
258
  </View>
260
259
  ) : null}
261
260
  </View>
262
261
  );
263
262
  updateShopDataFn: null,
263
+ import React from 'react';
264
264
  NETWORK_DATA_TYPE,
265
265
  M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
266
266
  APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
267
267
  (window.navigator.userAgent.includes('jdappPuppeteer') && window?.loadPuppeteerPageLocalData) ||
268
268
  window.location.href.includes('loadMasterJsType=xingyun');
269
269
  memberBaseInfo?: {
270
270
  shopId?: string;
271
271
  venderId?: string;
272
272
  channel?: string;
273
273
  venderType?: string;
274
274
  showDefaultModule?: boolean;
275
275
  customerLevel?: string;
276
276
  isUserForMember?: boolean;
277
277
  isLv0?: boolean;
278
278
  levelZeroMenuUrl?: string;
279
279
  totalRefresh?: functionType;
280
280
  callOpenCardPopPage?: functionType;
281
281
  };
282
282
  source?: string;
283
283
  containerFloorListData: ComponentInterFace.ContainerItemData[];
284
284
  extendInfoData?: object;
285
285
  className?: string;
286
286
  containerItemClass?: object;
287
287
  style?: object;
288
288
  hasGoodsFeeds?: boolean;
289
289
  builtInComponents?: object;
290
290
  loadingEndComponentFn?: functionType;
291
291
  sectionType?: string;
292
292
  updateShopFloorDataFn?: functionType;
293
293
  updateContainerFloorListDataFn?: functionType;
294
294
  refreshFloorListDataFn?: functionType;
295
295
  refreshFloorListDataBtnLabel?: string;
296
296
  customErrorIsvFloorModule?: React.ReactElement;
297
297
  componentExtend?: React.ReactElement;
298
298
  luxuryFixedIndex?: number;
299
299
  isContainerListHasMarginBottom?: boolean;
300
300
  switchConfig?: {
301
301
  [key: string]: any;
302
302
  };
303
303
  containerFloorListPageInfo?: {
304
304
  hasNextPage: boolean;
305
305
  isByPage: boolean;
306
306
  };
307
307
  const { windowHeight, screenHeight } = taroJdBaseInfo.info.sysInfo;
308
308
  const {
309
309
  source,
310
310
  className,
311
311
  style,
312
312
  memberBaseInfo,
313
313
  containerItemClass = null,
314
314
  containerFloorListData,
315
315
  extendInfoData,
316
316
  builtInComponents,
317
317
  loadingEndComponentFn,
318
318
  sectionType,
319
319
  updateShopFloorDataFn,
320
320
  updateContainerFloorListDataFn,
321
321
  refreshFloorListDataFn,
322
322
  refreshFloorListDataBtnLabel,
323
323
  customErrorIsvFloorModule,
324
324
  luxuryFixedIndex = -1,
325
325
  isContainerListHasMarginBottom,
326
326
  switchConfig,
327
327
  containerFloorListPageInfo = {
328
328
  hasNextPage: false,
329
329
  isByPage: false,
330
330
  },
331
331
  } = props;
332
332
  const { hasNextPage, isByPage } = containerFloorListPageInfo;
333
333
  const isContainerListHasMore = isCheckFloorListByPage && hasNextPage && isByPage;
334
334
  const emptyFloorListHidden = switchConfig?.emptyFloorListHidden || false;
335
335
  const isSageShop = taroJdBaseInfo.info?.pageInfo?.isSageShop;
336
336
  const isHasMarginBottom = isContainerListHasMarginBottom ?? !isSageShop;
337
337
 
338
338
  const hasLiveForSageShop =
339
339
  isSageShop && taroJdBaseInfo.info?.pageInfo?.isJdShowNativeImmersivePlayer;
340
340
 
341
341
  const renderFloorItem = (
342
342
  item,
343
343
  floorItem,
344
344
  floorIndex,
345
345
  containerLayoutLeftRightMargin,
346
346
  lazyLoadState = false,
347
347
  index,
348
348
  borderStyle,
349
349
  ) => {
350
350
  return (
351
351
  <View
352
352
  className={classNames(shopContainerListStyle['d-floor-item'])}
353
353
  data-floor-uid={floorItem?.uid}
354
354
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
355
355
  data-lazy-load={lazyLoadState}
356
356
  key={floorItem.uid}
357
357
  id={`J_floor_${floorItem.uid}`}
358
358
  style={borderStyle}
359
359
  >
360
360
  {isChartH5 && (
361
361
  <View
362
362
  className={shopContainerListStyle['d-floor-chart-item']}
363
363
  id={`J_chart_floor_${floorItem?.uid}`}
364
364
  data-floor-uid={floorItem?.uid}
365
365
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
366
366
  />
367
367
  )}
368
368
  <FloorListItem
369
369
  memberBaseInfo={memberBaseInfo}
370
370
  source={source}
371
371
  floorIndex={floorIndex}
372
372
  floorData={floorItem}
373
373
  containerIndex={index}
374
374
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
375
375
  containerBorderRadius={borderStyle}
376
376
  updateShopFloorDataFn={updateShopFloorDataFn}
377
377
  loadingEndComponentFn={loadingEndComponentFn}
378
378
  extendInfoData={
379
379
  passExtendInfoModuleWhiteList.includes(floorItem?.floorExtInfo?.moduleFlag)
380
380
  ? extendInfoData
381
381
  : undefined
382
382
  }
383
383
  key={floorItem.uid}
384
384
  builtInComponents={builtInComponents}
385
385
  updateContainerFloorListDataFn={updateContainerFloorListDataFn}
386
386
  customErrorIsvFloorModule={customErrorIsvFloorModule}
387
387
  />
388
388
  {index === luxuryFixedIndex ? props.children : null}
389
389
  {floorItem?.inspectResult === '1' && (
390
390
  <View className={shopContainerListStyle['d-floor-inspect-mask']} />
391
391
  )}
392
392
  </View>
393
393
  );
394
394
  };
395
395
 
396
396
  const getFloorSetHeight = (item) => {
397
397
  const getHeight = item?.floorExtInfo?.floorHeight
398
398
  ? Number(item?.floorExtInfo?.floorHeight)
399
399
  : 200;
400
400
  return getHeight > 0 ? getHeight : 200;
401
401
  };
402
402
  const containerFloorListDataLen = containerFloorListData.length;
403
403
 
404
404
  const getNoDataContainerHeight = () => {
405
405
  const getWindowHeight = windowHeight > 10 ? windowHeight : screenHeight;
406
406
  const changeHeight = hasLiveForSageShop
407
407
  ? getWindowHeight
408
408
  : getWindowHeight -
409
409
  (isJdApp
410
410
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
411
411
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT);
412
412
  return {
413
413
  height: `${changeHeight}px`,
414
414
  };
415
415
  };
416
416
  return (
417
417
  <View
418
418
  id="J_shopContainerFloorList"
419
419
  className={classNames(
420
420
  className,
421
421
  shopContainerListStyle['d-shop-container-list'],
422
422
  isHasMarginBottom
423
423
  ? shopContainerListStyle['d-container-list-with-margin-bottom']
424
424
  : shopContainerListStyle['d-container-list-no-margin-bottom'],
425
425
  )}
426
426
  style={style}
427
427
  >
428
428
  {containerFloorListDataLen > 0 ? (
429
429
  <>
430
430
  {containerFloorListData.map((item, index) => {
431
431
  const containerLayoutLeftRightMargin = (item.marginLeft || 0) + (item.marginRight || 0);
432
432
  const getContainerId = `J_container_${item.containerId}`;
433
433
  const getDealContainerFloorListLen = isContainerListHasMore
434
434
  ? 1000
435
435
  : containerFloorListDataLen;
436
436
  const borderStyle = getBorderStyle(
437
437
  item,
438
438
  index,
439
439
  containerFloorListData,
440
440
  getDealContainerFloorListLen,
441
441
  );
442
442
  return (
443
443
  <React.Fragment key={item.containerId + index}>
444
444
  {item.addLuxuryStyle ? (
445
445
  <View className={shopContainerListStyle['d-luxury-header']} />
446
446
  ) : null}
447
447
  {item.addLuxuryBackupStyle ? (
448
448
  <View
449
449
  style={{
450
450
  height: taroJdBaseInfo?.info?.sysInfo?.jdNativeHeaderHeight + 'px',
451
451
  }}
452
452
  className={shopContainerListStyle['d-luxury-header-black']}
453
453
  />
454
454
  ) : null}
455
455
  {typeof item?.renderExtendComponent === 'function'
456
456
  ? item?.renderExtendComponent(item?.floorExtendData)
457
457
  : null}
458
458
  <View
459
459
  className={classNames(
460
460
  shopContainerListStyle['d-container-item'],
461
461
  containerItemClass,
462
462
  )}
463
463
  id={getContainerId}
464
464
  key={item.containerId}
465
465
  data-container-id={item?.containerId}
466
466
  data-container-type={item?.typeCode}
467
467
  data-container-index={index}
468
468
  style={{
469
469
  marginBottom: item.marginBottom ? `${item.marginBottom}px` : 0,
470
470
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
471
471
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
472
472
  marginRight: item.marginRight ? `${item.marginRight}px` : 0,
473
473
  borderTopLeftRadius: borderStyle?.borderTopLeftRadius || `0px`,
474
474
  borderTopRightRadius: borderStyle?.borderTopRightRadiu || `0px`,
475
475
  borderBottomLeftRadius: borderStyle?.borderBottomLeftRadius || `0px`,
476
476
  borderBottomRightRadius: borderStyle?.borderBottomRightRadius || `0px`,
477
477
  '--container-layout-left-right-margin': `${containerLayoutLeftRightMargin}px`,
478
478
  }}
479
479
  >
480
480
  {typeof item?.insertContainerStartComponent === 'function'
481
481
  ? item?.insertContainerStartComponent(item)
482
482
  : null}
483
483
  {item.floors &&
484
484
  item.floors.length > 0 &&
485
485
  item.floors?.map((floorItem, floorIndex) => {
486
486
  return index > lazyLoadStartIndex ? (
487
487
  <LazyLayoutLoad
488
488
  key={item.containerId}
489
489
  sectionType={sectionType}
490
490
  containerId={getContainerId}
491
491
  height={getFloorSetHeight(floorItem)}
492
492
  floorData={floorItem}
493
493
  >
494
494
  {renderFloorItem(
495
495
  item,
496
496
  floorItem,
497
497
  floorIndex,
498
498
  containerLayoutLeftRightMargin,
499
499
  true,
500
500
  index,
501
501
  borderStyle,
502
502
  )}
503
503
  </LazyLayoutLoad>
504
504
  ) : (
505
505
  renderFloorItem(
506
506
  item,
507
507
  floorItem,
508
508
  floorIndex,
509
509
  containerLayoutLeftRightMargin,
510
510
  false,
511
511
  index,
512
512
  borderStyle,
513
513
  )
514
514
  );
515
515
  })}
516
516
  </View>
517
517
  </React.Fragment>
518
518
  );
519
519
  })}
520
520
  </>
521
521
  ) : !emptyFloorListHidden ? (
522
522
  <View
523
523
  className={classNames(shopContainerListStyle['d-container-list-no-data'], {
524
524
  [shopContainerListStyle['d-sage-shop-no-data']]: hasLiveForSageShop,
525
525
  })}
526
526
  style={getNoDataContainerHeight()}
527
527
  >
528
528
  <NetworkDataError
529
529
  netWorkShowType={NetWorkShowType.PART}
530
530
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
531
531
  backgroundColorWhite={hasLiveForSageShop}
532
532
  refreshCallBackFn={refreshFloorListDataFn ? refreshFloorListDataFn : null}
533
533
  btnLabel={refreshFloorListDataBtnLabel || ''}
534
534
  />
535
535
  </View>
536
536
  ) : null}
537
537
  </View>
538
538
  );
539
539
  updateShopDataFn: null,