@conecli/cone-render 0.8.32 → 0.8.34

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
  className?: string
7
6
  containerItemClass?: object
8
7
  style?: object
9
8
  hasGoodsFeeds?: boolean
10
9
  builtInComponents?: Object
11
10
  loadingEndComponentFn?: Function
12
11
  sectionType?: string
13
12
  updateShopFloorDataFn?: Function
14
13
  updateContainerFloorListDataFn?: Function
15
14
  customErrorIsvFloorModule?: React.ReactElement
16
15
  const {
17
16
  className,
18
17
  style,
19
18
  containerItemClass = null,
20
19
  containerFloorListData,
21
20
  builtInComponents,
22
21
  loadingEndComponentFn,
23
22
  sectionType,
24
23
  updateShopFloorDataFn,
25
24
  updateContainerFloorListDataFn,
26
25
  customErrorIsvFloorModule
27
26
  } = props
28
27
 
29
28
  const renderFloorItem = (
30
29
  item,
31
30
  floorItem,
32
31
  floorIndex,
33
32
  containerLayoutLeftRightMargin,
34
33
  lazyLoadState = false,
35
34
  ) => {
36
35
  return (
37
36
  <View
38
37
  className={classNames(shopContainerListStyle['d-floor-item'])}
39
38
  data-floor-uid={floorItem?.uid}
40
39
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
41
40
  data-lazy-load={lazyLoadState}
42
41
  key={floorItem.uid}
43
42
  id={`J_floor_${floorItem.uid}`}
44
43
  style={{
45
44
  borderRadius: `${item?.borderRadius || 0}px`,
46
45
  }}
47
46
  >
48
47
  <FloorListItem
49
48
  floorIndex={floorIndex}
50
49
  floorData={floorItem}
51
50
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
52
51
  containerBorderRadius={item?.borderRadius || 0}
53
52
  updateShopFloorDataFn={updateShopFloorDataFn}
54
53
  loadingEndComponentFn={loadingEndComponentFn}
55
54
  key={floorItem.uid}
56
55
  builtInComponents={builtInComponents}
57
56
  updateContainerFloorListDataFn={
58
57
  updateContainerFloorListDataFn
59
58
  }
60
59
  customErrorIsvFloorModule={customErrorIsvFloorModule}
61
60
  />
62
61
  </View>
63
62
  )
64
63
  }
65
64
 
66
65
  const getFloorSetHeight = (item) => {
67
66
  const getHeight = item?.floorExtInfo?.floorHeight
68
67
  ? Number(item?.floorExtInfo?.floorHeight)
69
68
  : 200
70
69
  return getHeight > 0 ? getHeight : 200
71
70
  }
