|
|
|
@ -7,7 +7,35 @@
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div :class="listData && listData.length ? 'page' : ''">
|
|
|
|
|
<div v-if="pageloading" class="main flex">
|
|
|
|
|
<el-skeleton
|
|
|
|
|
v-for="item in 5"
|
|
|
|
|
:key="item"
|
|
|
|
|
style="width: 230px;margin-right:20px;"
|
|
|
|
|
:loading="true"
|
|
|
|
|
animated
|
|
|
|
|
>
|
|
|
|
|
<template slot="template">
|
|
|
|
|
<el-skeleton-item variant="image" style="width: 240px; height: 240px" />
|
|
|
|
|
<div style="padding: 14px">
|
|
|
|
|
<el-skeleton-item variant="h3" style="width: 50%" />
|
|
|
|
|
<div
|
|
|
|
|
style="
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-items: space-between;
|
|
|
|
|
margin-top: 16px;
|
|
|
|
|
height: 16px;
|
|
|
|
|
"
|
|
|
|
|
>
|
|
|
|
|
<el-skeleton-item variant="text" style="margin-right: 16px" />
|
|
|
|
|
<el-skeleton-item variant="text" style="width: 30%" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-skeleton>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else :class="listData && listData.length ? 'page' : ''">
|
|
|
|
|
<main class="main" v-if="listData && listData.length">
|
|
|
|
|
<nav class="main__nav">
|
|
|
|
|
<p class="main__nav-crumbs">
|
|
|
|
@ -70,7 +98,7 @@
|
|
|
|
|
<img class="main-none-img" src="@/assets/img/goods/none.png" alt="" />
|
|
|
|
|
<p class="main-none-txt">没有搜到你想要的商品哦,换个关键词试试</p>
|
|
|
|
|
</main>
|
|
|
|
|
<BsChosen></BsChosen>
|
|
|
|
|
<BsChosen v-if="!listData || !listData.length"></BsChosen>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
@ -81,11 +109,12 @@ import {
|
|
|
|
|
} from "@/plugins/api/goods";
|
|
|
|
|
import Sort from "./module/SortItem.vue";
|
|
|
|
|
import UiGoodsItem from "@/components/UiGoodsItem.vue";
|
|
|
|
|
import BsChosen from '@/components/BsChosen.vue';
|
|
|
|
|
import BsChosen from "@/components/BsChosen.vue";
|
|
|
|
|
export default {
|
|
|
|
|
components: { Sort, UiGoodsItem, BsChosen },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
pageloading: true,
|
|
|
|
|
navActive: 0,
|
|
|
|
|
levelActive: 0,
|
|
|
|
|
listData: [],
|
|
|
|
@ -104,7 +133,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
async created() {
|
|
|
|
|
created() {
|
|
|
|
|
this.init();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
@ -168,6 +197,7 @@ export default {
|
|
|
|
|
vm.params.categoryId = vm.categoryOneList[vm.levelActive].id;
|
|
|
|
|
}
|
|
|
|
|
let res = await ApiGetGoodsList(vm.params);
|
|
|
|
|
vm.pageloading = false;
|
|
|
|
|
if (res.error) {
|
|
|
|
|
vm.$message.error(res.error.message);
|
|
|
|
|
return false;
|
|
|
|
@ -286,5 +316,4 @@ export default {
|
|
|
|
|
color: #999999;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|