1、
onShow() {
// 获取当前小程序的页面栈
let pages = getCurrentPages();
// 数组中索引最大的页面--当前页面
let currentPage = pages[pages.length-1];
// 打印出当前页面中的 options
console.log(currentPage.options) //正常打印出 options 值
}
//#ifdef APP-PLUS
console.log('版本',plus.runtime.versionCode)
// this.version=plus.runtime.versionCode
// 获取本地应用资源版本号
plus.runtime.getProperty(plus.runtime.appid, (info) => {
console.log(JSON.stringify(info));
this.version = info.version;
// this.versionCode = info.versionCode ;
})
//设备型号
uni.getSystemInfoSync().platform
//#endif
const that = this
var webview = plus.webview.currentWebview();//获取窗口
plus.key.addEventListener('backbutton', function() {
//监听返回事件
webview.canBack(function(e) {
if (e.canBack) {
uni.webView.switchTab({
url: '/pages/index/datav'
})
} else {
console.log(22222);
}
})
});