2024-03-12 09:27:48 +08:00
|
|
|
|
<script>
|
2024-04-18 08:26:16 +08:00
|
|
|
|
import config from './config';
|
|
|
|
|
|
import store from '@/store';
|
|
|
|
|
|
import {
|
|
|
|
|
|
getToken
|
|
|
|
|
|
} from '@/utils/auth';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
|
onLaunch: function() {
|
|
|
|
|
|
this.initApp();
|
2024-03-12 17:41:00 +08:00
|
|
|
|
},
|
2024-04-18 08:26:16 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-08-21 17:49:37 +08:00
|
|
|
|
width: '--width:360px;',
|
2024-04-18 08:26:16 +08:00
|
|
|
|
height: '--height:712px;'
|
|
|
|
|
|
};
|
2024-03-12 17:41:00 +08:00
|
|
|
|
},
|
2024-04-18 08:26:16 +08:00
|
|
|
|
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() {
|
2025-08-21 17:49:37 +08:00
|
|
|
|
const token = getToken();
|
|
|
|
|
|
if (!token) {
|
2024-04-18 08:26:16 +08:00
|
|
|
|
this.$tab.reLaunch('/pages/login');
|
|
|
|
|
|
}
|
2024-03-12 17:41:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-04-18 08:26:16 +08:00
|
|
|
|
};
|
2024-03-12 09:27:48 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2024-04-18 08:26:16 +08:00
|
|
|
|
/* 注意要写在第一行,同时给style标签加入lang="scss"属性 */
|
|
|
|
|
|
@import '@/uni_modules/uview-ui/index.scss';
|
|
|
|
|
|
|
|
|
|
|
|
/* 无顶部nav无tab通用主容器 可使用高度 */
|
|
|
|
|
|
.common-container {
|
|
|
|
|
|
width: 360px;
|
|
|
|
|
|
height: 712px;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-19 14:07:40 +08:00
|
|
|
|
/* 存在顶部nav主容器 可使用高度 */
|
2024-04-18 08:26:16 +08:00
|
|
|
|
.common-nav-container {
|
|
|
|
|
|
width: 360px;
|
|
|
|
|
|
height: 644px;
|
|
|
|
|
|
background-color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 通用测试边框 */
|
|
|
|
|
|
.border {
|
|
|
|
|
|
border: 1px solid black;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.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%;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.gap-5 {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: 5px;
|
|
|
|
|
|
height: 5px;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.gap-10 {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: 10px;
|
|
|
|
|
|
height: 10px;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.gap-20 {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: 20px;
|
|
|
|
|
|
height: 20px;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.gap-40 {
|
|
|
|
|
|
margin: 0;
|
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
width: 40px;
|
|
|
|
|
|
height: 40px;
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@import '@/static/scss/index.scss';
|
2024-03-27 20:56:32 +08:00
|
|
|
|
</style>
|