diff --git a/pages/index/index.js b/pages/index/index.js index b10f182..bdf801b 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -145,6 +145,8 @@ Page({ for(let i = 0;i { + return $1 + ","; }).replace(/\.$/, "") } this.setData({todoList:res.rows}) } @@ -174,6 +176,8 @@ Page({ for(let i = 0;i { + return $1 + ","; }).replace(/\.$/, "") } this.setData({doneList:res.rows}) } @@ -200,6 +204,10 @@ Page({ if (res.code == API.SUCCESS_CODE) { let a = res.total this.setData({yfqNum:a}) + for(let i = 0;i { + return $1 + ","; }).replace(/\.$/, "") + } this.setData({yfqList:res.rows}) } }, fail: (res) => { @@ -223,7 +231,12 @@ Page({ let a = this.data.yfqNum+res.total this.setData({yfqNum:a}) let b = this.data.yfqList - this.setData({yfqList:res.rows.concat(b)}) + let c = res.rows.concat(b) + for(let i = 0;i< c.lenght;i++){ + c[i].totalAmount = Number(c[i].totalAmount).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => { + return $1 + ","; }).replace(/\.$/, "") + } + this.setData({yfqList:c}) } }, fail: (res) => { }, @@ -245,6 +258,10 @@ Page({ success: (res) => { if (res.code == API.SUCCESS_CODE) { this.setData({yzdNum:res.total}) + for(let i = 0;i< res.rows.lenght;i++){ + res.rows[i].totalAmount = Number(res.rows[i].totalAmount).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, ($0, $1) => { + return $1 + ","; }).replace(/\.$/, "") + } this.setData({yzdList:res.rows}) } }, fail: (res) => { diff --git a/pages/index/index.wxml b/pages/index/index.wxml index d29d645..21b4a2e 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -130,7 +130,7 @@ {{item.formData.activityBusinessType=='35'?'现金转账':'银行转账'}} - {{float.float(item.formData.totalAmount)}} + {{item.formData.totalAmount}} @@ -147,7 +147,7 @@ {{item.formData.activityBusinessType=='35'?'现金转账':'银行转账'}} - {{float.float(item.formData.totalAmount)}} + {{item.formData.totalAmount}} @@ -167,7 +167,7 @@ {{item.formData.activityBusinessType=='35'?'现金转账':'银行转账'}} - {{float.float(item.totalAmount)}} + {{item.totalAmount}} @@ -184,7 +184,7 @@ {{item.formData.activityBusinessType=='35'?'现金转账':'银行转账'}} - {{float.float(item.totalAmount)}} + {{item.totalAmount}}