index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: Boolean
  5. },
  6. data: {
  7. sys_enterpriseid: 0,
  8. content: {
  9. "nacache": true,
  10. "pageNumber": 1,
  11. "pageSize": 20,
  12. "pageTotal": 1,
  13. "total": null,
  14. "where": {
  15. "condition": ""
  16. }
  17. },
  18. list: []
  19. },
  20. methods: {
  21. changeTotal() {
  22. this.setData({
  23. "content.total": this.data.content.total - 1
  24. })
  25. },
  26. getList(id, init) {
  27. let content = this.data.content;
  28. content.sys_enterpriseid = id;
  29. if (init) {
  30. content.pageNumber = 1
  31. content.pageTotal = 1
  32. }
  33. _Http.basic({
  34. "id": "20230214163402",
  35. content
  36. }).then(res => {
  37. console.log("客户合同信息", res)
  38. if (res.msg != '成功') return wx.showToast({
  39. title: res.data,
  40. icon: "none"
  41. })
  42. this.setData({
  43. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  44. "content.pageNumber": res.pageNumber + 1,
  45. "content.pageSize": res.pageSize,
  46. "content.pageTotal": res.pageTotal,
  47. "content.total": res.total,
  48. sys_enterpriseid: id
  49. })
  50. })
  51. }
  52. }
  53. })