首页静态完成
This commit is contained in:
70
App.vue
70
App.vue
@@ -1,13 +1,81 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// console.log('App Launch');
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.cache.set('menuInfo', uni.getMenuButtonBoundingClientRect());
|
||||
// #endif
|
||||
},
|
||||
onShow: function() {
|
||||
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
||||
// console.log('App Show');
|
||||
try {
|
||||
// #ifdef APP-PLUS
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
let system = res;
|
||||
if (system.platform == 'ios') {
|
||||
console.log('ios', 64);
|
||||
uni.request({
|
||||
url: uni.conf.baseUrl + '/api/systemConfig/updateSystemVersion?platformCode=' + 1,
|
||||
method: 'POST',
|
||||
// header: {
|
||||
// userId: uni.getStorageSync('userId'),
|
||||
// token: uni.getStorageSync('token'),
|
||||
// myLoginName: uni.getStorageSync('myLoginName')
|
||||
// },
|
||||
success: (res) => {
|
||||
let datares = res.data;
|
||||
// uni.showToast({
|
||||
// title: res.message || res.msg,
|
||||
// icon: "none",
|
||||
// })
|
||||
// console.log(datares, '11111111')
|
||||
if (datares.code == 200) {
|
||||
uni.is_update = datares.data.versionCode; //是版本号,判断是否升级
|
||||
uni.is_force = datares.data.forceUpdate; //是否强制更新 1:强制 0:未强制
|
||||
uni.versionName = datares.data.versionName; //是版本号 显示版本号
|
||||
uni.is_wgt = 0; //是热更新 目前好像没有该功能
|
||||
uni.updateUrlApp = datares.data.url; //是下载地址
|
||||
uni.update_content = datares.data.updateInfo; //版本说明
|
||||
// uni.pro.switchTab('index/index');
|
||||
}
|
||||
},
|
||||
fail: (res) => {
|
||||
// uni.showToast({
|
||||
// title: res.message || res.msg,
|
||||
// icon: "none",
|
||||
// })
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.log(res, 66);
|
||||
uni.request({
|
||||
url: uni.conf.baseUrl + '/api/systemConfig/updateSystemVersion?platformCode=' + 0,
|
||||
method: 'POST',
|
||||
// header: {
|
||||
// userId: uni.getStorageSync('userId'),
|
||||
// token: uni.getStorageSync('token'),
|
||||
// myLoginName: uni.getStorageSync('myLoginName')
|
||||
// },
|
||||
success: (res) => {
|
||||
let datares = res.data;
|
||||
console.log(res);
|
||||
if (datares.code == 200) {
|
||||
uni.is_update = datares.data.versionCode; //是版本号,判断是否升级
|
||||
uni.is_force = datares.data.forceUpdate; //是否强制更新 1:强制 0:未强制
|
||||
uni.versionName = datares.data.versionName; //是版本号 显示版本号
|
||||
uni.is_wgt = 0; //是热更新 目前好像没有该功能
|
||||
uni.updateUrlApp = datares.data.url; //是下载地址
|
||||
uni.update_content = datares.data.updateInfo; //版本说明
|
||||
// uni.pro.switchTab('index/index');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
} catch (e) {}
|
||||
},
|
||||
onHide: function() {
|
||||
// console.log('App Hide');
|
||||
|
||||
Reference in New Issue
Block a user