index.js 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. },
  5. data: {
  6. content: {
  7. nocache: true,
  8. pageNumber: 1,
  9. pageTotal: 1,
  10. total: null
  11. }
  12. },
  13. methods: {
  14. /* 获取产品列表 */
  15. getList(id, init) {
  16. let content = this.data.content;
  17. content.sa_customersid = id || this.data.sa_customersid;
  18. if (init) content.pageNumber = 1;
  19. _Http.basic({
  20. "id": "2026030916342701",
  21. content
  22. }).then(res => {
  23. console.log("客户工单列表", res)
  24. if (res.msg != '成功') return wx.showToast({
  25. title: res.msg,
  26. icon: "none"
  27. })
  28. this.setData({
  29. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  30. "content.pageNumber": res.pageNumber + 1,
  31. "content.pageSize": res.pageSize,
  32. "content.pageTotal": res.pageTotal,
  33. "content.total": res.total,
  34. "sa_customersid": content.sa_customersid
  35. })
  36. })
  37. }
  38. }
  39. })