Parcourir la source

Merge branch 'master' of git.beswell.com:duanchangpeng/flyLong

# Conflicts:
#	hbuild/online/unpackage/res/icons/1024x1024.png
#	hbuild/online/unpackage/res/icons/120x120.png
#	hbuild/online/unpackage/res/icons/144x144.png
#	hbuild/online/unpackage/res/icons/152x152.png
#	hbuild/online/unpackage/res/icons/167x167.png
#	hbuild/online/unpackage/res/icons/180x180.png
#	hbuild/online/unpackage/res/icons/192x192.png
#	hbuild/online/unpackage/res/icons/20x20.png
#	hbuild/online/unpackage/res/icons/29x29.png
#	hbuild/online/unpackage/res/icons/40x40.png
#	hbuild/online/unpackage/res/icons/58x58.png
#	hbuild/online/unpackage/res/icons/60x60.png
#	hbuild/online/unpackage/res/icons/72x72.png
#	hbuild/online/unpackage/res/icons/76x76.png
#	hbuild/online/unpackage/res/icons/80x80.png
#	hbuild/online/unpackage/res/icons/87x87.png
#	hbuild/online/unpackage/res/icons/96x96.png
Changpeng Duan il y a 5 ans
Parent
commit
d420a7c1c6
3 fichiers modifiés avec 181 ajouts et 37 suppressions
  1. 25 24
      hbuild/online/manifest.json
  2. 3 1
      online/src/main.js
  3. 153 12
      online/src/page/mainpage.vue

+ 25 - 24
hbuild/online/manifest.json

@@ -10,7 +10,7 @@
     "icons" : {
         "72" : "icon.png"
     },
-    "launch_path" : "index.html", /*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/
+    "launch_path" : "http://192.168.0.162:8080/", /*应用的入口页面,默认为根目录下的index.html;支持网络地址,必须以http://或https://开头*/
     "developer" : {
         "name" : "", /*开发者名称*/
         "email" : "", /*开发者邮箱地址*/
@@ -103,14 +103,14 @@
                         "spotlight-retina7" : "", /*iPhone iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/
                         "settings-normal" : "", /*iPhone设置页面程序图标,分辨率:29x29*/
                         "settings-retina" : "",
-                        "app@2x" : "D:\\wwwroot\\flyong\\icon\\online/120x120.png",
-                        "app@3x" : "D:\\wwwroot\\flyong\\icon\\online/180x180.png",
-                        "notification@2x" : "D:\\wwwroot\\flyong\\icon\\online/40x40.png",
-                        "notification@3x" : "D:\\wwwroot\\flyong\\icon\\online/60x60.png",
-                        "settings@2x" : "D:\\wwwroot\\flyong\\icon\\online/58x58.png",
-                        "settings@3x" : "D:\\wwwroot\\flyong\\icon\\online/87x87.png",
-                        "spotlight@2x" : "D:\\wwwroot\\flyong\\icon\\online/80x80.png",
-                        "spotlight@3x" : "D:\\wwwroot\\flyong\\icon\\online/120x120.png"
+                        "app@2x" : "D:/wwwroot/flyLong/icon/online/120x120.png",
+                        "app@3x" : "D:/wwwroot/flyLong/icon/online/180x180.png",
+                        "notification@2x" : "D:/wwwroot/flyLong/icon/online/40x40.png",
+                        "notification@3x" : "D:/wwwroot/flyLong/icon/online/60x60.png",
+                        "settings@2x" : "D:/wwwroot/flyLong/icon/online/58x58.png",
+                        "settings@3x" : "D:/wwwroot/flyLong/icon/online/87x87.png",
+                        "spotlight@2x" : "D:/wwwroot/flyLong/icon/online/80x80.png",
+                        "spotlight@3x" : "D:/wwwroot/flyLong/icon/online/120x120.png"
                     },
                     "ipad" : {
                         "normal" : "", /*iPad普通屏幕程序图标,分辨率:72x72*/
@@ -123,25 +123,25 @@
                         "spotlight-retina7" : "", /*iPad iOS7高分屏Spotlight搜索程序图标,分辨率:80x80*/
                         "settings-normal" : "", /*iPad设置页面程序图标,分辨率:29x29*/
                         "settings-retina" : "",
-                        "app" : "D:\\wwwroot\\flyong\\icon\\online/76x76.png",
-                        "app@2x" : "D:\\wwwroot\\flyong\\icon\\online/152x152.png",
-                        "notification" : "D:\\wwwroot\\flyong\\icon\\online/20x20.png",
-                        "notification@2x" : "D:\\wwwroot\\flyong\\icon\\online/40x40.png",
-                        "proapp@2x" : "D:\\wwwroot\\flyong\\icon\\online/167x167.png",
-                        "settings" : "D:\\wwwroot\\flyong\\icon\\online/29x29.png",
-                        "settings@2x" : "D:\\wwwroot\\flyong\\icon\\online/58x58.png",
-                        "spotlight" : "D:\\wwwroot\\flyong\\icon\\online/40x40.png",
-                        "spotlight@2x" : "D:\\wwwroot\\flyong\\icon\\online/80x80.png"
+                        "app" : "D:/wwwroot/flyLong/icon/online/76x76.png",
+                        "app@2x" : "D:/wwwroot/flyLong/icon/online/152x152.png",
+                        "notification" : "D:/wwwroot/flyLong/icon/online/20x20.png",
+                        "notification@2x" : "D:/wwwroot/flyLong/icon/online/40x40.png",
+                        "proapp@2x" : "D:/wwwroot/flyLong/icon/online/167x167.png",
+                        "settings" : "D:/wwwroot/flyLong/icon/online/29x29.png",
+                        "settings@2x" : "D:/wwwroot/flyLong/icon/online/58x58.png",
+                        "spotlight" : "D:/wwwroot/flyLong/icon/online/40x40.png",
+                        "spotlight@2x" : "D:/wwwroot/flyLong/icon/online/80x80.png"
                     },
