修改购物车逻辑
This commit is contained in:
@ -36,10 +36,11 @@
|
||||
|
||||
<view class="row u-row-center mt20 u-p-b-20" :class="specValueText.indexOf('请选择') != -1 || checkedGoods.stock == 0 ? 'disabled' : ''">
|
||||
<view class="w-40 mr10">
|
||||
<u-button @click="close" hover-class="none" :customStyle="{color: themeColor, border: '1px solid ' + themeColor, padding: '16rpx 0'}" :plain="true" :hair-line="false" shape="circle">取消</u-button>
|
||||
<!-- <u-button @click="close" hover-class="none" :customStyle="{color: themeColor, border: '1px solid ' + themeColor, padding: '16rpx 0'}" :plain="true" :hair-line="false" shape="circle">取消</u-button> -->
|
||||
<u-button @click="confirm('cart')" hover-class="none" :customStyle="{color: themeColor, border: '1px solid ' + themeColor, padding: '16rpx 0'}" :plain="true" :hair-line="false" shape="circle">加入购物车</u-button>
|
||||
</view>
|
||||
<view class="w-40 ml10">
|
||||
<u-button @click="confirm" hover-class="none" :customStyle="{backgroundColor: themeColor, color: '#fff', border: 'none', padding: '16rpx 0'}" :hair-line="false" shape="circle">确定</u-button>
|
||||
<u-button @click="confirm('buy')" hover-class="none" :customStyle="{backgroundColor: themeColor, color: '#fff', border: 'none', padding: '16rpx 0'}" :hair-line="false" shape="circle">确定</u-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -198,7 +199,7 @@
|
||||
// },
|
||||
|
||||
// 确认选择的规格
|
||||
confirm() {
|
||||
confirm(type) {
|
||||
let { checkedGoods, goodsNum } = this;
|
||||
if (this.specValueText.indexOf("请选择") != -1)
|
||||
return this.$toast({
|
||||
@ -211,6 +212,7 @@
|
||||
checkedGoods.goodsNum = goodsNum;
|
||||
this.$emit('buynow', {
|
||||
detail: checkedGoods,
|
||||
type
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user