rewrite tab swiper 8.7

This commit is contained in:
2020-08-07 17:34:59 +08:00
parent f4ba942870
commit 9d3f8da629
8 changed files with 153 additions and 92 deletions

View File

@@ -9,7 +9,7 @@
@click="removeFavorite"
@open="open"
>
<view class="item u-border-bottom">
<view class="item u-border-bottom" @click="viewGoodsDetails(item)">
<image :src="item.goods_image"></image>
<!-- 此层wrap在此为必写的否则可能会出现标题定位错误 -->
<view class="title-wrap">
@@ -45,6 +45,18 @@ export default {
this.getGoodsFavoritesList();
},
methods: {
viewGoodsDetails(item) {
const list = this.list.filter(item => {
return item.show;
})
if(list.length) return false;
this.$u.route({
url: 'pageB/sdetails/index',
params: {
id: item.fav_id,
}
})
},
getGoodsFavoritesList() {
this.$u.api.getFavoritesList().then(res => {
if(res.errCode == 0) {
@@ -75,6 +87,7 @@ export default {
this.list.map((val, idx) => {
if(index != idx) this.list[idx].show = false;
})
this.$forceUpdate();
}
},
};