@conecli/cone-render 0.8.15-alpha.20 → 0.8.15-alpha.21

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,35 +1,36 @@
1
1
 
2
2
  .d-shop-container-list {
3
- position: relative;
4
- overflow: hidden;
5
- z-index: 2;
3
+ position: relative;
4
+ overflow: hidden;
5
+ z-index: 2;
6
6
 
7
- .d-container-item,
8
- .d-floor-item {
9
- position: relative;
10
- // 不能加overflow 防止IntersectionObserver监听异常
11
- //overflow: hidden;
12
- }
13
-
14
- .d-floor-item {
15
- overflow: hidden;
16
- }
7
+ .d-container-item,
8
+ .d-floor-item {
9
+ position: relative;
10
+ // 不能加overflow 防止IntersectionObserver监听异常
11
+ //overflow: hidden;
12
+ }
13
+
14
+ .d-floor-item {
15
+ overflow: hidden;
16
+ display: block; // 由于taro的View属于一种自定义标签,虽然taro自己会给View设置display为block,但是这个是一个异步过程,而自定义标签的默认display是inline,inline状态下即使设置了overflow:hidden,也会由于内容过大导致宽度被撑大而超出容器实际宽度。所以为了保证楼层容器节点在加载过程中不被撑大,需要显示设置display:block
17
+ }
17
18
 
18
- .d-container-item {
19
- //opacity: 0;
20
- //animation: containerShowToOpacity 500ms;
21
- //animation-fill-mode: forwards;
22
- :global {
23
- .lazyload-placeholder {
24
- background: url('https://img13.360buyimg.com/imagetools/jfs/t1/151010/32/14284/30214/5ff66791Ea1bc6cc6/698c0772b377aef5.png')
25
- center center / 40px 40px no-repeat;
26
- }
27
- }
28
- }
19
+ .d-container-item {
20
+ //opacity: 0;
21
+ //animation: containerShowToOpacity 500ms;
22
+ //animation-fill-mode: forwards;
23
+ :global {
24
+ .lazyload-placeholder {
25
+ background: url('https://img13.360buyimg.com/imagetools/jfs/t1/151010/32/14284/30214/5ff66791Ea1bc6cc6/698c0772b377aef5.png')
26
+ center center / 40px 40px no-repeat;
27
+ }
28
+ }
29
+ }
29
30
 
30
- .d-container-list-no-data {
31
- min-height: 400px;
32
- }
31
+ .d-container-list-no-data {
32
+ min-height: 400px;
33
+ }
33
34
  }
34
35
  //@keyframes containerShowToOpacity {
35
36
  // from {
@@ -1 +1 @@
1
- import React from 'react'
1
+ import React from 'react'
2
2
  NETWORK_DATA_TYPE,
3
3
  M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
4
4
  APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT,
5
5
  containerFloorListData: ComponentInterFace.ContainerItemData[]
6
6
  className?: string
7
7
  containerItemClass?: object
8
8
  style?: object
9
9
  hasGoodsFeeds?: boolean
10
10
  builtInComponents?: Object
11
11
  loadingEndComponentFn?: Function
12
12
  sectionType?: string
13
13
  updateShopFloorDataFn?: Function
14
14
  updateContainerFloorListDataFn?: Function
15
15
  const {
16
16
  className,
17
17
  style,
18
18
  containerItemClass = null,
19
19
  containerFloorListData,
20
20
  builtInComponents,
21
21
  loadingEndComponentFn,
22
22
  sectionType,
23
23
  updateShopFloorDataFn,
24
24
  updateContainerFloorListDataFn,
25
25
  } = props
26
26
 
27
27
  const renderFloorItem = (
28
28
  item,
29
29
  floorItem,
30
30
  floorIndex,
31
31
  containerLayoutLeftRightMargin,
32
32
  lazyLoadState = false,
33
33
  ) => {
34
34
  return (
35
35
  <View
36
36
  className={classNames(shopContainerListStyle['d-floor-item'])}
37
37
  data-floor-uid={floorItem?.uid}
38
38
  data-floor-type={floorItem?.floorExtInfo?.moduleFlag || ''}
39
39
  data-lazy-load={lazyLoadState}
40
40
  key={floorItem.uid}
41
41
  id={`J_floor_${floorItem.uid}`}
42
42
  style={{
43
43
  borderRadius: `${item?.borderRadius || 0}px`,
44
44
  }}
45
45
  >
46
46
  <FloorListItem
47
47
  floorIndex={floorIndex}
48
48
  floorData={floorItem}
49
49
  layoutLeftRightMargin={containerLayoutLeftRightMargin}
50
50
  containerBorderRadius={item?.borderRadius || 0}
51
51
  updateShopFloorDataFn={updateShopFloorDataFn}
52
52
  loadingEndComponentFn={loadingEndComponentFn}
53
53
  key={floorItem.uid}
54
54
  builtInComponents={builtInComponents}
55
55
  updateContainerFloorListDataFn={
56
56
  updateContainerFloorListDataFn
57
57
  }
58
58
  />
59
59
  </View>
60
60
  )
61
61
  }
