|
@@ -54,18 +54,19 @@ Page({
|
|
outMoney(e) {
|
|
outMoney(e) {
|
|
//console.log(e);
|
|
//console.log(e);
|
|
let outMoney = e.detail.value;
|
|
let outMoney = e.detail.value;
|
|
- // 如果输入的长度超过2个字符,则截取前2个字符
|
|
|
|
- if (outMoney.length > 4) {
|
|
|
|
- outMoney = outMoney.slice(0, 4);
|
|
|
|
|
|
+ let value = outMoney;
|
|
|
|
+ if (value.includes('.')) {
|
|
|
|
+ let parts = value.split('.');
|
|
|
|
+ if (parts[1].length > 2) {
|
|
|
|
+ value = parts[0] + '.' + parts[1].substring(0, 2);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
this.setData({
|
|
this.setData({
|
|
- inputValue:outMoney
|
|
|
|
|
|
+ inputValue:value
|
|
});
|
|
});
|
|
this.setData({
|
|
this.setData({
|
|
outMoney:this.data.inputValue
|
|
outMoney:this.data.inputValue
|
|
});
|
|
});
|
|
- console.log(this.data.outMoney);
|
|
|
|
- console.log("45456");
|
|
|
|
if (this.data.userInfo.repaidbalance && outMoney && outMoney >= 0.3 && outMoney <= this.data.userInfo.repaidbalance) {
|
|
if (this.data.userInfo.repaidbalance && outMoney && outMoney >= 0.3 && outMoney <= this.data.userInfo.repaidbalance) {
|
|
if (this.data.remarkArrayIndex){
|
|
if (this.data.remarkArrayIndex){
|
|
this.setData({
|
|
this.setData({
|