修改购物车逻辑

This commit is contained in:
2025-08-11 15:48:44 +08:00
parent 9c0be00fbd
commit ff5e4af2d4
3 changed files with 21 additions and 16 deletions

View File

@ -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
});
}
},