Browse Source

特价申请详情页输入小数时bug修复

master
chenxuhui 7 years ago
parent
commit
8413f0ac95
2 changed files with 10 additions and 75 deletions
  1. +0
    -71
      pages/order/detail/detail.js
  2. +10
    -4
      pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js

+ 0
- 71
pages/order/detail/detail.js View File

@ -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];


+ 10
- 4
pages/specialOrderApplication/specialOrderApplyDetail/specialOrderApplyDetail.js View File

@ -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,
})
}
},
// 获取存货时间变化进行保存


Loading…
Cancel
Save