62
62
 
63
63
  const getFloorSetHeight = (item) => {
64
64
  const getHeight = item?.floorExtInfo?.floorHeight
65
65
  ? Number(item?.floorExtInfo?.floorHeight)
66
66
  : 200
67
67
  return getHeight > 0 ? getHeight : 200
68
68
  }
69
69
  return (
70
70
  <View
71
71
  className={classNames(
72
72
  className,
73
73
  shopContainerListStyle['d-shop-container-list'],
74
74
  )}
75
75
  style={style}
76
76
  >
77
77
  <View id='J_shopContainerFloorList'>
78
78
  {containerFloorListData.length > 0 ? (
79
79
  containerFloorListData.map((item, index) => {
80
80
  const containerLayoutLeftRightMargin =
81
81
  (item.marginLeft || 0) + (item.marginRight || 0)
82
82
  const getContainerId = `J_container_${item.containerId}`
83
83
  return (
84
84
  <View
85
85
  className={classNames(
86
86
  shopContainerListStyle['d-container-item'],
87
87
  containerItemClass,
88
88
  )}
89
89
  id={getContainerId}
90
90
  key={item.containerId}
91
91
  data-container-id={item?.containerId}
92
92
  data-container-type={item?.typeCode}
93
93
  style={{
94
94
  marginBottom: item.marginBottom
95
95
  ? `${item.marginBottom}px`
96
96
  : 0,
97
97
  marginTop: item.marginTop
98
98
  ? `${item.marginTop}px`
99
99
  : 0,
100
100
  marginLeft: item.marginLeft
101
101
  ? `${item.marginLeft}px`
102
102
  : 0,
103
103
  marginRight: item.marginRight
104
104
  ? `${item.marginRight}px`
105
105
  : 0,
106
106
  borderRadius: item.borderRadius
107
107
  ? `${item.borderRadius}px`
108
108
  : 0,
109
109
  }}
110
110
  >
111
111
  {item.floors &&
112
112
  item.floors.length > 0 &&
113
113
  item.floors?.map(
114
114
  (floorItem, floorIndex) => {
115
115
  return index > 4 ? (
116
116
  <LazyLayoutLoad
117
117
  key={item.containerId}
118
118
  sectionType={sectionType}
119
119
  containerId={getContainerId}
120
120
  height={getFloorSetHeight(
121
121
  floorItem,
122
122
  )}
123
123
  floorData={floorItem}
124
124
  >
125
125
  {renderFloorItem(
126
126
  item,
127
127
  floorItem,
128
128
  floorIndex,
129
129
  containerLayoutLeftRightMargin,
130
130
  true,
131
131
  )}
132
132
  </LazyLayoutLoad>
133
133
  ) : (
134
134
  renderFloorItem(
135
135
  item,
136
136
  floorItem,
137
137
  floorIndex,
138
138
  containerLayoutLeftRightMargin,
139
139
  )
140
140
  )
141
141
  },
142
142
  )}
143
143
  </View>
144
144
  )
145
145
  })
146
146
  ) : (
147
147
  <View
148
148
  className={
149
149
  shopContainerListStyle['d-container-list-no-data']
150
150
  }
151
151
  style={{
152
152
  height: `${
153
153
  windowHeight -
154
154
  (isJdApp
155
155
  ? APP_SHOP_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT
156
156
  : M_SHOP_DOWNLOAD_HEADER_NAV_BAR_BOTTOM_MENU_HEIGHT)
157
157
  }px`,
158
158
  }}
159
159
  >
160
160
  <NetworkDataError
161
161
  netWorkShowType={NetWorkShowType.PART}
162
162
  netWorkDataType={NETWORK_DATA_TYPE.DATA_ERROR}
163
163
  />
164
164
  </View>
165
165
  )}
166
166
  </View>
167
167
  </View>
168
168
  )
169
169
  updateShopDataFn: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conecli/cone-render",
3
- "version": "0.8.15-alpha.20",
3
+ "version": "0.8.15-alpha.21",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist/"