修复代客下单起售数量问题

This commit is contained in:
2024-10-12 15:18:27 +08:00
parent 1bf3334127
commit 68c23e6e48
2 changed files with 20 additions and 6 deletions

View File

@@ -52,8 +52,10 @@
import {
computed,
reactive,
ref
ref,
watch
} from 'vue';
import infobox from '@/commons/utils/infoBox.js'
import myModel from '@/components/my-components/my-model.vue'
import myButton from '@/components/my-components/my-button.vue'
const props = defineProps({
@@ -98,6 +100,10 @@
const goods=computed(()=>{
return props.skuMap[selSku.value]
})
watch(()=>goods.value,(newval)=>{
console.log(newval);
number.value=newval.suit||1
})
//全部规格是否都无法使用
const isAllDisabled=computed(()=>{
@@ -142,7 +148,11 @@
if(isDisabled()){
return
}
const suit=goods.value.suit||1
const newval = number.value - 1
if(newval<suit){
return infobox.showToast(suit+'个起售')
}
number.value = newval <= 1 ? 1 : newval
}