index.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: Boolean
  5. },
  6. data: {
  7. list: [],
  8. sys_enterpriseid: "",
  9. "content": {
  10. "nocache": true,
  11. "pageNumber": 1,
  12. "pageTotal": 1,
  13. "total": null,
  14. "type": 1,
  15. "where": {
  16. "condition": ""
  17. }
  18. }
  19. },
  20. methods: {
  21. getList(id, init) {
  22. let content = this.data.content;
  23. content.sys_enterpriseid = id;
  24. if (init) content.pageNumber = 1
  25. _Http.basic({
  26. "id": "20221022165803",
  27. content
  28. }).then(res => {
  29. console.log("银行卡信息", res)
  30. if (res.msg != '成功') return wx.showToast({
  31. title: res.data,
  32. icon: "none"
  33. })
  34. this.setData({
  35. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  36. "content.pageNumber": res.pageNumber + 1,
  37. "content.pageSize": res.pageSize,
  38. "content.pageTotal": res.pageTotal,
  39. "content.total": res.total,
  40. sys_enterpriseid: id
  41. });
  42. })
  43. },
  44. addOffers() {
  45. wx.navigateTo({
  46. url: '/packageA/setclient/modules/bankcard/update?sys_enterpriseid=' + this.data.sys_enterpriseid,
  47. })
  48. },
  49. /* 修改总数 */
  50. changeTotal() {
  51. this.setData({
  52. "content.total": this.data.content.total - 1
  53. })
  54. },
  55. deleteItem({
  56. detail
  57. }) {
  58. _Http.basic({
  59. "id": 20221022165903,
  60. "content": {
  61. "sys_enterprise_bankids": [detail.sys_enterprise_bankid]
  62. }
  63. }).then(res => {
  64. console.log("删除", res)
  65. wx.showToast({
  66. title: res.msg == '成功' ? '删除成功' : res.msg,
  67. icon: "none",
  68. mask: true
  69. })
  70. if (res.msg == '成功') this.setData({
  71. list: this.data.list.filter(v => v.sys_enterprise_bankid != detail.sys_enterprise_bankid),
  72. "content.total": this.data.content.total - 1
  73. })
  74. })
  75. }
  76. }
  77. })