体育大屏
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

173 lines
3.7 KiB

<template>
<view class="home">
<view class="header">
<view class="logo">
<image src="@/static/logo2.png"></image>
</view>
<view class="info">
<view class="a">弹射者{{"|"+saiName}}</view>
<view class="b">{{subName}}</view>
</view>
</view>
<view class="body">
<view class="list">
<view class="item" v-for="(a,i) in slist" :key="i">
<view class="a">{{a.time}}</view>
<view class="b">{{a.name}}</view>
<view class="c">{{a.type_name}}</view>
</view>
</view>
<view class="items">
<image src="@/static/bottom.png"></image>
</view>
</view>
</view>
</template>
<script>
const app = getApp()
export default {
data() {
return {
slist: [],
saiName: ""
}
},
onLoad() {
this.saiName = uni.getStorageSync("saiName");
var obj = uni.getStorageSync("slist")?uni.getStorageSync("slist"):{};
this.slist = obj.list;
this.subName = obj.name+'('+obj.time+obj.type_name+')'+" 日程";
if(app.globalData.socketWBObj){
app.globalData.socketWBObj.closeSocket();
}
app.globalData.socketWBObj = new this.$websocketUtils(1);
//监听获取消息
uni.$on('socketMessage', res=>{
if(res){
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') {//日程
var obj = data;
this.slist = obj.list;
this.subName = obj.name+'('+obj.time+obj.type_name+')'+" 日程";
}else if(cmd == 'check_in') {//检录
uni.setStorageSync("slist",data)
uni.navigateTo({
url: '/pages/check/index'
})
}else if(cmd == 'award') {//颁奖
uni.setStorageSync("slist",data)
uni.navigateTo({
url: '/pages/check/index'
})
}else if(cmd == 'clear') {//清屏
uni.navigateTo({
url: '/pages/clear/index'
})
}
}
})
},
methods: {
arrayUnique(arr, name) {
    var hash = {};
    return arr.reduce(function (item, next) {
        hash[next[name]]
            ? ""
            : (hash[next[name]] = true && item.push(next));
        return item;
    }, []);
},
}
}
</script>
<style lang="scss" scoped>
.body{
min-height: calc(100vh - 186px);
background: url(@/static/bg3.png) center center no-repeat;
background-size: cover;
margin-top: 2px;
.items{
height: 88px;
display: flex;
align-items: center;
justify-content: flex-end;
border-top: 1px solid #6286d7;
image{
width: 415px;
height: 45px;
margin-right: 45rpx;
}
}
.list{
height: calc(100vh - 186px - 176px);
}
.item{
padding: 10px 0;
border-top: 1px solid #6286d7;
display: flex;
align-items: center;
justify-content: space-between;
&:first-child{
border-top: 1px solid transparent;
}
.a{
width: 203px;
line-height: 60px;
font-weight: bold;
font-size: 51rpx;
color: #FFFFFF;
text-align: center;
margin: 0 50px;
background-color: #DD1D2B;
border-radius: 10rpx;
}
.b{
flex: 1;
font-size: 51px;
color: #FFFFFF;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
margin-left: 5%;
}
.c{
width: 200px;
font-size: 51px;
color: #FFFFFF;
margin-right: 5%;
}
}
}
@media screen and (min-width: 1200px) and (max-width: 1359px) {
.body{
.item{
.a{
width: 170px;
font-size: 30px;
}
.b{
font-size: 30px;
}
.c{
font-size: 30px;
}
}
}
}
</style>