commit
83dd6c4a3f
@ -1,81 +1,81 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="chosen">
|
<div class="chosen">
|
||||||
<div class="chosen-title flex flex-between flex-middle">
|
<div class="chosen-title flex flex-between flex-middle">
|
||||||
<h3 class="chosen-title--txt">为你精选</h3>
|
<h3 class="chosen-title--txt">为你精选</h3>
|
||||||
<div class="chosen-title--btn flex" @click="getRecommendedGoodsList()">
|
<div class="chosen-title--btn flex" @click="getRecommendedGoodsList()">
|
||||||
<img src="@/assets/img/goods/each.png" alt="切换推荐" />
|
<img src="@/assets/img/goods/each.png" alt="切换推荐" />
|
||||||
<span>换一组</span>
|
<span>换一组</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="chosen-list">
|
<div class="chosen-list">
|
||||||
<UiGoodsItem
|
<UiGoodsItem
|
||||||
:item="item"
|
:item="item"
|
||||||
v-for="item in recommendedData"
|
v-for="item in recommendedData"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
></UiGoodsItem>
|
></UiGoodsItem>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { ApiGetRecommendedGoodsList } from "@/plugins/api/goods";
|
import { ApiGetRecommendedGoodsList } from "@/plugins/api/goods";
|
||||||
import UiGoodsItem from "@/components/UiGoodsItem.vue";
|
import UiGoodsItem from "@/components/UiGoodsItem.vue";
|
||||||
export default {
|
export default {
|
||||||
components: { UiGoodsItem },
|
components: { UiGoodsItem },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
recommendedData: [],
|
recommendedData: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getRecommendedGoodsList();
|
this.getRecommendedGoodsList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getRecommendedGoodsList() {
|
async getRecommendedGoodsList() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
let res = await ApiGetRecommendedGoodsList();
|
let res = await ApiGetRecommendedGoodsList();
|
||||||
vm.recommendedData = res.result;
|
vm.recommendedData = res.result;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.chosen {
|
.chosen {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 30px 0 40px;
|
padding: 30px 0 40px;
|
||||||
background: #f8f8f8;
|
background: #f8f8f8;
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
@include layout-box;
|
@include layout-box;
|
||||||
&--txt {
|
&--txt {
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
}
|
}
|
||||||
&--btn {
|
&--btn {
|
||||||
width: 140px;
|
width: 140px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
img {
|
img {
|
||||||
width: 27px;
|
width: 27px;
|
||||||
height: 27px;
|
height: 27px;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
span {
|
span {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
font-family: Microsoft YaHei-Regular, Microsoft YaHei;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
&-list {
|
&-list {
|
||||||
@include layout-box;
|
@include layout-box;
|
||||||
padding-top: 40px;
|
padding-top: 40px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, 232px);
|
grid-template-columns: repeat(auto-fill, 232px);
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
grid-row-gap: 10px;
|
grid-row-gap: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,10 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: ch
|
|
||||||
* @Date: 2022-05-07 22:57:24
|
|
||||||
* @LastEditors: ch
|
|
||||||
* @LastEditTime: 2022-05-07 22:57:39
|
|
||||||
* @Description: file content
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-radio/>
|
|
||||||
</template>
|
|
Loading…
Reference in new issue