| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- // pages/voyages/detail/detail.js
- import {
- postApi
- } from "../../../apis/api"
- Page({
- data: {
- id: '',
- tab: 1,
- recordCurrentPage: 1,
- dischargeCurrentPage: 1,
- coordinates: [],
- medias: [],
- policys: [],
- voyage: [],
- waybills: [],
- infoType:'ship'
- },
- changeTab(e) {
- let {
- tab
- } = e.currentTarget.dataset
- this.setData({
- tab
- })
- },
- async getVoyageDetail() {
- let res = await postApi("/voyage/detail", {
- voyageId: this.data.id,
- })
- let {
- coordinates,
- medias,
- policys,
- voyage,
- waybills
- } = res.data.result
- this.setData({
- coordinates,
- medias,
- policys,
- voyage,
- waybills
- })
- },
- async getCarLoadRecordList(isScroll) {
- let res = await postApi("/voyage/getCarLoadRecordList", {
- voyageId: this.data.id,
- size: 10,
- currentPage: this.data.recordCurrentPage
- })
- },
- async getDischargeList(isScroll) {
- let res = await postApi("/voyage/getDischargeList", {
- voyageId: this.data.id,
- size: 10,
- currentPage: this.data.dischargeCurrentPage
- })
- },
- previewImage(e) {
- let {
- src
- } = e.currentTarget.dataset
- wx.previewImage({
- current: src, // 当前显示图片的http链接
- urls: [src] // 需要预览的图片http链接列表
- })
- },
- changeInfoType(e){
- let {type} = e.currentTarget.dataset
- this.setData({
- infoType:type
- })
- },
- onLoad(options) {
- this.setData({
- id: options.id
- })
- this.getVoyageDetail()
- this.getCarLoadRecordList()
- this.getDischargeList()
- },
- })
|