frozenList.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. const _Http = getApp().globalData.http;
  2. import currency from "../../utils/currency";
  3. let CNY = value => currency(value, {
  4. symbol: "¥",
  5. precision: 2
  6. }).format();
  7. Page({
  8. data: {
  9. params: {
  10. "id": 2025070310561403,
  11. "content": {
  12. "isExport": 0,
  13. "pageNumber": 1,
  14. "pageSize": 20,
  15. "sa_accountbalanceid": 106561,
  16. "where": {
  17. "condition": ""
  18. }
  19. },
  20. }
  21. },
  22. onLoad(options) {
  23. this.data.params.content.sa_accountbalanceid = options.id;
  24. try {
  25. let privacyFieldC = wx.getStorageSync('auth').worderform.forms.selectaccount.formcols.map(v => v.title);
  26. this.setData({
  27. privacyFieldC
  28. })
  29. } catch (error) {
  30. console.error(error)
  31. }
  32. this.getList()
  33. },
  34. getList(init = false) {
  35. //init 用于初始化分页
  36. if (init.detail != undefined) init = init.detail;
  37. let params = this.data.params;
  38. if (init) params.content.pageNumber = 1
  39. if (params.content.pageNumber > params.content.pageTotal) return;
  40. _Http.basic(params).then(res => {
  41. console.log("冻结金额", res)
  42. this.selectComponent('#ListBox').RefreshToComplete();
  43. if (res.msg != '成功') return wx.showToast({
  44. title: res.msg,
  45. icon: "none"
  46. })
  47. res.data = res.data.map(v => {
  48. v.amount = CNY(v.amount)
  49. return v
  50. })
  51. this.setData({
  52. 'params.content.pageNumber': res.pageNumber + 1,
  53. 'params.content.pageTotal': res.pageTotal,
  54. 'params.content.total': res.total,
  55. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  56. loading: false
  57. })
  58. })
  59. },
  60. onReady() {
  61. this.selectComponent("#ListBox").setHeight(".total", this);
  62. },
  63. onUnload() {
  64. //回收数据
  65. getApp().globalData.handleSelect = null;
  66. }
  67. })