| 123456789101112131415161718192021222324252627282930313233343536 |
- // 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')
- })
- console.log(res)
- this.setData({
- indexInfo: res.data.result
- })
- },
- forbidTouchMove() {
- },
- onLoad() {
- let cargoOwnerId = wx.getStorageSync('cargoOwnerId')
- if (cargoOwnerId) {
- this.getIndexInfo()
- const child = this.selectComponent('.voyages');
- child.getVoyageList()
- } else {
- wx.redirectTo({
- url: '/pages/login/login',
- })
- }
- }
- })
|