Files
shanghaiganxiangtuzhuangwor…/App.vue
2024-03-27 20:34:26 +08:00

62 lines
1.3 KiB
Vue

<script>
import config from './config';
import store from '@/store';
import { getToken } from '@/utils/auth';
export default {
onLaunch: function () {
this.initApp();
},
data() {
return {
width: '--width:300px;',
height: '--height:712px;'
};
},
methods: {
// 初始化应用
initApp() {
// 初始化应用配置
this.initConfig();
// 检查用户登录状态
//#ifdef H5
this.checkLogin();
//#endif
},
initConfig() {
const _windowsWidth = uni.getWindowInfo().windowWidth;
const _windowsHeight = uni.getWindowInfo().windowHeight;
// console.log(_windowsWidth,_windowsHeight);
this.globalData.config = config;
// 设置页面初始大小
// this.'--width' = _windowsWidth + 'px;';
// this.'--height' = (_windowsHeight - 50) + 'px;';
},
checkLogin() {
if (!getToken()) {
this.$tab.reLaunch('/pages/login');
}
}
}
};
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
background-image: linear-gradient(rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)), url('static/images/background/background.png');
background-size: cover;
//filter: opacity(50%);
font-size: 36px;
font-weight: 700;
width: 360px;
height: 662px;
}
.main-box {
width: 100%;
height: 100%;
}
@import '@/static/scss/index.scss';
</style>