|
|
|
@ -181,15 +181,20 @@ Page({ |
|
|
|
if(this.checkSkuPrice(this.data.matchTag, element)){ |
|
|
|
this.data.form.unitPrice = Number(element.price) |
|
|
|
this.data.form.stockNumber = Number(element.stockNumber) |
|
|
|
// 如果当前的数量大于所选规格的库存数量,那么就设置成库存数量;
|
|
|
|
if(this.data.form.number > this.data.form.stockNumber){ |
|
|
|
this.data.form.number = Number(element.stockNumber) |
|
|
|
} |
|
|
|
this.data.form.dividePrice = Number(element.dividePrice) |
|
|
|
this.data.form.skuId = element.id |
|
|
|
console.log(element) |
|
|
|
// console.log(element)
|
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
// 如果查询到了价格,进行价格计算
|
|
|
|
if(this.data.form.unitPrice){ |
|
|
|
this.setData({ |
|
|
|
['form.number']: this.data.form.number, |
|
|
|
['form.unitPrice']: this.data.form.unitPrice, |
|
|
|
['form.stockNumber']: this.data.form.stockNumber, |
|
|
|
amount: float.accMul(this.data.form.unitPrice, this.data.form.number) |
|
|
|
|