index.js 1.5 KB

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