// pages/index/index.js import { getApi, postApi } from "../../apis/api" import cloudApi from "../../apis/cloudApi" Page({ data: { indexInfo: {}, }, async getIndexInfo() { let res = await postApi('/voyage/index', { cargoOwnerId: wx.getStorageSync('cargoOwnerId') }) this.setData({ indexInfo: res.data.result }) }, forbidTouchMove() { }, onLoad() { wx.removeStorageSync('voyageDetailId') }, onShow() { if (wx.getStorageSync('voyageDetailId')) return wx.removeStorageSync('voyageDetailId') let cargoOwnerId = wx.getStorageSync('cargoOwnerId') if (cargoOwnerId) { this.getIndexInfo() this.setData({ cargoOwnerId }) } const child = this.selectComponent('.voyages'); child.getVoyageList() } })