jufubao-mall 2.0.83-beta1 → 2.0.83-beta2
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.
- package/package.json +1 -1
- package/src/components/JfbMallCategoryAll/JfbMallCategoryAll.vue +36 -25
- package/src/components/JfbMallCategoryAll/XdStoreProductType.vue +123 -163
- package/src/components/JfbMallCategoryAll/cusAttr/style.js +32 -18
- package/src/components/JfbMallCategoryProduct/Api.js +16 -0
- package/src/components/JfbMallCategoryProduct/JfbMallCategoryProduct.vue +224 -91
- package/src/components/JfbMallCategoryProduct/Mock.js +93 -1
- package/src/components/JfbMallCategoryProduct/cusAttr/content.js +6 -4
- package/src/components/JfbMallCategoryProduct/cusAttr/style.js +16 -9
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
:color="mainColor"
|
|
42
42
|
:default-index="0"
|
|
43
43
|
:style-config="styleConfig"
|
|
44
|
+
:layout-style="layoutStyle"
|
|
44
45
|
@onNavList="handleNavList"
|
|
45
46
|
@onToDetail="handleToDetail"
|
|
46
47
|
></xd-store-product-type>
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
mixins: [componentsMixins, extsMixins, JfbMallCategoryAllMixin],
|
|
69
70
|
data() {
|
|
70
71
|
return {
|
|
72
|
+
closeMask: true,
|
|
71
73
|
isPreview: false,
|
|
72
74
|
allNavList: [],
|
|
73
75
|
loadingList: true,
|
|
@@ -90,14 +92,14 @@
|
|
|
90
92
|
leftNavItemSpacing: 0,
|
|
91
93
|
leftNavBgColor: '#F7F7F7',
|
|
92
94
|
leftNavBorder: '',
|
|
93
|
-
leftNavRadius: '
|
|
95
|
+
leftNavRadius: '0',
|
|
94
96
|
leftNavShadow: '',
|
|
95
97
|
leftNavPadding: {top:0, bottom:0, left:0, right:0},
|
|
96
98
|
// 右侧导航样式
|
|
97
99
|
rightNavMargin: [0],
|
|
98
100
|
rightNavPadding: {top:0, bottom:0, left:0, right:0},
|
|
99
101
|
rightNavBgColor: '#fff',
|
|
100
|
-
rightNavIconSize:
|
|
102
|
+
rightNavIconSize: 120,
|
|
101
103
|
rightNavIconPadding: 0,
|
|
102
104
|
rightNavIconTextColor: '#666',
|
|
103
105
|
rightNavIconTextSize: '12',
|
|
@@ -127,10 +129,10 @@
|
|
|
127
129
|
leftNavBorder: this.leftNavBorder,
|
|
128
130
|
leftNavRadius: this.leftNavRadius,
|
|
129
131
|
leftNavShadow: this.leftNavShadow,
|
|
130
|
-
leftNavPadding: this.leftNavPadding,
|
|
132
|
+
leftNavPadding: this.getMarginAndPadding(this.leftNavPadding, 0),
|
|
131
133
|
// 右侧导航
|
|
132
|
-
rightNavMargin: this.rightNavMargin,
|
|
133
|
-
rightNavPadding: this.rightNavPadding,
|
|
134
|
+
rightNavMargin: this.getMarginAndPadding(this.rightNavMargin, 0),
|
|
135
|
+
rightNavPadding: this.getMarginAndPadding(this.rightNavPadding, 0),
|
|
134
136
|
rightNavBgColor: this.rightNavBgColor,
|
|
135
137
|
rightNavIconSize: this.rightNavIconSize,
|
|
136
138
|
rightNavIconPadding: this.rightNavIconPadding,
|
|
@@ -175,35 +177,44 @@
|
|
|
175
177
|
init(container) {
|
|
176
178
|
this.listPath = getContainerPropsValue(container, 'content.listPath', {value: ""}).value;
|
|
177
179
|
this.xnamespace = getContainerPropsValue(container, 'content.xnamespace', this.projectAttr.business_code);
|
|
178
|
-
this.need_tag = getContainerPropsValue(container, 'content.need_tag', null);
|
|
179
180
|
this.showRecommend = gCPVal(container, 'showRecommend', 'Y');
|
|
181
|
+
this.need_tag = getContainerPropsValue(container, 'content.need_tag', null);
|
|
180
182
|
this.categoryParentType = gCPVal(container, 'categoryParentType', 'child');
|
|
181
183
|
this.categoryParent = gCPVal(container, 'categoryParent', '');
|
|
182
|
-
this.recommendName = gCPVal(container, 'recommendName', '');
|
|
184
|
+
this.recommendName = gCPVal(container, 'recommendName', '推荐');
|
|
183
185
|
this.layoutStyle = gCPVal(container, 'layoutStyle', '1');
|
|
184
186
|
|
|
185
187
|
// ===== 左侧导航样式 =====
|
|
186
|
-
this.leftNavName = gCPVal(container, 'leftNavName', {
|
|
188
|
+
this.leftNavName = gCPVal(container, 'leftNavName', {
|
|
189
|
+
color: '#333',
|
|
190
|
+
actColor: this.mainColor,
|
|
191
|
+
fontSize: '24rpx',
|
|
192
|
+
actFontSize: '24rpx',
|
|
193
|
+
fontWeight: 'normal',
|
|
194
|
+
bgColor: '',
|
|
195
|
+
borderStyle: 'solid'
|
|
196
|
+
});
|
|
187
197
|
this.leftNavItemSpacing = gCPVal(container, 'leftNavItemSpacing', 0);
|
|
188
|
-
this.leftNavBgColor = gCPVal(container, 'leftNavBgColor', '#
|
|
189
|
-
this.leftNavBorder = gCPVal(container, 'leftNavBorder',
|
|
190
|
-
this.leftNavRadius = gCPVal(container, 'leftNavRadius', '
|
|
198
|
+
this.leftNavBgColor = gCPVal(container, 'leftNavBgColor', '#FFFFFF');
|
|
199
|
+
this.leftNavBorder = gCPVal(container, 'leftNavBorder', 'none', {isBorder: true});
|
|
200
|
+
this.leftNavRadius = gCPVal(container, 'leftNavRadius', '0', {sKey: "leftNavRadiusStatus"}) || 0;
|
|
191
201
|
this.leftNavShadow = gCPVal(container, 'leftNavShadow', {width:20, color:'rgba(0,0,0,0)'}, {isShadow: true});
|
|
192
202
|
this.leftNavPadding = gCPVal(container, 'leftNavPadding', {top:0, bottom:0, left:0, right:0}, {isPM: true, isCPM: true});
|
|
193
203
|
|
|
194
204
|
// ===== 右侧导航样式 =====
|
|
195
|
-
this.rightNavMargin = gCPVal(container, 'rightNavMargin',
|
|
205
|
+
this.rightNavMargin = gCPVal(container, 'rightNavMargin', {top:24, bottom:24, left:24, right:24}, {sKey: "rightNavMarginStatus", isPMR: true});
|
|
196
206
|
this.rightNavPadding = gCPVal(container, 'rightNavPadding', {top:0, bottom:0, left:0, right:0}, {isPM: true, isCPM: true});
|
|
197
|
-
this.rightNavBgColor = gCPVal(container, 'rightNavBgColor', '#
|
|
198
|
-
this.rightNavIconSize = gCPVal(container, 'rightNavIconSize',
|
|
199
|
-
this.rightNavIconPadding = gCPVal(container, 'rightNavIconPadding',
|
|
207
|
+
this.rightNavBgColor = gCPVal(container, 'rightNavBgColor', '#f8f8f8');
|
|
208
|
+
this.rightNavIconSize = gCPVal(container, 'rightNavIconSize', 120, {sKey: "rightNavIconSizeStatus"});
|
|
209
|
+
this.rightNavIconPadding = gCPVal(container, 'rightNavIconPadding', [12], {sKey: "rightNavIconPaddingStatus"});
|
|
200
210
|
this.rightNavIconTextColor = gCPVal(container, 'rightNavIconTextColor', '#666');
|
|
201
|
-
this.rightNavIconTextSize = gCPVal(container, 'rightNavIconTextSize', '
|
|
202
|
-
this.rightNavIconRadius = gCPVal(container, 'rightNavIconRadius', '
|
|
203
|
-
this.rightNavIconBorder = gCPVal(container, 'rightNavIconBorder', {
|
|
204
|
-
this.rightNavIconShadow = gCPVal(container, 'rightNavIconShadow', {
|
|
211
|
+
this.rightNavIconTextSize = gCPVal(container, 'rightNavIconTextSize', '24');
|
|
212
|
+
this.rightNavIconRadius = gCPVal(container, 'rightNavIconRadius', '16', {sKey: "rightNavIconRadiusStatus"});
|
|
213
|
+
this.rightNavIconBorder = gCPVal(container, 'rightNavIconBorder', {}, {isBorder: true});
|
|
214
|
+
this.rightNavIconShadow = gCPVal(container, 'rightNavIconShadow', [{color: 'rgba(0,0,0,.15)', width: '10'},'none'], { isShadow: true});
|
|
205
215
|
this.rightNavIconBgColor = gCPVal(container, 'rightNavIconBgColor', '');
|
|
206
|
-
this.rightNavIconTextGap = gCPVal(container, 'rightNavIconTextGap',
|
|
216
|
+
this.rightNavIconTextGap = gCPVal(container, 'rightNavIconTextGap', 10);
|
|
217
|
+
console.log('rightNavIconShadow', this.rightNavIconShadow)
|
|
207
218
|
},
|
|
208
219
|
handleNavList(resolve) {
|
|
209
220
|
try {
|
|
@@ -212,7 +223,8 @@
|
|
|
212
223
|
data: {
|
|
213
224
|
xnamespace: this.xnamespace,
|
|
214
225
|
need_tag: this.need_tag,
|
|
215
|
-
group_id: 'default'
|
|
226
|
+
group_id: 'default',
|
|
227
|
+
root_category_id: this.categoryParent || 0,
|
|
216
228
|
}
|
|
217
229
|
}).then(res => {
|
|
218
230
|
this.loadingList = false;
|
|
@@ -223,7 +235,7 @@
|
|
|
223
235
|
}
|
|
224
236
|
if(this.isPreview && this.need_tag) {
|
|
225
237
|
res.items.unshift({
|
|
226
|
-
category_name:
|
|
238
|
+
category_name: this.recommendName,
|
|
227
239
|
category_id: 5555,
|
|
228
240
|
category_icon: 'https://jfb-public-images.oss-cn-qingdao.aliyuncs.com/uploads/20230317/43cc2cb3c71edb6415ec8cb662693471.webp.jpg',
|
|
229
241
|
parent_id: 2,
|
|
@@ -273,14 +285,13 @@
|
|
|
273
285
|
})
|
|
274
286
|
}
|
|
275
287
|
let items = res.items.map(item => {
|
|
288
|
+
//category_id === 0 时,认为是推荐分类
|
|
289
|
+
if(item.category_id === 0) item.category_name = this.recommendName;
|
|
276
290
|
item['category_icon'] = getServiceUrl(item['category_icon'], 'size3');
|
|
277
291
|
item.children = item.children.map(child => {
|
|
278
292
|
child['category_icon'] = getServiceUrl(child['category_icon'], 'size3');
|
|
279
293
|
return child;
|
|
280
294
|
});
|
|
281
|
-
if(this.recommendName) {
|
|
282
|
-
item.category_name = this.recommendName
|
|
283
|
-
}
|
|
284
295
|
return item;
|
|
285
296
|
});
|
|
286
297
|
this.allNavList = items;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
>
|
|
6
6
|
<view
|
|
7
7
|
class="xd-product-type__left"
|
|
8
|
-
:style="leftNavStyle"
|
|
8
|
+
:style="[leftNavStyle]"
|
|
9
9
|
>
|
|
10
10
|
<scroll-view
|
|
11
11
|
class="xd-product-type__left-scroll"
|
|
@@ -20,17 +20,21 @@
|
|
|
20
20
|
:key="navIndex"
|
|
21
21
|
:id="getNavID(nav)"
|
|
22
22
|
@click="handleSelectNav(nav)"
|
|
23
|
-
:style="
|
|
23
|
+
:style="[
|
|
24
|
+
leftNavItem,
|
|
25
|
+
nav.category_id===selectNav.category_id ? leftNavActItem : {}
|
|
26
|
+
]"
|
|
24
27
|
:class="{active: nav.category_id===selectNav.category_id}"
|
|
25
28
|
class="xd-product-type__left-item"
|
|
26
29
|
>{{nav.category_name}}
|
|
27
|
-
<text :style="{background: nav.category_id===selectNav.category_id ?
|
|
30
|
+
<text class="act_bar" :style="{background: nav.category_id===selectNav.category_id ? leftNavActItem.color : ''}"
|
|
31
|
+
v-if="layoutStyle === '1' && nav.category_id===selectNav.category_id"></text>
|
|
28
32
|
</view>
|
|
29
33
|
</view>
|
|
30
34
|
</scroll-view>
|
|
31
35
|
</view>
|
|
32
36
|
<view class="xd-product-type__right"
|
|
33
|
-
:style="rightNavStyle"
|
|
37
|
+
:style="[rightNavStyle]"
|
|
34
38
|
:class="{isPreview:isPreview}">
|
|
35
39
|
<scroll-view scroll-y
|
|
36
40
|
:scroll-top="scrollTop"
|
|
@@ -46,7 +50,7 @@
|
|
|
46
50
|
<view class="xd-product-type__right-list" :key="navIndex"
|
|
47
51
|
:id="getNavListID(nav)"
|
|
48
52
|
>
|
|
49
|
-
<view class="xd-product-type__right-title" @click="toProductDetail(nav)" :style="rightNavTitleStyle">
|
|
53
|
+
<view class="xd-product-type__right-title" @click="toProductDetail(nav)" :style="[rightNavTitleStyle]">
|
|
50
54
|
{{nav['category_name']}}
|
|
51
55
|
<xd-font-icon class="xd-font-icon"
|
|
52
56
|
icon="iconxiangyou_xian"
|
|
@@ -54,21 +58,23 @@
|
|
|
54
58
|
color="#666666"
|
|
55
59
|
></xd-font-icon>
|
|
56
60
|
</view>
|
|
57
|
-
<view class="xd-product-type__right-content-box" v-if="nav.children.length > 0">
|
|
61
|
+
<view class="xd-product-type__right-content-box" :style="[rightContBoxStyle]" v-if="nav.children.length > 0">
|
|
58
62
|
<view class="xd-product-type__right-content">
|
|
59
63
|
<view
|
|
60
64
|
class="xd-product-type__right-item"
|
|
61
|
-
:style="rightNavItemStyle"
|
|
65
|
+
:style="[rightNavItemStyle]"
|
|
62
66
|
@click="toProductDetail(nav, subNav)"
|
|
63
67
|
v-for="subNav in nav.children"
|
|
64
68
|
:key="subNav.category_id"
|
|
65
69
|
>
|
|
66
|
-
<view :style="rightNavIconWrapperStyle">
|
|
70
|
+
<view class="cate_image" :style="[rightNavIconWrapperStyle]">
|
|
67
71
|
<image :src="subNav.category_icon" mode="aspectFit" :style="rightNavIconStyle"></image>
|
|
68
72
|
</view>
|
|
69
|
-
<view :style="rightNavIconTextStyle">{{subNav.category_name}}</view>
|
|
73
|
+
<view class="cate_text" :style="rightNavIconTextStyle">{{subNav.category_name}}</view>
|
|
70
74
|
</view>
|
|
71
75
|
<view v-if="nav.children.length%3==2" class="xd-product-type__right-item" :style="rightNavItemStyle"></view>
|
|
76
|
+
<view v-if="nav.children.length%3==1" class="xd-product-type__right-item" :style="rightNavItemStyle"></view>
|
|
77
|
+
<view v-if="nav.children.length%3==1" class="xd-product-type__right-item" :style="rightNavItemStyle"></view>
|
|
72
78
|
</view>
|
|
73
79
|
</view>
|
|
74
80
|
<xd-no-data v-else height="300rpx">{{noData}}</xd-no-data>
|
|
@@ -125,6 +131,10 @@
|
|
|
125
131
|
styleConfig: {
|
|
126
132
|
type: Object,
|
|
127
133
|
default: () => ({}),
|
|
134
|
+
},
|
|
135
|
+
layoutStyle: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: '1',
|
|
128
138
|
}
|
|
129
139
|
},
|
|
130
140
|
data(){
|
|
@@ -171,52 +181,70 @@
|
|
|
171
181
|
const baseMinHeight = ((this.layoutInfo && this.layoutInfo.bodyMinHeightRpx) || '100vh') + 'rpx';
|
|
172
182
|
let style = { minHeight: baseMinHeight };
|
|
173
183
|
|
|
174
|
-
// 外边距
|
|
175
|
-
if (cfg.bodyPaddingStatus === 'C' && cfg.bodyPadding) {
|
|
176
|
-
style.padding = this.getPaddingOrMarginValue(cfg.bodyPadding);
|
|
177
|
-
}
|
|
178
184
|
return style;
|
|
179
185
|
},
|
|
180
186
|
|
|
187
|
+
leftNavItem(){
|
|
188
|
+
const cfg = this.styleConfig;
|
|
189
|
+
let style = {
|
|
190
|
+
color: cfg.leftNavName.color,
|
|
191
|
+
fontSize: cfg.leftNavName.fontSize,
|
|
192
|
+
fontWeight: cfg.leftNavName.fontWeight,
|
|
193
|
+
backgroundColor: cfg.leftNavName.bgColor,
|
|
194
|
+
marginBottom: cfg.leftNavItemSpacing + 'rpx',
|
|
195
|
+
border: cfg.leftNavBorder,
|
|
196
|
+
borderRadius: cfg.leftNavRadius + 'rpx',
|
|
197
|
+
boxShadow: cfg.leftNavShadow,
|
|
198
|
+
padding: cfg.leftNavPadding
|
|
199
|
+
}
|
|
200
|
+
return style;
|
|
201
|
+
},
|
|
202
|
+
leftNavActItem(){
|
|
203
|
+
const cfg = this.styleConfig;
|
|
204
|
+
let style = {
|
|
205
|
+
color: cfg.leftNavName.actColor,
|
|
206
|
+
fontSize: cfg.leftNavName.actFontSize,
|
|
207
|
+
fontWeight: cfg.leftNavName.actFontWeight,
|
|
208
|
+
backgroundColor: cfg.leftNavName.actBgColor,
|
|
209
|
+
}
|
|
210
|
+
if(this.layoutStyle === '3'){
|
|
211
|
+
style.backgroundColor = cfg.leftNavName.actColor,
|
|
212
|
+
style.color = '#FFFFFF';
|
|
213
|
+
}
|
|
214
|
+
return style;
|
|
215
|
+
},
|
|
181
216
|
// 左侧导航样式
|
|
182
217
|
leftNavStyle() {
|
|
183
218
|
const cfg = this.styleConfig;
|
|
184
219
|
const baseMinHeight = ((this.layoutInfo && this.layoutInfo.bodyMinHeightRpx) || '100vh') + 'rpx';
|
|
185
|
-
let style = {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
220
|
+
let style = {
|
|
221
|
+
minHeight: baseMinHeight,
|
|
222
|
+
background: cfg.leftNavBgColor,
|
|
223
|
+
};
|
|
224
|
+
return style;
|
|
225
|
+
},
|
|
226
|
+
rightContBoxStyle(){
|
|
227
|
+
let style = {
|
|
228
|
+
background: '#fff',
|
|
229
|
+
borderRadius: '16rpx',
|
|
230
|
+
padding: '40rpx',
|
|
231
|
+
boxSizing: 'border-box'
|
|
194
232
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
style.borderRight = `${cfg.leftNavStrokeWidth || 1}px ${cfg.leftNavStrokeStyle} ${cfg.leftNavStrokeColor || '#ddd'}`;
|
|
233
|
+
if(this.layoutStyle === '2'){
|
|
234
|
+
style.borderRadius = '0 0 16rpx 16rpx';
|
|
198
235
|
}
|
|
199
236
|
return style;
|
|
200
237
|
},
|
|
201
|
-
|
|
202
238
|
// 右侧导航样式
|
|
203
239
|
rightNavStyle() {
|
|
204
240
|
const cfg = this.styleConfig;
|
|
205
241
|
const baseHeight = ((this.layoutInfo && this.layoutInfo.bodyMinHeightRpx) || '100vh') + 'rpx';
|
|
206
|
-
let style = {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
// 右侧导航外边距
|
|
213
|
-
if (cfg.rightNavMarginStatus === 'C' && cfg.rightNavMargin) {
|
|
214
|
-
style.margin = this.getPaddingOrMarginValue(cfg.rightNavMargin);
|
|
215
|
-
}
|
|
216
|
-
// 右侧导航内边距
|
|
217
|
-
if (cfg.rightNavPaddingStatus === 'C' && cfg.rightNavPadding) {
|
|
218
|
-
style.padding = this.getPaddingOrMarginValue(cfg.rightNavPadding);
|
|
219
|
-
}
|
|
242
|
+
let style = {
|
|
243
|
+
height: baseHeight,
|
|
244
|
+
margin: cfg.rightNavMargin,
|
|
245
|
+
background: cfg.rightNavBgColor,
|
|
246
|
+
padding: cfg.rightNavPadding,
|
|
247
|
+
};
|
|
220
248
|
return style;
|
|
221
249
|
},
|
|
222
250
|
|
|
@@ -228,10 +256,13 @@
|
|
|
228
256
|
// 右侧导航标题样式
|
|
229
257
|
rightNavTitleStyle() {
|
|
230
258
|
const cfg = this.styleConfig;
|
|
231
|
-
let style = {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
259
|
+
let style = {
|
|
260
|
+
background: 'transparent',
|
|
261
|
+
borderRadius: '16rpx 16rpx 0 0',
|
|
262
|
+
};
|
|
263
|
+
if(this.layoutStyle === '2'){
|
|
264
|
+
style.background = '#fff';
|
|
265
|
+
style.paddingLeft = '40rpx';
|
|
235
266
|
}
|
|
236
267
|
return style;
|
|
237
268
|
},
|
|
@@ -239,59 +270,25 @@
|
|
|
239
270
|
// 右侧导航项样式
|
|
240
271
|
rightNavItemStyle() {
|
|
241
272
|
const cfg = this.styleConfig;
|
|
242
|
-
let style = {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (cfg.rightNavIconBgStatus === 'C' && cfg.rightNavIconBgColor) {
|
|
246
|
-
style.background = cfg.rightNavIconBgColor;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
// 标与字间距
|
|
250
|
-
if (cfg.rightNavIconTextGapStatus === 'C' && cfg.rightNavIconTextGap !== undefined) {
|
|
251
|
-
style.gap = cfg.rightNavIconTextGap + 'rpx';
|
|
252
|
-
}
|
|
253
|
-
|
|
273
|
+
let style = {
|
|
274
|
+
width: Number(cfg.rightNavIconSize) + 'rpx',
|
|
275
|
+
};
|
|
254
276
|
return style;
|
|
255
277
|
},
|
|
256
278
|
|
|
257
279
|
// 右侧导航图标包裹容器样式
|
|
258
280
|
rightNavIconWrapperStyle() {
|
|
259
281
|
const cfg = this.styleConfig;
|
|
260
|
-
let style = {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
// 图标内边距
|
|
271
|
-
if (cfg.rightNavIconPaddingStatus === 'C' && cfg.rightNavIconPadding !== undefined) {
|
|
272
|
-
style.padding = cfg.rightNavIconPadding + 'rpx';
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// 图标圆角
|
|
276
|
-
if (cfg.rightNavIconRadiusStatus === 'C' && cfg.rightNavIconRadius) {
|
|
277
|
-
const radiusMap = { small: '8rpx', medium: '16rpx', large: '24rpx' };
|
|
278
|
-
style.borderRadius = radiusMap[cfg.rightNavIconRadius] || cfg.rightNavIconRadius + 'rpx';
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
// 图标描边
|
|
282
|
-
if (cfg.rightNavIconStrokeStatus === 'C' && cfg.rightNavIconStrokeStyle) {
|
|
283
|
-
style.border = `${cfg.rightNavIconStrokeWidth || 1}px ${cfg.rightNavIconStrokeStyle} ${cfg.rightNavIconStrokeColor || '#ddd'}`;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
// 图标投影
|
|
287
|
-
if (cfg.rightNavIconShadowStatus === 'C' && cfg.rightNavIconShadow) {
|
|
288
|
-
const shadowMap = {
|
|
289
|
-
small: '0 2rpx 8rpx rgba(0,0,0,0.08)',
|
|
290
|
-
medium: '0 4rpx 16rpx rgba(0,0,0,0.12)',
|
|
291
|
-
large: '0 8rpx 24rpx rgba(0,0,0,0.16)',
|
|
292
|
-
};
|
|
293
|
-
style.boxShadow = shadowMap[cfg.rightNavIconShadow] || cfg.rightNavIconShadow;
|
|
294
|
-
}
|
|
282
|
+
let style = {
|
|
283
|
+
width: Number(cfg.rightNavIconSize) + 'rpx',
|
|
284
|
+
height: Number(cfg.rightNavIconSize) + 'rpx',
|
|
285
|
+
padding: cfg.rightNavIconPadding + 'rpx',
|
|
286
|
+
border: cfg.rightNavIconBorder,
|
|
287
|
+
borderRadius: cfg.rightNavIconRadius + 'rpx',
|
|
288
|
+
boxShadow: cfg.rightNavIconShadow,
|
|
289
|
+
background: cfg.rightNavIconBgColor,
|
|
290
|
+
boxSizing: 'border-box',
|
|
291
|
+
};
|
|
295
292
|
|
|
296
293
|
return style;
|
|
297
294
|
},
|
|
@@ -299,25 +296,23 @@
|
|
|
299
296
|
// 右侧导航图标样式
|
|
300
297
|
rightNavIconStyle() {
|
|
301
298
|
const cfg = this.styleConfig;
|
|
302
|
-
let style = {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
307
|
-
style.width = '100%';
|
|
308
|
-
style.height = '100%';
|
|
299
|
+
let style = {
|
|
300
|
+
width: '100%',
|
|
301
|
+
height: '100%',
|
|
302
|
+
};
|
|
309
303
|
return style;
|
|
310
304
|
},
|
|
311
305
|
|
|
312
306
|
// 右侧导航图标文字样式
|
|
313
307
|
rightNavIconTextStyle() {
|
|
314
308
|
const cfg = this.styleConfig;
|
|
315
|
-
let style = {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
309
|
+
let style = {
|
|
310
|
+
width: Number(cfg.rightNavIconSize) + 'rpx',
|
|
311
|
+
fontSize: cfg.rightNavIconTextSize + 'rpx',
|
|
312
|
+
color: cfg.rightNavIconTextColor,
|
|
313
|
+
marginTop: cfg.rightNavIconTextGap + 'rpx',
|
|
314
|
+
fontWeight: 'normal',
|
|
315
|
+
};
|
|
321
316
|
return style;
|
|
322
317
|
},
|
|
323
318
|
},
|
|
@@ -326,45 +321,6 @@
|
|
|
326
321
|
this.isPreview = this.$configProject.isPreview;
|
|
327
322
|
},
|
|
328
323
|
methods: {
|
|
329
|
-
// 处理 padding/margin 值
|
|
330
|
-
getPaddingOrMarginValue(val) {
|
|
331
|
-
if (!val) return '';
|
|
332
|
-
if (Array.isArray(val)) {
|
|
333
|
-
if (val.length === 1) return val[0] + 'rpx';
|
|
334
|
-
if (val.length === 2) return `${val[0]}rpx ${val[1]}rpx`;
|
|
335
|
-
if (val.length === 4) return `${val[0]}rpx ${val[1]}rpx ${val[2]}rpx ${val[3]}rpx`;
|
|
336
|
-
return val.join(' ') + 'rpx';
|
|
337
|
-
}
|
|
338
|
-
if (typeof val === 'object') {
|
|
339
|
-
const {top, right, bottom, left} = val;
|
|
340
|
-
return `${top || 0}rpx ${right || 0}rpx ${bottom || 0}rpx ${left || 0}rpx`;
|
|
341
|
-
}
|
|
342
|
-
return val + 'rpx';
|
|
343
|
-
},
|
|
344
|
-
|
|
345
|
-
// 获取左侧导航项样式
|
|
346
|
-
getNavItemStyle(nav, navIndex) {
|
|
347
|
-
const cfg = this.styleConfig;
|
|
348
|
-
let style = {};
|
|
349
|
-
|
|
350
|
-
const isActive = this.selectNav && nav.category_id === this.selectNav.category_id;
|
|
351
|
-
|
|
352
|
-
// 名称样式
|
|
353
|
-
if (cfg.leftNavNameStatus === 'C') {
|
|
354
|
-
if (cfg.leftNavName) style.fontSize = cfg.leftNavName + 'rpx';
|
|
355
|
-
if (isActive && cfg.leftNavNameColor) style.color = cfg.leftNavNameColor;
|
|
356
|
-
else if (!isActive && cfg.leftNavNameColor) style.color = cfg.leftNavNameColor;
|
|
357
|
-
if (cfg.leftNavNameWeight) style.fontWeight = cfg.leftNavNameWeight;
|
|
358
|
-
if (!isActive && cfg.leftNavNameBgc) style.background = cfg.leftNavNameBgc;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
// 选项间距
|
|
362
|
-
if (cfg.leftNavItemSpacingStatus === 'C' && cfg.leftNavItemSpacing !== undefined) {
|
|
363
|
-
style.marginBottom = cfg.leftNavItemSpacing + 'rpx';
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
return style;
|
|
367
|
-
},
|
|
368
324
|
|
|
369
325
|
getNavID(item) {
|
|
370
326
|
return `xd-product-type__${item.category_id}`;
|
|
@@ -461,7 +417,7 @@
|
|
|
461
417
|
|
|
462
418
|
&__left {
|
|
463
419
|
height: 100%;
|
|
464
|
-
width:
|
|
420
|
+
width: 160rpx;
|
|
465
421
|
background: #f8f8f8;
|
|
466
422
|
flex-shrink: 0;
|
|
467
423
|
|
|
@@ -487,15 +443,14 @@
|
|
|
487
443
|
font-weight: bold;
|
|
488
444
|
position: relative;
|
|
489
445
|
|
|
490
|
-
|
|
446
|
+
.act_bar{
|
|
491
447
|
position: absolute;
|
|
492
|
-
left:
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
448
|
+
left: 0;
|
|
449
|
+
width: 8rpx;
|
|
450
|
+
height: 24rpx;
|
|
451
|
+
top: 50%;
|
|
452
|
+
transform: translateY(-50%);
|
|
496
453
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
454
|
}
|
|
500
455
|
}
|
|
501
456
|
}
|
|
@@ -527,18 +482,18 @@
|
|
|
527
482
|
}
|
|
528
483
|
}
|
|
529
484
|
&-list{
|
|
530
|
-
margin-bottom:
|
|
485
|
+
margin-bottom: 24rpx;
|
|
531
486
|
}
|
|
532
487
|
|
|
533
488
|
&-title {
|
|
534
489
|
height: unit(100,rpx);
|
|
535
490
|
line-height: unit(100,rpx);
|
|
536
|
-
font-size:
|
|
491
|
+
font-size: 24rpx;
|
|
537
492
|
display: flex;
|
|
538
493
|
align-items: center;
|
|
539
494
|
color: #333;
|
|
540
|
-
margin-bottom: 20rpx;
|
|
541
495
|
font-weight: 500;
|
|
496
|
+
background: #FFFFFF;
|
|
542
497
|
.xd-font-icon{
|
|
543
498
|
margin-left: 8rpx;
|
|
544
499
|
}
|
|
@@ -547,10 +502,9 @@
|
|
|
547
502
|
&-content {
|
|
548
503
|
display: flex;
|
|
549
504
|
align-items: center;
|
|
550
|
-
justify-content: space-between;
|
|
551
505
|
font-size: @xd-font-size-sm;
|
|
552
506
|
flex-wrap: wrap;
|
|
553
|
-
|
|
507
|
+
justify-content: space-between;
|
|
554
508
|
&-box {
|
|
555
509
|
width: 100%;
|
|
556
510
|
}
|
|
@@ -558,29 +512,35 @@
|
|
|
558
512
|
|
|
559
513
|
&-item {
|
|
560
514
|
margin-bottom: 30rpx;
|
|
561
|
-
width: 160rpx;
|
|
562
515
|
flex-shrink: 0;
|
|
563
516
|
display: flex;
|
|
564
517
|
flex-direction: column;
|
|
565
518
|
align-items: center;
|
|
519
|
+
|
|
520
|
+
// margin-right: 30rpx;
|
|
521
|
+
// &:nth-child(3n) {
|
|
522
|
+
// margin-right: 0;
|
|
523
|
+
// }
|
|
524
|
+
&:nth-last-child(-n+3) {
|
|
525
|
+
margin-bottom: 0;
|
|
526
|
+
}
|
|
566
527
|
|
|
567
|
-
|
|
568
|
-
width: unit(120,rpx);
|
|
569
|
-
height: unit(120,rpx);
|
|
570
|
-
|
|
528
|
+
.cate_image{
|
|
571
529
|
& > image {
|
|
572
530
|
width: 100%;
|
|
573
531
|
height: 100%;
|
|
574
532
|
}
|
|
575
533
|
}
|
|
576
|
-
|
|
577
|
-
& > view:last-child {
|
|
534
|
+
.cate_text{
|
|
578
535
|
.uni-max-cut(1, 40);
|
|
579
536
|
line-height: unit(40,rpx);
|
|
580
537
|
text-align: center;
|
|
581
538
|
margin-top: unit(10,rpx);
|
|
582
539
|
font-size: 24rpx;
|
|
583
540
|
color: #666666;
|
|
541
|
+
overflow: hidden;
|
|
542
|
+
white-space: nowrap;
|
|
543
|
+
text-overflow: ellipsis;
|
|
584
544
|
}
|
|
585
545
|
}
|
|
586
546
|
}
|