SmartParks_visitore/App.vue
2025-08-21 11:23:54 +08:00

58 lines
1.8 KiB
Vue
Raw Permalink 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>
/**
* Copyright (c) 2013-Now http://aidex.vip All rights reserved.
*/
// import socketManager from '@/utils/GlobalWebSocket.js'
export default {
onLaunch() {
// 国际化,设置当前语言
if (this.vuex_locale) {
this.$i18n.locale = this.vuex_locale;
this.$u.api.lang({
lang: this.vuex_locale
});
}
// console.log('App Launch');
// socketManager.closeSocket();
// const token = uni.getStorageSync('token');
// if (token && !socketManager.checkSocketStatus()) {
// const socketUrl = `wss://your-socket-server.com/ws?token=${token}`;
// socketManager.connectSocket(socketUrl, {
// 'Authorization': `Bearer ${token}`
// });
// }
// // 监听网络状态变化
// uni.onNetworkStatusChange((res) => {
// console.log('网络状态变化:', res);
// if (!res.isConnected) {
// // 网络断开关闭Socket
// socketManager.closeSocket();
// } else {
// // 网络恢复如果已登录则重新连接Socket
// const token = uni.getStorageSync('token');
// if (token && !socketManager.checkSocketStatus()) {
// const socketUrl = `wss://your-socket-server.com/ws?token=${token}`;
// socketManager.connectSocket(socketUrl, {
// 'Authorization': `Bearer ${token}`
// });
// }
// }
// });
// 设置底部导航栏角标
// uni.setTabBarBadge({
// index: 0,
// text: '3'
// });
// uni.removeTabBarBadge({
// index: 0
// });
}
}
</script>
<style>
@import url("~@/static/iconfont/iconfont.css");
</style>
<style lang="scss">
@import "uview-ui/index.scss";
@import "pages/common/aidex.scss";
</style>