detail.js 775 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // pages/voyages/detail/detail.js
  2. import {
  3. postApi
  4. } from "../../../apis/api"
  5. Page({
  6. data: {
  7. id: '',
  8. tab: 1,
  9. recordCurrentPage: 1,
  10. dischargeCurrentPage: 1
  11. },
  12. changeTab(e) {
  13. let {
  14. tab
  15. } = e.currentTarget.dataset
  16. this.setData({
  17. tab
  18. })
  19. },
  20. async getVoyageDetail() {
  21. let res = await postApi("/voyage/detail", {
  22. voyageId: this.data.id
  23. })
  24. },
  25. async getCarLoadRecordList() {
  26. let res = await postApi("/voyage/getCarLoadRecordList", {
  27. voyageId: this.data.id
  28. })
  29. },
  30. async getDischargeList() {
  31. let res = await postApi("/voyage/getDischargeList", {
  32. voyageId: this.data.id
  33. })
  34. },
  35. onLoad(options) {
  36. this.setData({
  37. id: options.id
  38. })
  39. this.getVoyageDetail()
  40. },
  41. })