Skip to content

Commit b767233

Browse files
committed
fix:家具
1 parent 5a67712 commit b767233

4 files changed

Lines changed: 48 additions & 18 deletions

File tree

src/assets/css/furniture/pc/single.less

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,32 @@
6565
.mt(40px);
6666
.mb(20px);
6767
.flex;
68+
align-items: stretch;
6869
gap: 20px;
6970

7071
.u-img {
7172
box-shadow: 0px 0px 10px 0px #0000001A;
7273
.pr;
73-
.size(240px, 240px);
74+
width: 240px;
75+
min-height: 240px;
7476
.r(10px);
7577
box-sizing: border-box;
7678
background: #ffffff;
7779
padding: 10px;
7880
box-sizing: border-box;
7981
flex-shrink: 0;
82+
.flex;
83+
align-items: center;
84+
justify-content: center;
8085

8186
.u-img-wrap {
8287
background-image: url("../../../../assets/img/horse/horse_item_bg_sm.jpg");
8388
background-position: center;
8489
background-repeat: no-repeat;
8590
background-size: cover;
8691
width: 100%;
87-
height: 100%;
92+
height: auto;
93+
aspect-ratio: 1 / 1;
8894
.flex;
8995
align-items: center;
9096
justify-content: center;
@@ -105,7 +111,8 @@
105111
.u-info {
106112
box-shadow: 0px 0px 10px 0px #0000001A;
107113
.pr;
108-
.size(100%, 240px);
114+
width: 100%;
115+
min-height: 240px;
109116
background-color: #fff;
110117
padding: 20px;
111118
box-sizing: border-box;
@@ -298,8 +305,17 @@
298305
margin-right: 0;
299306
width: 100%;
300307
height: unset;
308+
min-height: unset;
301309
.flex;
310+
align-items: center;
302311
justify-content: center;
312+
313+
.u-img-wrap {
314+
width: 240px;
315+
max-width: 100%;
316+
height: auto;
317+
aspect-ratio: 1 / 1;
318+
}
303319
}
304320
}
305321

src/views/furniture/Index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ export default {
171171
key: "isSet",
172172
value: "庐园广记",
173173
},
174+
{
175+
key: "isMatch",
176+
value: "园宅会赛",
177+
},
174178
],
175179
},
176180
],

src/views/furniture/Single.vue

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@
1212
{{ data.szName }}
1313
<i class="u-interact" v-if="data.bInteract"></i>
1414
</div>
15-
<!-- <div class="u-attrs">
16-
<span class="u-attr" v-if="data.Attribute1"><span class="u-label blue">观赏</span>{{ data.Attribute1 }}</span>
17-
<span class="u-attr" v-if="data.Attribute2"><span class="u-label pink">实用</span>{{ data.Attribute2 }}</span>
18-
<span class="u-attr" v-if="data.Attribute3"><span class="u-label yellow">坚固</span>{{ data.Attribute3 }}</span>
19-
<span class="u-attr" v-if="data.Attribute4"><span class="u-label green">风水</span>{{ data.Attribute4 }}</span>
20-
<span class="u-attr" v-if="data.Attribute5"><span class="u-label purple">趣味</span>{{ data.Attribute5 }}</span>
21-
</div> -->
22-
<div class="u-attrs" v-if="data.Record || data.Record === 0">
23-
<span class="u-attr"
15+
<div class="u-attrs" v-if="data.Record || data.Record === 0 || furniture_attrs.length">
16+
<span class="u-attr" v-if="data.Record || data.Record === 0"
2417
><span class="u-label score">装修评分</span>{{ data.Record }}</span
2518
>
19+
<span class="u-attr" v-for="item in furniture_attrs" :key="item.key"
20+
><span class="u-label" :class="item.className">{{ item.label }}</span>{{ item.value }}</span
21+
>
2622
</div>
2723
<div class="u-metas">
2824
<span class="u-meta"
@@ -363,13 +359,22 @@ export default {
363359
return getFurnitureType(this.data, this.category);
364360
},
365361
furniture_attrs: function () {
362+
const hasAttrValue = (value) => ![undefined, null, ""].includes(value);
363+
const useDefaultAttrs =
364+
Number(this.data?.nFurnitureType) === 2 &&
365+
!this.data?.Attribute1 &&
366+
!this.data?.Attribute2 &&
367+
!this.data?.Attribute3 &&
368+
!this.data?.Attribute4 &&
369+
!this.data?.Attribute5;
370+
366371
return [
367-
{ key: "view", label: "观赏", value: this.data?.Attribute1, className: "blue" },
368-
{ key: "practical", label: "实用", value: this.data?.Attribute2, className: "pink" },
369-
{ key: "strong", label: "坚固", value: this.data?.Attribute3, className: "yellow" },
370-
{ key: "fengshui", label: "风水", value: this.data?.Attribute4, className: "green" },
371-
{ key: "interest", label: "趣味", value: this.data?.Attribute5, className: "purple" },
372-
].filter((item) => item.value);
372+
{ key: "view", label: "观赏", value: useDefaultAttrs ? 1 : this.data?.Attribute1, className: "blue" },
373+
{ key: "practical", label: "实用", value: useDefaultAttrs ? 1 : this.data?.Attribute2, className: "pink" },
374+
{ key: "strong", label: "坚固", value: useDefaultAttrs ? 1 : this.data?.Attribute3, className: "yellow" },
375+
{ key: "fengshui", label: "风水", value: useDefaultAttrs ? 1 : this.data?.Attribute4, className: "green" },
376+
{ key: "interest", label: "趣味", value: useDefaultAttrs ? 1 : this.data?.Attribute5, className: "purple" },
377+
].filter((item) => hasAttrValue(item.value));
373378
},
374379
375380
has_extend: function () {

src/views/furniture/miniprogram/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ export default {
219219
value: "庐园广记",
220220
paramsKey: "isSet",
221221
},
222+
{
223+
key: "1",
224+
value: "园宅会赛",
225+
paramsKey: "isMatch",
226+
},
222227
],
223228
},
224229
],

0 commit comments

Comments
 (0)