// pages/voyages/detail/detail.js import { postApi } from "../../../apis/api" Page({ data: { id: '', tab: 1, recordCurrentPage: 1, dischargeCurrentPage: 1 }, changeTab(e) { let { tab } = e.currentTarget.dataset this.setData({ tab }) }, async getVoyageDetail() { let res = await postApi("/voyage/detail", { voyageId: this.data.id }) }, async getCarLoadRecordList() { let res = await postApi("/voyage/getCarLoadRecordList", { voyageId: this.data.id }) }, async getDischargeList() { let res = await postApi("/voyage/getDischargeList", { voyageId: this.data.id }) }, onLoad(options) { this.setData({ id: options.id }) this.getVoyageDetail() }, })