From abcbd8fe45789d13e8c962be53baa9b5153caaf4 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Tue, 2 Mar 2021 14:33:18 +0800 Subject: [PATCH] no message --- pages/process/order-price/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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 }