index.js 2.6 KB

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