Selaa lähdekoodia

胜率功能
app首页样式修改

Changpeng Duan 5 vuotta sitten
vanhempi
commit
67196be288

+ 12 - 9
app/src/page/mainpage.vue

@@ -12,10 +12,9 @@
                     <img src="../static/images/main/shop3.png" width="100%" height="100%" v-show="parseInt(l.ShopID) == 5"/>
                 </div>
                 <div class="rt">
-                    <h5>{{ l.ShopName.substr(0,5)}}</h5>
-                    <h4 style="color: #F8BD00" v-if="l.ShopID == 3">{{ l.ShopName.substr(5,12) }}</h4>
-                    <h4 style="color: #B50080" v-if="l.ShopID == 4">{{ l.ShopName.substr(5,12) }}</h4>
-                    <h4 style="color: #6EB82C" v-if="l.ShopID == 5">{{ l.ShopName.substr(5,12) }}</h4>
+                    <h4 style="background-color: #FFA310" v-if="l.ShopID == 3">{{ l.ShopName.substr(5,12) }}</h4>
+                    <h4 style="background-color: #37CB00" v-if="l.ShopID == 4">{{ l.ShopName.substr(5,12) }}</h4>
+                    <h4 style="background-color: #028FE1" v-if="l.ShopID == 5">{{ l.ShopName.substr(5,12) }}</h4>
                     <span>今日预约名额剩余
               <i v-if="l.RemainOrdernum > 0">{{ l.RemainOrdernum }}</i>
               <i v-if="l.RemainOrdernum == 0" class="red">{{ l.RemainOrdernum }}</i>
