天府星

This commit is contained in:
yanran200730
2022-11-08 13:58:55 +08:00
parent b9f3cda9b8
commit ecd44a3c78
7 changed files with 231 additions and 33 deletions

View File

@@ -31,13 +31,14 @@
<div class="section yh">
<h2>商家优惠</h2>
<div class="yh-list">
<div class="yh-item" v-for="(item, index) in 4" :key="index" hover-class="text-hover" @click="$linkTo('./StoreDetail')">
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/banner.png" />
<div class="yh-item" v-for="(item, index) in list" :key="index" hover-class="text-hover" @click="$linkTo('./StoreDetail?id=' + item.id)">
<image :src="item.userAvatarUrl || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/banner.png'" />
<div class="right">
<h2>实惠超市</h2>
<p>Lv.1会员进店享受9折优惠</p>
<h2>{{ item.merchantName }}</h2>
<p>{{ item.title }}</p>
</div>
</div>
<AiEmpty v-if="!list.length"></AiEmpty>
</div>
<div class="more" @click="$linkTo('./Store')" hover-class="text-hover">查看更多优惠</div>
</div>
@@ -99,10 +100,31 @@
} else {
this.getUserInfo()
}
this.getList()
},
methods: {
...mapActions(['autoLogin', 'getUserInfo'])
...mapActions(['autoLogin', 'getUserInfo']),
getList () {
this.$instance.post(`/api/appmerchantinfo/discountList`, null, {
withoutToken: true,
params: {
current: 1,
size: 4,
status: 1
}
}).then(res => {
if (res.code === 0) {
this.list = res.data.records
this.isMore = true
} else {
this.isMore = true
}
}).catch(() => {
})
}
}
}
</script>