This commit is contained in:
xk_guohonglei
2021-06-04 09:20:09 +08:00
parent 422843e0ac
commit 1335809f58
14 changed files with 1504 additions and 241 deletions

View File

@@ -51,7 +51,35 @@
onPullDownRefresh() {
this.getUserInfo()
},
onReady(option) {
const updateManager = uni.getUpdateManager();
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
console.log('请求完新版本信息的回调', res.hasUpdate);
});
updateManager.onUpdateReady(function(res) {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate();
}
}
});
});
updateManager.onUpdateFailed(function(res) {
// 新的版本下载失败
});
},
onShow() {
uni.setStorageSync('orderType',null)
// uni.preloadPage({url: "/pages/station-info/scan-camera/scan-camera"});
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('device')
@@ -77,6 +105,11 @@
}
},
onLoad() {
// uni.navigateTo({
// url:'/pages/stationDetail/ZYSite'
// })
},
methods: {
getSiteInfo() {
@@ -84,10 +117,7 @@
if (res.code === 20000) {
this.site = res.data.site
this.oilList = res.data.oil
uni.setStorage({
key: 'oilSite',
data: res.data.site
})
uni.setStorageSync( 'oilSite',res.data.site)
}
})
},
@@ -117,10 +147,10 @@
uni.navigateTo({
url: scanUrl,
fail: (err) => {
console.log(err)
// console.log(err)
},
success: (res) => {
console.log('chengg', res)
// console.log('chengg', res)
}
})