index.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. "content": {
  5. nocache: true,
  6. sys_enterpriseid: "",
  7. pageNumber: 1,
  8. pageTotal: 1,
  9. "where": {
  10. "condition": "",
  11. "workaddress": 1
  12. }
  13. }
  14. },
  15. onLoad(options) {
  16. this.setData({
  17. "content.sys_enterpriseid": options.id
  18. })
  19. this.getList(true);
  20. },
  21. /* 获取产品 */
  22. getList(init = false) {
  23. if (init.detail != undefined) init = init.detail;
  24. let content = this.data.content;
  25. if (init) content.pageNumber = 1;
  26. if (content.pageNumber > content.pageTotal) return;
  27. _Http.basic({
  28. "id": "20221022165803",
  29. content
  30. }).then(res => {
  31. console.log("账户列表", res)
  32. this.selectComponent('#ListBox').RefreshToComplete();
  33. if (res.msg != '成功') return wx.showToast({
  34. title: res.msg,
  35. icon: "none",
  36. mask: true
  37. });
  38. content.pageNumber = res.pageNumber + 1;
  39. content.pageTotal = res.pageTotal;
  40. this.setData({
  41. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
  42. })
  43. })
  44. },
  45. /* 单击卡号 */
  46. onClick({
  47. detail
  48. }) {
  49. if (getApp().globalData.handleSelect) return getApp().globalData.handleSelect(detail);
  50. wx.navigateTo({
  51. url: `/pages/bankAccount/update?item=${JSON.stringify(detail)}&id=${detail.sys_enterpriseid}`,
  52. })
  53. },
  54. /* 开始搜索 */
  55. onSearch({
  56. detail
  57. }) {
  58. if (detail == this.data.content.where.condition) return;
  59. this.data.content.where.condition = detail;
  60. this.getList(true);
  61. },
  62. onClear(e) {
  63. this.data.content.where.condition = "";
  64. this.getList(true);
  65. },
  66. onReady() {
  67. this.selectComponent("#ListBox").setHeight(".top", this);
  68. },
  69. deleteItem() {
  70. _Http.basic({
  71. "id": "20221022165903",
  72. "content": {
  73. "sys_enterprise_bankids": [7]
  74. }
  75. })
  76. }
  77. })