index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {},
  4. data: {
  5. list: [],
  6. sa_projectid: "",
  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.sa_projectid = id;
  22. if (init) {
  23. content.pageNumber = 1
  24. content.pageTotal = 1
  25. }
  26. _Http.basic({
  27. "id": "20221124110002",
  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. sa_projectid: id
  42. })
  43. this.getTags()
  44. })
  45. },
  46. /* 获取列表标签 */
  47. getTags() {
  48. let list = this.data.list,
  49. ownerids = list.map(v => v.sat_orderclueid);
  50. _Http.basic({
  51. "id": 20221018102001,
  52. "content": {
  53. nocache: true,
  54. "ownertable": "sat_orderclue",
  55. ownerids
  56. }
  57. }).then(res => {
  58. console.log("标签", res)
  59. for (let key in res.data) {
  60. let index = list.findIndex(v => v.sat_orderclueid == key);
  61. list[index].tags = res.data[key]
  62. };
  63. this.setData({
  64. list
  65. })
  66. })
  67. },
  68. }
  69. })