// pages/trainInfoDetail/index.js
const app = getApp();
Page({
  data: {
    id:0,
    pageData:{}
  },
  onLoad: function (options) {
    var id = options.id;
    this.setData({
      id: id,
      userInfo:wx.getStorageSync('userInfo')
    })
  },
  onShow: function () {
    this.getData();
  },
  getData(){
    var PageThis = this;
    wx.request({
      url: app.globalData.serverInfo.gateWayUrl,
      header: {
        'content-type': 'application/json'
      },
      method: 'POST',
      data: {
        api_name: "get_train_detail",
        train_id: PageThis.data.id,
        login_manager_id: PageThis.data.userInfo.manager_id
      },
      success: function (res) {
        var data = res.data.data;
        // data.train_content = JSON.parse(data.train_content);
        PageThis.setData({
          pageData:data
        })
      }
    })
  }
})