72
71
  return (
73
72
  <View
74
73
  className={classNames(
75
74
  className,
76
75
  shopContainerListStyle['d-shop-container-list'],
77
76
  )}
78
77
  style={style}
79
78
  >
80
79
  <View id='J_shopContainerFloorList'>
81
80
  {containerFloorListData.length > 0 ? (
82
81
  containerFloorListData.map((item, index) => {
83
82
  const containerLayoutLeftRightMargin =
84
83
  (item.marginLeft || 0) + (item.marginRight || 0)
85
84
  const getContainerId = `J_container_${item.containerId}`
86
85
  return (
87
86
  <View
88
87
  className={classNames(
89
88
  shopContainerListStyle['d-container-item'],
90
89
  containerItemClass,
91
90
  )}
92
91
  id={getContainerId}
93
92
  key={item.containerId}
94
93
  data-container-id={item?.containerId}
95
94
  data-container-type={item?.typeCode}
96
95
  style={{
97
96
  marginBottom: item.marginBottom
98
97
  ? `${item.marginBottom}px`
99
98
  : 0,
100
99
  marginTop: item.marginTop
101
100
  ? `${item.marginTop}px`
102
101
  : 0,
103
102
  marginLeft: item.marginLeft
104
103
  ? `${item.marginLeft}px`
105
104
  : 0,
106
105
  marginRight: item.marginRight
107
106
  ? `${item.marginRight}px`
108
107
  : 0,
109
108
  borderRadius: item.borderRadius
110
109
  ? `${item.borderRadius}px`
111
110
  : 0,
112
111
  }}
113
112
  >
114
113
  {item.floors &&
115
114
  item.floors.length > 0 &&
116
115
  item.floors?.map(
117
116
  (floorItem, floorIndex) => {
118
117
  return index > 4 ? (
119
118
  <LazyLayoutLoad
120
119
  key={item.containerId}
121
120
  sectionType={sectionType}
122
121
  containerId={getContainerId}
123
122
  height={getFloorSetHeight(
124
123
  floorItem,
125
124
  )}
126
125
  floorData={floorItem}
127
126
  >
128
127
  {renderFloorItem(
129
128
  item,
130
129
  floorItem,
131
130
  floorIndex,
132
131
  containerLayoutLeftRightMargin,
133
132
  true,
134
133
  )}
135
134
  </LazyLayoutLoad>
136
135
  ) : (
137
136
  renderFloorItem(
138
137
  item,
139
138
  floorItem,
140
139
  floorIndex,
141
140
  containerLayoutLeftRightMargin,
142
141
  )
143
142
  )
144
143
  },
145
144
  )}
146
145
  </View>
147
146
  )
148
147
  })
149
148
  ) : (
150
149
  <View
151
150
  className={
152
151
  shopContainerListStyle['d-container-list-no-data']
153
152
  }
154
153
  style={{
155
154
  height: `${
156
155
  windowHeight -
157
156
  (isJdApp
158
157
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
159
158
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT)
160
159
  }px`,
161
160
  }}
162
161
  >
163
162
  <NetworkDataError
164
163
  netWorkShowType={NetWorkShowType.PART}
165
164
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
166
165
  />
167
166
  </View>
168
167
  )}
169
168
  </View>
170
169
  </View>
171
170
  )
172
171
  updateShopDataFn: null,
172
+ import React from 'react'
173
173
  NETWORK_DATA_TYPE,
174
174
  M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
175
175
  APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
176
176
  containerFloorListData: ComponentInterFace.ContainerItemData[]
177
177
  className?: string
178
178
  containerItemClass?: object
179
179
  style?: object
180
180
  hasGoodsFeeds?: boolean
181
181
  builtInComponents?: Object
182
182
  loadingEndComponentFn?: Function
183
183
  sectionType?: string
184
184
  updateShopFloorDataFn?: Function
185
185
  updateContainerFloorListDataFn?: Function
186
186
  customErrorIsvFloorModule?: React.ReactElement
187
187
  const {
188
188
  className,
189
189
  style,
190
190
  containerItemClass = null,
191
191
  containerFloorListData,
192
192
  builtInComponents,
193
193
  loadingEndComponentFn,
194
194
  sectionType,
195
195
  updateShopFloorDataFn,
196
196
  updateContainerFloorListDataFn,
197
197
  customErrorIsvFloorModule,
198
198
  } = props
199
199
 
200
200
  const renderFloorItem = (
201
201
  item,
202
202
  floorItem,
203
203
  floorIndex,
204
204
  containerLayoutLeftRightMargin,
205
205
  lazyLoadState = false,
206
206
  ) => {
207
207
  return (
208
208
  <View
209
209
  className={classNames(shopContainerListStyle['d-floor-item'])}
210
210
  data-floor-uid={floorItem?.uid}
211
211
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
212
212
  data-lazy-load={lazyLoadState}
213
213
  key={floorItem.uid}
214
214
  id={`J_floor_${floorItem.uid}`}
215
215
  style={{
216
216
  borderRadius: `${item?.borderRadius || 0}px`,
217
217
  }}
218
218
  >
219
219
  <FloorListItem
220
220
  floorIndex={floorIndex}
221
221
  floorData={floorItem}
222
222
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
223
223
  containerBorderRadius={item?.borderRadius || 0}
224
224
  updateShopFloorDataFn={updateShopFloorDataFn}
225
225
  loadingEndComponentFn={loadingEndComponentFn}
226
226
  key={floorItem.uid}
227
227
  builtInComponents={builtInComponents}
228
228
  updateContainerFloorListDataFn={updateContainerFloorListDataFn}
229
229
  customErrorIsvFloorModule={customErrorIsvFloorModule}
230
230
  />
231
231
  </View>
232
232
  )
233
233
  }
