Commit b2fe21eb by 施宇

11

parent 719bf102
Showing with 5 additions and 7 deletions
...@@ -51,9 +51,7 @@ App({ ...@@ -51,9 +51,7 @@ App({
if (this.globalData.auth) { if (this.globalData.auth) {
//是否登录 //是否登录
if (judgeToken()) { if (judgeToken()) {
// wx.switchTab({
// url: '/pages/tab/home/home'
// });
} else { } else {
wx.reLaunch({ wx.reLaunch({
url: '/pages/person/login/index' url: '/pages/person/login/index'
......
...@@ -324,21 +324,21 @@ const interval = (usedTime) => { ...@@ -324,21 +324,21 @@ const interval = (usedTime) => {
} }
} }
} }
const fourPoint = (num) => { //检测价格是否是数字或者是四位小数点的小数 const fourPoint = (num) => { //检测价格是否是数字或者是不大于四位小数点的小数
let price = num.trim(); let price = num.trim();
if (!price.length) { if (!price.length) {
tips('请填写价格'); tips('请填写价格');
return false return false
} else { } else {
if (isNaN(Number(price))) { if (isNaN(price)) {
tips('价格必须为数字'); tips('价格必须为数字');
return false return false
} else { } else {
let strArr = price.split('.'); let strArr = price.split('.');
if ((strArr.length == 1) || (strArr.length == 2 && strArr[1].length == 4)) { if ((strArr.length == 1) || (strArr.length == 2 && strArr[1].length < 5)) {
return true return true
} else { } else {
tips('价格只支持4位小数点'); tips('价格最多4位小数点');
return false return false
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment