feat: 起订倍数修改

This commit is contained in:
2025-09-09 22:53:10 +08:00
parent c47ebbc121
commit 9c625a594b
2 changed files with 18 additions and 7 deletions
@@ -158,7 +158,7 @@
:class="oItem.inventory === 0 ? 'item_Warp item_Warp_no_warp' : item.selectVal === oItem.n ? 'item_Warp item_Warp_yes_warp' : 'item_Warp'"
v-for="(oItem, oIndex) in item.items"
:key="oItem.n"
@click="clickSpecification(index, oItem)"
@click="clickSpecification(index,item, oItem)"
>
{{ oItem.n }}
</view>
@@ -433,10 +433,13 @@ export default {
}
},
//改变规格的样式
clickSpecification(pIndex, oItem) {
// if(oItem.inventory<=0){
// return;
// }
clickSpecification(pIndex,item, oItem) {
console.log("改变规格的样式",item,oItem,this.specificationTempl)
const currentSelectSpecification = this.specificationTempl.find(ele=>ele.combTypes == item.type && ele.combNames == oItem.n);
console.log("当前规格",currentSelectSpecification)
this.orderInfo.quantity = currentSelectSpecification?.minBuyNum || 1;
this.specificationList[pIndex].selectVal = oItem.n;
// 计算规格的价格
this.selectSpecificationFun(pIndex, oItem);
@@ -467,6 +470,7 @@ export default {
quantityFun(type) {
let currentQuantity = this.orderInfo.quantity; // 当前数量
const minBuyNum = this.selectSpecificationTempl.minBuyNum || 1; // 当前起订量,默认为1
console.log(' 当前起订量,默认为1',currentQuantity,minBuyNum)
// 确保起订量至少为1
const step = Math.max(minBuyNum, 1);