优化逻辑
This commit is contained in:
parent
54af4deacf
commit
fc5d34772c
|
@ -19,7 +19,7 @@
|
||||||
<text class="text">{{ cartCount }}</text>
|
<text class="text">{{ cartCount }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="order-btn" @click="utils.toPage('/pages/service/cart')">
|
<view class="order-btn" @click="toCart">
|
||||||
<text class="text">去下单</text>
|
<text class="text">去下单</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -128,6 +128,16 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 去下单
|
||||||
|
*/
|
||||||
|
toCart() {
|
||||||
|
if (this.cartCount > 0) {
|
||||||
|
this.$utils.toPage("/pages/service/cart");
|
||||||
|
} else {
|
||||||
|
this.$utils.toast("请添加商品到购物车");
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue