lxp_Maxcess/App.vue

71 lines
1.8 KiB
Vue
Raw Normal View History

2025-04-09 18:55:14 +08:00
<script>
import { useI18n } from 'vue-i18n'
export default {
onLaunch: function() {
console.log('App Launch')
// #ifdef APP-NVUE
domModule.addRule('fontFace', {
'fontFamily': "Regular",
'src': "url('https://dushuba.oss-cn-guangzhou.aliyuncs.com/fonts/MiSans-Regular.ttf')"
});
domModule.addRule('fontFace', {
'fontFamily': "Medium",
'src': "url('https://dushuba.oss-cn-guangzhou.aliyuncs.com/fonts/MiSans-Medium.ttf')"
});
domModule.addRule('fontFace', {
'fontFamily': "Bold",
'src': "url('https://dushuba.oss-cn-guangzhou.aliyuncs.com/fonts/MiSans-Demibold.ttf')"
});
domModule.addRule('fontFace', {
'fontFamily': "DOUYU",
'src': "url('https://dushuba.oss-cn-guangzhou.aliyuncs.com/fonts/douyuFont.otf')"
});
domModule.addRule('fontFace', {
'fontFamily': "Bebas",
'src': "url('https://dushuba.oss-cn-guangzhou.aliyuncs.com/fonts/BEBAS.ttf')"
});
// #endif
2025-04-29 13:26:19 +08:00
2025-04-09 18:55:14 +08:00
},
onShow: function() {
2025-04-29 13:26:19 +08:00
console.log('App Show')
2025-04-09 18:55:14 +08:00
const getI18n = useI18n()
const { t, locale } = getI18n
2025-04-29 13:26:19 +08:00
if (!uni.getStorageSync('locale')) {
2025-04-09 18:55:14 +08:00
locale.value = 'en'
uni.setStorageSync('locale', locale.value)
} else {
locale.value = uni.getStorageSync('locale')
}
2025-04-29 13:26:19 +08:00
let tokenStr = ''
tokenStr = uni.getStorageSync('TOKEN')
console.log(tokenStr, '==================================================');
if (tokenStr === '') {
uni.reLaunch({
url: '/pages/client/account/login',
})
}
2025-04-09 18:55:14 +08:00
},
onHide: function() {
console.log('App Hide')
},
methods: {
2025-04-29 13:26:19 +08:00
2025-04-09 18:55:14 +08:00
}
}
</script>
<style lang="scss">
/*每个页面公共css */
@import "@/uni_modules/uview-plus/index.scss";
@import '@/static/css/main.scss';
/* #ifndef APP-NVUE */
@import '@/static/css/vue.scss';
/* #endif */
@import '@/static/css/animista.scss';
:deep(.uni-tabbar-bottom) {
z-index: 0 !important;
}
</style>