Commit 54461e54 by wangzhihui

修复bug

1 parent 1ecc8c1f
......@@ -147,7 +147,7 @@ Page({
})
}
}).catcn((err) => {
}).catch((err) => {
wx.p.wxApi.showToast(JSON.stringify(err))
})
},
......
......@@ -146,7 +146,7 @@ Page({
}
})
},
goBank(){
goBank() {
let {
score
} = this.data;
......@@ -236,15 +236,23 @@ Page({
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
// 4.判断最大值和最小值
if (price) {
price = Number(price)
max = Number(max)
if ((max||max===0) && price > max) {
if ((max || max === 0) && price > max) {
result = max
}
if ((min||min===0) && price < min) {
if ((min || min === 0) && price < min) {
result = min
}
}
......
......@@ -32,8 +32,8 @@ Page({
let userInfo = wx.p.storage.get('userInfo')
let params = {
pageNum: 2,
pageSize: 4,
pageNum: 1,
pageSize: 8,
canExchange: 1,
businessType:1,
staffPhone: userInfo?.phone,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!