From 8413f0ac95669fb6b37a1222ad1da991f758e7a2 Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Tue, 18 Dec 2018 10:44:36 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E4=BB=B7=E7=94=B3=E8=AF=B7=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E9=A1=B5=E8=BE=93=E5=85=A5=E5=B0=8F=E6=95=B0=E6=97=B6?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/detail/detail.js | 71 ------------------- .../specialOrderApplyDetail.js | 14 ++-- 2 files changed, 10 insertions(+), 75 deletions(-) diff --git a/pages/order/detail/detail.js b/pages/order/detail/detail.js index 1e03168..663ed6e 100644 --- a/pages/order/detail/detail.js +++ b/pages/order/detail/detail.js @@ -367,77 +367,6 @@ Page({ this.util(); }, - // getGoodsNum: function (e) { - // var v = e.detail.value; - // let end = v.charAt(v.length - 1) - // if (end == ".") - // return; - // let idx = e.target.dataset.idx; - // var detail = this.data.dmo.Details[idx]; - // let value = Number(v); - // if (isNaN(value)) { - // wx.showModal({ - // title: '提示', - // content: '输入格式不正确', - // }); - // } else { - // detail.UnitNum = value; - - // var numberNumber = detail.UnitNum / detail.RightRatio * detail.LeftRatio; - // if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 1) { - // detail.SecondNumber = numberNumber / (detail.Goods_MainUnitRatio) * (detail.Goods_SecondUnitRatio); - // } - // } - // this.setData({ - // dmo: this.data.dmo - // }) - // }, - - // getSecondNum: function (e) { - // var v = e.detail.value; - // let end = v.charAt(v.length - 1) - // if (end == ".") - // return; - // let idx = e.target.dataset.idx; - // var detail = this.data.dmo.Details[idx]; - // let value = Number(v); - // if (isNaN(value)) { - // wx.showModal({ - // title: '提示', - // content: '输入格式不正确', - // }); - // } else { - // detail.SecondNumber = value; - - // var numberNumber = detail.SecondNumber / detail.LeftRatio * detail.RightRatio; - // if (detail.Goods_UnitConvertDirection == 0 || detail.Goods_UnitConvertDirection == 2) { - // detail.UnitNum = numberNumber / (detail.Goods_SecondUnitRatio) * (detail.Goods_MainUnitRatio); - // } - // } - // this.setData({ - // dmo: this.data.dmo - // }) - // }, - - // getPrice: function (e) { - // var v = e.detail.value; - // let end = v.charAt(v.length - 1) - // if (end == ".") - // return; - // let idx = e.target.dataset.idx; - // let value = Number(v); - // if (isNaN(value)) { - // wx.showToast({ - // title: '提示', - // content: '输入格式不正确', - // }) - // } else - // this.data.dmo.Details[idx].Price = value; - // this.setData({ - // dmo: this.data.dmo - // }) - // }, - getGoodsNum: function (e) { let idx = e.target.dataset.idx; var detail = this.data.dmo.Details[idx]; diff --git a/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js b/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js index 8506bb8..0efc6a4 100644 --- a/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js +++ b/pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js @@ -111,15 +111,21 @@ Page({ this.data.remark = e.detail.value; }, + // 获取输入框值进行保存 getInputValue: function (e) { var style = e.currentTarget.dataset.datastyle var itemIndex = e.currentTarget.dataset.index; var array = this.data.goodsNameArr; - array[itemIndex][style] = e.detail.value, - this.setData({ - goodsNameArr: array, - }) + + let value = e.detail.value; + let end = value.charAt(value.length - 1) + if (end != ".") { + array[itemIndex][style] = Number(value), + this.setData({ + goodsNameArr: array, + }) + } }, // 获取存货时间变化进行保存