234
234
 
235
235
  const getFloorSetHeight = (item) => {
236
236
  const getHeight = item?.floorExtInfo?.floorHeight
237
237
  ? Number(item?.floorExtInfo?.floorHeight)
238
238
  : 200
239
239
  return getHeight > 0 ? getHeight : 200
240
240
  }
241
241
  return (
242
242
  <View
243
243
  className={classNames(
244
244
  className,
245
245
  shopContainerListStyle['d-shop-container-list'],
246
246
  )}
247
247
  style={style}
248
248
  >
249
249
  <View id="J_shopContainerFloorList">
250
250
  {containerFloorListData.length > 0 ? (
251
251
  containerFloorListData.map((item, index) => {
252
252
  const containerLayoutLeftRightMargin =
253
253
  (item.marginLeft || 0) + (item.marginRight || 0)
254
254
  const getContainerId = `J_container_${item.containerId}`
255
255
  return (
256
256
  <View
257
257
  className={classNames(
258
258
  shopContainerListStyle['d-container-item'],
259
259
  containerItemClass,
260
260
  )}
261
261
  id={getContainerId}
262
262
  key={item.containerId}
263
263
  data-container-id={item?.containerId}
264
264
  data-container-type={item?.typeCode}
265
265
  style={{
266
266
  marginBottom: item.marginBottom
267
267
  ? `${item.marginBottom}px`
268
268
  : 0,
269
269
  marginTop: item.marginTop ? `${item.marginTop}px` : 0,
270
270
  marginLeft: item.marginLeft ? `${item.marginLeft}px` : 0,
271
271
  marginRight: item.marginRight ? `${item.marginRight}px` : 0,
272
272
  borderRadius: item.borderRadius
273
273
  ? `${item.borderRadius}px`
274
274
  : 0,
275
275
  }}
276
276
  >
277
277
  {item.floors &&
278
278
  item.floors.length > 0 &&
279
279
  item.floors?.map((floorItem, floorIndex) => {
280
280
  return index > 4 ? (
281
281
  <LazyLayoutLoad
282
282
  key={item.containerId}
283
283
  sectionType={sectionType}
284
284
  containerId={getContainerId}
285
285
  height={getFloorSetHeight(floorItem)}
286
286
  floorData={floorItem}
287
287
  >
288
288
  {renderFloorItem(
289
289
  item,
290
290
  floorItem,
291
291
  floorIndex,
292
292
  containerLayoutLeftRightMargin,
293
293
  true,
294
294
  )}
295
295
  </LazyLayoutLoad>
296
296
  ) : (
297
297
  renderFloorItem(
298
298
  item,
299
299
  floorItem,
300
300
  floorIndex,
301
301
  containerLayoutLeftRightMargin,
302
302
  )
303
303
  )
304
304
  })}
305
305
  </View>
306
306
  )
307
307
  })
308
308
  ) : (
309
309
  <View
310
310
  className={shopContainerListStyle['d-container-list-no-data']}
311
311
  style={{
312
312
  height: `${
313
313
  windowHeight -
314
314
  (isJdApp
315
315
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
316
316
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT)
317
317
  }px`,
318
318
  }}
319
319
  >
320
320
  <NetworkDataError
321
321
  netWorkShowType={NetWorkShowType.PART}
322
322
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
323
323
  />
324
324
  </View>
325
325
  )}
326
326
  </View>
327
327
  </View>
328
328
  )
329
329
  updateShopDataFn: null,