index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. isproject: String
  5. },
  6. data: {
  7. sa_quotedpriceid: 0,
  8. content: {
  9. nocache: true,
  10. isExport: 0,
  11. pageNumber: 1,
  12. pageTotal: 1,
  13. total: null,
  14. where: {},
  15. type: "0",
  16. },
  17. },
  18. methods: {
  19. /* 获取产品列表 */
  20. getList(id, init) {
  21. let content = this.data.content;
  22. content.sa_quotedpriceid = id;
  23. if (init) content.pageNumber = 1;
  24. content.where.isproject = this.data.isproject;
  25. _Http.basic({
  26. "id": "20221209093003",
  27. content
  28. }).then(res => {
  29. console.log("历史报价", res)
  30. if (res.msg != '成功') return wx.showToast({
  31. title: res.data,
  32. icon: "none"
  33. })
  34. this.setData({
  35. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  36. "content.pageNumber": res.pageNumber + 1,
  37. "content.pageSize": res.pageSize,
  38. "content.pageTotal": res.pageTotal,
  39. "content.total": res.total,
  40. sa_quotedpriceid: id
  41. })
  42. })
  43. },
  44. }
  45. })