index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: Boolean
  5. },
  6. data: {
  7. list: [],
  8. sa_projectid: "",
  9. "content": {
  10. "version": 1,
  11. "nocache": true,
  12. "pageNumber": 1,
  13. "pageTotal": 1,
  14. "total": null,
  15. "type": 1,
  16. "where": {
  17. "condition": ""
  18. }
  19. }
  20. },
  21. methods: {
  22. getList(id, init) {
  23. let content = this.data.content;
  24. content.sa_projectid = id;
  25. if (init) content.pageNumber = 1
  26. _Http.basic({
  27. "id": 20221124190702,
  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. })
  44. },
  45. addOffers() {
  46. const {
  47. projectname,
  48. sa_projectid
  49. } = getCurrentPages().find(v => v.__route__ == 'packageA/project/detail').data.detail;
  50. wx.navigateTo({
  51. url: `/packageA/offers/addProjectOffer?sa_projectid=${JSON.stringify({
  52. sa_projectid:[projectname,[sa_projectid]]
  53. })}`,
  54. })
  55. },
  56. /* 修改总数 */
  57. changeTotal() {
  58. this.setData({
  59. "content.total": this.data.content.total - 1
  60. })
  61. }
  62. }
  63. })