修改文件
This commit is contained in:
@ -29,7 +29,8 @@
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="flex1 u-text-right">
|
||||
<u-number-box v-model="goodsNum" :min="1" :max="checkedGoods.stock"
|
||||
<!-- 限购逻辑:套餐和单品内的商品列表,每个都是只能购买两个 -->
|
||||
<u-number-box v-model="goodsNum" :min="1" :max="goods.first_category_id == 1 || goods.first_category_id == 2 ? 2 : checkedGoods.stock"
|
||||
:disabled="disabledNumberBox"></u-number-box>
|
||||
</view>
|
||||
</view>
|
||||
@ -157,6 +158,23 @@
|
||||
|
||||
},
|
||||
|
||||
// 商品数量变化
|
||||
handleCountChange({ value }) {
|
||||
console.log("🚀 ~ countChange ~ value:", value)
|
||||
console.log("🚀 ~ countChange ~ goods:", this.goods)
|
||||
if (this.goods.first_category_id === 1 || this.goods.first_category_id === 2) {
|
||||
// 套餐和单品系列限购2套
|
||||
if (value > 2) {
|
||||
this.disabledNumberBox = true
|
||||
return this.$toast({
|
||||
title: '套餐与单品系列限购2套',
|
||||
})
|
||||
} else {
|
||||
this.goodsNum = value
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 选择规格
|
||||
// chooseSpec(item, index1, index2, attr) {
|
||||
// if (item.name == '辣度') {
|
||||
|
||||
Reference in New Issue
Block a user