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