-                    "appstore" : "D:\\wwwroot\\flyong\\icon\\online/1024x1024.png"
+                    "appstore" : "D:/wwwroot/flyLong/icon/online/1024x1024.png"
                 },
                 "android" : {
                     "mdpi" : "", /*普通屏程序图标,分辨率:48x48*/
                     "ldpi" : "", /*大屏程序图标,分辨率:48x48*/
-                    "hdpi" : "D:\\wwwroot\\flyong\\icon\\online/72x72.png", /*高分屏程序图标,分辨率:72x72*/
-                    "xhdpi" : "D:\\wwwroot\\flyong\\icon\\online/96x96.png", /*720P高分屏程序图标,分辨率:96x96*/
-                    "xxhdpi" : "D:\\wwwroot\\flyong\\icon\\online/144x144.png",
-                    "xxxhdpi" : "D:\\wwwroot\\flyong\\icon\\online/192x192.png"
+                    "hdpi" : "D:/wwwroot/flyLong/icon/online/72x72.png", /*高分屏程序图标,分辨率:72x72*/
+                    "xhdpi" : "D:/wwwroot/flyLong/icon/online/96x96.png", /*720P高分屏程序图标,分辨率:96x96*/
+                    "xxhdpi" : "D:/wwwroot/flyLong/icon/online/144x144.png",
+                    "xxxhdpi" : "D:/wwwroot/flyLong/icon/online/192x192.png"
                 }
             },
             "splashscreen" : {
@@ -186,5 +186,6 @@
             }
         }
     },
-    "screenOrientation" : [ "landscape-primary" ]
+    "screenOrientation" : [ "portrait-primary" ],
+    "fullscreen" : true
 }

+ 3 - 1
online/src/main.js

@@ -19,7 +19,9 @@ import '../node_modules/vue-simple-verify/dist/vue-simple-verify.css'
 Vue.component('vue-simple-verify', VueSimpleVerify);
 
 // import VConsole from 'vconsole/dist/vconsole.min.js' //import vconsole
-// let vConsole = new VConsole() // 初始化
+
+import VConsole from 'vconsole';
+let vConsole = new VConsole();// 初始化
 
 Vue.use(MuseUI);
 Vue.locale = () => {

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

@@ -62,21 +62,21 @@
             <ul>
                 <li>
                     <div class="center">
-                        <em>2578</em>
+                        <em>{{cal}}</em>
                         <img src="../static/images/main/normal.png"/>
                         <span>卡路里</span>
                     </div>
                 </li>
                 <li>
                     <div class="center">
-                        <em>2578</em>
+                        <em>{{sportCal}}</em>
                         <img src="../static/images/main/redfire.png"/>
                         <span>运动卡路里</span>
                     </div>
                 </li>
                 <li>
                     <div class="center">
-                        <em>17.8</em>
+                        <em>{{ck}}</em>
                         <img src="../static/images/main/ck.png" class="ck"/>
                         <span>CK</span>
                     </div>
@@ -92,12 +92,28 @@
                     :dataLabels="dataLabels"
                     :datadatasets="dataDatasets"
             />
-            <em :class="[
+            <em v-if="activeState" :class="[
                             {'normalJump':activeLevel > 30 &&  activeLevel <= 90},
                             {'fastJump':activeLevel > 90},
                             {'slowJump':activeLevel < 30},
                             ]">{{heartRate}}</em>
         </div>
+        <mu-dialog title="" width="600" max-width="80%" :esc-press-close="false"
+                   :overlay-close="false" :open.sync="openAlert">
+            <p v-if="!watchs">
+                没有任何设备
+            </p>
+            <div class="watchList" v-else>
+                <p>请选择设备</p>
+                <ul>
+                    <li v-for="w in watchs" @click="choiceWatch">{{w.name}} <em>信号:{{w.level}}</em></li>
+                </ul>
+            </div>
+            <br>
+            <mu-button slot="actions" flat color="primary" @click="closeAlertDialog" v-if="watchListState">取消
+            </mu-button>
+            <mu-button slot="actions" flat color="primary" @click="searchWatch" v-else>搜索</mu-button>
+        </mu-dialog>
     </div>
 </template>
 
