| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- const _Http = getApp().globalData.http;
- import currency from "../../utils/currency";
- let CNY = value => currency(value, {
- symbol: "¥",
- precision: 2
- }).format();
- Page({
- data: {
- params: {
- "id": 2025070310561403,
- "content": {
- "isExport": 0,
- "pageNumber": 1,
- "pageSize": 20,
- "sa_accountbalanceid": 106561,
- "where": {
- "condition": ""
- }
- },
- }
- },
- onLoad(options) {
- this.data.params.content.sa_accountbalanceid = options.id;
- try {
- let privacyFieldC = wx.getStorageSync('auth').worderform.forms.selectaccount.formcols.map(v => v.title);
- this.setData({
- privacyFieldC
- })
- } catch (error) {
- console.error(error)
- }
- this.getList()
- },
- getList(init = false) {
- //init 用于初始化分页
- if (init.detail != undefined) init = init.detail;
- let params = this.data.params;
- if (init) params.content.pageNumber = 1
- if (params.content.pageNumber > params.content.pageTotal) return;
- _Http.basic(params).then(res => {
- console.log("冻结金额", res)
- this.selectComponent('#ListBox').RefreshToComplete();
- if (res.msg != '成功') return wx.showToast({
- title: res.msg,
- icon: "none"
- })
- 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,
- 'params.content.total': res.total,
- list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
- loading: false
- })
- })
- },
- onReady() {
- this.selectComponent("#ListBox").setHeight(".total", this);
- },
- onUnload() {
- //回收数据
- getApp().globalData.handleSelect = null;
- }
- })
|