|
|
@@ -1,5 +1,9 @@
|
|
|
-const _Http = getApp().globalData.http;
|
|
|
-
|
|
|
+const _Http = getApp().globalData.http,
|
|
|
+ currency = require("../../../../utils/currency"),
|
|
|
+ CNY = num => currency(num, {
|
|
|
+ symbol: "¥",
|
|
|
+ precision: 2
|
|
|
+ }).format();
|
|
|
Page({
|
|
|
data: {
|
|
|
loading: true,
|
|
|
@@ -8,7 +12,7 @@ Page({
|
|
|
radio: false, //是否为单选
|
|
|
idname: "sa_orderid", //idkey
|
|
|
showName: "sonum",
|
|
|
- list:[]
|
|
|
+ list: []
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
if (options.params) {
|
|
|
@@ -26,7 +30,7 @@ Page({
|
|
|
idname: options.idname || this.data.idname,
|
|
|
showName: options.showName || this.data.showName,
|
|
|
});
|
|
|
- getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
|
|
|
+ getApp().globalData.Language.getLanguagePackage(this, 'E-订单');
|
|
|
this.getList()
|
|
|
},
|
|
|
getList(init = false) {
|
|
|
@@ -42,7 +46,10 @@ Page({
|
|
|
title: res.msg,
|
|
|
icon: "none"
|
|
|
})
|
|
|
- res.data.forEach(item => item.amount = 0)
|
|
|
+ res.data = res.data.map(v => {
|
|
|
+ v.amount = CNY(v.amount)
|
|
|
+ return v
|
|
|
+ })
|
|
|
this.setData({
|
|
|
'params.content.pageNumber': res.pageNumber + 1,
|
|
|
'params.content.pageTotal': res.pageTotal,
|
|
|
@@ -53,14 +60,14 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
/*金额改变 */
|
|
|
- amountChange (e) {
|
|
|
- e.currentTarget.dataset.item.amount = e.detail.value
|
|
|
- let index = this.data.list.findIndex(item => item.sa_accountclassid == e.currentTarget.dataset.item.sa_accountclassid)
|
|
|
- let list = this.data.list
|
|
|
- list[index] = e.currentTarget.dataset.item
|
|
|
- this.setData({
|
|
|
- list
|
|
|
- })
|
|
|
+ amountChange(e) {
|
|
|
+ e.currentTarget.dataset.item.amount = e.detail.value
|
|
|
+ let index = this.data.list.findIndex(item => item.sa_accountclassid == e.currentTarget.dataset.item.sa_accountclassid)
|
|
|
+ let list = this.data.list
|
|
|
+ list[index] = e.currentTarget.dataset.item
|
|
|
+ this.setData({
|
|
|
+ list
|
|
|
+ })
|
|
|
},
|
|
|
/* 选中 */
|
|
|
changeResult(e) {
|
|
|
@@ -120,6 +127,6 @@ Page({
|
|
|
onUnload() {
|
|
|
//回收数据
|
|
|
getApp().globalData.handleSelect = null;
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
})
|