@@ -112,10 +128,13 @@
                 watchText: '',
                 watchState: false,//false
                 bgColor: '#028FE1',
-                activeLevel: 90,
+                activeLevel: 0,
                 activeLevelText: '激活放松',
-                heartRate: 100,
-                activeState: true,//false
+                heartRate: 0,
+                activeState: false,//false
+                openAlert: false,//false
+                alertState: false,//false
+                watchListState: false,//false
                 username: '王胜寒',
                 sex: 1,
                 height: 148,
@@ -124,16 +143,87 @@
                 peaceHeart: 100,
                 heartMax: 0,
                 heartAverage: 0,
-                screenWidth:document.body.clientWidth,
-                screenHeight:parseInt(document.documentElement.clientHeight/5),
+                cal: 0,
+                sportCal: 0,
+                ck: 0,
+                screenWidth: document.body.clientWidth,
+                screenHeight: parseInt(document.documentElement.clientHeight / 5),
+                watchs: [],
             }
         },
-        mounted(){
+        mounted() {
+            this.getBodyInfo();
+            this.activeLevel = 0;
+            this.watchs = [
+                // {name: 'CL831-0022750', id: 1, rssi: -90, level: '强'},
+                // {name: 'CL831-0022767', id: 2, rssi: -30, level: '弱'},
+            ]
+        },
+        watch: {
+            activeLevel(val) {
+                let that = this;
+                switch (true) {
+                    case parseInt(val) < 39 :
+                        that.bgColor = '#028FE1';
+                        that.activeLevelText = '激活放松';
+                        break;
+                    case parseInt(val) < 54 && parseInt(val) >= 39 :
+                        that.bgColor = '#6D29FA';
+                        that.activeLevelText = '动态热身';
+                        break;
+                    case parseInt(val) < 69 && parseInt(val) >= 54 :
+                        that.bgColor = '#0AB105';
+                        that.activeLevelText = '脂肪燃烧';
+                        break;
+                    case parseInt(val) < 79 && parseInt(val) >= 69 :
+                        that.bgColor = '#B9CB01';
+                        that.activeLevelText = '糖分消耗';
+                        break;
+                    case parseInt(val) < 89 && parseInt(val) >= 79 :
+                        that.bgColor = '#EA8813';
+                        that.activeLevelText = '心肺训练';
+                        break;
+                    case parseInt(val) >= 90 :
+                        that.bgColor = '#D11122';
+                        that.activeLevelText = '峰值锻炼';
+                        break;
+
+                }
+            }
         },
         methods: {
             connectWatch() {
-                console.log(123);
+                // 打开蓝牙适配器
+                this.Toast('蓝牙适配器打开成功!');
+                let that = this;
+                plus.bluetooth.openBluetoothAdapter({
+                    success: function (e) {
+                        that.Toast('蓝牙适配器打开成功!');
+                        that.openAlert = true;
+                        return e
+                    },
+                    fail: function (e) {
+                        that.Toast('打开失败! 请确认蓝牙开关已开启');
+                    }
+                });
+            },
+            closeAlertDialog() {
+                this.openAlert = false;
+            },
+            searchWatch() {
+                // test
+                this.watchs = [
+                    {name: 'CL831-0022750', id: 1, rssi: -90, level: '强'},
+                    {name: 'CL831-0022767', id: 2, rssi: -30, level: '弱'},
+                ];
+                this.watchListState = true;
             },
+            choiceWatch() {
+            },
+            // 获取基础身体数据
+            getBodyInfo() {
+
+            }
         },
         components: {
             LineExample
@@ -197,7 +287,7 @@
     }
 
     .activeLevel div {
-        width: 80px;
+        width: 86px;
         overflow: hidden;
         display: block;
         margin: 0 auto;
@@ -294,6 +384,7 @@
         margin-top: 10px;
         color: #fff;
     }
+
     .heartJump div {
         width: 86px;
         overflow: hidden;
@@ -602,4 +693,54 @@
         }
     }
 
+    /deep/ .mu-dialog {
+        background-color: rgba(0, 0, 0, 0.75);
+        color: #fff;
+        border-radius: 20px;
+        background-size: 100%;
+        background-origin: content-box;
+        filter: blur(0.5px);
+    }
+
+    /deep/ .mu-dialog p {
+        color: #fff;
+        text-align: center;
+    }
+
+    /deep/ .mu-dialog .mu-primary-text-color {
+        margin: 0 auto;
+        border-radius: 9px;
+        background-color: rgba(255, 255, 255, 0.1);
+        color: #fff;
+    }
+
+    .watchList {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        min-height: 100px;
+        overflow-y: scroll;
+    }
+
+    .watchList li {
+        width: 100%;
+        padding-left: 5%;
+        padding-right: 5%;
+        padding-top: 5px;
+        padding-bottom: 5px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        background-color: rgba(255, 255, 255, 0.29);
+        color: #fff;
+        border-radius: 9px;
+        font-size: 12px;
+        margin-bottom: 5px;
+    }
+
+    .watchList li em {
+        float: right;
+        text-align: right;
+    }
 </style>