1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/zhw_w-zhw-uniapp-shangwu

Клонировать/Скачать
App.vue 1.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
zhuhongwei Отправлено 18.04.2024 12:38 0dc628f
<script>
import config from './config'
import store from '@/store'
import { getToken } from '@/utils/auth'
import Vue from 'vue'
export default {
// onLaunch: function() {
// this.initApp()
// },
onLaunch: function () {
this.initApp()
uni.getSystemInfo({
success: function (e) {
// #ifndef MP
Vue.prototype.StatusBar = e.statusBarHeight;
if (e.platform == 'android') {
Vue.prototype.CustomBar = e.statusBarHeight + 50;
} else {
Vue.prototype.CustomBar = e.statusBarHeight + 45;
};
// #endif
// #ifdef MP-WEIXIN
Vue.prototype.StatusBar = e.statusBarHeight;
let custom = wx.getMenuButtonBoundingClientRect();
Vue.prototype.Custom = custom;
Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight + 4;
// #endif
// #ifdef MP-ALIPAY
Vue.prototype.StatusBar = e.statusBarHeight;
Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
// #endif
}
});
},
onShow: function () {
console.log('App Show')
},
onHide: function () {
console.log('App Hide')
},
methods: {
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig()
// 检查用户登录状态
//#ifdef H5
this.checkLogin()
//#endif
},
initConfig() {
this.globalData.config = config
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch('/pages/login')
}
}
}
}
</script>
<style lang="scss">
@import "colorui/main.css";
@import "colorui/icon.css";
@import "./uview-ui/index.scss";
@import '@/static/scss/index.scss'
</style>

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/zhw_w-zhw-uniapp-shangwu.git
git@api.gitlife.ru:oschina-mirror/zhw_w-zhw-uniapp-shangwu.git
oschina-mirror
zhw_w-zhw-uniapp-shangwu
zhw_w-zhw-uniapp-shangwu
master