<template>
	<view class="home">
		<view class="header1">
			<view class="logo">
				<image src="@/static/logo.png"></image>
			</view>
			<view class="info">
				<view class="a">弹射者|{{saiName}}</view>
			</view>
		</view>
		<view class="body">
			<view class="a">
				<image mode="widthFix" src="@/static/logo3.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				saiName: "",
				id: ""
			}
		},
		onLoad() {
			this.saiName = uni.getStorageSync("saiName");
			this.id = uni.getStorageSync("sid");
			
			if(app.globalData.socketWBObj){
				app.globalData.socketWBObj.closeSocket();
			}
			app.globalData.socketWBObj = new this.$websocketUtils(1);
			//监听获取消息
			 uni.$on('socketMessage', res=>{
				 if(res.data){
					var { cmd, data } = res.data !='链接成功'?JSON.parse(res.data):{};
					//成绩
					if(cmd == 'score'){
						uni.setStorageSync("slist",data)
						uni.navigateTo({
							url: '/pages/score/index'
						})
					}else if(cmd == 'declare') {//宣告
						uni.setStorageSync("slist",data)
						uni.navigateTo({
							url: '/pages/declare/index'
						})
					}else if(cmd == 'schedule') {//日程
						uni.setStorageSync("slist",data)
						uni.navigateTo({
							url: '/pages/schedule/index'
						})
					}else if(cmd == 'check_in') {//检录
						uni.navigateTo({
							url: '/pages/check/index'
						})
					}else if(cmd == 'award') {//颁奖
						uni.setStorageSync("slist",data)
						uni.navigateTo({
							url: '/pages/award/index'
						})
					}
				 }
			 })
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
.body{
	width: 100%;
	min-height: calc(100vh - 136px);
	background: url(@/static/bg3.png) center center no-repeat;
	background-size: cover;
	.a{
		width: 100%;
		text-align: center;
		padding-top: 210px;
		image{
			width: 1306px;
			height: 513px;
		}
	}
	
}
@media screen and (min-width: 1200px) and (max-width: 1359px) {
	.body{
		.a{
			padding-top: 190px;
			image{
				width: 100%;
			}
		}
	}
}
</style>
