Procházet zdrojové kódy

Signed-off-by: Changpeng Duan <838560574@qq.com>

Changpeng Duan před 4 roky
rodič
revize
95812de86e

+ 15 - 0
.vscode/launch.json

@@ -0,0 +1,15 @@
+{
+    // 使用 IntelliSense 了解相关属性。 
+    // 悬停以查看现有属性的描述。
+    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "type": "pwa-msedge",
+            "request": "launch",
+            "name": "Launch Chrome against localhost",
+            "url": "http://localhost:8080",
+            "webRoot": "${workspaceFolder}"
+        }
+    ]
+}

+ 4 - 0
.vscode/settings.json

@@ -0,0 +1,4 @@
+{
+    "editor.fontSize": 16,
+    "files.autoSave": "onFocusChange"
+}

+ 13 - 0
.vscode/tasks.json

@@ -0,0 +1,13 @@
+{
+	"version": "2.0.0",
+	"tasks": [
+		{
+			"type": "npm",
+			"script": "serve",
+			"path": "pc/",
+			"problemMatcher": [],
+			"label": "npm: serve - pc",
+			"detail": "vue-cli-service serve"
+		}
+	]
+}

+ 24 - 12
online/src/page/mainpage.vue

@@ -256,6 +256,7 @@
                 } else {
                     // 页面初始化操作
                     document.addEventListener('plusready', function (e) {
+                        that.setWakelock();
                         plus.bluetooth.onBLECharacteristicValueChange(function (e) {
                             if (e.characteristicId == '00002A19-0000-1000-8000-00805F9B34FB') {
                                 // 获取电量
@@ -272,12 +273,11 @@
                                 that.watchState = true;//关闭连接按钮并显示当前课程名
                                 // 卡路里计算
                                 that.calcCalorie(that.heartRate);
+                                that.heartLine.push(that.heartRate);
+                                that.dataLabels.push('');
                                 if (that.heartLine.length > 30) {
-                                    that.heartLine = that.heartLine.concat();
-                                    that.dataLabels = that.dataLabels.concat();
-                                } else {
-                                    that.heartLine.push(that.heartRate);
-                                    that.dataLabels.push('');
+                                    that.heartLine.shift();
+                                    that.dataLabels.shift();
                                 }
                                 that.DrawHeartLine(that.heartLine, that.dataLabels);
                             }
@@ -285,6 +285,16 @@
                     });
                 }
             },
+            // 屏幕常亮
+            setWakelock() {
+                plus.device.setWakelock(true);
+                console.log('屏幕常量已开启');
+            },
+            // 震动
+            vibrate() {
+                let milliseconds = 500;
+                plus.device.vibrate(milliseconds)
+            },
             showConsole() {
                 let vconDom = document.getElementById('__vconsole');
                 this.toggleClass(vconDom, 'show')
@@ -308,7 +318,7 @@
                     obj.className = obj.className.replace(reg, ' ');
                 }
             },
-            // 生成心率数据
+            // 测试 生成心率数据
             mockCreateDate() {
                 let that = this;
                 clearInterval(this.timermockCreateDate);
@@ -324,12 +334,12 @@
                     that.watchState = true;//关闭连接按钮
                     // 卡路里计算
                     that.calcCalorie(that.heartRate);
-                    if (that.heartLine.length > 30) {
+
+                    that.heartLine.push(that.heartRate);
+                    that.dataLabels.push('');
+                    if (that.heartLine.length > 3) {
                         that.heartLine.shift();
                         that.dataLabels.shift();
-                    } else {
-                        that.heartLine.push(that.heartRate);
-                        that.dataLabels.push('');
                     }
                     that.DrawHeartLine(that.heartLine, that.dataLabels);
                 }, 1000);
@@ -349,7 +359,7 @@
                         that.duId = parseInt(json.DuInfo.DuId);
                         that.DpName = json.DuInfo.DpName;
                         console.log('that.duId:' + that.duId);
-                        if(that.InClass == 1){
+                        if (that.InClass == 1) {
                             that.AddHrSensorsUpdate(that.sn);
                         }
                     } else {
@@ -487,6 +497,8 @@
                             success: function (e) {
                                 console.log('---> 获取心跳服务' + JSON.stringify(e));
                                 console.log('---> notifyBLECharacteristicValueChange ' + chaaracterUuid + ' success.');
+                                // 服务获取成功,震动提示
+                                // that.vibrate();
                                 //that.onValuesChange();
                             },
                             fail: function (e) {
@@ -617,7 +629,7 @@
             ,
             // 活动强度计算公式
             calcActLevel(heartRate) {
-                let actLevel = (heartRate - this.peaceHeart) / (208-0.7*this.age - this.peaceHeart) *100;
+                let actLevel = (heartRate - this.peaceHeart) / (208 - 0.7 * this.age - this.peaceHeart) * 100;
                 actLevel = actLevel > 100 ? 100 : actLevel < 0 ? 0 : actLevel;
                 this.activeLevel = parseInt(actLevel);
             },

+ 5 - 0
pc/src/api/getApiRes.js

@@ -893,3 +893,8 @@ export function CalorieStatsQuery(postdata) {
     let url = headcpi + 'CalorieStatsQuery';
     return getApiBasic(url, postdata);
 }
+// 卡路里场馆统计(分月度、周统计,TV左上角统计)
+export function  ClassUserRank(postdata) {
+    let url = headcpi + 'ClassUserRank';
+    return getApiBasic(url, postdata);
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 519 - 442
pc/src/views/courseEdit.vue


+ 7 - 19
pc/src/views/online.vue

@@ -207,30 +207,19 @@
             getClassUserRank() {
                 let that = this;
                 let param = {
-                    eqSn: localStorage.eqSn
+                    eqSn:that.EqSn
                 };
                 let postdata = qs.stringify(param);
+
                 ClassUserRank(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        let totalTime = 40;
-                        let Studenlength = 0;
-                        let CkSort = json.Rs;
-                        let CalSort = deepClone(json.Rs);
-                        let Rs = json.Rs;
-                        if (Rs != '') {
-                            // 排序
-                            that.students.CkSort = json.Rs.sort(function (a, b) {
-                                return b.Ck - a.Ck;
-                            });
-
-                            that.students.CalSort = CalSort.sort(function (a, b) {
-                                return b.Cle - a.Cle;
-                            });
+                        if (json.Rs) {
+                            that.rankInfo = json.Rs;
+                        }else{
+                            that.rankInfo = [];
                         }
                     } else {
-                        this.students.CkSort = [];
-                        this.students.CalSort = [];
                         if (json.Code == '999') {
                             // that.$router.push({path: '/'});
                         } else {
@@ -358,7 +347,6 @@
                 let that = this;
                 that.loading = true;
                 if(!that.VenueId){
-                    console.log(123);
                     return false
                 }
                 let param = {
@@ -1029,7 +1017,7 @@
 
     .max .lhj span.plus {
         position: relative;
-        left: 2.75rem
+        left: 8.75rem
     }
 
     .max .bottomLi .btcla img {

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů