comment 7.2

This commit is contained in:
2020-07-24 19:48:57 +08:00
parent 4196f545fd
commit dd71a0f32a
23 changed files with 1630 additions and 350 deletions

View File

@@ -11,7 +11,7 @@
<swiper-item class="swiper-item list" v-for="(_, i) in classifyList" :key="i">
<!-- 最多显示3个 -->
<sitem :info="info" v-for="(info, index) in groupList.slice(0, 3)" :key="index"></sitem>
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length"></u-empty>
<u-empty text="暂无拼团商品" mode="list" color="#000" v-if="!groupList.length" style="margin: 0 auto;"></u-empty>
</swiper-item>
</swiper>
</view>
@@ -24,16 +24,33 @@ export default {
sitem
},
props: {
groupList: Array,
classifyList: Array,
},
data(){
return {
current: 0,
current: -1,
swiperCurrent: 0,
groupList: [], // 拼团商品
}
},
watch: {
current(value) {
this.getPinTuanList(this.classifyList[value].gc_id);
}
},
created() {
this.current = 0;
},
methods: {
// 拼团列表
getPinTuanList(id) {
this.$u.api.getPinTuanList({
page: 0,
gc_id: id,
}).then(res => {
this.groupList = res.data;
})
},
tabsChange(index) {
this.swiperCurrent = index;
},
@@ -52,7 +69,9 @@ export default {
</script>
<style lang="scss" scoped>
.group{
.top{
background-color: #ffffff;
.top {
padding: 0 30rpx;
height: 90rpx;
width: 100%;
display: flex;
@@ -67,18 +86,11 @@ export default {
color: #999;
}
}
// .label{
// display: flex;
// font-size: 24rpx;
// color: #999;
// >text{
// margin-right: 34rpx;
// }
// }
.list{
.list {
box-sizing: border-box;
padding: 30rpx;
display: flex;
justify-content: space-between;
margin-top: 21rpx;
}
}
</style>

View File

@@ -16,19 +16,26 @@ export default {
},
methods: {
toDetailsPage() {
this.$u.api.getPinTuanDetails({
pintuan_id: this.info.pintuan_id,
}).then(res => {
if(res.errCode == 0) {
const goods = {
goods: res.data.data,
type: 2,
}
this.$store.commit('setGoodsDetails', goods);
this.$store.commit('setGoodsId', this.info.pintuan_id);
this.$u.route({
url: 'pageB/sdetails/index',
})
// this.$u.api.getPinTuanDetails({
// pintuan_id: this.info.pintuan_id,
// }).then(res => {
// if(res.errCode == 0) {
// const goods = {
// goods: res.data.data,
// type: 2,
// }
// this.$store.commit('setGoodsDetails', goods);
// this.$store.commit('setGoodsId', this.info.pintuan_id);
// this.$u.route({
// url: 'pageB/sdetails/index',
// })
// }
// })
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: this.info.pintuan_id,
type: 2,
}
})
}