Commit 54461e54 by wangzhihui

修复bug

1 parent 1ecc8c1f
...@@ -147,7 +147,7 @@ Page({ ...@@ -147,7 +147,7 @@ Page({
}) })
} }
}).catcn((err) => { }).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err)) wx.p.wxApi.showToast(JSON.stringify(err))
}) })
}, },
......
...@@ -146,7 +146,7 @@ Page({ ...@@ -146,7 +146,7 @@ Page({
} }
}) })
}, },
goBank(){ goBank() {
let { let {
score score
} = this.data; } = this.data;
...@@ -236,15 +236,23 @@ Page({ ...@@ -236,15 +236,23 @@ Page({
price = '0.' price = '0.'
} }
} }
// 4. 处理多个小数点的情况,只保留第一个小数点
const dotIndex = price.indexOf('.')
if (dotIndex !== -1) {
const beforeDot = price.substring(0, dotIndex)
const afterDot = price.substring(dotIndex + 1).replace(/\./g, '')
price = beforeDot + '.' + afterDot
}
result = price result = price
// 4.判断最大值和最小值 // 4.判断最大值和最小值
if (price) { if (price) {
price = Number(price) price = Number(price)
max = Number(max) max = Number(max)
if ((max||max===0) && price > max) { if ((max || max === 0) && price > max) {
result = max result = max
} }
if ((min||min===0) && price < min) { if ((min || min === 0) && price < min) {
result = min result = min
} }
} }
......
...@@ -32,8 +32,8 @@ Page({ ...@@ -32,8 +32,8 @@ Page({
let userInfo = wx.p.storage.get('userInfo') let userInfo = wx.p.storage.get('userInfo')
let params = { let params = {
pageNum: 2, pageNum: 1,
pageSize: 4, pageSize: 8,
canExchange: 1, canExchange: 1,
businessType:1, businessType:1,
staffPhone: userInfo?.phone, staffPhone: userInfo?.phone,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!