var app = getApp();
|
var Constant = require('../../utils/constant.js');
|
Page({
|
data: {
|
webViewUrl: ''
|
},
|
onLoad: function (options) {
|
// console.log(options,8)
|
var stationName = options.name;
|
if(stationName){
|
wx.setNavigationBarTitle({
|
title: stationName
|
});
|
}
|
|
var userInfo = app.globalData.userInfo;
|
// console.log('登录之后的用户信息', userInfo)
|
if (userInfo == null) {
|
wx.redirectTo({
|
url: '/login/login/index',
|
})
|
return;
|
}
|
|
var stationID = options.id;
|
if (stationID == null) {
|
stationID = 3;
|
}
|
let tokenInfo = wx.getStorageSync('AccessToken') //获取缓存里的token
|
if(tokenInfo == undefined || tokenInfo == null){
|
wx.reLaunch({
|
url: '/login/login/index',
|
})
|
return
|
}
|
// console.log(stationID,userInfo.CorpID)
|
let currentTime = new Date().getTime()
|
var url = 'https://szjt2.beng35.com/mvc/BIM/miniProgram/stationsimple.html?id=' + stationID + '&token='+ tokenInfo.Token + "&V=" + currentTime;
|
// console.log(url,31)
|
this.setData({
|
webViewUrl: url
|
});
|
// console.log(this.data.webViewUrl,35)
|
|
},
|
loadMessage: function (e) {
|
//console.log(e, '加载返回的消息')
|
},
|
loadSuccesss: function (e) {
|
// console.log(e, '加载成功')
|
},
|
loadError: function (e) {
|
console.log(e, '加载失败')
|
},
|
onReady: function () {},
|
onShow: function () {},
|
onHide: function () {},
|
onUnload: function () {},
|
onPullDownRefresh: function () {},
|
onReachBottom: function () {},
|
onShareAppMessage: function () {
|
return Constant.Share;
|
}
|
})
|