index.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {},
  4. data: {
  5. sa_projectid: null,
  6. "content": {
  7. "isAll": 0,
  8. "total": null
  9. }
  10. },
  11. methods: {
  12. getList(id, init) {
  13. let content = this.data.content;
  14. content.sa_projectid = id;
  15. if (init) content.pageNumber = 1
  16. _Http.basic({
  17. "id": "20221201140104",
  18. content
  19. }).then(res => {
  20. console.log("工作任务列表", res)
  21. if (res.msg != '成功') return wx.showToast({
  22. title: res.data,
  23. icon: "none"
  24. })
  25. this.setData({
  26. list: res.data.rows,
  27. "content.total": res.data.sumscore,
  28. sa_projectid: id
  29. })
  30. console.log(this.data.sumscore,this.data.list)
  31. })
  32. },
  33. onChange({
  34. detail
  35. }) {
  36. this.setData({
  37. "content.isAll": detail ? 1 : 0
  38. });
  39. this.getList(this.data.sa_projectid, true)
  40. },
  41. handleRoute(item, list){
  42. console.log(item, list)
  43. }
  44. }
  45. })