dengrui/App.vue

58 lines
1.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<script>
import toolAll from '@/jsFile/tools.js';
export default {
globalData: {
statusBarHeight: 0, //状态栏高度
navigationBarHeight: 44, //这里先默认为44ios 导航栏高度值,安卓和ios有点差别哦
},
onLaunch: function() {
// console.log('App Launch');
let that = this;
uni.getSystemInfo({
success(res) {
that.globalData.statusBarHeight = res.statusBarHeight;
if (res.platform == 'ios') {
// console.log('ios',that.globalData.statusBarHeight);
that.globalData.navigationBarHeight == 44;
} else if (res.platform == 'android') {
// console.log('android',that.globalData.statusBarHeight);
that.globalData.navigationBarHeight = 48;
} else {
// console.log('其他',that.globalData.statusBarHeight);
that.globalData.navigationBarHeight = 44;
}
}
})
// 给底部tab加角标
// setTimeout(() => {
// uni.setTabBarBadge({
// index: 1,
// text: '31'
// });
// uni.showTabBarRedDot({
// index: 3
// });
// }, 1000);
},
onShow: function() {
setTimeout(()=>{
toolAll.tools.guoq()
},3000)
},
onHide: function() {
// console.log('App Hide');
}
};
</script>
<style>
/*每个页面公共css */
@import url("./commons/dengrui.css");
@import url("./commons/animate.min.css");
page {
background-color: #F5F5F5;
}
</style>