index.js 507 B

123456789101112131415161718192021222324252627
  1. // pages/index/index.js
  2. import {
  3. getApi,
  4. postApi
  5. } from "../../apis/api"
  6. import cloudApi from "../../apis/cloudApi"
  7. Page({
  8. data: {
  9. indexInfo: {},
  10. },
  11. async getIndexInfo() {
  12. let res = await postApi('/voyage/index', {
  13. cargoOwnerId: wx.getStorageSync('cargoOwnerId')
  14. })
  15. this.setData({
  16. indexInfo: res.data.result
  17. })
  18. },
  19. forbidTouchMove() {
  20. },
  21. onLoad() {
  22. this.getIndexInfo()
  23. const child = this.selectComponent('.voyages');
  24. child.getVoyageList()
  25. }
  26. })