Skip to content

Commit

Permalink
fix: 家具改不动,修个BUG…
Browse files Browse the repository at this point in the history
  • Loading branch information
zixuan1986 committed Feb 21, 2024
1 parent e664601 commit 8898d4b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 deletions.
31 changes: 13 additions & 18 deletions src/views/furniture/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div ref="listRef" class="p-furniture" v-loading="loading">
<PvxSearch
ref="search"
:items="isPhone? searchProps.slice(0,1) : searchProps"
:items="isPhone ? searchProps.slice(0, 1) : searchProps"
:initValue="initValue"
:active="isActive"
class="m-furniture-search"
Expand All @@ -26,7 +26,7 @@
<PvxSearch
style="margin-top: 40px"
ref="search"
:items="searchProps.slice(2,3)"
:items="searchProps.slice(2, 3)"
:initValue="initValue"
:active="isActive"
class="m-furniture-search"
Expand All @@ -47,14 +47,8 @@
</div>
</div>
<div v-if="list.length" class="m-furniture-list" :class="!childCategory.length && 'm-no-child'">
<!-- <FurnitureItem :item="item" v-for="item in list" :key="item.ID" :copy="hasCopy"></FurnitureItem>-->
<furnitureSet
:data="item"
v-for="item in list"
:key="item.ID"
:category="categoryObj"
:copy="hasCopy"
/>
<!-- <FurnitureItem :item="item" v-for="item in list" :key="item.ID" :copy="hasCopy"></FurnitureItem>-->
<furnitureSet :data="item" v-for="item in list" :key="item.ID" :category="categoryObj" :copy="hasCopy" />
<div class="m-furniture-null" v-if="!list.length">
<el-alert center title="没有对应的家具" show-icon type="info"> </el-alert>
</div>
Expand Down Expand Up @@ -233,6 +227,9 @@ export default {
},
},
computed: {
isPhone() {
return isPhone();
},
hasNextPage: function () {
return this.pages > 1 && this.page < this.pages;
},
Expand Down Expand Up @@ -270,7 +267,6 @@ export default {
...this.search,
};
},
isPhone
},
watch: {
active(type) {
Expand Down Expand Up @@ -391,16 +387,16 @@ export default {
};
});
if (window.innerWidth > 1680) {
this.searchProps[0].options = this.category
this.searchProps[0].options = this.category;
} else {
this.searchProps[0].type = 'select'
this.searchProps[0].options = this.category.map(i => {
this.searchProps[0].type = "select";
this.searchProps[0].options = this.category.map((i) => {
return {
id: i.id,
value: i.type,
label: i.name,
children: i.children,
}
};
});
}
Expand Down Expand Up @@ -481,7 +477,7 @@ export default {
const base = 348;
this.per = Math.floor(listWidth / base) * 4;
// 加载更多按钮的实际宽度
if (!this.isPhone()) {
if (!this.isPhone) {
this.buttonWidth = (this.per / 4) * (base + 20) - 20;
}
this.getData();
Expand Down Expand Up @@ -528,7 +524,7 @@ export default {
flex-wrap: wrap;
flex-direction: row;
justify-content: space-between;
gap:10px;
gap: 10px;
.search-item {
width: 40% !important;
position: relative;
Expand All @@ -541,5 +537,4 @@ export default {
}
}
}
</style>
14 changes: 7 additions & 7 deletions src/views/horse/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<el-popover
ref="popover"
:placement="isPhone ? 'right' : 'bottom'"
:width="!isPhone && 420"
:width="isPhone ? '100%' : '420px'"
trigger="click"
>
<div class="filter-content">
Expand All @@ -29,7 +29,7 @@
</el-row>
</div>
<template slot="reference">
<img svg-inline src="@/assets/img/filter.svg" fill="#949494" @click="filter = true" />
<img svg-inline src="@/assets/img/filter.svg" @click="filter = true" />
</template>
</el-popover>
</div>
Expand Down Expand Up @@ -241,7 +241,7 @@ export default {
methods: {
iconLink,
clickTabs(type) {
const active = this.typeList.filter((item) => item.value == type)[0].type;
const active = this.typeList.filter((item) => item.value == type)[0].type;
this.active = active;
this.typeList = this.typeList.map((e) => {
e.page = 1;
Expand Down Expand Up @@ -365,19 +365,19 @@ export default {
},
loadData(params = this.params) {
this.loading = true;
params = omit(params, ["type", "value", "label"]);
params = omit(params, ["type", "value", "label"]);
if (this.active === "") {
const list = this.typeList.filter((e) => e.type !== "");
list.forEach((e) => {
params.page = e.page;
params.type = e.type;
params.per = this.per;
this.loadList(params, e.type);
});
});
} else {
params.page = this.page;
params.per = this.per * 3;
this.loadList({ ...params, type: this.active }, this.active);
this.loadList({ ...params, type: this.active }, this.active);
}
},
loadList(params, key) {
Expand Down Expand Up @@ -425,7 +425,7 @@ export default {
this.feed = [];
this.attr = [];
},
updateToolbar(data) {
updateToolbar(data) {
const { type, search } = data;
this.keyword = search;
this.clickTabs(type);
Expand Down

0 comments on commit 8898d4b

Please sign in to comment.