<script>
import { routeInterceptor } from '@/interceptor/router.js';
import { appStart } from '@/utils/appStart.js';
import { useStoreGame } from '@/store/game.js';
// #ifdef APP-PLUS
import { pushInit } from '@/utils/jpush.js';
import { getMyMumber } from '@/api/OAuth2.js';
import { upgrade } from '@/utils/upgrade.js';
// #endif
export default {
globalData: {
name: '',
windowWidth: uni.getSystemInfoSync().windowWidth,
windowHeight: uni.getSystemInfoSync().windowHeight,
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
navBarHeight: 44,
tabBarHeight: 60,
popup: {
open: () => {},
close: () => {}
},
/** switchTab路由参数(switchTab路径后不能带参数) */
switchTabParams: {}
},
onLaunch(options) {
console.log('App Launch', options);
// 挂载路由拦截器
routeInterceptor();
// 比赛socket
useStoreGame().startGameSocket();
// #ifdef APP-PLUS
// 消息推送
upgrade();
pushInit();
getMyMumber();
// #endif
},
onShow(options) {
console.log('App Show');
// #ifdef APP-PLUS
appStart(options);
//设置消息角标
plus.runtime.setBadgeNumber(0);
// #endif
},
onHide() {
console.log('App Hide');
}
};
</script>
<style>
/*每个页面公共css */
@import '/static/css/custom.scss';
</style>