wzx 4 years ago
parent
commit
21b1db7891
6 changed files with 64 additions and 74 deletions
  1. 1 0
      src/Global.js
  2. 4 2
      src/Mock/index.js
  3. 17 11
      src/api/getApiRes.js
  4. 29 50
      src/views/Index.vue
  5. 10 8
      src/views/pk.vue
  6. 3 3
      src/views/threepk.vue

+ 1 - 0
src/Global.js

@@ -16,6 +16,7 @@ runVersion = 'normal';
 // headapi = '/api/';
 // headapi = '/api/';
 // headapi = 'http://192.168.0.62:9000/';//从郑伟那里获得数据源
 // headapi = 'http://192.168.0.62:9000/';//从郑伟那里获得数据源
 // headapi = 'http://192.168.0.3:9000/';//从郑伟那里获得数据源
 // headapi = 'http://192.168.0.3:9000/';//从郑伟那里获得数据源
+
 headapi = 'http://221.214.111.254:9000/';//实际场馆默认数据源
 headapi = 'http://221.214.111.254:9000/';//实际场馆默认数据源
 
 
 // 七牛云imgsrc
 // 七牛云imgsrc

+ 4 - 2
src/Mock/index.js

@@ -130,6 +130,7 @@ let testStudent = function (num, team, mustbeTeamOne) {
             AvgHr: 0,
             AvgHr: 0,
             BeginTime: 1608188579,
             BeginTime: 1608188579,
             Ck: "@float(1,25,0,1)",
             Ck: "@float(1,25,0,1)",
+            // Ck: "@float(0,0,0,0)",
             Cle: "@float(1,1500,0,1)",
             Cle: "@float(1,1500,0,1)",
             EI: "@float(1,1000,0,1)",
             EI: "@float(1,1000,0,1)",
             DuId: 119,
             DuId: 119,
@@ -162,6 +163,7 @@ let testStudent = function (num, team, mustbeTeamOne) {
             ActivePercent: "@integer(10, 100)",
             ActivePercent: "@integer(10, 100)",
             bmrMSjRmrcb: 66.00000000000001,
             bmrMSjRmrcb: 66.00000000000001,
             FormatCk: "@integer(1, 50)",
             FormatCk: "@integer(1, 50)",
+            // FormatCk: "@integer(0, 0)",
             isAlive: true,
             isAlive: true,
             isFinish: false,
             isFinish: false,
             isOver: false,
             isOver: false,
@@ -408,8 +410,8 @@ if (t == 1) {
     // }
     // }
 
 
     // 0: 下课 团课/私教/PK 的排名
     // 0: 下课 团课/私教/PK 的排名
-    let LessonClass = 2;
-    let LessonDp = 2;
+    let LessonClass = 3;
+    let LessonDp = 3;
     // 1:团课/私教
     // 1:团课/私教
     // 2:竞技课2PK
     // 2:竞技课2PK
     // 3:竞技课threepk
     // 3:竞技课threepk

+ 17 - 11
src/api/getApiRes.js

@@ -107,21 +107,27 @@ export function ClassUserRank(postdata) {
 }
 }
 
 
 
 
-// 用查询最新wgt 般本
-export function QueryVueFramework(postdata) {
-    let url = 'http://cal.beswell.com:85/v1/Sensors/QueryVueFrameworkV2';
-    // let url = 'http://192.168.0.3:19096/v1/Sensors/QueryVueFrameworkV2';
-    // let url = 'http://192.168.0.60:19096/v1/Sensors/QueryVueFrameworkV2';
+// 用查询最新wgt版本
+export function QueryVueFramework(postdata, testMode=false) {
+    let url = '';
+    if (!testMode)  //正式版
+        url = 'http://cal.beswell.com:85/v1/Sensors/QueryVueFrameworkV2';
+    else    //测试版
+        url = 'http://192.168.0.3:19096/v1/Sensors/QueryVueFrameworkV2';
+        // url = 'http://192.168.0.60:19096/v1/Sensors/QueryVueFrameworkV2';
     return getApiBasic(url, postdata);
     return getApiBasic(url, postdata);
 }
 }
-// 下载最新wgt 般本
-export function DownloadVueFramework() {
-    let url = 'http://cal.beswell.com:85/v1/Sensors/DownloadVueFrameworkV2?vfType=3';
-    // let url = 'http://192.168.0.3:19096/v1/Sensors/DownloadVueFrameworkV2?vfType=3';
-    // let url = 'http://192.168.0.60:19096/v1/Sensors/DownloadVueFrameworkV2?vfType=3';
+// 下载最新wgt版本
+export function DownloadVueFramework(testMode=false) {
+    let url = '';
+    if (!testMode)  //正式版
+        url = 'http://cal.beswell.com:85/v1/Sensors/DownloadVueFrameworkV2?vfType=3';
+    else    //测试版
+        url = 'http://192.168.0.3:19096/v1/Sensors/DownloadVueFrameworkV2?vfType=3';
+        // url = 'http://192.168.0.60:19096/v1/Sensors/DownloadVueFrameworkV2?vfType=3';
     return url;
     return url;
 }
 }
-// // 下载最新wgt 般本
+// // 下载最新wgt
 // export function DownloadVueFramework(postdata) {
 // export function DownloadVueFramework(postdata) {
 //     // let url = 'http://cal.beswell.com:85/v1/Sensors/DownloadVueFrameworkV2';
 //     // let url = 'http://cal.beswell.com:85/v1/Sensors/DownloadVueFrameworkV2';
 //     let url = 'http://192.168.0.3:19096/v1/Sensors/DownloadVueFrameworkV2';
 //     let url = 'http://192.168.0.3:19096/v1/Sensors/DownloadVueFrameworkV2';

+ 29 - 50
src/views/Index.vue

@@ -23,7 +23,7 @@ export default {
   name: 'Home',
   name: 'Home',
   data() {
   data() {
     return {
     return {
-      autoUpdate: false,//自动升级
+      testMode: false,    //是否测试模式
       aSideState: false,
       aSideState: false,
       thisClick: 0,
       thisClick: 0,
       tabwildState: 1,
       tabwildState: 1,
@@ -51,7 +51,7 @@ export default {
       //浏览器默认的
       //浏览器默认的
       // localStorage.eqSn = '30:9C:23:0C:8B:1E';
       // localStorage.eqSn = '30:9C:23:0C:8B:1E';
       localStorage.eqSn = 'd104bd6ffec3d5ba';
       localStorage.eqSn = 'd104bd6ffec3d5ba';
-      localStorage.version = '2.0';
+      localStorage.version = '2.1.6';
 
 
       if (window.plus) {
       if (window.plus) {
         plusReady();
         plusReady();
@@ -83,51 +83,30 @@ export default {
             // 获取转发端口地址
             // 获取转发端口地址
             that.getServeIpAddress(e.uuid);
             that.getServeIpAddress(e.uuid);
 
 
-            // 公司测试机用公司版本升级
-            // if (uuid == "a1f2d679c1624d3a" || uuid == "8e501b0bde9ce600") {
-            if (uuid == "1277fcb4c81e29d2" || uuid == "8e501b0bde9ce600") {
-              //首发版本 '1.1.0' 在线版不需要自动升级
-              // 内测版自动升级
-              let url = 'http://192.168.0.3:19096/v1/Sensors/QueryVueFramework';
-              let param = {};
-              let postdata = qs.stringify(param);
-              axios.post(url, postdata).then(function (data) {
-                let json = data.data;
-                if (json.Code == 0) {
-                  if (localStorage.version != json.VueFramework.Version) {
-                    // 测试版本下载
-                    console.log(332);
-                    let downUrl = "http://192.168.0.3:19096/v1/Sensors/DownloadVueFramework";
-                    that.downWgt(downUrl);
-                  }
-                } else {
-                  console.log(json.Memo);
-                }
-              }, function (response) {
-                console.info(response);
-              })
-            } else {
-              console.log(223);
-              // 正式版
-              //开启自动升级
-              // 教室版本自动升级,户外版禁用自动升级
-              if (runVersion == 'outDoor') {
-                console.log('户外版禁用自动升级');
-                return false
-              } else {
-                // that.checkUpdate();
-
-                // 每10分钟检测一下升级信息
-                setInterval(() => {
-                  // console.log("$route.path: " + this.$route.path);
-                  // console.log("$route.name: " + this.$route.name);
-                  if (this.$route.name == "Wait") {
-                    console.log("===> checkUpdate");
-                    that.checkUpdate();
-                  }
-                }, 600000);
-              }
+            // 公司测试机用公司版本升级 
+            // if (uuid == "1277fcb4c81e29d2" || uuid == "8e501b0bde9ce600") {
+            if (uuid == "d104bd6ffec3d5ba") { // 内测版
+              that.testMode = true;                 
+            } else {  // 正式版
+              that.testMode = false;            
+            }
 
 
+            // 教室版本自动升级,户外版禁用自动升级
+            if (runVersion == 'outDoor') {
+              console.log('户外版禁用自动升级');
+              return false
+            } else {
+              that.checkUpdate();
+
+              // 每10分钟检测一下升级信息
+              setInterval(() => {
+                // console.log("$route.path: " + that.$route.path);
+                // console.log("$route.name: " + that.$route.name);
+                if (that.$route.name == "Wait") {
+                  console.log("===> checkUpdate");
+                  that.checkUpdate();
+                }
+              }, 600000);
             }
             }
           },
           },
           fail: function (e) {
           fail: function (e) {
@@ -143,8 +122,8 @@ export default {
         vfType: 3   //新版电视端-Http接口
         vfType: 3   //新版电视端-Http接口
       };
       };
       let postdata = qs.stringify(param);
       let postdata = qs.stringify(param);
-      const h = this.$createElement;
-      QueryVueFramework(postdata).then(res => {
+      const h = that.$createElement;
+      QueryVueFramework(postdata, that.testMode).then(res => {
         let json = res;
         let json = res;
         if (json.Code == 0) {
         if (json.Code == 0) {
           console.log('localStorage.version: ' + localStorage.version);
           console.log('localStorage.version: ' + localStorage.version);
@@ -153,8 +132,8 @@ export default {
           if (localStorage.version != json.VueFramework.Version) {
           if (localStorage.version != json.VueFramework.Version) {
             // 正式
             // 正式
             plus.nativeUI.toast("发现新版本 " + json.VueFramework.Version + ",准备升级...");
             plus.nativeUI.toast("发现新版本 " + json.VueFramework.Version + ",准备升级...");
-            let url = DownloadVueFramework();
-            this.downWgt(url);
+            let url = DownloadVueFramework(that.testMode);
+            that.downWgt(url);
           }
           }
         }
         }
       })
       })

+ 10 - 8
src/views/pk.vue

@@ -121,10 +121,10 @@ export default {
         percent: 0,
         percent: 0,
         studentTime: 15
         studentTime: 15
       },
       },
-      Redflag: 0,
-      BlueFlag: 0,
-      RedProgress: 25,
-      BlueProgress: 25,
+      Redflag: 3,
+      BlueFlag: 3,
+      RedProgress: 21,
+      BlueProgress: 21,
     }
     }
   },
   },
   mounted() {
   mounted() {
@@ -339,13 +339,14 @@ export default {
 
 
       // 当为0时均分
       // 当为0时均分
       if (redFmtSum == 0) {
       if (redFmtSum == 0) {
-        that.Redflag = 7;
-        that.RedProgress = 25;
+        that.Redflag = 3;
+        that.RedProgress = 21;
       } else {
       } else {
         // 限制最大
         // 限制最大
         let redPercent = parseInt((redFmtSum / sumMax) * 100);
         let redPercent = parseInt((redFmtSum / sumMax) * 100);
         redPercent = redPercent > 100 ? 100 : redPercent;
         redPercent = redPercent > 100 ? 100 : redPercent;
         that.Redflag = redPercent * 0.70;
         that.Redflag = redPercent * 0.70;
+        that.Redflag = that.Redflag >= 3 ? that.Redflag : 3;
         that.RedProgress = that.Redflag + 18.2;
         that.RedProgress = that.Redflag + 18.2;
         if (that.RedProgress > 90) {
         if (that.RedProgress > 90) {
           that.RedProgress = 90
           that.RedProgress = 90
@@ -353,13 +354,14 @@ export default {
       }
       }
 
 
       if (blueFmtSum == 0) {
       if (blueFmtSum == 0) {
-        that.BlueFlag = 7;
-        that.BlueProgress = 25;
+        that.BlueFlag = 3;
+        that.BlueProgress = 21;
       } else {
       } else {
         // 限制最大
         // 限制最大
         let bluePercent = parseInt((blueFmtSum / sumMax) * 100);
         let bluePercent = parseInt((blueFmtSum / sumMax) * 100);
         bluePercent = bluePercent > 100 ? 100 : bluePercent;
         bluePercent = bluePercent > 100 ? 100 : bluePercent;
         that.BlueFlag = bluePercent * 0.70;
         that.BlueFlag = bluePercent * 0.70;
+        that.BlueFlag = that.BlueFlag >= 3 ? that.BlueFlag : 3;
         that.BlueProgress = that.BlueFlag + 18.2;
         that.BlueProgress = that.BlueFlag + 18.2;
         if (that.BlueProgress > 90) {
         if (that.BlueProgress > 90) {
           that.BlueProgress = 90
           that.BlueProgress = 90

+ 3 - 3
src/views/threepk.vue

@@ -140,9 +140,9 @@ export default {
       Redflag: 0,
       Redflag: 0,
       BlueFlag: 0,
       BlueFlag: 0,
       yellowFlag: 0,
       yellowFlag: 0,
-      RedProgress: 25,
-      BlueProgress: 25,
-      yellowProgress: 25,
+      RedProgress: 28,
+      BlueProgress: 28,
+      yellowProgress: 28,
     }
     }
   },
   },
   mounted() {
   mounted() {