diff --git a/pages/process/order-price/index.js b/pages/process/order-price/index.js index 0261e7e..9d82fa7 100644 --- a/pages/process/order-price/index.js +++ b/pages/process/order-price/index.js @@ -102,15 +102,17 @@ Page({ util.showToast('请输入单价') return } - if(this.data.nowItem.highestUnitPrice && Number(this.data.form.unitPrice) > Number(this.data.nowItem.highestUnitPrice)){ - util.showToast('输入单价过高,价格范围:' + this.data.nowItem.lowestUnitPrice + '元/KG-'+ this.data.nowItem.highestUnitPrice + '元/KG') - return - } - if(this.data.nowItem.lowestUnitPrice && Number(this.data.form.unitPrice) < Number(this.data.nowItem.lowestUnitPrice)){ - util.showToast('输入单价过低,价格范围:' + this.data.nowItem.lowestUnitPrice + '元/KG-'+ this.data.nowItem.highestUnitPrice + '元/KG') - return + if(this.data.nowItem){ + if(this.data.nowItem.highestUnitPrice && Number(this.data.form.unitPrice) > Number(this.data.nowItem.highestUnitPrice)){ + util.showToast('输入单价过高,价格范围:' + this.data.nowItem.lowestUnitPrice + '元/KG-'+ this.data.nowItem.highestUnitPrice + '元/KG') + return + } + if(this.data.nowItem.lowestUnitPrice && Number(this.data.form.unitPrice) < Number(this.data.nowItem.lowestUnitPrice)){ + util.showToast('输入单价过低,价格范围:' + this.data.nowItem.lowestUnitPrice + '元/KG-'+ this.data.nowItem.highestUnitPrice + '元/KG') + return + } } - if(!util.isEmpty(this.data.form.deductWeight) && Number(this.data.form.deductWeight) >= Number(this.data.nowItem.totalWeight)){ + if(!util.isEmpty(this.data.form.deductWeight) && Number(this.data.form.deductWeight) >= Number(this.data.form.totalWeight)){ util.showToast('扣重不得超过皮重') return }