mine concerns 8.15

This commit is contained in:
2020-08-15 17:16:11 +08:00
parent 7deb5d312b
commit df52535848
11 changed files with 377 additions and 227 deletions

View File

@@ -31,9 +31,9 @@
<text>{{ goodsInfo.goods_price || '0.00' }}</text>
</view>
<view class="collect" @click="switchCollect(goodsInfo.is_collect)">
<u-icon name="star" color="#474747" size="28" v-if="goodsInfo.is_collect == 0"></u-icon>
<u-icon name="star-fill" color="#FF7807" size="28" v-else></u-icon>
<text>{{ !goodsInfo.is_collect == 1 ? '收藏' : '收藏' }}</text>
<u-icon name="star-fill" color="#FF7807" size="28" v-if="goodsInfo.is_collect == 1"></u-icon>
<u-icon name="star" color="#474747" size="28" v-else></u-icon>
<text>{{ goodsInfo.is_collect == 1 ? '收藏' : '收藏' }}</text>
</view>
</view>
</view>
@@ -638,7 +638,7 @@ export default {
current: arr[index]
})
},
switchCollect(status) {
switchCollect(status = 0) {
if(status == 1) {
this.removeFavorite();
} else {
@@ -646,6 +646,13 @@ export default {
}
},
addFavoriteGoods() {
// // 尝试登录
// if (!this.$store.state.hasLogin) {
// uni.navigateTo({
// url: "pageA/login/login"
// })
// return false;
// }
this.$u.api.addFavoriteGoods({ fid: this.goodsInfo.goods_id }).then(res => {
if(res.errCode == 0) {
this.getGoodsDetails(this.id);