| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- const _Http = getApp().globalData.http,
- currency = require("../../../../utils/currency"),
- CNY = value => currency(value, {
- symbol: "¥",
- precision: 2
- }).format();
- Component({
- properties: {
- disabled: {
- type: Boolean
- }
- },
- data: {
- sys_enterpriseid: 0,
- content: {
- "nacache": true,
- "pageNumber": 1,
- "pageSize": 20,
- "pageTotal": 1,
- "total": null,
- "where": {
- "condition": ""
- }
- },
- list: []
- },
- lifetimes: {
- attached: function () {
- getApp().globalData.Language.getLanguagePackage(this)
- }
- },
- methods: {
- changeTotal() {
- this.setData({
- "content.total": this.data.content.total - 1
- })
- },
- getList(id, init) {
- let content = this.data.content;
- content.sys_enterpriseid = 0;
- if (init) {
- content.pageNumber = 1
- content.pageTotal = 1
- }
- _Http.basic({
- "id": "20221009160003",
- content
- }).then(res => {
- console.log("客户账户信息", res)
- if (res.code != '1') return wx.showToast({
- title: res.data,
- icon: "none"
- })
- if (res.data.length) res.data = res.data.map(v => {
- v.balance = CNY(v.balance);
- v.creditquota = CNY(v.creditquota);
- return v
- })
- this.setData({
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
- "content.pageNumber": res.pageNumber + 1,
- "content.pageSize": res.pageSize,
- "content.pageTotal": res.pageTotal,
- "content.total": res.total,
- sys_enterpriseid: id
- })
- })
- }
- }
- })
|