@@ -291,14 +290,18 @@
     }
 
     .list .rt h4 {
+        width: auto;
         font-family: "PingFang SC";
         font-weight: normal;
         font-size: 16px;
-        text-align: left;
-        color: #3b3b3b;
-        margin: 0;
-        margin-top: 0px;
-        margin-bottom: 1px;
+        float: left;
+        padding-left: 12px;
+        padding-right: 12px;
+        margin-top: 12px;
+        margin-bottom: 12px;
+        border-radius: 250px;
+        color: #fff;
+        text-align: center;
     }
 
     .list .rt span {

+ 1 - 1
pc/src/api/Navs.js

@@ -18,7 +18,7 @@ let navs = [
         "show": 3,
         "grouplist": "2,5",
         "icon": "el-icon-user",
-    }, {
+    },{
         "clmid": "3",
         "clmcode": "lesson",
         "clmname": "课目管理",

+ 10 - 10
pc/src/views/courseEdit.vue

@@ -40,7 +40,7 @@
           :data="tableData"
           border
           is-horizontal-resize
-          :default-sort="{prop: 'group_no', order: 'descending'}"
+          :default-sort="{prop: 'data', order: 'descending'}"
           element-loading-background="rgba(0, 0, 0, 0.8)"
           class=""
           :row-class-name="tableRowClassName"
@@ -1127,14 +1127,14 @@ export default {
   right: 0;
 }
 
-/deep/ .el-table .red-row {
-  background: #fb88c1;
-}
+/*/deep/ .el-table .red-row {*/
+  /*background: #fb88c1;*/
+/*}*/
 
-/deep/ .el-table .blue-row {
-  background: #7099d0;
-}
-/deep/ .el-table .yellow-row {
-  background: #fbe56e;
-}
+/*/deep/ .el-table .blue-row {*/
+  /*background: #7099d0;*/
+/*}*/
+/*/deep/ .el-table .yellow-row {*/
+  /*background: #fbe56e;*/
+/*}*/
 </style>

+ 13 - 0
pc/src/views/tempUser.vue

@@ -0,0 +1,13 @@
+<template>
+    <h5>临时会员</h5>
+</template>
+
+<script>
+    export default {
+        name: "tempUser"
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 2 - 2
tv/src/Mock/index.js

@@ -137,8 +137,8 @@ let testStudent = function (num, team) {
             IsNewUser: 0,
             MaxHr: 80,
             Name: "@cname",
-            PkSucessnum: 2,
-            PkTotalnum: 6,
+            PkSucessnum: '@integer(0, 999)',//胜场数
+            PkTotalnum: '@integer(0, 999)',//总场数
             PlanId: 60,
             PureCalorieNoVo2: "@integer(1, 999)",
             Sex: 1,

+ 3 - 0
tv/src/static/img/comm/isPrivate.svg

@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="40.913" height="44.657" viewBox="0 0 40.913 44.657">
+  <path id="路径_183" data-name="路径 183" d="M38.594,41.533,31.75,38.8l0,.006a.99.99,0,0,0-1.157,1.5l0,0a2.488,2.488,0,0,1,.035.823A2.514,2.514,0,0,1,28.335,43.3c-1.243.091-2.6-1.8-2.578-1.73A27.582,27.582,0,0,0,.831,32.342a17.282,17.282,0,0,1,14.025-1.427.582.582,0,0,0,.187.06l.049.016v-.011a.289.289,0,0,1,.037,0,.669.669,0,0,0,.776-.44.74.74,0,0,0-.011-.477,58.731,58.731,0,0,1-5.343-3.551C1.441,19.758-2.53,9.676,1.682,4s14.727-5.475,23.5,1.717A24.844,24.844,0,0,1,28.8,9.324c3.356,3.764,4.582,8.324,2.687,10.471-1.863,2.11-6.123,1.487-10.138-1.26,2.785,1.269,5.022,1.348,6,.12,1.1-1.369-.777-5.211-4.777-8.221-2.691-2.025-6.207-3.181-8.219-2.817,0-.016,0-.031.006-.047A5.423,5.423,0,0,0,10.52,9.555c-2.743,3.7.307,11.921,7.644,17.362a35.83,35.83,0,0,0,8.1,4.765c2.623.919,5.4,1.725,8.319,2.6a16.6,16.6,0,0,1,3.147,1.125c2.045,1.636,2.123,6.26.865,6.124" transform="translate(40.913 43.281) rotate(178)" fill="#fff"/>
+</svg>

+ 29 - 11
tv/src/views/2pkRank.vue

@@ -11,7 +11,8 @@
                         <em>{{redSum}}</em><i>Ck</i>
                     </span>
                     <span class="flagContainer">
-                        <img src="../assets/img/2pkRank/flag.svg" alt="" v-if="parseFloat(redSum) >= parseFloat(blueSum)">
+                        <img src="../assets/img/2pkRank/flag.svg" alt=""
+                             v-if="parseFloat(redSum) >= parseFloat(blueSum)">
                     </span>
                     <span class="mineUniteName">
                         红队
@@ -23,7 +24,8 @@
                         蓝队
                     </span>
                     <span class="flagContainer">
-                        <img src="../assets/img/2pkRank/flag.svg" alt="" v-if="parseFloat(redSum) <= parseFloat(blueSum)">
+                        <img src="../assets/img/2pkRank/flag.svg" alt=""
+                             v-if="parseFloat(redSum) <= parseFloat(blueSum)">
                     </span>
                     <span class="sumCK">
                         <em>{{blueSum}}</em><i>Ck</i>
@@ -45,8 +47,7 @@
                             <div class="CLEscore">
                                 <!--                                <em>Cal</em>-->
                                 <em>胜率</em>
-                                <span v-if="redSum >= blueSum">100%</span>
-                                <span v-else>0%</span>
+                                <span>{{s.success }}%</span>
                                 <!--                                {{s.Cle|fmtInt}}-->
                             </div>
                             <div class="CKscore">
@@ -75,8 +76,7 @@
                             </div>
                             <div class="CLEscore">
                                 <em>胜率</em>
-                                <span v-if="redSum <= blueSum">100%</span>
-                                <span v-else>0%</span>
+                                <span>{{s.success }}%</span>
                             </div>
                             <div class="CKscore">
                                 <em>CK</em>
@@ -198,10 +198,12 @@
                 let redSum = 0;
                 let blueSum = 0;
                 Rs.redUnite.map(function (item, t) {
-                    redSum += parseFloat(item.Ck.toFixed(1))
+                    redSum += parseFloat(item.Ck.toFixed(1));
+                    that.successCalc(item);
                 });
                 Rs.blueUnite.map(function (item, t) {
-                    blueSum += parseFloat(item.Ck.toFixed(1))
+                    blueSum += parseFloat(item.Ck.toFixed(1));
+                    that.successCalc(item);
                 });
                 that.redSum = redSum.toFixed(1);
                 that.blueSum = blueSum.toFixed(1);
@@ -210,6 +212,19 @@
                 let groupNo = redSum >= blueSum ? 1 : 2;
                 that.PostAddPkInfo(PlanId, groupNo);
             },
+            // 插入胜率结果
+            successCalc(item) {
+                if (item.PkTotalnum == 0 || item.PkSucessnum == 0) {
+                    item.success = 0;
+                } else {
+                    let res = (parseFloat(parseFloat(item.PkSucessnum) / parseFloat(item.PkTotalnum)) * 100);
+                    if (res >= 100) {
+                        item.success = 100;
+                    } else {
+                        item.success = res.toFixed(1);
+                    }
+                }
+            },
             getClassUserRank() {
                 let that = this;
                 let param = {
@@ -502,7 +517,7 @@
     li.redUnite {
         width: 100%;
         float: left;
-        background: rgba(232, 32, 62, 0.75);
+        background: rgba(207, 17, 34, 0.75);
         color: #fff;
 
     }
@@ -510,7 +525,7 @@
     li .CLEscore {
         width: 2.6rem;
         float: left;
-        font-size: 0.6rem;
+        font-size: 0.5rem;
         margin-left: 5%;
         line-height: 0.8rem;
         text-align: left;
@@ -522,7 +537,7 @@
 
     li .CLEscore span {
         padding-left: 0.1rem;
-        font-size: 0.7rem;
+        font-size: 0.6rem;
     }
 
     li .CKscore {
@@ -597,4 +612,7 @@
         font-size: 0.4rem;
         color: #fff;
     }
+    /deep/ .el-col {
+        min-height: 1rem;
+    }
 </style>

+ 47 - 19
tv/src/views/3pkRank.vue

@@ -71,8 +71,7 @@
                                 <!--                                <em>Cal</em>-->
                                 <!--                                {{s.Cle|fmtInt}}-->
                                 <em>胜率</em>
-                                <span v-if="red.rank == 1">100%</span>
-                                <span v-else>0%</span>
+                                <span>{{s.success }}%</span>
                             </div>
                             <div class="CKscore">
                                 <em>CK</em>
@@ -98,8 +97,7 @@
                             </div>
                             <div class="CLEscore">
                                 <em>胜率</em>
-                                <span v-if="blue.rank == 1">100%</span>
-                                <span v-else>0%</span>
+                                <span>{{s.success }}%</span>
                             </div>
                             <div class="CKscore">
                                 <em>CK</em>
@@ -125,8 +123,7 @@
                             </div>
                             <div class="CLEscore">
                                 <em>胜率</em>
-                                <span v-if="yellow.rank == 1">100%</span>
-                                <span v-else>0%</span>
+                                <span>{{s.success }}%</span>
                             </div>
                             <div class="CKscore">
                                 <em>CK</em>
@@ -235,7 +232,7 @@
                 }, 1000)
             },
             // 分队展示
-            UniteBreak(Rs,PlanId) {
+            UniteBreak(Rs, PlanId) {
                 let that = this;
                 that.students.redUnite = [];
                 that.students.blueUnite = [];
@@ -269,23 +266,26 @@
                     return b.Ck - a.Ck;
                 });
 
-                that.calcSumCK(that.students,PlanId);
+                that.calcSumCK(that.students, PlanId);
 
             },
             // 计算各队总分
-            calcSumCK(Rs,PlanId) {
+            calcSumCK(Rs, PlanId) {
                 let that = this;
                 let redSum = 0;
                 let blueSum = 0;
                 let yellowSum = 0;
                 Rs.redUnite.map(function (item, t) {
-                    redSum += parseFloat(item.Ck)
+                    redSum += parseFloat(item.Ck);
+                    that.successCalc(item);
                 });
                 Rs.blueUnite.map(function (item, t) {
-                    blueSum += parseFloat(item.Ck)
+                    blueSum += parseFloat(item.Ck);
+                    that.successCalc(item);
                 });
                 Rs.yellowUnite.map(function (item, t) {
-                    yellowSum += parseFloat(item.Ck)
+                    yellowSum += parseFloat(item.Ck);
+                    that.successCalc(item);
                 });
                 that.redSum = redSum.toFixed(1);
                 that.blueSum = blueSum.toFixed(1);
@@ -295,10 +295,23 @@
                     {name: "blue", val: that.blueSum},
                     {name: "yellow", val: that.yellowSum},
                 ];
-                that.getUnitRank(res,PlanId);
+                that.getUnitRank(res, PlanId);
+            },
+            // 插入胜率结果
+            successCalc(item) {
+                if (item.PkTotalnum == 0 || item.PkSucessnum == 0) {
+                    item.success = 0;
+                } else {
+                    let res = (parseFloat(parseFloat(item.PkSucessnum) / parseFloat(item.PkTotalnum)) * 100);
+                    if (res >= 100) {
+                        item.success = 100;
+                    } else {
+                        item.success = res.toFixed(1);
+                    }
+                }
             },
             // 结果排序
-            getUnitRank(res,PlanId) {
+            getUnitRank(res, PlanId) {
                 let that = this;//这个that不要删
                 let sum = res.sort(function (a, b) {
                     return b.val - a.val;
@@ -308,8 +321,20 @@
                 });
 
                 // 上报胜率结果
-                console.log(sum);
-                let groupNo = 1;
+
+                let groupNo = 0;
+                console.log('name' + sum[0].name);
+                switch (sum[0].name) {
+                    case "red":
+                        groupNo = 1;
+                        break;
+                    case "blue":
+                        groupNo = 2;
+                        break;
+                    case "yellow":
+                        groupNo = 3;
+                        break
+                }
                 that.PostAddPkInfo(PlanId, groupNo);
             },
             getClassUserRank() {
@@ -324,7 +349,7 @@
                     that.students.blueUnite = [];
                     that.students.yellowUnite = [];
                     if (json.Code == 0) {
-                        that.UniteBreak(json.Rs,json.Dp.PlanId);
+                        that.UniteBreak(json.Rs, json.Dp.PlanId);
 
                         let totalTime = 40;
                         let Studenlength = 0;
@@ -596,7 +621,8 @@
     .sumCK i {
         font-size: 0.24rem;
     }
-/*todo*/
+
+    /*todo*/
     .flagContainer {
         position: relative;
         top: -1rem;
@@ -626,6 +652,8 @@
 
     .list .part {
         width: 33.333%;
+        height: 100%;
+        min-height: 1rem;
         float: left;
     }
 
@@ -633,7 +661,7 @@
     li.redUnite {
         width: 96%;
         float: left;
-        background: rgba(232, 32, 62, 0.75);
+        background: rgba(207, 17, 34, 0.75);
         color: #fff;
         margin-bottom: 0.07rem;
         overflow: hidden;

+ 2 - 1
tv/需求修改和debug.md

@@ -79,11 +79,12 @@ getServeIpAddress
 PC端 左侧拉不动 √
 PC端 适配窄屏幕 √
 <s> 4.课程管理每次打开加入学生,没清理穿梭框 <s> 
+pK颜色更换
+9. 胜率显示从后台取胜率数据   √
 =================================
 
 
 2. 私有心率带角标  
-9. 胜率显示从后台取胜率数据  
 23.彩蛋和新学生接口可以合并 todo