Просмотр исходного кода

pk rank 重构 与修复样式问题

Changpeng Duan 5 лет назад
Родитель
Сommit
2b624c07aa

+ 2 - 4
pc/src/views/Member.vue

@@ -59,7 +59,6 @@
                     is-horizontal-resize
                     :default-sort="{prop: 'date', order: 'descending'}"
                     element-loading-background="rgba(0, 0, 0, 0.8)"
-                    class=""
                     @selection-change="handleSelectionChange" @current-change="clickChange"
             >
                 >
@@ -1165,7 +1164,7 @@
                     phone: that.panel.phone,//
                     name: that.panel.name,//
                     expDay: that.panel.expDay,//
-                    start: 1,//
+                    start: 0,//
                     tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
@@ -1234,8 +1233,7 @@
                     return nonTfmtDatetoLength(column, 10);
                 }
             },
-        }
-        ,
+        },
         watch: {
             $route(to) {
                 if (to.name == 'Member') {

+ 3 - 3
pc/src/views/cost.vue

@@ -53,8 +53,6 @@
           :summary-method="getSummaries"
           @selection-change="handleSelectionChange"
       >
-
-        >
         <el-table-column
             type="index"
             label="序号"
@@ -409,7 +407,9 @@ export default {
           return;
         }
         const values = data.map(item => Number(item[column.property]));
-        if (!values.every(value => isNaN(value)) && index != 0 && index != 1 && index != 2) {
+        if (!values.every(value => isNaN(value)) && index != 0 && index != 1 && index != 2 && index != 5 && index != 6
+            && index != 8   && index != 9
+        ) {
           sums[index] = values.reduce((prev, curr) => {
             const value = Number(curr);
             if (!isNaN(value)) {

+ 1 - 0
tv/src/Global.js

@@ -438,6 +438,7 @@ fakeNews = function (num, team) {
                 "heartRate": 90,
                 "PureCalorieNoVo2": 999,
                 "Name": "测试人",
+                "name": "测试人",
                 "updateTime": 1604568915582,
                 "Ck": nums + i * 2.2,
                 "Head": "http://192.168.0.2/zw.png",

+ 9 - 3
tv/src/components/Headside.vue

@@ -13,11 +13,13 @@
 
 
         <el-dialog
-                title="当前设备uuid"
+                title=""
                 :visible.sync="dialogVisible"
-                width="100%"
+                width="60%"
         >
-            <span>{{eqSn}}</span>
+            <span class="eqSnText">当前设备uuid</span>
+            <br>
+            <span class="eqSnText">{{eqSn}}</span>
             <div id='qrcode' class="qrcode" ref="qrCodeUrl">
 
             </div>
@@ -73,6 +75,7 @@
                 // console.log(version)
             },
             qrcode(code) {
+                this.$refs.qrCodeUrl.innerHTML="";
                 let qrcode = new QRCode(this.$refs.qrCodeUrl, {
                     width: 200,
                     height: 200, // 高度
@@ -178,4 +181,7 @@
         display: block;
         margin: 0 auto;
     }
+    .eqSnText {
+        font-size: 0.4rem;
+    }
 </style>

+ 37 - 59
tv/src/views/2pkRank.vue

@@ -118,26 +118,27 @@
                 this.rankTimer = setInterval(() => {
                     this.getClassUserRank();
                 }, 5000);
+                if (this.autoJump) {
+                    // 倒计时60秒自动关闭
+                    let that = this;
+                    this.totalTime = 60;
+                    let clock = window.setInterval(() => {
+                        this.totalTime--;
+                        console.log(this.totalTime);
+                        if (parseInt(this.totalTime) < 0) {
+                            // 前往等待页面
+                            that.$router.push({path: '/'});
+                            // 计时器回收
+                            clearInterval(clock);
+                        }
+                    }, 1000)
+                }
 
             } else {
-                let Rs = this.fakeNews(18);
+                let Rs = fakeNews(18,2);
                 that.UniteBreak(Rs);
             }
-            if (this.autoJump) {
-                // 倒计时60秒自动关闭
-                let that = this;
-                this.totalTime = 60;
-                let clock = window.setInterval(() => {
-                    this.totalTime--;
-                    console.log(this.totalTime);
-                    if (parseInt(this.totalTime) < 0) {
-                        // 前往等待页面
-                        that.$router.push({path: '/'});
-                        // 计时器回收
-                        clearInterval(clock);
-                    }
-                }, 1000)
-            }
+
         },
         watch: {
             '$route': function (val) {
@@ -148,26 +149,28 @@
                             this.getClassUserRank();
                         }, 5000);
 
+                        if (this.autoJump) {
+                            // 倒计时60秒自动关闭
+                            let that = this;
+                            this.totalTime = 60;
+                            let clock = window.setInterval(() => {
+                                this.totalTime--;
+                                if (parseInt(this.totalTime) < 0) {
+                                    // 前往等待页面
+                                    that.$router.push({path: '/'});
+                                    // 计时器回收
+                                    clearInterval(clock);
+                                }
+                            }, 1000)
+                        }
+
                     } else {
                         this.rankTimer = setInterval(() => {
-                            this.students.redUnite = this.fakeNews();
-                            this.students.blueUnite = this.fakeNews();
+                            this.students.redUnite = fakeNews(6,2);
+                            this.students.blueUnite = fakeNews(6,2);
                         }, 5000);
                     }
-                    if (this.autoJump) {
-                        // 倒计时60秒自动关闭
-                        let that = this;
-                        this.totalTime = 60;
-                        let clock = window.setInterval(() => {
-                            this.totalTime--;
-                            if (parseInt(this.totalTime) < 0) {
-                                // 前往等待页面
-                                that.$router.push({path: '/'});
-                                // 计时器回收
-                                clearInterval(clock);
-                            }
-                        }, 1000)
-                    }
+
                 } else {
                     clearInterval(this.autoJump);
                     clearInterval(this.rankTimer);
@@ -179,38 +182,11 @@
             this.rankTimer = null;
         },
         methods: {
-            fakeNews(fakeNums) {
-                let item = [];
-                // 1 2 3 5 9 11 13 16 21 30
-                for (var i = 0; i < fakeNums; i++) {
-                    item.push(
-                        {
-                            "SvId": 1,
-                            "UserId": 1,
-                            "Cle": i * 14,
-                            "realHr1": parseInt(Math.random() * 100 + 50),
-                            "realHr": 60,
-                            "activePercent": 30,
-                            "heartRate": 90,
-                            "Steps": 9999,
-                            "PureCalorieNoVo2": 999,
-                            "Name": "刘宇宁",
-                            "updateTime": 1604568915582,
-                            "Ck": i * 9.9,
-                            "Head": "http://192.168.0.2/zw.png",
-                            "GroupNo": i % 2 + 1
-                        }
-                    )
-                }
-                return item;
-            },
             // 分队展示
             UniteBreak(Rs) {
                 let that = this;
                 that.students.redUnite = [];
                 that.students.blueUnite = [];
-                console.log(!Rs);
-
                 Rs.map(function (item, t) {
                     if (item.GroupNo == 1) {
                         that.students.redUnite.push(item);
@@ -517,6 +493,7 @@
         font-size: 0.6rem;
         margin-left: 5%;
         line-height: 0.8rem;
+        text-align: left;
     }
 
     li .CLEscore em {
@@ -529,6 +506,7 @@
         font-size: 0.6rem;
         margin-left: 5%;
         line-height: 0.8rem;
+        text-align: left;
     }
 
     li .CKscore em {

+ 45 - 64
tv/src/views/3pkRank.vue

@@ -65,11 +65,11 @@
                                 {{s.Name}}
                             </div>
                             <div class="CLEscore">
-                                <em>CAL</em>
+                                <em>cal</em>
                                 {{s.Cle|fmtInt}}
                             </div>
                             <div class="CKscore">
-                                <em>cal</em>
+                                <em>ck</em>
                                 {{s.Ck|fmtFloat}}
                             </div>
                             <div class="record">
@@ -181,26 +181,28 @@
                 this.rankTimer = setInterval(() => {
                     this.getClassUserRank();
                 }, 5000);
-
+                if (this.autoJump) {
+                    // 倒计时60秒自动关闭
+                    let that = this;
+                    this.totalTime = 60;
+                    let clock = window.setInterval(() => {
+                        this.totalTime--;
+                        console.log(this.totalTime);
+                        if (parseInt(this.totalTime) < 0) {
+                            // 前往等待页面
+                            that.$router.push({path: '/'});
+                            // 计时器回收
+                            clearInterval(clock);
+                        }
+                    }, 1000)
+                }
             } else {
-                let Rs = this.fakeNews(18);
-                that.UniteBreak(Rs);
-            }
-            if (this.autoJump) {
-                // 倒计时60秒自动关闭
-                let that = this;
-                this.totalTime = 60;
-                let clock = window.setInterval(() => {
-                    this.totalTime--;
-                    console.log(this.totalTime);
-                    if (parseInt(this.totalTime) < 0) {
-                        // 前往等待页面
-                        that.$router.push({path: '/'});
-                        // 计时器回收
-                        clearInterval(clock);
-                    }
-                }, 1000)
+                this.rankTimer = setInterval(() => {
+                    let Rs = fakeNews(18,3);
+                    that.UniteBreak(Rs);
+                }, 1000);
             }
+
         },
         watch: {
             '$route': function (val) {
@@ -211,27 +213,29 @@
                             this.getClassUserRank();
                         }, 5000);
 
+                        if (this.autoJump) {
+                            // 倒计时60秒自动关闭
+                            let that = this;
+                            this.totalTime = 60;
+                            let clock = window.setInterval(() => {
+                                this.totalTime--;
+                                console.log(this.totalTime);
+                                if (parseInt(this.totalTime) < 0) {
+                                    // 前往等待页面
+                                    that.$router.push({path: '/'});
+                                    // 计时器回收
+                                    clearInterval(clock);
+                                }
+                            }, 1000)
+                        }
+
                     } else {
                         this.rankTimer = setInterval(() => {
-                            this.students.redUnite = this.fakeNews();
-                            this.students.blueUnite = this.fakeNews();
-                        }, 5000);
-                    }
-                    if (this.autoJump) {
-                        // 倒计时60秒自动关闭
-                        let that = this;
-                        this.totalTime = 60;
-                        let clock = window.setInterval(() => {
-                            this.totalTime--;
-                            console.log(this.totalTime);
-                            if (parseInt(this.totalTime) < 0) {
-                                // 前往等待页面
-                                that.$router.push({path: '/'});
-                                // 计时器回收
-                                clearInterval(clock);
-                            }
-                        }, 1000)
+                            let Rs = fakeNews(18,3);
+                            that.UniteBreak(Rs);
+                        }, 1000);
                     }
+
                 } else {
                     clearInterval(this.autoJump);
                     clearInterval(this.rankTimer);
@@ -243,31 +247,6 @@
             this.rankTimer = null;
         },
         methods: {
-            fakeNews(fakeNums) {
-                let item = [];
-                // 1 2 3 5 9 11 13 16 21 30
-                for (var i = 0; i < fakeNums; i++) {
-                    item.push(
-                        {
-                            "SvId": 1,
-                            "UserId": 1,
-                            "Cle": i * 14,
-                            "realHr1": parseInt(Math.random() * 100 + 50),
-                            "realHr": 60,
-                            "activePercent": 30,
-                            "heartRate": 90,
-                            "Steps": 9999,
-                            "PureCalorieNoVo2": 999,
-                            "Name": "刘宇宁",
-                            "updateTime": 1604568915582,
-                            "Ck": i * 9.9,
-                            "Head": "http://192.168.0.2/zw.png",
-                            "GroupNo": i % 2 + 1
-                        }
-                    )
-                }
-                return item;
-            },
             // 分队展示
             UniteBreak(Rs) {
                 let that = this;
@@ -656,6 +635,7 @@
         font-size: 0.4rem;
         margin-left: 1%;
         line-height: 0.8rem;
+        text-align: left;
     }
 
     li .CLEscore em {
@@ -666,8 +646,9 @@
         width: 1.6rem;
         float: left;
         font-size: 0.4rem;
-        margin-left: 1%;
+        margin-left: 2%;
         line-height: 0.8rem;
+        text-align: left;
     }
 
     li .CKscore em {

+ 22 - 127
tv/src/views/Main.vue

@@ -35,9 +35,8 @@
                                         <span class="fastJump" v-if="s.realHr != 0"
                                               v-show="parseInt(s.activePercent) > 90">{{ s.realHr }}</span>
                                         <span class="normalJump" v-if="s.realHr != 0"
-                                              v-show="parseInt(s.activePercent) <= 90 && parseInt(s.activePercent) > 30">{{
-                        s.realHr
-                      }}</span>
+                                              v-show="parseInt(s.activePercent) <= 90 && parseInt(s.activePercent) > 30">
+                                            {{s.realHr}}</span>
                                         <span class="slowJump" v-if="s.realHr != 0"
                                               v-show="parseInt(s.activePercent) <= 30">{{ s.realHr }}</span>
 
@@ -158,46 +157,6 @@
                     dialogVisible: false,
                     toper: {},
                 },
-                // 本地绑定名字和头像路径
-                headImg: [
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                    {name: 'flyhead.png'},
-                ],
-                nameList: [
-                    {name: '杨东艳'},
-                    {name: '隋小飞'},
-                    {name: '刘晓蕾'},
-                    {name: '刘海生'},
-                    {name: '贾雨琦'},
-                    {name: '李延海'},
-                    {name: '宋凌晨'},
-                    {name: '段长鹏'},
-                    {name: '郑伟'},
-                    {name: '周睿'},
-                    {name: '贾奕'},
-                    {name: '王正祥'},
-                    {name: '高超'},
-                    {name: '武发鲁'},
-                    {name: '赵晋洪'},
-                    {name: '张岩'},
-                    {name: '郑伟'},
-                    {name: '郑伟'},
-                ],
                 fakeEgg: {
                     Rs: {
                         "DuId": 37,
@@ -235,32 +194,15 @@
                 this.createEgg();
             } else {
                 // 彩蛋
-                this.OpenEgg(this.fakeEgg);
-                this.mainTimer = setInterval(() => {
-                    this.students = this.fakeNews();
-                    this.giveClassName(this.students);
-                }, 1000);
+                // this.OpenEgg(this.fakeEgg);
+                let Rs = fakeNews(21);
+                this.giveClassName(Rs);
+                this.students = Rs;
+                // this.mainTimer = setInterval(() => {
+                //     this.students = fakeNews(2);
+                //     this.giveClassName(this.students);
+                // }, 10000);
             }
-
-
-            // this.alertInfo(document.body.clientWidth);
-            // this.alertInfo(window.screen.height);
-
-            // 倒计时
-            let that = this;
-            // that.serachBtnStatus = true;
-            // let totalTime = 3
-            // let clock = window.setInterval(() => {
-            //       totalTime--
-            //       if (totalTime < 0) {
-            //         totalTime = 3;
-            //         that.serachBtnStatus = false;
-
-            //       }
-            //     }
-            //     ,
-            //     1000
-            // )
         },
         watch: {
             '$route': function (val) {
@@ -275,7 +217,7 @@
                             this.createEgg();
                         }, 6000);
                     } else {
-                        this.students = this.fakeNews();
+                        this.students = fakeNews(2);
                         this.giveClassName(this.students);
                         // this.createEgg(this.students[5]);
                     }
@@ -292,31 +234,6 @@
             this.timer2 = null;
         },
         methods: {
-            fakeNews() {
-                let item = [];
-                // 1 2 3 5 9 11 13 16 21 30
-                let fakeNums = 2;
-                for (var i = 0; i < fakeNums; i++) {
-                    item.push(
-                        {
-                            "SvId": 1,
-                            "UserId": 1,
-                            "Cle": 999,
-                            "realHr1": parseInt(Math.random() * 100 + 50),
-                            "realHr": 60,
-                            "activePercent": 30,
-                            "heartRate": 90,
-                            "Steps": 9999,
-                            "PureCalorieNoVo2": 999,
-                            "Name": "东南西北中",
-                            "updateTime": 1604568915582,
-                            "Ck": 99.9,
-                            "Head": '',
-                        }
-                    )
-                }
-                return item;
-            },
             alertInfo(info) {
                 alert(info);
             },
@@ -365,37 +282,14 @@
                     let json = res;
                     if (json.Code == 0) {
                         that.students = json.Rs;
-                        // // 返回空值不处理
-                        // if (that.times == 1) {
-                        //     that.students = json.Rs;
-                        //     if (!json.Rs) return false;
-                        //     // // 添加头像 和 姓名 ..
-                        //     that.times++
-                        // } else {
-                        //     if (localStorage.result != JSON.stringify(json.Rs)) {
-                        //         that.students = json.Rs;
-                        //         // this.createEgg(this.students[1]);
-                        //         if (!json.Rs) return false;
-                        //         // // 添加头像 和 姓名
-                        //         // that.students.map(function (i, v) {
-                        //         //     i.head = that.headImg[v].name;
-                        //         //     i.userNmae = that.nameList[v].name
-                        //         // });
-                        //     }
-                        //     localStorage.res = JSON.stringify(json.Rs);
-                        // }
 
                         that.giveClassName(json.Rs);
-                        // test 启动一个成就彩蛋
-                        // this.createEgg(that.students[4]);
                     } else {
                         // 已下课
                         if (json.Code == '999') {
                             that.students = ""
-                            // 没人不做处理
-                            //     that.$router.push({path: '/rank'});
                         } else {
-                            //     // 已出错
+                            // 已出错
                             that.$message.error(json.Memo);
                         }
                     }
@@ -505,6 +399,7 @@
                             colorClass = 'blue';
                             break
                     }
+
                     that.studentsClassName[i] = {
                         name: numberClass + ' ' + colorClass,
                     }
@@ -1139,7 +1034,7 @@
     }
 
     .two .centerLi {
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
     }
 
     .two:nth-child(2) {
@@ -1257,7 +1152,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -1375,7 +1270,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -1502,7 +1397,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -1620,7 +1515,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -1740,7 +1635,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -1863,7 +1758,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -1983,7 +1878,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         float: none;
     }
 
@@ -2096,7 +1991,7 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        border: 1px solid #fff;
+        /*border: 1px solid #fff;*/
         /*border: 0.03rem solid rgba(255,255,255,0.1);*/
         /*box-shadow:inset 0 0 6px rgba(0,0,0,0.4);*/
         float: none;