Files
learning-system-mobile/App.vue
2023-08-02 16:41:12 +08:00

149 lines
3.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script>
import Vue from 'vue'
export default {
name: 'App',
onLaunch: function() {
//获取设备信息
uni.getSystemInfo({
success: function (res) {
Vue.prototype.$width=res.windowWidth;
Vue.prototype.$height=res.windowHeight;
// console.log(res.model,'model');
// console.log(res.pixelRatio,'pixelRatio');
// console.log(res.windowWidth,'windowWidth');
// console.log(res.windowHeight,'windowHeight');
// console.log(res.language,'language');
// console.log(res.version,'version');
// console.log(res.platform,'platform');
//console.log(this.$width,'$width');
}
});
//获取或加载一次用户信息
//console.log('App Launch');
//登录页面不需要,此页面用于本地测试
//console.log(location.href,'location.href');
var href=location.href;
//不包含登录页和加载页
if(href.indexOf('/pages/login/login')==-1 && href.indexOf('/pages/login/loading')==-1){
console.log('href='+href)
//先做登录校验
//每次加载增加一次对token的验证直接调用用户中心的接口,如果token不对这里会直接返回登录
//apiUserbasic.getUserInfo();
this.$store.dispatch('GetUserInfo');
}
},
mounted() {
},
onShow: function() {
},
onHide: function() {
},
onload:function(){
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "@/uni_modules/uview-ui/index.scss";
* {
margin: 0;
padding: 0;
font-family: Microsoft YaHei,PingFang SC,Arial Black,Source Han Sans SC,sans-serif,uicon-iconfont;
}
/* #ifdef H5 */
uni-page-head { display: none; }
/* #endif */
page {
background: #f4f4f4;
}
.content {
background: #FFFFFF;
padding: 10px;
border-radius: 20upx;
}
.arrow-right {
width: 9px;
height: 9px;
margin-top: 8px;
display: inline-block;
border-top: 1px solid #bdbdbd;
border-right: 1px solid #bdbdbd;
transform: rotate(45deg);
}
uni-modal {
.uni-modal {
width: 288px !important;
max-width: 288px !important;
border-radius: 26upx;
.uni-modal__bd{
font-size: 36upx;
font-weight: 600;
color: #333333;
padding: 33px 25px 33px 25px;
}
.uni-modal__ft{
font-size: 32upx;
.uni-modal__btn_default{
color: #333333;
}
.uni-modal__btn_primary{
color: #387DF7;
}
}
}
}
uni-toast .uni-toast{
img{
width: 38px;
height: 18px;
}
}
/**统一样式*/
.fixed-field{
width: 180px;
height: 30px;
background: rgb(247,247,249);
display: flex;
.fixed-field-icon{
margin-top: 2px;
margin-left: 10px;
}
.fixed-field-text{
font-size: 12px;
color: #000000;
margin-left: 2px;
margin-top: 5px;
}
}
/**统一分享样式*/
.share-btn{
display: flex;
justify-content: flex-end;
padding-top: 10upx;
line-height: 28upx;
.share-btn-icon{
img{
width: 28upx;
height: 28upx;
}
}
.share-btn-name{
font-size: 28upx;
margin-left: 8upx;
}
}
</style>