index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: {
  5. type: Boolean
  6. }
  7. },
  8. data: {
  9. list: [],
  10. sys_enterpriseid: "",
  11. "content": {
  12. "nocache": true,
  13. "pageNumber": 1,
  14. "pageTotal": 1,
  15. "total": null,
  16. "type": 1,
  17. "where": {
  18. "condition": ""
  19. }
  20. }
  21. },
  22. lifetimes: {
  23. attached: function () {
  24. getApp().globalData.Language.getLanguagePackage(this)
  25. }
  26. },
  27. methods: {
  28. getList(id, init) {
  29. let content = this.data.content;
  30. content.sys_enterpriseid = id;
  31. if (init) content.pageNumber = 1
  32. _Http.basic({
  33. "id": "20221018102003",
  34. content
  35. }).then(res => {
  36. console.log("项目商机", res)
  37. if (res.code != '1') return wx.showToast({
  38. title: res.data,
  39. icon: "none"
  40. })
  41. res.data = res.data.map(v => {
  42. v.progress = v.totalstage ? v.stage / v.totalstage * 100 : 0;
  43. return v
  44. })
  45. this.setData({
  46. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  47. "content.pageNumber": res.pageNumber + 1,
  48. "content.pageSize": res.pageSize,
  49. "content.pageTotal": res.pageTotal,
  50. "content.total": res.total,
  51. sys_enterpriseid: id
  52. });
  53. })
  54. }
  55. }
  56. })