index.js 1.3 KB

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