index.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. disabled: {
  5. type: Boolean
  6. },
  7. isInsert: {
  8. type: Boolean
  9. }
  10. },
  11. data: {
  12. list: [],
  13. sa_projectid: "",
  14. "content": {
  15. "version": 1,
  16. "nocache": true,
  17. "pageNumber": 1,
  18. "pageTotal": 1,
  19. "total": null,
  20. "type": 1,
  21. "where": {
  22. "condition": ""
  23. }
  24. }
  25. },
  26. lifetimes: {
  27. attached: function () {
  28. getApp().globalData.Language.getLanguagePackage(this)
  29. }
  30. },
  31. methods: {
  32. getList(id, init) {
  33. let content = this.data.content;
  34. content.sa_projectid = id;
  35. if (init) content.pageNumber = 1
  36. _Http.basic({
  37. "id": 20221124190702,
  38. content
  39. }).then(res => {
  40. console.log("报价单", res)
  41. if (res.code != '1') return wx.showToast({
  42. title: res.data,
  43. icon: "none"
  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. sa_projectid: id
  52. });
  53. })
  54. },
  55. addOffers() {
  56. const {
  57. projectname,
  58. sa_projectid
  59. } = getCurrentPages().find(v => v.__route__ == 'packageA/project/detail').data.detail;
  60. wx.navigateTo({
  61. url: `/packageA/offers/addProjectOffer?sa_projectid=${JSON.stringify({
  62. sa_projectid:[projectname,[sa_projectid]]
  63. })}`,
  64. })
  65. },
  66. /* 修改总数 */
  67. changeTotal() {
  68. this.setData({
  69. "content.total": this.data.content.total - 1
  70. })
  71. }
  72. }
  73. })