diff --git a/app/src/main/assets/web/app.html b/app/src/main/assets/web/app.html index 3169ed3..7f0f9e3 100644 --- a/app/src/main/assets/web/app.html +++ b/app/src/main/assets/web/app.html @@ -11,6 +11,7 @@ + diff --git a/app/src/main/assets/web/app/css/style.css b/app/src/main/assets/web/app/css/style.css index 0610fb4..4e502cc 100755 --- a/app/src/main/assets/web/app/css/style.css +++ b/app/src/main/assets/web/app/css/style.css @@ -1,427 +1,4 @@ @CHARSET "UTF-8"; -html,body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - font:12px 'Microsoft YaHei', 微软雅黑, Arial, Lucida Grande, Tahoma, sans-serif; - /*background-color: #f9f9f9;*/ - -webkit-text-size-adjust: 100%; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - overflow-x: hidden; -} - -html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 { - 一webkit一text一size一adjust: 100%; - 一ms一text一size一adjust: 100%; - text一size一adjust: 100%; -} -/*去除IE文本框自带的叉号*/ -::-ms-clear{ - display: none; -} -button:focus, button:active:focus, -a:focus, a:active:focus, -input:focus, input:active:focus, -span:focus, span:active:focus, -textarea:focus, textarea:active:focus, -.bootstrap-select .dropdown-toggle:focus{ - outline: none !important; -} -*:not(input, textarea) { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -input, textarea{ - -webkit-appearance: none !important; - -webkit-user-select:auto !important; - -khtml-user-select:auto !important; - -ms-user-select: text !important; - user-select: text !important; -} -input:disabled, -textarea:disabled { - opacity: 1; -} -a{ - outline:none; - -moz-outline-style:none; -} -@font-face { - font-family: 'icomoon'; - src: url('../../css/fonts/icomoon.eot?djo6qt'); - src: url('../../css/fonts/icomoon.eot?djo6qt#iefix') format('embedded-opentype'), - url('../../css/fonts/icomoon.ttf?djo6qt') format('truetype'), - url('../../css/fonts/icomoon.woff?djo6qt') format('woff'), - url('../../css/fonts/icomoon.svg?djo6qt#icomoon') format('svg'); - font-weight: normal; - font-style: normal; -} - -[class^="icon-"], [class*=" icon-"] { - /* use !important to prevent issues with browser extensions that change fonts */ - font-family: 'icomoon' !important; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.icon-upgrade:before { - content: "\e953"; -} -.icon-co_upgrade:before { - content: "\e954"; -} -.icon-guanlian:before { - content: "\e905"; -} -.icon-iBeacon:before { - content: "\e949"; -} -.icon-up:before { - content: "\e948"; -} -.icon-door:before { - content: "\e947"; -} -.icon-bg:before { - content: "\e945"; -} -.icon-cg:before { - content: "\e946"; -} -.icon-problem:before { - content: "\e944"; -} -.icon-mobile:before { - content: "\e943"; -} -.icon-bluetooth:before { - content: "\e900"; -} -.icon-link:before { - content: "\e901"; -} -.icon-reset:before { - content: "\e902"; -} -.icon-send:before { - content: "\e903"; -} -.icon-scanner:before { - content: "\e904"; -} -.icon-radar:before { - content: "\e94a"; -} -.icon-gear:before { - content: "\e906"; -} -.icon-sensor:before { - content: "\e907"; -} -.icon-ionic:before { - content: "\e908"; -} -.icon-groups:before { - content: "\e909"; -} -.icon-light:before { - content: "\e90a"; -} -.icon-network:before { - content: "\e90b"; -} -.icon-plus:before { - content: "\e90c"; -} -.icon-power:before { - content: "\e90d"; -} -.icon-radar-chart:before { - content: "\e90e"; -} -.icon-recent:before { - content: "\e90f"; -} -.icon-search:before { - content: "\e910"; -} -.icon-speakerphone:before { - content: "\e911"; -} -.icon-left:before { - content: "\e912"; -} -.icon-arrow-left:before { - content: "\e913"; -} -.icon-checkmark-round:before { - content: "\e914"; -} -.icon-right:before { - content: "\e915"; -} -.icon-password:before { - content: "\e916"; -} -.icon-reload:before { - content: "\e917"; -} -.icon-loop:before { - content: "\e918"; -} -.icon-android-alert:before { - content: "\e919"; -} -.icon-person:before { - content: "\e91a"; -} -.icon-more:before { - content: "\e91b"; -} -.icon-station:before { - content: "\e91c"; -} -.icon-ios-timer-outline:before { - content: "\e91d"; -} -.icon-ios-alarm-outline:before { - content: "\e91e"; -} -.icon-time:before { - content: "\e91f"; -} -.icon-disc:before { - content: "\e920"; -} -.icon-contrast:before { - content: "\e921"; -} -.icon-easel:before { - content: "\e922"; -} -.icon-eye-off:before { - content: "\e923"; -} -.icon-eye:before { - content: "\e924"; -} -.icon-round:before { - content: "\e925"; -} -.icon-alarm:before { - content: "\e926"; -} -.icon-ball:before { - content: "\e927"; -} -.icon-film:before { - content: "\e928"; -} -.icon-love:before { - content: "\e929"; -} -.icon-moon:before { - content: "\e92a"; -} -.icon-read:before { - content: "\e92b"; -} -.icon-rice:before { - content: "\e92c"; -} -.icon-thinking:before { - content: "\e92d"; -} -.icon-work:before { - content: "\e92e"; -} -.icon-speaker:before { - content: "\e92f"; -} -.icon-wifi:before { - content: "\e930"; -} -.icon-mark:before { - content: "\e931"; -} -.icon-map:before { - content: "\e932"; -} -.icon-rss:before { - content: "\e933"; -} -.icon-uncheck:before { - content: "\e934"; -} -.icon-check:before { - content: "\e935"; -} -.icon-el-icon-arrow-up:before { - content: "\e936"; -} -.icon-el-icon-arrow-down:before { - content: "\e937"; -} -.icon-import:before { - content: "\e938"; -} -.icon-down-dir:before { - content: "\e939"; -} -.icon-right-dir:before { - content: "\e93a"; -} -.icon-ok-circled:before { - content: "\e93b"; -} -.icon-table:before { - content: "\e93c"; -} -.icon-edit:before { - content: "\e93d"; -} -.icon-cancel:before { - content: "\e93e"; -} -.icon-cancel-circled:before { - content: "\e93f"; -} -.icon-less:before { - content: "\e940"; -} -.icon-clear:before { - content: "\e941"; -} -.icon-warning:before { - content: "\e942"; -} -.icon-sensor2:before { - content: "\e94e"; -} -.icon-valves:before { - content: "\e94f"; -} -.icon-statistics:before { - content: "\e950"; -} -.icon-bin:before { - content: "\e9ac"; -} -.icon-cross:before { - content: "\ea0f"; - font-weight: 800; -} - - -input::-webkit-input-placeholder { /* WebKit browsers*/ - color: #ababab !important; -} -input:-moz-placeholder { /* Mozilla Firefox 4 to 18*/ - color: #ababab !important; -} -input::-moz-placeholder { /* Mozilla Firefox 19+*/ - color: #ababab !important; -} -input:-ms-input-placeholder { /* Internet Explorer 10+*/ - color: #ababab !important; -} -.flex-1 { - -webkit-box: 1; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flex { - display: box; /* OLD - Android 4.4- */ - display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ - display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ - display: -ms-flexbox; /* TWEENER - IE 10 */ - display: -webkit-flex; /* NEW - Chrome */ - display: flex; -} -.flex-ac { - -webkit-box-align: center; - -webkit-align-items: center; - -moz-align-items: center; - -ms-align-items: center; - -o-align-items: center; - align-items: center; -} -.flex-ae { - -webkit-box-align: end; - -webkit-align-items: flex-end; - -moz-align-items: flex-end; - -ms-align-items: flex-end; - -o-align-items: flex-end; - align-items: flex-end; -} -.flex-as { - -webkit-box-align: stretch; - -webkit-align-items: stretch; - -moz-align-items: stretch; - -ms-align-items: stretch; - -o-align-items: stretch; - align-items: stretch; -} -.flex-jcb { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - -moz-justify-content: space-between; - -ms-justify-content: space-between; - -o-justify-content: space-between; - justify-content: space-between; -} -.flex-jcs { - -webkit-box-pack: start; - -webkit-justify-content: flex-start; - -moz-justify-content: flex-start; - -ms-justify-content: flex-start; - -o-justify-content: flex-start; - justify-content: flex-start; -} -.flex-jce { - -webkit-box-pack: end; - -webkit-justify-content: flex-end; - -moz-justify-content: flex-end; - -ms-justify-content: flex-end; - -o-justify-content: flex-end; - justify-content: flex-end; -} -.flex-jcc { - -webkit-box-pack: center; - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -o-justify-content: center; - justify-content: center; -} -.flex-v { - -webkit-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} -.flex-m { - -moz-box-lines: multiple; /*Firefox*/ - -webkit-box-lines: multiple; /*Safari,Opera,Chrome*/ - box-lines: multiple; - -webkit-flex-wrap: wrap; - -moz-flex-wrap: wrap; - flex-wrap: wrap; -} ul { padding: 0; margin: 0; @@ -482,93 +59,6 @@ ul { } .content-info .item-power:active { -} -.moves-enter-active, .moves-leave-active { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.moves-enter, .moves-leave-to /* .fade-leave-active in below version 2.1.8 */ { - -webkit-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); -} -.ups-enter-active, .ups-leave-active { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.ups-enter, .ups-leave-to /* .fade-leave-active in below version 2.1.8 */ { - -webkit-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); -} -.downs-enter-active, .downs-leave-active { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.downs-enter, .downs-leave-to /* .fade-leave-active in below version 2.1.8 */ { - -webkit-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); -} -.app-title { - height: 50px; - line-height: 50px; - color: #fff; - text-align: center; - margin: 0; - font-size: 16px; - background: #3ec2fc; -} -.app-title .back { - position: absolute; - top: 0; - left: 0; - height: 50px; - width: 50px; - display: flex; - justify-content: center; - align-items: center; - font-size: 22px; -} -.app-title .left-two { - position: absolute; - top: 0; - right: 40px; - height: 50px; - width: 45px; - display: flex; - justify-content: center; - align-items: center; - font-size: 22px; -} -.app-title .left-two .icon-cross { - font-size: 21px; -} -.input-info { - position: relative; - margin: 9px 10px; -} -.input-info input { - background: #fff; - border: none; - color: #ababab; - padding-left: 30px; - border-radius: 5px; - -webkit-transition: all .3s linear; - transition: all .3s linear; -} - -.input-info i { - position: absolute; - top: 7px; - left: 5px; - font-size: 23px; - color: #ababab; - -webkit-transition: all .3s linear; - transition: all .3s linear; } .hidden { display: none !important; @@ -626,199 +116,6 @@ ul { min-height: 100%; } -/*加载动画*/ -.chromeframe { - margin: 0.2em 0; - background: #ccc; - color: #000; - padding: 0.2em 0; -} -#loader-wrapper, -#loader-wrapper-small { - position: absolute; - left: 0; - width: 100%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - z-index: 199; -} -#loader-wrapper { - top: 50px; - bottom: 55px; -} -#loader-wrapper-small { - top: 0; - height: 50px; -} -.loader { - display: block; - width: 90px; - height: 90px; - border-radius: 50%; - border: 3px solid transparent; - /* COLOR 1 */ - border-top-color: #3ec2fc; - -webkit-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -moz-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 2s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ - z-index:1001; -} -.loader-small { - top: 1px; - width: 30px; - height: 30px; -} -.loader:before { - content: ""; - position: absolute; - top: 5px; - left: 5px; - right: 5px; - bottom: 5px; - border-radius: 50%; - border: 3px solid transparent; - /* COLOR 2 */ - border-top-color: #3ec2fc; - -webkit-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -moz-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 3s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -.loader:after { - content: ""; - position: absolute; - top: 15px; - left: 15px; - right: 15px; - bottom: 15px; - border-radius: 50%; - border: 3px solid transparent; - border-top-color: #3ec2fc; - /* COLOR 3 */ - -moz-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -webkit-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 1.5s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -.loader-small:before { - content: ""; - position: absolute; - top: 1px; - left: 1px; - right: 1px; - bottom: 1px; - border-radius: 50%; - border: 3px solid transparent; - /* COLOR 2 */ - border-top-color: #3ec2fc; - -webkit-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -moz-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 3s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -.loader-small:after { - content: ""; - position: absolute; - top: 5px; - left: 5px; - right: 5px; - bottom: 5px; - border-radius: 50%; - border: 3px solid transparent; - border-top-color: #3ec2fc; - /* COLOR 3 */ - -moz-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -webkit-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 1.5s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} - -@-webkit-keyframes spin { - 0%{ - -webkit-transform: rotate(0deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(0deg); /* IE 9 */ - transform: rotate(0deg); /* Firefox 16+, IE 10+, Opera */ - }100%{ - -webkit-transform: rotate(360deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(360deg); /* IE 9 */ - transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */} -} - -@keyframes spin { - 0%{ - -webkit-transform: rotate(0deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(0deg); /* IE 9 */ - transform: rotate(0deg); /* Firefox 16+, IE 10+, Opera */ - }100%{ - -webkit-transform: rotate(360deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(360deg); /* IE 9 */ - transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */} -} - - -#loader-wrapper .loader-section { - position: absolute; - top: 0; - width: 51%; - height: 100%; - background: transparent; /* Old browsers */ - z-index: 1000; - -webkit-transform: translateX(0); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateX(0); /* IE 9 */ - transform: translateX(0); /* Firefox 16+, IE 10+, Opera */} -#loader-wrapper .loader-section.section-left {left: 0;} -#loader-wrapper .loader-section.section-right {right: 0;} - -/* Loaded */ -.loaded #loader-wrapper .loader-section.section-left { - height:100%; - -webkit-transform: translateX(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateX(-100%); /* IE 9 */ - transform: translateX(-100%); /* Firefox 16+, IE 10+, Opera */ - -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); - transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);} -.loaded #loader-wrapper .loader-section.section-right { - height:100%; - -webkit-transform: translateX(100%); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateX(100%); /* IE 9 */ - transform: translateX(100%); /* Firefox 16+, IE 10+, Opera */ - -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); - transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);} -.loaded .loader { - opacity: 0; - -webkit-transition: all 0.3s ease-out; - transition: all 0.3s ease-out;} -.loaded #loader-wrapper { - visibility: hidden; - -webkit-transform: translateY(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateY(-100%); /* IE 9 */ - transform: translateY(-100%); /* Firefox 16+, IE 10+, Opera */ - -webkit-transition: all 0.3s 1s ease-out; - transition: all 0.3s 1s ease-out;} -/* JavaScript Turned Off */ -.no-js #loader-wrapper {display: none;} -.no-js h1 {color: #222222;} -#loader-wrapper .load_title { - font-family:'Open Sans'; - color:#625b7a; - font-size:16px; - width:100%; - text-align:center; - z-index:9999999999999; - margin-top: 10px; - line-height:30px; -} - - - /* 登录 */ .wrapper { height: 100vh; @@ -999,55 +296,7 @@ ul { /*background-repeat: repeat-x;*/ /*min-height: 100%;*/ } -.title-info { - height: 50px; - font-size: 16px; - background: #fff; - border-bottom: 1px solid #e6e6e6; -} -.title-info .app-title { - color: #fff; -} -.right-top { - position: absolute; - top: 0; - height: 50px; - width: 30px; - display: flex; - justify-content: center; - align-items: center; - right: 10px; - font-size: 22px; - color: #fff; -} -.right-top.right-40 { - right: 40px; - width: 35px; -} -.right-top.right-75 { - right: 75px; - width: 35px; -} -.right-top .right-icon { - position: relative; - flex: 1; - display: flex; - justify-content: center; - align-items: center; - height: 100%; -} -.icon-position { - position: relative; -} -.right-top .right-icon .icon-cancel-circled { - position: absolute; - bottom: -1px; - right: -2px; - font-size: 12px; - color: #fff; - background: #d1001e; - border-radius: 100%; -} + .content-info { background: #f6f6f6; height: calc(100% - 105px); @@ -1759,7 +1008,7 @@ operate-bg .group-wrapper .operate-way-info { border-radius: 100%; } .scan-device { - height: calc(100vh - 225px); + height: calc(100vh - 215px); padding-bottom: 0; -webkit-transition: all .3s linear; transition: all .3s linear; @@ -1910,7 +1159,7 @@ operate-bg .group-wrapper .operate-way-info { color: #3ec2fc; } .scan-device.height { - height: calc(100% - 315px); + height: calc(100% - 305px); } .join-device { height: calc(100% - 185px); @@ -2569,20 +1818,20 @@ operate-bg .group-wrapper .operate-way-info { color: #44ee9a; } .add-ul.scan-more li { - padding-left: 12px; + padding-left: 12px; } .add-ul.scan-more li i { - display: inline-block; - width: 26px; - text-align: center; + display: inline-block; + width: 26px; + text-align: center; } .scan-more .icon-rss { - font-size: 17px; + font-size: 17px; } .scan-more .icon-up { - display: inline-block; - -webkit-transition: all .3s linear; - transition: all .3s linear; + display: inline-block; + -webkit-transition: all .3s linear; + transition: all .3s linear; } .scan-more .sort-down { -webkit-transform: rotate(180deg); @@ -4049,8 +3298,8 @@ operate-bg .group-wrapper .operate-way-info { font-size: 16px; font-weight: bold; overflow: hidden; - text-overflow:ellipsis; - white-space: nowrap; + text-overflow:ellipsis; + white-space: nowrap; } .debug-navbar .mint-navbar .mint-tab-item { min-width: 35%; @@ -4114,8 +3363,8 @@ operate-bg .group-wrapper .operate-way-info { } .room-info-content .room-title span.icon-more { - font-size: 22px; - font-weight: bold; + font-size: 22px; + font-weight: bold; } .room-info-content .room-desc { margin-bottom: 8px; @@ -4220,8 +3469,8 @@ operate-bg .group-wrapper .operate-way-info { justify-content: space-between; } .ibeacon-content .mint-checkbox-input:checked + .mint-checkbox-core { - background-color: #3ec2fc; - border-color: #3ec2fc; + background-color: #3ec2fc; + border-color: #3ec2fc; } .blue-connect { padding: 20px 15px; @@ -4262,41 +3511,6 @@ operate-bg .group-wrapper .operate-way-info { font-size: 20px; color: #fff; } -.logout-btn { - padding: 0 15px; - box-sizing: border-box; - bottom: 30px; -} -.logout-btn .btn { - background: transparent; - color: #ff4929; - border: 1px solid #ff4929; -} -.content-tab { - background: #fff; - margin-bottom: 5px; -} -.content-tab span { - padding: 15px 10px; - background-color: transparent; - background-image: linear-gradient(#3ec2fc, #3ec2fc), linear-gradient(#f1f1f1, #f1f1f1); - background-position: center bottom, center calc(100% - 1px); - background-repeat: no-repeat; - background-size: 0 3px, 100% 1px; - font-size: 14px; - font-weight: bold; - -moz-transition: all 0s ease-out 0s; /* Firefox 4 */ - -webkit-transition: all 0s ease-out 0s; /* Safari 和 Chrome */ - -o-transition: all 0s ease-out 0s; /* Opera */ - transition: all 0s ease-out 0s; -} -.content-tab span.active { - color: #3ec2fc; - background-image: linear-gradient(#3ec2fc, #3ec2fc), linear-gradient(#f1f1f1, #f1f1f1); - background-size: 100% 3px, 100% 1px; - outline: medium none; - transition-duration: 0.3s; -} @media (max-height: 615px){ .content-wrapper { height: 100%; diff --git a/app/src/main/assets/web/app/js/automation-btn-select.js b/app/src/main/assets/web/app/js/automation-btn-select.js index 965946e..3c569a2 100644 --- a/app/src/main/assets/web/app/js/automation-btn-select.js +++ b/app/src/main/assets/web/app/js/automation-btn-select.js @@ -123,6 +123,13 @@ define(["vue","MINT", "Util", "txt!../../pages/automation-btn-select.html", "../ hideThis: function() { window.onBackPressed = this.hide; }, + isGray: function() { + var flag = true; + if (!Util._isEmpty(this.newEventType) && this.newEventType > 0) { + flag = false; + } + return flag; + }, onGetEvent: function(res) { var self = this; console.log(res); diff --git a/app/src/main/assets/web/app/js/blueConnect.js b/app/src/main/assets/web/app/js/blueConnect.js index fd4a542..41a15b9 100644 --- a/app/src/main/assets/web/app/js/blueConnect.js +++ b/app/src/main/assets/web/app/js/blueConnect.js @@ -30,21 +30,29 @@ define(["vue", "MINT", "Util", "txt!../../pages/blueConnect.html"], self.flag = true; }, selectColor: function(item) { - if (this.currentRgb == item) { - this.currentRgb = ""; + var self = this; + if (self.currentRgb == item) { + self.currentRgb = ""; } else { - this.currentRgb = item; + self.currentRgb = item; var meshs = []; meshs.push({cid: HUE_CID, value: this.getHue(item)}); meshs.push({cid: SATURATION_CID, value: 100}); - this.customData = '{"type":"json","value":{"header":{"group":["010000000000"]},"body":{"request":"set_status",' + self.customData = '{"type":"json","value":{"header":{"group":["010000000000"]},"body":{"request":"set_status",' +'"characteristics":'+JSON.stringify(meshs)+'}}}'; + setTimeout(function() { + self.postData(); + }) } }, selectSwitch: function(status) { - this.currentRgb = ""; - this.customData = '{"type":"json","value":{"header":{"group":["010000000000"]},"body":{"request":"set_status",' + var self = this; + self.currentRgb = ""; + self.customData = '{"type":"json","value":{"header":{"group":["010000000000"]},"body":{"request":"set_status",' +'"characteristics":[{"cid":0,"value":'+parseInt(status)+'}]}}}'; + setTimeout(function() { + self.postData(); + }) }, postData: function() { var self = this; diff --git a/app/src/main/assets/web/app/js/blueList.js b/app/src/main/assets/web/app/js/blueList.js index fe1757b..f9d8a27 100644 --- a/app/src/main/assets/web/app/js/blueList.js +++ b/app/src/main/assets/web/app/js/blueList.js @@ -71,7 +71,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/blueList.html", "../js/blueConne }, onConScanBLE: function(devices) { var self = this; - console.log(devices); devices = JSON.parse(devices); $.each(devices, function(i, item) { var name = item.name; @@ -91,7 +90,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/blueList.html", "../js/blueConne if (flag && !Util._isEmpty(obj)) { self.blueList.push(obj); } - console.log(JSON.stringify(self.blueList)); } }) window.onBackPressed = self.hide; diff --git a/app/src/main/assets/web/app/js/conDevice.js b/app/src/main/assets/web/app/js/conDevice.js index 9b7fa1b..f5da2b1 100644 --- a/app/src/main/assets/web/app/js/conDevice.js +++ b/app/src/main/assets/web/app/js/conDevice.js @@ -57,13 +57,14 @@ define(["vue", "MINT", "Util", "txt!../../pages/conDevice.html"], function(v, MI scanDeviceList = self.$store.state.scanDeviceList, scanMacs = [], rssi = -1000, rssiMac = "", version = -1; espmesh.startBleScan(); - self.setStartTimer(); + self.setTimer(); self.success = true; self.title = self.$t('connetDeviceTitle'); self.desc = self.$t('connetDeviceDesc'); setTimeout(function () { espmesh.stopBleScan(); if (self.rssiList.length != 0) { + console.log(JSON.stringify(scanDeviceList)) $.each(scanDeviceList, function(i, item) { scanMacs.push(item.bssid); }); @@ -80,10 +81,11 @@ define(["vue", "MINT", "Util", "txt!../../pages/conDevice.html"], function(v, MI self.setFail(self.$t('farDeviceDesc')); return false; } - var data = {"ble_addr": rssiMac, "ssid": self.wifiName,"password": self.password, + var data = {"ble_addr": rssiMac,"ssid": self.wifiName,"password": self.password, "white_list": scanMacs, "bssid": self.wifiInfo.bssid, "mesh_id": self.convert(self.meshId), "version": version}; data = Object.assign(data, self.moreObj) + console.log(JSON.stringify(scanMacs)); espmesh.saveMeshId(self.meshId); espmesh.startConfigureBlufi(JSON.stringify(data)); } else { @@ -92,18 +94,17 @@ define(["vue", "MINT", "Util", "txt!../../pages/conDevice.html"], function(v, MI }, 5000); }, - setStartTimer: function() { + setTimer: function() { var self = this; self.timerId = setInterval(function() { + console.log("aaaaa"); if (!self.addFlag) { clearInterval(self.timerId); - self.timerId = ''; } if (self.value < 5) { self.value += 1; } else { clearInterval(self.timerId); - self.timerId = ''; } }, 1000) }, @@ -146,15 +147,10 @@ define(["vue", "MINT", "Util", "txt!../../pages/conDevice.html"], function(v, MI espmesh.clearBleCache(); self.$store.commit("setScanDeviceList", []); self.count = 0; - MINT.Toast({ - message: self.$t('connetSuccessDesc'), - position: 'bottom', - }); setTimeout(function() { self.hide(); self.$parent.hideParent(); - console.log("成功"); - }, 3000); + }, 1000); } else { if (config.code == -20) { self.setFail(config.message); @@ -195,4 +191,4 @@ define(["vue", "MINT", "Util", "txt!../../pages/conDevice.html"], function(v, MI }); return ConDevice; -}); +}); \ No newline at end of file diff --git a/app/src/main/assets/web/app/js/index.js b/app/src/main/assets/web/app/js/index.js index d08fed1..88f5279 100644 --- a/app/src/main/assets/web/app/js/index.js +++ b/app/src/main/assets/web/app/js/index.js @@ -19,10 +19,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ temperatureId: "device-temperature", otaDeviceId: "ota-device-id", deviceList: [], - aliDevices: [], - aliDeviceList: [], deviceInfo: "", - deviceCloudInfo: "", name: "", loadDesc: "", infoShow: false, @@ -79,11 +76,11 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ }, computed: { list: function () { - var self = this, deviceList = []; + var self = this; self.deviceList = self.$store.state.deviceList; - deviceList = self.deviceList; - if (deviceList.length > 0) { + if (self.deviceList.length > 0) { self.$refs.remind.hide(); + if (self.hideTrue) { self.hideLoad(); } @@ -94,12 +91,11 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ } }); - if (Util._isEmpty(self.searchName)) { - self.indexList = self.sortList(deviceList); + self.indexList = self.sortList(self.deviceList); } else { var searchList = []; - $.each(deviceList, function(i, item) { + $.each(self.deviceList, function(i, item) { if (item.name.indexOf(self.searchName) != -1 || item.position.indexOf(self.searchName) != -1) { searchList.push(item); } @@ -132,23 +128,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ self.loadList = []; self.$store.commit("setTsfTime", ""); } - }, - cloudList: function() { - var self = this, deviceList = [], indexList = []; - self.aliDeviceList = self.$store.state.aliDeviceList; - deviceList = self.aliDeviceList; - var searchList = []; - if (Util._isEmpty(self.searchName)) { - indexList = self.sortList(deviceList); - } else { - $.each(deviceList, function (i, item) { - if (item.name.indexOf(self.searchName) != -1) { - searchList.push(item); - } - }) - indexList = self.sortList(searchList); - } - return indexList; } }, methods:{ @@ -449,9 +428,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ self.$store.commit("setList", []); self.loadList = []; espmesh.scanDevicesAsync(); - if (this.isLogin) { - espmesh.getAliyunDeviceList(); - } }, 50); }, showUl: function () { @@ -489,9 +465,8 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ tid = item.tid; self.flag = false; this.$store.commit("setShowScanBle", false); - this.isCloud = false; setTimeout(function() { - if (self.deviceList.length > 0 && !self.pullLoad) { + if (self.deviceList.length > 0) { if (tid >= MIN_LIGHT && tid <= MAX_LIGHT) { self.deviceInfo = item; self.$store.commit("setDeviceInfo", self.deviceInfo); @@ -506,7 +481,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ } }, 50) }, - showAbout: function () { this.infoShow = false; this.$store.commit("setShowScanBle", false); @@ -730,15 +704,13 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ } }); var characteristics = []; - if (!Util._isEmpty(self.deviceInfo)) { - $.each(self.deviceInfo.characteristics, function(i, item) { - if (item.cid == STATUS_CID) { - deviceStatus = item.value; - item.value = parseInt(status); - } - characteristics.push(item); - }); - } + $.each(self.deviceInfo.characteristics, function(i, item) { + if (item.cid == STATUS_CID) { + deviceStatus = item.value; + item.value = parseInt(status); + } + characteristics.push(item); + }); if (!deviceStatus == status) { meshs.push({cid: STATUS_CID, value: parseInt(status)}); var data = '{"' + MESH_MAC + '": "' + self.deviceInfo.mac + @@ -810,7 +782,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ self.$store.commit("setShowScanBle", true); self.stopBleScan(); self.$refs.load.hide(); - console.log("本地"); espmesh.scanDevicesAsync(); } else { self.pullLoad = false; @@ -1101,6 +1072,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ if (wifi.encode) { wifi.ssid = Util.Base64.decode(wifi.ssid); } + if (wifi.ssid == wifiInfo.ssid) { return false; } @@ -1131,7 +1103,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ console.log(blue); if (!Util._isEmpty(blue)) { blue = JSON.parse(blue); - if (blue.enable != "false" && (blue.enable || blue.enable == "true")) { + if (blue.enable || blue.enable == "true") { blue.enable = true; } else { blue.enable = false; @@ -1141,10 +1113,11 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ } }, onScanBLE: function (devices) { + console.log(devices); var self = this, scanList = [], rssiList = [], notExist = [], rssiValue = self.$store.state.rssiInfo; - if (!Util._isEmpty(devices) && self.$store.state.showScanBle && self.showScanDevice && !self.loadShow ) { + if (!Util._isEmpty(devices) && self.$store.state.showScanBle && self.showScanDevice && !self.loadShow) { var conScanDeviceList = self.$store.state.conScanDeviceList; devices = JSON.parse(devices); $.each(devices, function(i, item) { @@ -1214,7 +1187,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/index.html", "../js/footer", "./ }, onDeviceScanned: function(devices) { var self = this; - console.log(devices); self.deviceList = self.$store.state.deviceList; if (!Util._isEmpty(devices)) { devices = JSON.parse(devices); diff --git a/app/src/main/assets/web/app/js/joinDevice.js b/app/src/main/assets/web/app/js/joinDevice.js index bf48055..2bba7e3 100644 --- a/app/src/main/assets/web/app/js/joinDevice.js +++ b/app/src/main/assets/web/app/js/joinDevice.js @@ -290,9 +290,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/joinDevice.html", "./importDevic $.each(devices, function(i, item) { if(Util.isMesh(item.name, item.version, item.beacon)) { var flag = true, - obj = {mac: item.mac, name: Util.setName(item.name, item.bssid), - rssi: item.rssi, bssid: item.bssid, position: self.getPairInfo(item.mac), - tid: item.tid}; + obj = Util.assemblyObject(item, self); $.each(self.scanDeviceList, function(j, itemSub) { if (item.mac == itemSub.mac) { if (item.rssi >= self.rssiValue) { diff --git a/app/src/main/assets/web/app/js/joinMesh.js b/app/src/main/assets/web/app/js/joinMesh.js index be35e1a..2300409 100644 --- a/app/src/main/assets/web/app/js/joinMesh.js +++ b/app/src/main/assets/web/app/js/joinMesh.js @@ -294,9 +294,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/joinMesh.html", "./importDevice" $.each(devices, function(i, item) { if(Util.isMesh(item.name, item.version, item.beacon)) { var flag = true, - obj = {mac: item.mac, name: Util.setName(item.name, item.bssid), - rssi: item.rssi, bssid: item.bssid, - position: self.getPairInfo(item.mac), tid: item.tid}; + obj = Util.assemblyObject(item, self) $.each(self.scanDeviceList, function(j, itemSub) { if (item.mac == itemSub.mac) { if (item.rssi >= self.rssiValue) { diff --git a/app/src/main/assets/web/app/js/operateDevice.js b/app/src/main/assets/web/app/js/operateDevice.js index 9a028ba..6ad78e0 100644 --- a/app/src/main/assets/web/app/js/operateDevice.js +++ b/app/src/main/assets/web/app/js/operateDevice.js @@ -1,4 +1,4 @@ -define(["vue","MINT", "Util", "txt!../../pages/operateDevice.html", "../js/colorPicker"], +define(["vue","MINT", "Util", "txt!../../pages/operateDevice.html", "../js/colorPicker" ], function(v, MINT, Util, operateDevice, colorPicker) { var OperateDevice = v.extend({ @@ -23,7 +23,6 @@ define(["vue","MINT", "Util", "txt!../../pages/operateDevice.html", "../js/color addFlag: false, deviceMacs: "", name: "", - isCloud: false, operateType: RECENT_TYPE_DEVICE, device: "" } @@ -45,7 +44,7 @@ define(["vue","MINT", "Util", "txt!../../pages/operateDevice.html", "../js/color self.deviceMacs = [self.device.mac]; } self.addFlag = true; - setTimeout(function () { + setTimeout(function() { self.$refs.color.show() }) }, @@ -56,7 +55,7 @@ define(["vue","MINT", "Util", "txt!../../pages/operateDevice.html", "../js/color }, }, components: { - "v-color": colorPicker, + "v-color": colorPicker } }); diff --git a/app/src/main/assets/web/app/js/resetDevice.js b/app/src/main/assets/web/app/js/resetDevice.js index 892a7ef..e91f65b 100644 --- a/app/src/main/assets/web/app/js/resetDevice.js +++ b/app/src/main/assets/web/app/js/resetDevice.js @@ -35,29 +35,23 @@ define(["vue", "MINT", "Util", "txt!../../pages/resetDevice.html", "./addDevice" }, computed: { list: function () { - var self = this, list = [], deviceList = []; + var self = this, list = []; if (self.addFlag) { self.scanDeviceList = self.$store.state.scanDeviceList; - $.each(self.scanDeviceList, function(i, item) { - if (item.beacon != BEACON_MAY) { - deviceList.push(item); - } - }) if (Util._isEmpty(self.searchReset)) { - $.each(deviceList, function(i, item) { + $.each(self.scanDeviceList, function(i, item) { if (item.rssi >= self.rssiValue) { list.push(item); } }); } else { - $.each(deviceList, function(i, item) { + $.each(self.scanDeviceList, function(i, item) { if ((item.name.indexOf(self.searchReset) != -1 || item.position.indexOf(self.searchReset) != -1 ) && item.rssi >= self.rssiValue) { list.push(item); } }) } - if (self.showFilter) { var macList = []; $.each(list, function(i, item) { @@ -346,7 +340,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/resetDevice.html", "./addDevice" var name = item.name; if(Util.isMesh(name, item.version, item.beacon)) { var flag = true, - obj = Util.assemblyObject(item, self); + obj = Util.assemblyObject(item, self) $.each(self.scanDeviceList, function(j, itemSub) { if (item.mac == itemSub.mac) { if (item.rssi >= self.rssiValue) { diff --git a/app/src/main/assets/web/app/js/room.js b/app/src/main/assets/web/app/js/room.js index c16e8c1..f9121e7 100644 --- a/app/src/main/assets/web/app/js/room.js +++ b/app/src/main/assets/web/app/js/room.js @@ -167,47 +167,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/room.html", "../js/footer", "../ return statusFlag; }, getColor: function (characteristics, tid) { - var self = this, - hueValue = 0, saturation = 0, luminance = 0, status = 0, rgb = "#6b6b6b", - mode = 0, temperature = 0, brightness = 0; - if (!Util._isEmpty(characteristics)) { - $.each(characteristics, function(i, item) { - if (item.cid == HUE_CID) { - hueValue = item.value; - }else if (item.cid == SATURATION_CID) { - saturation = item.value; - }else if (item.cid == VALUE_CID) { - luminance = item.value; - } else if (item.cid == STATUS_CID) { - status = item.value; - } else if (item.cid == MODE_CID) { - mode = item.value; - } else if (item.cid == TEMPERATURE_CID) { - temperature = item.value; - } else if (item.cid == BRIGHTNESS_CID) { - brightness = item.value; - } - }) - } - if (status == STATUS_ON) { - if (mode == MODE_CTB) { - rgb = Util.modeFun(temperature, brightness); - } else { - rgb = Raphael.hsb2rgb(hueValue / 360, saturation / 100, luminance / 100); - var v = luminance / 100; - if (v <= 0.4) { - v *= 1.2; - } - if(v <= 0.2) { - v = 0.2; - } - rgb = "rgba("+Math.round(rgb.r)+", "+Math.round(rgb.g)+", "+Math.round(rgb.b)+", "+ v +")"; - } - } - if (tid < MIN_LIGHT || tid > MAX_LIGHT) { - rgb = "#3ec2fc"; - } - return rgb; + return Util.getColor(characteristics, tid); }, editName: function() { var self = this; @@ -460,13 +420,16 @@ define(["vue", "MINT", "Util", "txt!../../pages/room.html", "../js/footer", "../ } } var list = this.$store.state.roomList; - console.log(JSON.stringify(list)); $.each(list, function(i, item) { var key = item.key; if (roomKeys.indexOf(key) != -1) { $.each(roomList, function(j, itemSub) { if (key == itemSub.key) { - roomList.splice(j, 1, item); + var value = JSON.parse(decodeURIComponent(item.value)); + var valueSub = JSON.parse(decodeURIComponent(itemSub.value)); + roomList.splice(j, 1, {key: key, + value: encodeURIComponent(JSON.stringify({name: value.name, url: valueSub.url, + macs: value.macs}))}); return false; } }) @@ -484,12 +447,12 @@ define(["vue", "MINT", "Util", "txt!../../pages/room.html", "../js/footer", "../ }); var data = {name: ROOM_LIST, content: roomList}; espmesh.saveValuesForKeysInFile(JSON.stringify(data)); - console.log(JSON.stringify(list)); self.setRoomList(list); } }, setRoomList: function(list) { this.roomList = [], updateObj = '{'; + list.sort(Util.sortBy("name")); this.roomList = list; $.each(list, function(i, item) { updateObj += '"'+item.roomKey+'":' + JSON.stringify(item.macs) + ","; diff --git a/app/src/main/assets/web/app/js/set.js b/app/src/main/assets/web/app/js/set.js index 6057699..7b722da 100644 --- a/app/src/main/assets/web/app/js/set.js +++ b/app/src/main/assets/web/app/js/set.js @@ -11,7 +11,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ isNewVersion: false, time: 0, rootMac: "", - isLogin: false, } }, computed: { @@ -20,8 +19,7 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ return this.isNewVersion; }, delayTime: function() { - this.time = this.$store.state.delayTime - return this.time; + return this.$store.state.delayTime; } }, methods:{ @@ -29,7 +27,6 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ this.hideThis(); window.onCheckAppVersion = this.onCheckAppVersion; window.onGetTsfTime = this.onGetTsfTime; - this.isLogin = this.$store.state.isLogin; this.flag = true; }, hide: function () { @@ -37,24 +34,22 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ MINT.Indicator.close(); this.$emit("setShow"); }, - logout: function() { - var self = this; - MINT.MessageBox.confirm("退出登录后, 将无法获取到云端的设备,是否退出?", "系统提示",{ - confirmButtonText: self.$t('confirmBtn'), cancelButtonText: self.$t('cancelBtn')}).then(function(action) { - espmesh.userLogout(); - self.$store.commit("setUserInfo", ""); - self.$store.commit("setIsLogin", false); - self.isLogin = false; - }); - }, showDelay: function() { var self= this; MINT.MessageBox.prompt("请输入新的延时时间", "延时设置", {inputValue: this.time, inputType: 'number', confirmButtonText: self.$t('confirmBtn'), cancelButtonText: self.$t('cancelBtn')}).then(function(obj) { - self.time = parseInt(obj.value); - self.$store.commit("setDelayTime", self.time); var deviceList = self.$store.state.deviceList, rootMac = ""; + if (deviceList.length == 0) { + MINT.Toast({ + message: "延时设置失败", + position: 'bottom', + duration: 2000 + }); + return false; + } + self.time = parseInt(obj.value); + MINT.Indicator.open(); $.each(deviceList, function(i, item) { if (item.layer == 1) { rootMac = item.mac; @@ -64,7 +59,9 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ var data = '{"' + MESH_MAC + '": "' + rootMac + '","'+DEVICE_IP+'": "'+self.$store.state.deviceIp+'","' + MESH_REQUEST + '": "' + GET_TSF_TIME + '"' + ',"callback": "onGetTsfTime"}}'; - espmesh.requestDevice(data); + setTimeout(function() { + espmesh.requestDevice(data); + }, 1000) }); }, newVersionShow: function() { @@ -86,11 +83,24 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ updateApp: function() { }, onGetTsfTime: function(res) { - console.log(res); + MINT.Indicator.close(); if (!Util._isEmpty(res) && res != "{}") { res = JSON.parse(res); - + console.log(this.time); + this.$store.commit("setDelayTime", this.time); this.$store.commit("setTsfTime", new Date().getTime() * 1000 - parseInt(res.result.tsf_time)); + MINT.Toast({ + message: "延时设置成功", + position: 'bottom', + duration: 2000 + }); + } else { + this.time = this.$store.state.delayTime; + MINT.Toast({ + message: "延时设置失败", + position: 'bottom', + duration: 2000 + }); } }, onCheckAppVersion: function(res) { @@ -118,4 +128,4 @@ define(["vue", "MINT", "Util", "txt!../../pages/set.html", "../js/aboutUs", "../ } }); return Set; -}); +}); \ No newline at end of file diff --git a/app/src/main/assets/web/app/js/user.js b/app/src/main/assets/web/app/js/user.js index 465b25d..aedf972 100644 --- a/app/src/main/assets/web/app/js/user.js +++ b/app/src/main/assets/web/app/js/user.js @@ -1,106 +1,106 @@ define(["vue", "MINT", "Util", "txt!../../pages/user.html", "../js/footer", "../js/set", "../js/userinfo", - "../js/pair", "../js/selectDevice", "../js/debug", "../js/timingList", "../js/scan", "../js/deviceIbeacon", - "../js/blueList"], + "../js/pair", "../js/selectDevice", "../js/debug", "../js/timingList", "../js/scan", "../js/deviceIbeacon", + "../js/blueList"], function(v, MINT, Util, user, footer, set, userinfo, pair, selectDevice, debug, timingList, scan, deviceIbeacon, - blueList) { + blueList) { - var User = v.extend({ + var User = v.extend({ - template: user, + template: user, - data: function(){ - return { - user: "user", - wifi: "", - userName: "Guest" + data: function(){ + return { + user: "user", + wifi: "", + } + }, + mounted: function() { + this.$store.commit("setUserName", "Guest"); + }, + computed: { + currentWifi: function () { + var self = this; + var wifiInfo = this.$store.state.wifiInfo; + if (Util._isEmpty(wifiInfo)) { + return self.$t('no') + } else { + return wifiInfo.ssid; } + }, - mounted: function() { - this.$store.commit("setUserName", "Guest"); + }, + methods:{ + setFun: function () { + this.$refs.set.show(); }, - computed: { - currentWifi: function () { - var self = this; - var wifiInfo = this.$store.state.wifiInfo; - if (Util._isEmpty(wifiInfo)) { - return self.$t('no') - } else { - return wifiInfo.ssid; - } - } + infoFun: function () { + this.$refs.info.show(); }, - methods:{ - setFun: function () { - this.$refs.set.show(); - }, - infoFun: function () { - this.$refs.info.show(); - }, - ibeaconFun: function () { - this.$refs.ibeacon.show(); - }, - scanFun: function () { - this.$refs.scan.show(); - }, - selectFun: function () { - this.$refs.select.show(); - }, - pairFun: function () { - this.$refs.pair.show(); - }, - pairListFun: function () { - this.$refs.pairList.show(); - }, - bugFun: function () { - this.$refs.debug.show(); - }, - blueFun: function () { - this.$refs.blueList.show(); - }, - timingListFun: function () { - this.$refs.timingList.show(); - }, - scanFun: function () { - this.$refs.scan.show(); - }, - changeCloud: function() { - espmesh.mainPageLoad("cloud"); - }, - onBackUser: function() { - var startTime = 0; - var self = this; - window.onBackPressed = function () { - MINT.Toast({ - message: self.$t('exitProgramDesc'), - position: 'bottom', - duration: 2000 - }); - if (startTime == 0) { - startTime = new Date().getTime(); + ibeaconFun: function () { + this.$refs.ibeacon.show(); + }, + scanFun: function () { + this.$refs.scan.show(); + }, + selectFun: function () { + this.$refs.select.show(); + }, + pairFun: function () { + this.$refs.pair.show(); + }, + pairListFun: function () { + this.$refs.pairList.show(); + }, + bugFun: function () { + this.$refs.debug.show(); + }, + blueFun: function () { + this.$refs.blueList.show(); + }, + timingListFun: function () { + this.$refs.timingList.show(); + }, + scanFun: function () { + this.$refs.scan.show(); + }, + changeCloud: function() { + espmesh.mainPageLoad("cloud"); + }, + onBackUser: function() { + var startTime = 0; + var self = this; + window.onBackPressed = function () { + MINT.Toast({ + message: self.$t('exitProgramDesc'), + position: 'bottom', + duration: 2000 + }); + if (startTime == 0) { + startTime = new Date().getTime(); + } else { + if (new Date().getTime() - startTime < 2000) { + espmesh.finish(); } else { - if (new Date().getTime() - startTime < 2000) { - espmesh.finish(); - } else { - startTime = new Date().getTime(); - } + startTime = new Date().getTime(); } } } - }, - components: { - "v-footer": footer, - "v-set": set, - "v-selectDevice": selectDevice, - "v-userinfo": userinfo, - "v-pair": pair, - "v-debug": debug, - "v-timingList": timingList, - "v-scan": scan, - "v-deviceIbeacon": deviceIbeacon, - "v-blueList": blueList } + }, + components: { + "v-footer": footer, + "v-set": set, + "v-selectDevice": selectDevice, + "v-userinfo": userinfo, + "v-pair": pair, + "v-debug": debug, + "v-timingList": timingList, + "v-scan": scan, + "v-deviceIbeacon": deviceIbeacon, + "v-blueList": blueList + } - }); - - return User; }); + + return User; +}); \ No newline at end of file diff --git a/app/src/main/assets/web/app/pages/addDevice.html b/app/src/main/assets/web/app/pages/addDevice.html index c9ff1e9..cb9a6e9 100644 --- a/app/src/main/assets/web/app/pages/addDevice.html +++ b/app/src/main/assets/web/app/pages/addDevice.html @@ -25,12 +25,12 @@

- - - - - - + + + + + +
@@ -46,7 +46,7 @@

- +
@@ -71,25 +71,25 @@

- +
- +
- +
- +
- +
- +
- +
@@ -106,37 +106,37 @@

- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
diff --git a/app/src/main/assets/web/app/pages/automation-btn-select.html b/app/src/main/assets/web/app/pages/automation-btn-select.html index 57d0212..4e0ad4b 100644 --- a/app/src/main/assets/web/app/pages/automation-btn-select.html +++ b/app/src/main/assets/web/app/pages/automation-btn-select.html @@ -25,7 +25,7 @@

- +
diff --git a/app/src/main/assets/web/app/pages/index.html b/app/src/main/assets/web/app/pages/index.html index b0fe1db..ee249b5 100644 --- a/app/src/main/assets/web/app/pages/index.html +++ b/app/src/main/assets/web/app/pages/index.html @@ -22,10 +22,10 @@

{{$t('nav.device')}}

{{getPosition(item.position)}} {{item.mac}} - {{item.name}} - ({{item.version}})    - - + {{item.name}} + ({{item.version}})    + + - + - {{item.version}}    - - + {{item.version}}    + +
@@ -63,7 +63,8 @@

{{$t('nav.device')}}

-
+ +
diff --git a/app/src/main/assets/web/app/pages/set.html b/app/src/main/assets/web/app/pages/set.html index 8563600..d9f5f70 100644 --- a/app/src/main/assets/web/app/pages/set.html +++ b/app/src/main/assets/web/app/pages/set.html @@ -43,9 +43,6 @@

-
- -
diff --git a/app/src/main/assets/web/app/pages/user.html b/app/src/main/assets/web/app/pages/user.html index f9cbd32..c73794e 100644 --- a/app/src/main/assets/web/app/pages/user.html +++ b/app/src/main/assets/web/app/pages/user.html @@ -10,7 +10,7 @@

{{$t('nav.user')}}

- {{userName}} + Guest
@@ -44,7 +44,7 @@

{{$t('nav.user')}}

- Ibeacon + ibeacon {{$store.state.deviceList.length}}
@@ -96,17 +96,18 @@

{{$t('nav.user')}}

-
-
- -
-
- 云端 -
-
- -
-
+ + + + + + + + + + + +
diff --git a/app/src/main/assets/web/cloud.html b/app/src/main/assets/web/cloud.html index b683555..e9ca8c7 100644 --- a/app/src/main/assets/web/cloud.html +++ b/app/src/main/assets/web/cloud.html @@ -11,6 +11,7 @@ + diff --git a/app/src/main/assets/web/cloud/css/style.css b/app/src/main/assets/web/cloud/css/style.css index 1ce2278..fc81245 100755 --- a/app/src/main/assets/web/cloud/css/style.css +++ b/app/src/main/assets/web/cloud/css/style.css @@ -1,428 +1,3 @@ -@CHARSET "UTF-8"; - -html,body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - font:12px 'Microsoft YaHei', 微软雅黑, Arial, Lucida Grande, Tahoma, sans-serif; - /*background-color: #f9f9f9;*/ - -webkit-text-size-adjust: 100%; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - overflow-x: hidden; -} - -html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 { - 一webkit一text一size一adjust: 100%; - 一ms一text一size一adjust: 100%; - text一size一adjust: 100%; -} -/*去除IE文本框自带的叉号*/ -::-ms-clear{ - display: none; -} -button:focus, button:active:focus, -a:focus, a:active:focus, -input:focus, input:active:focus, -span:focus, span:active:focus, -textarea:focus, textarea:active:focus, -.bootstrap-select .dropdown-toggle:focus{ - outline: none !important; -} -*:not(input, textarea) { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -input, textarea{ - -webkit-appearance: none !important; - -webkit-user-select:auto !important; - -khtml-user-select:auto !important; - -ms-user-select: text !important; - user-select: text !important; -} -input:disabled, -textarea:disabled { - opacity: 1; -} -a{ - outline:none; - -moz-outline-style:none; -} -@font-face { - font-family: 'icomoon'; - src: url('../../css/fonts/icomoon.eot?djo6qt'); - src: url('../../css/fonts/icomoon.eot?djo6qt#iefix') format('embedded-opentype'), - url('../../css/fonts/icomoon.ttf?djo6qt') format('truetype'), - url('../../css/fonts/icomoon.woff?djo6qt') format('woff'), - url('../../css/fonts/icomoon.svg?djo6qt#icomoon') format('svg'); - font-weight: normal; - font-style: normal; -} - -[class^="icon-"], [class*=" icon-"] { - /* use !important to prevent issues with browser extensions that change fonts */ - font-family: 'icomoon' !important; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} -.icon-upgrade:before { - content: "\e953"; -} -.icon-co_upgrade:before { - content: "\e954"; -} -.icon-guanlian:before { - content: "\e905"; -} -.icon-iBeacon:before { - content: "\e949"; -} -.icon-up:before { - content: "\e948"; -} -.icon-door:before { - content: "\e947"; -} -.icon-bg:before { - content: "\e945"; -} -.icon-cg:before { - content: "\e946"; -} -.icon-problem:before { - content: "\e944"; -} -.icon-mobile:before { - content: "\e943"; -} -.icon-bluetooth:before { - content: "\e900"; -} -.icon-link:before { - content: "\e901"; -} -.icon-reset:before { - content: "\e902"; -} -.icon-send:before { - content: "\e903"; -} -.icon-scanner:before { - content: "\e904"; -} -.icon-radar:before { - content: "\e94a"; -} -.icon-gear:before { - content: "\e906"; -} -.icon-sensor:before { - content: "\e907"; -} -.icon-ionic:before { - content: "\e908"; -} -.icon-groups:before { - content: "\e909"; -} -.icon-light:before { - content: "\e90a"; -} -.icon-network:before { - content: "\e90b"; -} -.icon-plus:before { - content: "\e90c"; -} -.icon-power:before { - content: "\e90d"; -} -.icon-radar-chart:before { - content: "\e90e"; -} -.icon-recent:before { - content: "\e90f"; -} -.icon-search:before { - content: "\e910"; -} -.icon-speakerphone:before { - content: "\e911"; -} -.icon-left:before { - content: "\e912"; -} -.icon-arrow-left:before { - content: "\e913"; -} -.icon-checkmark-round:before { - content: "\e914"; -} -.icon-right:before { - content: "\e915"; -} -.icon-password:before { - content: "\e916"; -} -.icon-reload:before { - content: "\e917"; -} -.icon-loop:before { - content: "\e918"; -} -.icon-android-alert:before { - content: "\e919"; -} -.icon-person:before { - content: "\e91a"; -} -.icon-more:before { - content: "\e91b"; -} -.icon-station:before { - content: "\e91c"; -} -.icon-ios-timer-outline:before { - content: "\e91d"; -} -.icon-ios-alarm-outline:before { - content: "\e91e"; -} -.icon-time:before { - content: "\e91f"; -} -.icon-disc:before { - content: "\e920"; -} -.icon-contrast:before { - content: "\e921"; -} -.icon-easel:before { - content: "\e922"; -} -.icon-eye-off:before { - content: "\e923"; -} -.icon-eye:before { - content: "\e924"; -} -.icon-round:before { - content: "\e925"; -} -.icon-alarm:before { - content: "\e926"; -} -.icon-ball:before { - content: "\e927"; -} -.icon-film:before { - content: "\e928"; -} -.icon-love:before { - content: "\e929"; -} -.icon-moon:before { - content: "\e92a"; -} -.icon-read:before { - content: "\e92b"; -} -.icon-rice:before { - content: "\e92c"; -} -.icon-thinking:before { - content: "\e92d"; -} -.icon-work:before { - content: "\e92e"; -} -.icon-speaker:before { - content: "\e92f"; -} -.icon-wifi:before { - content: "\e930"; -} -.icon-mark:before { - content: "\e931"; -} -.icon-map:before { - content: "\e932"; -} -.icon-rss:before { - content: "\e933"; -} -.icon-uncheck:before { - content: "\e934"; -} -.icon-check:before { - content: "\e935"; -} -.icon-el-icon-arrow-up:before { - content: "\e936"; -} -.icon-el-icon-arrow-down:before { - content: "\e937"; -} -.icon-import:before { - content: "\e938"; -} -.icon-down-dir:before { - content: "\e939"; -} -.icon-right-dir:before { - content: "\e93a"; -} -.icon-ok-circled:before { - content: "\e93b"; -} -.icon-table:before { - content: "\e93c"; -} -.icon-edit:before { - content: "\e93d"; -} -.icon-cancel:before { - content: "\e93e"; -} -.icon-cancel-circled:before { - content: "\e93f"; -} -.icon-less:before { - content: "\e940"; -} -.icon-clear:before { - content: "\e941"; -} -.icon-warning:before { - content: "\e942"; -} -.icon-sensor2:before { - content: "\e94e"; -} -.icon-valves:before { - content: "\e94f"; -} -.icon-statistics:before { - content: "\e950"; -} -.icon-bin:before { - content: "\e9ac"; -} -.icon-cross:before { - content: "\ea0f"; - font-weight: 800; -} - - -input::-webkit-input-placeholder { /* WebKit browsers*/ - color: #ababab !important; -} -input:-moz-placeholder { /* Mozilla Firefox 4 to 18*/ - color: #ababab !important; -} -input::-moz-placeholder { /* Mozilla Firefox 19+*/ - color: #ababab !important; -} -input:-ms-input-placeholder { /* Internet Explorer 10+*/ - color: #ababab !important; -} -.flex-1 { - -webkit-box: 1; - -webkit-box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -.flex { - display: box; /* OLD - Android 4.4- */ - display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ - display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ - display: -ms-flexbox; /* TWEENER - IE 10 */ - display: -webkit-flex; /* NEW - Chrome */ - display: flex; -} -.flex-ac { - -webkit-box-align: center; - -webkit-align-items: center; - -moz-align-items: center; - -ms-align-items: center; - -o-align-items: center; - align-items: center; -} -.flex-ae { - -webkit-box-align: end; - -webkit-align-items: flex-end; - -moz-align-items: flex-end; - -ms-align-items: flex-end; - -o-align-items: flex-end; - align-items: flex-end; -} -.flex-as { - -webkit-box-align: stretch; - -webkit-align-items: stretch; - -moz-align-items: stretch; - -ms-align-items: stretch; - -o-align-items: stretch; - align-items: stretch; -} -.flex-jcb { - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - -moz-justify-content: space-between; - -ms-justify-content: space-between; - -o-justify-content: space-between; - justify-content: space-between; -} -.flex-jcs { - -webkit-box-pack: start; - -webkit-justify-content: flex-start; - -moz-justify-content: flex-start; - -ms-justify-content: flex-start; - -o-justify-content: flex-start; - justify-content: flex-start; -} -.flex-jce { - -webkit-box-pack: end; - -webkit-justify-content: flex-end; - -moz-justify-content: flex-end; - -ms-justify-content: flex-end; - -o-justify-content: flex-end; - justify-content: flex-end; -} -.flex-jcc { - -webkit-box-pack: center; - -webkit-justify-content: center; - -moz-justify-content: center; - -ms-justify-content: center; - -o-justify-content: center; - justify-content: center; -} -.flex-v { - -webkit-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} -.flex-m { - -moz-box-lines: multiple; /*Firefox*/ - -webkit-box-lines: multiple; /*Safari,Opera,Chrome*/ - box-lines: multiple; - -webkit-flex-wrap: wrap; - -moz-flex-wrap: wrap; - flex-wrap: wrap; -} ul { padding: 0; margin: 0; @@ -484,93 +59,7 @@ ul { .content-info .item-power:active { } -.moves-enter-active, .moves-leave-active { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.moves-enter, .moves-leave-to /* .fade-leave-active in below version 2.1.8 */ { - -webkit-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); -} -.ups-enter-active, .ups-leave-active { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.ups-enter, .ups-leave-to /* .fade-leave-active in below version 2.1.8 */ { - -webkit-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); -} -.downs-enter-active, .downs-leave-active { - -webkit-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.downs-enter, .downs-leave-to /* .fade-leave-active in below version 2.1.8 */ { - -webkit-transform: translate3d(0, -100%, 0); - transform: translate3d(0, -100%, 0); -} -.app-title { - height: 50px; - line-height: 50px; - color: #fff; - text-align: center; - margin: 0; - font-size: 16px; - background: #3ec2fc; -} -.app-title .back { - position: absolute; - top: 0; - left: 0; - height: 50px; - width: 50px; - display: flex; - justify-content: center; - align-items: center; - font-size: 22px; -} -.app-title .left-two { - position: absolute; - top: 0; - right: 40px; - height: 50px; - width: 45px; - display: flex; - justify-content: center; - align-items: center; - font-size: 22px; -} -.app-title .left-two .icon-cross { - font-size: 21px; -} -.input-info { - position: relative; - margin: 9px 10px; -} -.input-info input { - background: #fff; - border: none; - color: #ababab; - padding-left: 30px; - border-radius: 5px; - -webkit-transition: all .3s linear; - transition: all .3s linear; -} -.input-info i { - position: absolute; - top: 7px; - left: 5px; - font-size: 23px; - color: #ababab; - -webkit-transition: all .3s linear; - transition: all .3s linear; -} .hidden { display: none !important; } @@ -627,196 +116,7 @@ ul { min-height: 100%; } -/*加载动画*/ -.chromeframe { - margin: 0.2em 0; - background: #ccc; - color: #000; - padding: 0.2em 0; -} -#loader-wrapper, -#loader-wrapper-small { - position: absolute; - left: 0; - width: 100%; - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - z-index: 199; -} -#loader-wrapper { - top: 50px; - bottom: 55px; -} -#loader-wrapper-small { - top: 0; - height: 50px; -} -.loader { - display: block; - width: 90px; - height: 90px; - border-radius: 50%; - border: 3px solid transparent; - /* COLOR 1 */ - border-top-color: #3ec2fc; - -webkit-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -moz-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 2s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ - z-index:1001; -} -.loader-small { - top: 1px; - width: 30px; - height: 30px; -} -.loader:before { - content: ""; - position: absolute; - top: 5px; - left: 5px; - right: 5px; - bottom: 5px; - border-radius: 50%; - border: 3px solid transparent; - /* COLOR 2 */ - border-top-color: #3ec2fc; - -webkit-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -moz-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 3s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -.loader:after { - content: ""; - position: absolute; - top: 15px; - left: 15px; - right: 15px; - bottom: 15px; - border-radius: 50%; - border: 3px solid transparent; - border-top-color: #3ec2fc; - /* COLOR 3 */ - -moz-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -webkit-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 1.5s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -.loader-small:before { - content: ""; - position: absolute; - top: 1px; - left: 1px; - right: 1px; - bottom: 1px; - border-radius: 50%; - border: 3px solid transparent; - /* COLOR 2 */ - border-top-color: #3ec2fc; - -webkit-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -moz-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 3s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -.loader-small:after { - content: ""; - position: absolute; - top: 5px; - left: 5px; - right: 5px; - bottom: 5px; - border-radius: 50%; - border: 3px solid transparent; - border-top-color: #3ec2fc; - /* COLOR 3 */ - -moz-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -o-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -ms-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - -webkit-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ - animation: spin 1.5s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ -} -@-webkit-keyframes spin { - 0%{ - -webkit-transform: rotate(0deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(0deg); /* IE 9 */ - transform: rotate(0deg); /* Firefox 16+, IE 10+, Opera */ - }100%{ - -webkit-transform: rotate(360deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(360deg); /* IE 9 */ - transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */} -} - -@keyframes spin { - 0%{ - -webkit-transform: rotate(0deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(0deg); /* IE 9 */ - transform: rotate(0deg); /* Firefox 16+, IE 10+, Opera */ - }100%{ - -webkit-transform: rotate(360deg); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: rotate(360deg); /* IE 9 */ - transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */} -} - - -#loader-wrapper .loader-section { - position: absolute; - top: 0; - width: 51%; - height: 100%; - background: transparent; /* Old browsers */ - z-index: 1000; - -webkit-transform: translateX(0); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateX(0); /* IE 9 */ - transform: translateX(0); /* Firefox 16+, IE 10+, Opera */} -#loader-wrapper .loader-section.section-left {left: 0;} -#loader-wrapper .loader-section.section-right {right: 0;} - -/* Loaded */ -.loaded #loader-wrapper .loader-section.section-left { - height:100%; - -webkit-transform: translateX(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateX(-100%); /* IE 9 */ - transform: translateX(-100%); /* Firefox 16+, IE 10+, Opera */ - -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); - transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);} -.loaded #loader-wrapper .loader-section.section-right { - height:100%; - -webkit-transform: translateX(100%); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateX(100%); /* IE 9 */ - transform: translateX(100%); /* Firefox 16+, IE 10+, Opera */ - -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); - transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);} -.loaded .loader { - opacity: 0; - -webkit-transition: all 0.3s ease-out; - transition: all 0.3s ease-out;} -.loaded #loader-wrapper { - visibility: hidden; - -webkit-transform: translateY(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ - -ms-transform: translateY(-100%); /* IE 9 */ - transform: translateY(-100%); /* Firefox 16+, IE 10+, Opera */ - -webkit-transition: all 0.3s 1s ease-out; - transition: all 0.3s 1s ease-out;} -/* JavaScript Turned Off */ -.no-js #loader-wrapper {display: none;} -.no-js h1 {color: #222222;} -#loader-wrapper .load_title { - font-family:'Open Sans'; - color:#625b7a; - font-size:16px; - width:100%; - text-align:center; - z-index:9999999999999; - margin-top: 10px; - line-height:30px; -} @@ -1000,55 +300,6 @@ ul { /*background-repeat: repeat-x;*/ /*min-height: 100%;*/ } -.title-info { - height: 50px; - font-size: 16px; - background: #fff; - border-bottom: 1px solid #e6e6e6; -} -.title-info .app-title { - color: #fff; -} -.right-top { - position: absolute; - top: 0; - height: 50px; - width: 30px; - display: flex; - justify-content: center; - align-items: center; - right: 10px; - font-size: 22px; - color: #fff; -} -.right-top.right-40 { - right: 40px; - width: 35px; -} -.right-top.right-75 { - right: 75px; - width: 35px; -} -.right-top .right-icon { - position: relative; - flex: 1; - display: flex; - justify-content: center; - align-items: center; - height: 100%; -} -.icon-position { - position: relative; -} -.right-top .right-icon .icon-cancel-circled { - position: absolute; - bottom: -1px; - right: -2px; - font-size: 12px; - color: #fff; - background: #d1001e; - border-radius: 100%; -} .content-info { background: #f6f6f6; height: calc(100% - 105px); diff --git a/app/src/main/assets/web/cloud/js/user.js b/app/src/main/assets/web/cloud/js/user.js index 8c722ef..552d910 100644 --- a/app/src/main/assets/web/cloud/js/user.js +++ b/app/src/main/assets/web/cloud/js/user.js @@ -18,7 +18,9 @@ define(["vue", "MINT", "Util", "txt!../../pages/user.html", "../js/footer", "../ // 如果路由有变化,会再次执行该方法d '$route': function (to, form) { if (to.path == "/user") { - this.getAliOTAUpgradeDeviceList(); + if (this.$store.state.isLogin) { + this.getAliOTAUpgradeDeviceList(); + } } } diff --git a/app/src/main/assets/web/cloud/pages/user.html b/app/src/main/assets/web/cloud/pages/user.html index 9779ce8..439b3bf 100644 --- a/app/src/main/assets/web/cloud/pages/user.html +++ b/app/src/main/assets/web/cloud/pages/user.html @@ -28,7 +28,7 @@

{{$t('nav.user')}}

-
+
@@ -55,7 +55,7 @@

{{$t('nav.user')}}

- +
本地 diff --git a/app/src/main/assets/web/css/fonts/icomoon.eot b/app/src/main/assets/web/css/fonts/icomoon.eot index 312e872..e18f089 100755 Binary files a/app/src/main/assets/web/css/fonts/icomoon.eot and b/app/src/main/assets/web/css/fonts/icomoon.eot differ diff --git a/app/src/main/assets/web/css/fonts/icomoon.svg b/app/src/main/assets/web/css/fonts/icomoon.svg index 21fded2..27e490b 100755 --- a/app/src/main/assets/web/css/fonts/icomoon.svg +++ b/app/src/main/assets/web/css/fonts/icomoon.svg @@ -92,6 +92,8 @@ + + \ No newline at end of file diff --git a/app/src/main/assets/web/css/fonts/icomoon.ttf b/app/src/main/assets/web/css/fonts/icomoon.ttf index 0cc074b..37f8c7d 100755 Binary files a/app/src/main/assets/web/css/fonts/icomoon.ttf and b/app/src/main/assets/web/css/fonts/icomoon.ttf differ diff --git a/app/src/main/assets/web/css/fonts/icomoon.woff b/app/src/main/assets/web/css/fonts/icomoon.woff index ec3eaee..154648e 100755 Binary files a/app/src/main/assets/web/css/fonts/icomoon.woff and b/app/src/main/assets/web/css/fonts/icomoon.woff differ diff --git a/app/src/main/assets/web/css/style.css b/app/src/main/assets/web/css/style.css new file mode 100644 index 0000000..4104c0f --- /dev/null +++ b/app/src/main/assets/web/css/style.css @@ -0,0 +1,756 @@ +@CHARSET "UTF-8"; +html,body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + font:12px 'Microsoft YaHei', 微软雅黑, Arial, Lucida Grande, Tahoma, sans-serif; + /*background-color: #f9f9f9;*/ + -webkit-text-size-adjust: 100%; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + overflow-x: hidden; +} + +html, body, form, fieldset, p, div, h1, h2, h3, h4, h5, h6 { + 一webkit一text一size一adjust: 100%; + 一ms一text一size一adjust: 100%; + text一size一adjust: 100%; +} +/*去除IE文本框自带的叉号*/ +::-ms-clear{ + display: none; +} +button:focus, button:active:focus, +a:focus, a:active:focus, +input:focus, input:active:focus, +span:focus, span:active:focus, +textarea:focus, textarea:active:focus, +.bootstrap-select .dropdown-toggle:focus{ + outline: none !important; +} +*:not(input, textarea) { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +input, textarea{ + -webkit-appearance: none !important; + -webkit-user-select:auto !important; + -khtml-user-select:auto !important; + -ms-user-select: text !important; + user-select: text !important; +} +input:disabled, +textarea:disabled { + opacity: 1; +} +a{ + outline:none; + -moz-outline-style:none; +} +@font-face { + font-family: 'icomoon'; + src: url('fonts/icomoon.eot?djo6qt'); + src: url('fonts/icomoon.eot?djo6qt#iefix') format('embedded-opentype'), + url('fonts/icomoon.ttf?djo6qt') format('truetype'), + url('fonts/icomoon.woff?djo6qt') format('woff'), + url('fonts/icomoon.svg?djo6qt#icomoon') format('svg'); + font-weight: normal; + font-style: normal; +} + +[class^="icon-"], [class*=" icon-"] { + /* use !important to prevent issues with browser extensions that change fonts */ + font-family: 'icomoon' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.icon-jia:before { + content: "\e955"; +} +.icon-yunpingtai:before { + content: "\e956"; +} +.icon-upgrade:before { + content: "\e953"; +} +.icon-co_upgrade:before { + content: "\e954"; +} +.icon-guanlian:before { + content: "\e905"; +} +.icon-iBeacon:before { + content: "\e949"; +} +.icon-up:before { + content: "\e948"; +} +.icon-door:before { + content: "\e947"; +} +.icon-bg:before { + content: "\e945"; +} +.icon-cg:before { + content: "\e946"; +} +.icon-problem:before { + content: "\e944"; +} +.icon-mobile:before { + content: "\e943"; +} +.icon-bluetooth:before { + content: "\e900"; +} +.icon-link:before { + content: "\e901"; +} +.icon-reset:before { + content: "\e902"; +} +.icon-send:before { + content: "\e903"; +} +.icon-scanner:before { + content: "\e904"; +} +.icon-radar:before { + content: "\e94a"; +} +.icon-gear:before { + content: "\e906"; +} +.icon-sensor:before { + content: "\e907"; +} +.icon-ionic:before { + content: "\e908"; +} +.icon-groups:before { + content: "\e909"; +} +.icon-light:before { + content: "\e90a"; +} +.icon-network:before { + content: "\e90b"; +} +.icon-plus:before { + content: "\e90c"; +} +.icon-power:before { + content: "\e90d"; +} +.icon-radar-chart:before { + content: "\e90e"; +} +.icon-recent:before { + content: "\e90f"; +} +.icon-search:before { + content: "\e910"; +} +.icon-speakerphone:before { + content: "\e911"; +} +.icon-left:before { + content: "\e912"; +} +.icon-arrow-left:before { + content: "\e913"; +} +.icon-checkmark-round:before { + content: "\e914"; +} +.icon-right:before { + content: "\e915"; +} +.icon-password:before { + content: "\e916"; +} +.icon-reload:before { + content: "\e917"; +} +.icon-loop:before { + content: "\e918"; +} +.icon-android-alert:before { + content: "\e919"; +} +.icon-person:before { + content: "\e91a"; +} +.icon-more:before { + content: "\e91b"; +} +.icon-station:before { + content: "\e91c"; +} +.icon-ios-timer-outline:before { + content: "\e91d"; +} +.icon-ios-alarm-outline:before { + content: "\e91e"; +} +.icon-time:before { + content: "\e91f"; +} +.icon-disc:before { + content: "\e920"; +} +.icon-contrast:before { + content: "\e921"; +} +.icon-easel:before { + content: "\e922"; +} +.icon-eye-off:before { + content: "\e923"; +} +.icon-eye:before { + content: "\e924"; +} +.icon-round:before { + content: "\e925"; +} +.icon-alarm:before { + content: "\e926"; +} +.icon-ball:before { + content: "\e927"; +} +.icon-film:before { + content: "\e928"; +} +.icon-love:before { + content: "\e929"; +} +.icon-moon:before { + content: "\e92a"; +} +.icon-read:before { + content: "\e92b"; +} +.icon-rice:before { + content: "\e92c"; +} +.icon-thinking:before { + content: "\e92d"; +} +.icon-work:before { + content: "\e92e"; +} +.icon-speaker:before { + content: "\e92f"; +} +.icon-wifi:before { + content: "\e930"; +} +.icon-mark:before { + content: "\e931"; +} +.icon-map:before { + content: "\e932"; +} +.icon-rss:before { + content: "\e933"; +} +.icon-uncheck:before { + content: "\e934"; +} +.icon-check:before { + content: "\e935"; +} +.icon-el-icon-arrow-up:before { + content: "\e936"; +} +.icon-el-icon-arrow-down:before { + content: "\e937"; +} +.icon-import:before { + content: "\e938"; +} +.icon-down-dir:before { + content: "\e939"; +} +.icon-right-dir:before { + content: "\e93a"; +} +.icon-ok-circled:before { + content: "\e93b"; +} +.icon-table:before { + content: "\e93c"; +} +.icon-edit:before { + content: "\e93d"; +} +.icon-cancel:before { + content: "\e93e"; +} +.icon-cancel-circled:before { + content: "\e93f"; +} +.icon-less:before { + content: "\e940"; +} +.icon-clear:before { + content: "\e941"; +} +.icon-warning:before { + content: "\e942"; +} +.icon-sensor2:before { + content: "\e94e"; +} +.icon-valves:before { + content: "\e94f"; +} +.icon-statistics:before { + content: "\e950"; +} +.icon-bin:before { + content: "\e9ac"; +} +.icon-cross:before { + content: "\ea0f"; + font-weight: 800; +} + + +input::-webkit-input-placeholder { /* WebKit browsers*/ + color: #ababab !important; +} +input:-moz-placeholder { /* Mozilla Firefox 4 to 18*/ + color: #ababab !important; +} +input::-moz-placeholder { /* Mozilla Firefox 19+*/ + color: #ababab !important; +} +input:-ms-input-placeholder { /* Internet Explorer 10+*/ + color: #ababab !important; +} +.flex-1 { + -webkit-box: 1; + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} +.flex { + display: box; /* OLD - Android 4.4- */ + display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */ + display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */ + display: -ms-flexbox; /* TWEENER - IE 10 */ + display: -webkit-flex; /* NEW - Chrome */ + display: flex; +} +.flex-ac { + -webkit-box-align: center; + -webkit-align-items: center; + -moz-align-items: center; + -ms-align-items: center; + -o-align-items: center; + align-items: center; +} +.flex-ae { + -webkit-box-align: end; + -webkit-align-items: flex-end; + -moz-align-items: flex-end; + -ms-align-items: flex-end; + -o-align-items: flex-end; + align-items: flex-end; +} +.flex-as { + -webkit-box-align: stretch; + -webkit-align-items: stretch; + -moz-align-items: stretch; + -ms-align-items: stretch; + -o-align-items: stretch; + align-items: stretch; +} +.flex-jcb { + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -moz-justify-content: space-between; + -ms-justify-content: space-between; + -o-justify-content: space-between; + justify-content: space-between; +} +.flex-jcs { + -webkit-box-pack: start; + -webkit-justify-content: flex-start; + -moz-justify-content: flex-start; + -ms-justify-content: flex-start; + -o-justify-content: flex-start; + justify-content: flex-start; +} +.flex-jce { + -webkit-box-pack: end; + -webkit-justify-content: flex-end; + -moz-justify-content: flex-end; + -ms-justify-content: flex-end; + -o-justify-content: flex-end; + justify-content: flex-end; +} +.flex-jcc { + -webkit-box-pack: center; + -webkit-justify-content: center; + -moz-justify-content: center; + -ms-justify-content: center; + -o-justify-content: center; + justify-content: center; +} +.flex-v { + -webkit-box-orient: vertical; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} +.flex-m { + -moz-box-lines: multiple; /*Firefox*/ + -webkit-box-lines: multiple; /*Safari,Opera,Chrome*/ + box-lines: multiple; + -webkit-flex-wrap: wrap; + -moz-flex-wrap: wrap; + flex-wrap: wrap; +} +.moves-enter-active, .moves-leave-active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition: all .3s linear; + transition: all .3s linear; +} +.moves-enter, .moves-leave-to /* .fade-leave-active in below version 2.1.8 */ { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); +} +.ups-enter-active, .ups-leave-active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition: all .3s linear; + transition: all .3s linear; +} +.ups-enter, .ups-leave-to /* .fade-leave-active in below version 2.1.8 */ { + -webkit-transform: translate3d(0, 100%, 0); + transform: translate3d(0, 100%, 0); +} +.downs-enter-active, .downs-leave-active { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + -webkit-transition: all .3s linear; + transition: all .3s linear; +} +.downs-enter, .downs-leave-to /* .fade-leave-active in below version 2.1.8 */ { + -webkit-transform: translate3d(0, -100%, 0); + transform: translate3d(0, -100%, 0); +} +.app-title { + height: 44px; + line-height: 44px; + color: #fff; + text-align: center; + margin: 0; + font-size: 16px; + background: #3ec2fc; +} +.app-title .back { + position: absolute; + top: 0; + left: 0; + height: 44px; + width: 44px; + display: flex; + justify-content: center; + align-items: center; + font-size: 22px; +} +.app-title .left-two { + position: absolute; + top: 0; + right: 40px; + height: 44px; + width: 45px; + display: flex; + justify-content: center; + align-items: center; + font-size: 22px; +} +.app-title .left-two .icon-cross { + font-size: 21px; +} +.input-info { + position: relative; + margin: 9px 10px; +} +.input-info input { + background: #fff; + border: none; + color: #ababab; + padding-left: 30px; + border-radius: 5px; + -webkit-transition: all .3s linear; + transition: all .3s linear; +} + +.input-info i { + position: absolute; + top: 7px; + left: 5px; + font-size: 23px; + color: #ababab; + -webkit-transition: all .3s linear; + transition: all .3s linear; +} +.title-info { + height: 44px; + font-size: 16px; + background: #fff; + border-bottom: 1px solid #e6e6e6; +} +.title-info .app-title { + color: #fff; +} +.right-top { + position: absolute; + top: 0; + height: 50px; + width: 30px; + display: flex; + justify-content: center; + align-items: center; + right: 10px; + font-size: 22px; + color: #fff; +} +.right-top.right-40 { + right: 40px; + width: 35px; +} +.right-top.right-75 { + right: 75px; + width: 35px; +} +.right-top .right-icon { + position: relative; + flex: 1; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} +.icon-position { + position: relative; +} +.right-top .right-icon .icon-cancel-circled { + position: absolute; + bottom: -1px; + right: -2px; + font-size: 12px; + color: #fff; + background: #d1001e; + border-radius: 100%; +} +/*加载动画*/ +.chromeframe { + margin: 0.2em 0; + background: #ccc; + color: #000; + padding: 0.2em 0; +} +#loader-wrapper, +#loader-wrapper-small { + position: absolute; + left: 0; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 199; +} +#loader-wrapper { + top: 50px; + bottom: 55px; +} +#loader-wrapper-small { + top: 0; + height: 50px; +} +.loader { + display: block; + width: 90px; + height: 90px; + border-radius: 50%; + border: 3px solid transparent; + /* COLOR 1 */ + border-top-color: #3ec2fc; + -webkit-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -ms-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -moz-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -o-animation: spin 2s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + animation: spin 2s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ + z-index:1001; +} +.loader-small { + top: 1px; + width: 30px; + height: 30px; +} +.loader:before { + content: ""; + position: absolute; + top: 5px; + left: 5px; + right: 5px; + bottom: 5px; + border-radius: 50%; + border: 3px solid transparent; + /* COLOR 2 */ + border-top-color: #3ec2fc; + -webkit-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -moz-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -o-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -ms-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + animation: spin 3s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ +} +.loader:after { + content: ""; + position: absolute; + top: 15px; + left: 15px; + right: 15px; + bottom: 15px; + border-radius: 50%; + border: 3px solid transparent; + border-top-color: #3ec2fc; + /* COLOR 3 */ + -moz-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -o-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -ms-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -webkit-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + animation: spin 1.5s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ +} +.loader-small:before { + content: ""; + position: absolute; + top: 1px; + left: 1px; + right: 1px; + bottom: 1px; + border-radius: 50%; + border: 3px solid transparent; + /* COLOR 2 */ + border-top-color: #3ec2fc; + -webkit-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -moz-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -o-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -ms-animation: spin 3s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + animation: spin 3s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ +} +.loader-small:after { + content: ""; + position: absolute; + top: 5px; + left: 5px; + right: 5px; + bottom: 5px; + border-radius: 50%; + border: 3px solid transparent; + border-top-color: #3ec2fc; + /* COLOR 3 */ + -moz-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -o-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -ms-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + -webkit-animation: spin 1.5s linear infinite; /* Chrome, Opera 15+, Safari 5+ */ + animation: spin 1.5s linear infinite; /* Chrome, Firefox 16+, IE 10+, Opera */ +} + +@-webkit-keyframes spin { + 0%{ + -webkit-transform: rotate(0deg); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: rotate(0deg); /* IE 9 */ + transform: rotate(0deg); /* Firefox 16+, IE 10+, Opera */ + }100%{ + -webkit-transform: rotate(360deg); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: rotate(360deg); /* IE 9 */ + transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */} +} + +@keyframes spin { + 0%{ + -webkit-transform: rotate(0deg); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: rotate(0deg); /* IE 9 */ + transform: rotate(0deg); /* Firefox 16+, IE 10+, Opera */ + }100%{ + -webkit-transform: rotate(360deg); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: rotate(360deg); /* IE 9 */ + transform: rotate(360deg); /* Firefox 16+, IE 10+, Opera */} +} + + +#loader-wrapper .loader-section { + position: absolute; + top: 0; + width: 51%; + height: 100%; + background: transparent; /* Old browsers */ + z-index: 1000; + -webkit-transform: translateX(0); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: translateX(0); /* IE 9 */ + transform: translateX(0); /* Firefox 16+, IE 10+, Opera */} +#loader-wrapper .loader-section.section-left {left: 0;} +#loader-wrapper .loader-section.section-right {right: 0;} + +/* Loaded */ +.loaded #loader-wrapper .loader-section.section-left { + height:100%; + -webkit-transform: translateX(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: translateX(-100%); /* IE 9 */ + transform: translateX(-100%); /* Firefox 16+, IE 10+, Opera */ + -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); + transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);} +.loaded #loader-wrapper .loader-section.section-right { + height:100%; + -webkit-transform: translateX(100%); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: translateX(100%); /* IE 9 */ + transform: translateX(100%); /* Firefox 16+, IE 10+, Opera */ + -webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000); + transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);} +.loaded .loader { + opacity: 0; + -webkit-transition: all 0.3s ease-out; + transition: all 0.3s ease-out;} +.loaded #loader-wrapper { + visibility: hidden; + -webkit-transform: translateY(-100%); /* Chrome, Opera 15+, Safari 3.1+ */ + -ms-transform: translateY(-100%); /* IE 9 */ + transform: translateY(-100%); /* Firefox 16+, IE 10+, Opera */ + -webkit-transition: all 0.3s 1s ease-out; + transition: all 0.3s 1s ease-out;} +/* JavaScript Turned Off */ +.no-js #loader-wrapper {display: none;} +.no-js h1 {color: #222222;} +#loader-wrapper .load_title { + font-family:'Open Sans'; + color:#625b7a; + font-size:16px; + width:100%; + text-align:center; + z-index:9999999999999; + margin-top: 10px; + line-height:30px; +} \ No newline at end of file diff --git a/app/src/main/assets/web/js/utils.js b/app/src/main/assets/web/js/utils.js index 23cb9c5..c1f618a 100644 --- a/app/src/main/assets/web/js/utils.js +++ b/app/src/main/assets/web/js/utils.js @@ -505,7 +505,7 @@ define(function(){ var flag = false; if ((version == 0 || (version == -1 && !this._isEmpty(name) && name.indexOf("MESH_") != -1))) { if (!this._isEmpty(beacon)) { - if (beacon == BEACON_MDF || beacon == BEACON_MAY) { + if (beacon == BEACON_MDF) { flag = true; } } else { diff --git a/app/src/main/java/aliyun/espressif/mesh/AliInitialize.java b/app/src/main/java/aliyun/espressif/mesh/AliInitialize.java index b62b124..a6e2ad2 100644 --- a/app/src/main/java/aliyun/espressif/mesh/AliInitialize.java +++ b/app/src/main/java/aliyun/espressif/mesh/AliInitialize.java @@ -40,7 +40,7 @@ public final class AliInitialize { private final static String TAG = "AliInitialize"; - private static final String APP_KEY = "26063463"; + public static final String APP_KEY = "26063463"; public static void initAliyun(Application application) { initAPi(application); @@ -148,7 +148,10 @@ public void onFail(Object o, ErrorInfo errorInfo) { } private static void initBoneMobile(Application application) { - String language = null; //语言环境,目前支持中文“zh-CN”, 英文"en-US",法文"fr-FR",德文"de-DE",日文"ja-JP",韩文"ko-KR",西班牙文"es-ES",俄文"ru-RU",八种语言 + //语言环境,目前支持中文“zh-CN”, 英文"en-US",法文"fr-FR",德文"de-DE",日文"ja-JP",韩文"ko-KR" + // ,西班牙文"es-ES",俄文"ru-RU",八种语言 + String language = null; + LocaleListCompat localeList = LocaleListCompat.getDefault(); for (int i = 0; i < localeList.size(); i++) { Locale locale = LocaleListCompat.getDefault().get(i); diff --git a/app/src/main/java/aliyun/espressif/mesh/activity/TaobaoAuthActivity.java b/app/src/main/java/aliyun/espressif/mesh/activity/TaobaoAuthActivity.java new file mode 100644 index 0000000..ce64655 --- /dev/null +++ b/app/src/main/java/aliyun/espressif/mesh/activity/TaobaoAuthActivity.java @@ -0,0 +1,124 @@ +package aliyun.espressif.mesh.activity; + +import android.content.Intent; +import android.content.pm.ActivityInfo; +import android.graphics.Bitmap; +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.view.ViewGroup; +import android.webkit.WebResourceRequest; +import android.webkit.WebView; +import android.webkit.WebViewClient; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +import aliyun.espressif.mesh.AliInitialize; +import aliyun.espressif.mesh.constants.AliConstants; +import h5.espressif.esp32.R; +import libs.espressif.app.AppUtil; + +public class TaobaoAuthActivity extends AppCompatActivity { + private ViewGroup mWebForm; + private WebView mWebView; + + private String mAuthCode; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + if (AppUtil.isPad(this)) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); + } else { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + } + setContentView(R.layout.taobao_auth_activity); + + mWebForm = findViewById(R.id.web_form); + mWebView = new WebView(getApplicationContext()); + int width = ViewGroup.LayoutParams.MATCH_PARENT; + int height = ViewGroup.LayoutParams.MATCH_PARENT; + ViewGroup.MarginLayoutParams mlp = new ViewGroup.MarginLayoutParams(width, height); + mWebForm.addView(mWebView, mlp); + mWebView.setWebViewClient(new WebViewClient() { + @Override + public void onPageStarted(WebView view, String url, Bitmap favicon) { + setTitle(view.getTitle()); + } + + @Override + public void onPageFinished(WebView view, String url) { + setTitle(view.getTitle()); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + String url = request.getUrl().toString(); + if (isTokenUrl(url)) { + finishWithAuthCode(); + return true; + } + view.loadUrl(url, request.getRequestHeaders()); + return true; + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + if (isTokenUrl(url)) { + finishWithAuthCode(); + return true; + } + view.loadUrl(url); + return true; + } + }); + + String redirectUri = getIntent().getStringExtra(AliConstants.KEY_REDIRECT_URI); + try { + redirectUri = URLEncoder.encode(redirectUri, "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + String url = "https://oauth.taobao.com/authorize?response_type=code&client_id=" + AliInitialize.APP_KEY + + "&redirect_uri=" + redirectUri + "&view=wap"; + mWebView.loadUrl(url); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + + mWebForm.removeView(mWebView); + mWebView.destroy(); + } + + private boolean isTokenUrl(String url) { + if (!TextUtils.isEmpty(url)) { + if ( url.contains("code=")) { + String[] urlArray = url.split("code="); + if (urlArray.length > 1) { + String[] paramArray = urlArray[1].split("&"); + if (paramArray.length > 1) { + mAuthCode = paramArray[0]; + Log.i("TaobaoAuth", "AuthCode= " + mAuthCode); + return true; + } + } + } + } + return false; + } + + private void finishWithAuthCode() { + Intent intent = new Intent(); + intent.putExtra(AliConstants.KEY_AUTH_CODE, mAuthCode); + setResult(RESULT_OK, intent); + finish(); + } + +} diff --git a/app/src/main/java/aliyun/espressif/mesh/constants/AliConstants.java b/app/src/main/java/aliyun/espressif/mesh/constants/AliConstants.java index 49f82fc..fb810b6 100644 --- a/app/src/main/java/aliyun/espressif/mesh/constants/AliConstants.java +++ b/app/src/main/java/aliyun/espressif/mesh/constants/AliConstants.java @@ -23,4 +23,8 @@ public interface AliConstants { String KEY_TOKEN = "token"; String KEY_PROPERTIES = "properties"; String KEY_VERSION = "version"; + + String KEY_APP_KEY = "appKey"; + String KEY_REDIRECT_URI = "redirect_uri"; + String KEY_AUTH_CODE = "authCode"; } diff --git a/app/src/main/java/h5/espressif/esp32/module/MeshApp.java b/app/src/main/java/h5/espressif/esp32/module/MeshApp.java index ac762c7..a1545c6 100644 --- a/app/src/main/java/h5/espressif/esp32/module/MeshApp.java +++ b/app/src/main/java/h5/espressif/esp32/module/MeshApp.java @@ -1,5 +1,7 @@ package h5.espressif.esp32.module; +import androidx.multidex.MultiDex; + import aliyun.espressif.mesh.AliInitialize; import iot.espressif.esp32.app.EspApplication; @@ -8,6 +10,7 @@ public class MeshApp extends EspApplication { @Override public void onCreate() { super.onCreate(); + MultiDex.install(this); // AliInitialize.initAliyun(this); } diff --git a/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJS.java b/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJS.java index 36db0f0..46f4566 100644 --- a/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJS.java +++ b/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJS.java @@ -724,4 +724,16 @@ public void postDataToMeshBLEDevice(String request) { mImpl.postDataToMeshBLEDevice(request); } + /** + * Set system status bar style + * @param request + { + "background":[red, green, blue, alpha] // red:[0 .. 255] green:[0 .. 255] blue:[0 .. 255] alpha:[0 .. 255] + "defaultStyle": true // true is white text, false is black text + } + */ + @JavascriptInterface + public void setStatusBar(String request) { + mImpl.setStatusBar(request); + } } diff --git a/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJSImpl.java b/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJSImpl.java index 027ad80..1b66159 100644 --- a/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJSImpl.java +++ b/app/src/main/java/h5/espressif/esp32/module/model/web/AppApiForJSImpl.java @@ -9,10 +9,12 @@ import android.content.SharedPreferences; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; +import android.graphics.Color; import android.os.Handler; import android.provider.Settings; import android.text.TextUtils; import android.util.Base64; +import android.view.View; import androidx.core.os.LocaleListCompat; @@ -2440,4 +2442,32 @@ void postDataToMeshBLEDevice(String request) { mMeshBLEClient.write(value); } + + void setStatusBar(String request) { + int r, g, b, a; + boolean defalutStyle; + + try { + JSONObject requestJSON = new JSONObject(request); + JSONArray rgba = requestJSON.getJSONArray("background"); + r = rgba.getInt(0); + g = rgba.getInt(1); + b = rgba.getInt(2); + a = rgba.getInt(3); + defalutStyle = requestJSON.optBoolean("defaultStyle", true); + } catch (JSONException e) { + e.printStackTrace(); + return; + } + + int styleFlags = defalutStyle ? View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE + : View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; + int bgColor = Color.argb(a, r, g, b); + mActivity.runOnUiThread(() -> { + mActivity.getWindow().getDecorView().setSystemUiVisibility(styleFlags); + mActivity.getWindow().setStatusBarColor(bgColor); + }); + + + } } diff --git a/app/src/main/res/layout/taobao_auth_activity.xml b/app/src/main/res/layout/taobao_auth_activity.xml new file mode 100644 index 0000000..428eee4 --- /dev/null +++ b/app/src/main/res/layout/taobao_auth_activity.xml @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/appmesh/build.gradle b/appmesh/build.gradle index 01cc4b0..20afa00 100644 --- a/appmesh/build.gradle +++ b/appmesh/build.gradle @@ -25,7 +25,6 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'androidx.multidex:multidex:2.0.1' implementation lib.material implementation lib.rxjava diff --git a/appmesh/src/main/java/iot/espressif/esp32/app/EspApplication.java b/appmesh/src/main/java/iot/espressif/esp32/app/EspApplication.java index a27aaca..a90e4d5 100644 --- a/appmesh/src/main/java/iot/espressif/esp32/app/EspApplication.java +++ b/appmesh/src/main/java/iot/espressif/esp32/app/EspApplication.java @@ -1,5 +1,6 @@ package iot.espressif.esp32.app; +import android.app.Application; import android.content.BroadcastReceiver; import android.content.Intent; import android.content.IntentFilter; @@ -7,7 +8,6 @@ import android.os.Environment; import androidx.localbroadcastmanager.content.LocalBroadcastManager; -import androidx.multidex.MultiDexApplication; import java.util.HashMap; import java.util.Random; @@ -15,7 +15,7 @@ import iot.espressif.esp32.db.box.MeshObjectBox; import libs.espressif.utils.RandomUtil; -public class EspApplication extends MultiDexApplication { +public class EspApplication extends Application { private static EspApplication instance; private final Object mCacheLock = new Object(); private HashMap mCacheMap; diff --git a/doc/api/AliyunApis_en.md b/doc/api/AliyunApis_en.md index 74620fc..094130f 100644 --- a/doc/api/AliyunApis_en.md +++ b/doc/api/AliyunApis_en.md @@ -15,6 +15,7 @@ Class [aliyun.espressif.mesh.IAliHelper](../../app/src/main/java/aliyun/espressi - Add code above build.gradle ``apply from: 'dependency.gradle'`` ## Initialize Apis +- Set your APP_KEY in AliInitialize.java ```java AliInitialize.initAliyun(Application); ``` @@ -22,4 +23,4 @@ AliInitialize.initAliyun(Application); ## Create IAliHelper instance ```java IAliHelper helper = new AliHelper(context); -``` \ No newline at end of file +``` diff --git a/doc/api/AliyunApis_zh_rCN.md b/doc/api/AliyunApis_zh_rCN.md index b77c3ff..75a5ae9 100644 --- a/doc/api/AliyunApis_zh_rCN.md +++ b/doc/api/AliyunApis_zh_rCN.md @@ -15,6 +15,7 @@ - 在 build.gradle 上方添加 ``apply from: 'dependency.gradle'`` ## 初始化 Api +- 在 AliInitialize.java 文件设置您的 APP_KEY ```java AliInitialize.initAliyun(Application); ``` @@ -22,4 +23,4 @@ AliInitialize.initAliyun(Application); ## 创建 IAliHelper 实例 ```java IAliHelper helper = new AliHelper(context); -``` \ No newline at end of file +``` diff --git a/log/updatelog-en.md b/log/updatelog-en.md index cc44939..b017047 100644 --- a/log/updatelog-en.md +++ b/log/updatelog-en.md @@ -1,5 +1,9 @@ # Update Log +## v1.1.0 +- Add Aliyun APIs +- Merge meshblufi module and apptools module into appmesh module + ## v1.0.7 - Optimize UI - Fix bugs diff --git a/log/updatelog-zh-rCN.md b/log/updatelog-zh-rCN.md index 057fdf6..8519092 100644 --- a/log/updatelog-zh-rCN.md +++ b/log/updatelog-zh-rCN.md @@ -1,5 +1,9 @@ # 更新记录 +## v1.1.0 +- 增加阿里云开发接口 +- 合并meshblufi模块和apptools模块到appmesh模块 + ## v1.0.7 - 优化界面 - 修复BUG