优化逻辑

This commit is contained in:
TOP糯米 2023-03-22 22:29:57 +08:00
parent 54af4deacf
commit fc5d34772c
1 changed files with 11 additions and 1 deletions

View File

@ -19,7 +19,7 @@
<text class="text">{{ cartCount }}</text>
</view>
</view>
<view class="order-btn" @click="utils.toPage('/pages/service/cart')">
<view class="order-btn" @click="toCart">
<text class="text">去下单</text>
</view>
</view>
@ -128,6 +128,16 @@ export default {
});
}
},
/**
* 去下单
*/
toCart() {
if (this.cartCount > 0) {
this.$utils.toPage("/pages/service/cart");
} else {
this.$utils.toast("请添加商品到购物车");
}
},
},
};
</script>