index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {},
  4. data: {
  5. list: [],
  6. sys_enterpriseid: "",
  7. "content": {
  8. "version": 1,
  9. "nocache": true,
  10. "pageNumber": 1,
  11. "pageTotal": 1,
  12. "total": null,
  13. "type": 1,
  14. "where": {
  15. "condition": ""
  16. }
  17. }
  18. },
  19. methods: {
  20. getList(id, init) {
  21. let content = this.data.content;
  22. content.sys_enterpriseid = id;
  23. if (init) content.pageNumber = 1
  24. _Http.basic({
  25. "id": "20221018102103",
  26. content
  27. }).then(res => {
  28. console.log("报价单", res)
  29. if (res.msg != '成功') return wx.showToast({
  30. title: res.data,
  31. icon: "none"
  32. })
  33. this.setData({
  34. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data),
  35. "content.pageNumber": res.pageNumber + 1,
  36. "content.pageSize": res.pageSize,
  37. "content.pageTotal": res.pageTotal,
  38. "content.total": res.total,
  39. sys_enterpriseid: id
  40. });
  41. })
  42. },
  43. /* 修改总数 */
  44. changeTotal() {
  45. this.setData({
  46. "content.total": this.data.content.total - 1
  47. })
  48. }
  49. }
  50. })