| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- // 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
- })
- }
- let rolePermission = wx.getStorageSync('rolePermission')
- if (rolePermission.indexOf('VOYAGELIST') == -1) {
- wx.showToast({
- icon: "none",
- title: '暂无权限,请联系管理员',
- })
- return
- }
- const child = this.selectComponent('.voyages');
- child.getVoyageList()
- }
- })
|