index.js 1.7 KB

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