12345678910111213141516171819202122232425262728293031323334353637383940 |
- export default {
- data() {
- return {
- h:uni.getSystemInfoSync().windowHeight,//屏幕高度
- mt:uni.getSystemInfoSync().statusBarHeight + 44,//自定义头部组件高度(使用自定义头部组件的上边距)
- th:50+uni.getSystemInfoSync().safeAreaInsets.bottom,//底部tabbar高度
- imgBase:this.$imgBase
- }
- },
- onShow(){
- uni.getSystemInfo({
- success:res=>{
- if(res.platform === 'android'){
- this.th = res.screenHeight - res.windowHeight - res.statusBarHeight - 48;
- }
- }
- })
- },
- methods:{
- isLogin(){
- if(uni.getStorageSync('token')){
- return true
- }else {
- uni.showModal({
- title:'温馨提示',
- content:'当前功能需要登录后使用,是否跳转登录页面?',
- success: (res) => {
- if(res.confirm){
- uni.reLaunch({
- url:'/pages/login'
- })
- }else{
- return false
- }
- }
- })
- }
- }
- }
- }
|