Commit 45bfd9f0 by wjd

Merge branch 'jianxiang' into 'master'

Jianxiang

See merge request iot-project-js/doorlock!57
parents 02ea3415 ffe01157
...@@ -24,5 +24,14 @@ ...@@ -24,5 +24,14 @@
<arguments>1.0-name-matches-false-false-node_modules</arguments> <arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher> </matcher>
</filter> </filter>
<filter>
<id>1514974720847</id>
<name></name>
<type>26</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-node_modules</arguments>
</matcher>
</filter>
</filteredResources> </filteredResources>
</projectDescription> </projectDescription>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
"iscroll": "5.2.0", "iscroll": "5.2.0",
"moment": "^2.18.1", "moment": "^2.18.1",
"qrcode": "^0.9.0", "qrcode": "^0.9.0",
"ugen-components": "^0.2.4", "ugen-components": "^0.3.1",
"underscore": "1.8.3", "underscore": "1.8.3",
"vue": "2.2.6", "vue": "2.2.6",
"vue-i18n": "5.0.3", "vue-i18n": "5.0.3",
......
class Barcode{
constructor() {
}
startQr(id,keyArrays,success,error){
console.log("开始扫描....");
this.scan = iot.navigator.barcode(id);
console.log(this.scan);
this.scan.start();
this.scan.onmarked = (type, result)=>{
if(result) {
let typeJson = this.formatUrlToJson(result);
let type = typeJson["type"];
let bool = this.isInArray(keyArrays,type);
if (bool) {
success(type);
}else{
error("当前扫描的二维码不和规范");
}
}
};
}
isInArray(arr,value){
for(var i = 0; i < arr.length; i++){
if(value === arr[i]){
return true;
}
}
return false;
}
formatUrlToJson(str){
console.log("测试字符串截取功能");
let index = str.indexOf("?");
let subStr = str.substr(index+1,str.length);
let subIndex = subStr.indexOf("=");
let keyStr = subStr.substr(0,subIndex);
console.log(keyStr);
let value = subStr.substr(subIndex+1,subStr.length);
let json = {};
json[keyStr] = value;
// alert(JSON.stringify(json));
return json;
}
}
export default new Barcode();
\ No newline at end of file
...@@ -22,30 +22,36 @@ export default { ...@@ -22,30 +22,36 @@ export default {
3: "powerAlarm" 3: "powerAlarm"
}, },
"hijackMode": { "hijackMode": {
20: "hijackingAlarm", 2: "hijackingAlarm",
20: "hijackingAlarm"
}, },
"model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK", "model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK",
"GET_MSG_INTERVAL": 5000, "GET_MSG_INTERVAL": 5000,
"wifi_add_timeout": 300000, "wifi_add_timeout": 150000,
"add_wifi_timeout": 90,
// "active_device_timeout": 30,
//门铃晃动间隔时间 //门铃晃动间隔时间
"await_time": 5000, "await_time": 3000,
//门铃晃动次数 //门铃晃动次数
"shake_times": 5, "shake_times": 3,
//门锁晃动总时间 //门锁晃动总时间
"ring_time": 30000, "ring_time": 12000,
"remote_opendoor_timeout": 30000, "remote_opendoor_timeout": 15000,
//二维码失效时间 //二维码失效时间
"qrcode_timeout": 600000, "qrcode_timeout": 600000,
"remote_timeout": 300, "remote_timeout": 120,
"input":{ "input":{
"maxlength": 16 "maxlength": 16
}, },
"password":{ "password":{
"maxlength": 6 "maxlength": 12,
"minlength": 6
}, },
"ringBell_timeout": 300, "pushMsg_timeout": 300,
"intervalTime": 3, "intervalTime": 3,
//小红点超时时间,24小时之前的新消息没有小红点提示
"newMsg_timeout": 86400,
"getHistoryTime": 10, "getHistoryTime": 10,
"audioUrl": "../../resources/audio/tipSound.mp3" "audioUrl": "../../resources/audio/tipSound.mp3",
// "audioUrl": "_www/resources/audio/tipSound.mp3" // "audioUrl": "_www/resources/audio/tipSound.mp3"
} }
\ No newline at end of file
export default { export default {
"url": "https://cloud.iot.u-gen.net/", // "url": "https://cloud.iot.u-gen.net/",
"model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK", "url": "http://192.168.2.96:20000",
// "model": "UGEN_SECURITY_SMARTDOOR_YJ2017"
"model": "USMARTLOCK_SECURITY_SMARTDOOR_SMART_LOCK"
} }
\ No newline at end of file
import androidNotify from '../view/c_android-notify.vue';
import gridList from '../view/c_grid-list.vue'; import gridList from '../view/c_grid-list.vue';
import timeline from '../view/c_timeline.vue'; import timeline from '../view/c_timeline.vue';
import updateApp from '../view/c_update-app.vue';
var components = { var components = {
'android-notify': androidNotify,
'grid-list': gridList, 'grid-list': gridList,
'timeline': timeline 'timeline': timeline,
'update-app': updateApp
}; };
export default components; export default components;
\ No newline at end of file
import config from './config.js'; import config from './config.js';
import VueI18n from 'vue-i18n'; import VueI18n from 'vue-i18n';
import defaultConfig from './defaultConfig.js'; import defaultConfig from './defaultConfig';
var VueTouch = require('vue-touch'); var VueTouch = require('vue-touch');
Vue.use(VueTouch); Vue.use(VueTouch);
...@@ -20,11 +20,11 @@ const iot = new UIOT({ ...@@ -20,11 +20,11 @@ const iot = new UIOT({
cloud: { cloud: {
// url: 'http://wx.iotface.com' // url: 'http://wx.iotface.com'
//96环境 //96环境
// url: 'http://192.168.2.96:20000' url: defaultConfig.url
//96外网 //96外网
// url: 'http://jycinema.u-gen.net' // url: 'http://jycinema.u-gen.net'
//正式 //正式
url: defaultConfig.url // url: 'https://cloud.iot.u-gen.net/'
//正式测试 //正式测试
// url: 'https://cloud.iot.u-gen.net/test-openapi/' // url: 'https://cloud.iot.u-gen.net/test-openapi/'
}, },
...@@ -81,7 +81,7 @@ uPublic.checkResponseData = function (data) { ...@@ -81,7 +81,7 @@ uPublic.checkResponseData = function (data) {
} else { } else {
return data; return data;
} }
// array // array
} else if (Array.isArray(data)) { } else if (Array.isArray(data)) {
if (data.length > 0) { if (data.length > 0) {
return data; return data;
...@@ -91,6 +91,16 @@ uPublic.checkResponseData = function (data) { ...@@ -91,6 +91,16 @@ uPublic.checkResponseData = function (data) {
} }
}; };
// 检查输入文字是否含有特殊字符
uPublic.checkString = function (text){
var pattern = new RegExp("[~!@#$%^&*()_+=|\?/{}<>:;'`]+");
if(!pattern.test(text)){
return false
}else{
return true;
}
}
uPublic.openWindow = function (params){ uPublic.openWindow = function (params){
console.log("innnnn"); console.log("innnnn");
var wv = plus.webview.create(params.url, params.id, {styles: params.styles || {} }, { IOTData: params.extras }); var wv = plus.webview.create(params.url, params.id, {styles: params.styles || {} }, { IOTData: params.extras });
...@@ -148,6 +158,42 @@ uPublic.logout = function(opts){ ...@@ -148,6 +158,42 @@ uPublic.logout = function(opts){
}); });
} }
// 更新缓存中history存储的isReadFlag 和 time
uPublic.upDateRead = async function(key, time){
let oldHistory = {
alarm: {
time: null,
isReadFlag: true
},
notify: {
time: null,
isReadFlag: true
},
open: {
time: null,
isReadFlag: true
}
};
try{
let history = await iot.storage.getMap('history');
oldHistory = history ? history : oldHistory;
console.log(oldHistory);
}
catch (error){
console.log(error);
}
let newHistory = oldHistory;
newHistory[key].isReadFlag = true;
newHistory[key].time = time;
let flag = await iot.storage.setMap('history', newHistory);
if(flag){
return false;
}
}
iot.ready(() => { iot.ready(() => {
uPublic.recalc(); uPublic.recalc();
}); });
...@@ -276,163 +322,4 @@ iot.navigator.getCurrentWebView = function (){ ...@@ -276,163 +322,4 @@ iot.navigator.getCurrentWebView = function (){
return plus.webview.currentWebview(); return plus.webview.currentWebview();
} }
//function requestsend(url, opts, i){
// let data = [0,0,0,0,0,0,0,1,0,0,0];
// opts.success(data[i]);
//}
//
//function clearTime(interval, timeout){
// window.clearInterval(interval);
// window.clearTimeout(timeout);
//}
//
//function sendRequest(url, params, canSend){
// var opts = {
// type: 'post',
// data: params.data,
// success: params.success,
// error: params.error,
// complete: params.complete
// };
// canSend = false;
// requestsend(url, {
// type: 'post',
// data: {
// params.data
// },
// success: (response) => {
// intervalcb.success(response);
// if(stopcondition(response)){
// params.success(response);
// clearTime(handle, time);
// canSend = false;
// }else{
// canSend = true;
// }
// },
// error: (error) => {
// intervalcb.error(error);
// //在intervalcb.error(error)中返回的如果是true则继续执行,否则结束轮询
// if(intervalcb.error(error)){
// canSend = true;
// }else{
// params.error(error);
// clearTime(handle, time);
// }
// },
// complete: {}
// }, true, false);
// return canSend;
//}
//
//uComponents.loop = function(request, timeout, interval, fincb, stopcondition){
// var handle = null;
// var time = null;
// var url = request.url;
// var opts = request.opts;
// var intervalTime = interval.delay;
// var intervalcb = interval.opts;
// var flag = true;
// var canSend = true;
// var canDo = true;
// var i = 0;
// time = setTimeout(function(){
// clearTime(handle, time);
// fincb.error('timeout');
// },timeout);
// var watcher = setInterval(function(){
// if(canSend && canDo){
// var send = sendRequest(url, opts, canSend, canDo);
// }
// },1000);
// //一开始执行一次,发送一次请求
// requestsend(url, {
// data: {},
// success: (response) => {
// intervalcb.success(response);
// if(stopcondition(response)){
// //首次请求结果符合条件的话,结束整个方法
// fincb.success(response);
// clearTime(handle, time);
// }else{
// //首次请求结果不符合条件的话,每隔intervalTime时间发送请求
// handle = setInterval(() => {
// i++;
// console.log(i);
// if(flag){
// flag = false;
// requestsend(url, {
// data: {},
// success: (response) => {
// intervalcb.success(response);
// if(stopcondition(response)){
// fincb.success(response);
// clearTime(handle, time);
// }
// flag = true;
// },
// error: (error) => {
// if(intervalcb.error(error)){
// flag = false;
// }else{
// fincb.error(error);
// clearTime(handle, time);
// }
// },
// complete: {}
// }, i);
// }
// },intervalTime);
// }
// },
// error: (error) => {
// intervalcb.error(error);
// fincb.error(error);
// clearTime(handle, time);
// },
// complete: {}
// }, 0);
//
//}
//
////传递的参数依次是:
////1.request: 请求参数(数据类型: map,包括:url、header等);
////2.timeout: 整个方法的超时时间;
////3.interval: 发送请求的间隔时间、callback;
////4.fincb: 整个方法的callback;
////5.stopcondition: 请求停止所要符合的条件
//uComponents.loop({url:'getLockInfo',opts: {
// success: (response) => {
// console.log(response);
// },
// error: (error) => {
// console.log(error);
// }
//}}, 8000, {
// delay: 1000,
// opts: {
// success: (response) => {
// console.log('intervalcbSuccess:'+response);
// },
// error: (error) => {
// console.log('intervalcbSuccess:'+error);
// }
// }
//}, {
// success: (response) => {
// console.log('fincbSuccess:'+response);
// },
// error: (error) => {
// console.log('fincbError'+error);
// }
//}, (response) => {
// if(response == 1){
// return true;
// }else{
// return false;
// }
//});
export {iot, uPublic, uComponents} export {iot, uPublic, uComponents}
\ No newline at end of file
import {iot, uPublic, uComponents} from './public.js';
class Request{
constructor(json) {//当前版本号、最新版本号以及获取最新安装包地址
}
versionRequest(url,need,notneed){
this.getDownloadUrl(url,need,notneed);
}
getDownloadUrl(url,need,notneed){
let type = null;
if (iot.navigator.osName() == "iOS") {
type = "ios";
}else{
type = "android";
}
iot.business.api.send(url,
{
data: {
type:type
},
success: (response) => {
console.log(response);
if (response.code == 0) {
this.dealWithVersion(response,need,notneed);
}
},
error: (error) => {
console.log(error);
notneed(error);
},
complete: () => {}
},false);
}
dealWithVersion(response,need,notneed){
let type = null;
if (iot.navigator.osName() == "iOS") {
type = "ios";
}else{
type = "android";
}
let info = null;
if (type == "ios") {
info = response.data["ios"];
}else{
info = response.data["android"];
}
console.log(info);
let newVersion = info.version;// 新版本 无论是安卓还是iOS都用此变量存储
let downloadUrl = info.url;
let backinfo = {
url:downloadUrl,
version:newVersion
};
need(backinfo);
}
}
export default new Request();
\ No newline at end of file
/**
* @class
* loop
*/
//轮询通用方法:http://116.62.143.3:10080/iot-project-js/doorlock/issues/1
class Loop{
constructor(params) {
this.handle = null;
this.watcher = null;
this.time = null;
this.loopContent = params.loopContent;
this.times = params.times || 10;
this.fincb = params.fincb;
this.intervalTime = params.interval.delay;
this.intervalcb = params.interval.cb;
this.stopcondition = params.stopcondition;
this.canSend = true;
this.canDo = true;
this.i = 0;
}
clearTime(){
clearInterval(this.handle);
clearInterval(this.watcher);
clearTimeout(this.time);
}
async sendRequest(){
this.canSend = false;
try{
var response = null;
response = await this.loopContent();
console.log(response);
if(await this.stopcondition(response)){
if(this.fincb!= null){
this.fincb.success(response);
this.fincb.complete();
}
this.clearTime();
this.canSend = false;
}else{
if(this.intervalcb!= null){
this.intervalcb.success(response);
}
this.canSend = true;
}
}
catch (error){
if(this.intervalcb!= null){
if(this.intervalcb.error(error)){
this.canSend = true;
}else{
if(this.fincb!= null){
this.fincb.error(error);
this.fincb.complete();
this.clearTime();
}
}
}
}
}
start(){
console.log("开始");
console.log("第"+this.i+"次发送了请求");
console.log("发送时间"+new Date().getTime());
this.i++;
this.sendRequest();
this.watcher = setInterval(() => {
if(this.canSend && this.canDo){
this.canDo = false;
console.log("第"+this.i+"次发送了请求");
console.log("发送时间"+new Date().getTime());
this.i++;
this.sendRequest();
}
},1000);
let times = 1;
this.handle = setInterval(() => {
times++;
console.log('times'+times);
if(times > this.times){
this.clearTime();
this.canDo = false;
this.fincb.error('timeout');
this.fincb.complete();
this.intervalcb = null;
this.fincb = null;
}else{
this.canDo = true;
}
},this.intervalTime);
}
}
export default Loop;
...@@ -2,100 +2,101 @@ ...@@ -2,100 +2,101 @@
* @class * @class
* unotify * unotify
*/ */
import uloop from './uloop';
//获取cid: http://116.62.143.3:10080/iot-project-js/doorlock/issues/4
class unotify{ class unotify{
//在一个周期内获取cid //在一个周期内获取cid
static async getCid(successCallback, errorCallback){ static getCid(successCallback, errorCallback){
var cid = null; this.UpdateCid((response) => {
try{ successCallback(response);
//利用promise,直到执行完代码再获取cid }, (error) => {
cid = await this.getCidPeriotic(3); errorCallback(error);
//获取后,在缓存中存储cid });
if(typeof successCallback == 'function'){
iot.storage.setMap('clientId', cid, (res) => {
console.log("已成功保存cid"+cid);
successCallback(cid);
}, () => {
});
}
}
catch (err){
console.log(err);
if(typeof errorCallback == 'function'){
errorCallback(a);
}
}
} }
//周期性获取cid,周期可调整 //周期性获取cid,周期可调整
static getCidPeriotic(times){ static getCidPeriotic(times){
var self = this; var self = this;
return new Promise(function(resolve, reject){ return new Promise(function(resolve, reject){
var i = 0; new uloop({
var cid = null; loopContent: () => {
var handle = null; return self.getCidOnce();
i++; },
cid = self.getCidOnce(i); times: times,
console.log("第"+i+"次"+"获取的cid为"+cid); interval:{
if(cid != null && cid != 'null' || i >= times){ delay: 1000,
window.clearInterval(handle); cb: {
resolve(cid); success: (response) => {
}else{ console.log('intervalcbSuccess:'+JSON.stringify(response));
handle = setInterval(function(){ },
i++; error: (error) => {
cid = self.getCidOnce(i); console.log('intervalcbError:'+JSON.stringify(error));
console.log("第"+i+"次"+"获取的cid为"+cid); }
if(cid != null && cid != 'null' || i >= times){
window.clearInterval(handle);
resolve(cid);
} }
},1000); },
} fincb: {
success: (response) => {
console.log('fincbSuccess:'+JSON.stringify(response));
resolve(response);
},
error: (error) => {
console.log('fincbSuccess:'+JSON.stringify(error));
if(error == 'timeout'){
resolve(null);
}
},
complete: () => {}
},
stopcondition: async (response) => {
if(response != null && response != 'null' ){
return true;
}
}
}).start();
}); });
} }
//单次获取cid //单次获取cid
static getCidOnce(i){ static getCidOnce(){
var clientInfo = plus.push.getClientInfo(); var clientInfo = plus.push.getClientInfo();
if(clientInfo && clientInfo.hasOwnProperty('clientid') && clientInfo.clientid){ if(clientInfo && clientInfo.hasOwnProperty('clientid') && clientInfo.clientid){
// if(i == 6){ return(clientInfo.clientid);
return(clientInfo.clientid);
// }else{
// return(null);
// }
}else{ }else{
return(null); return(null);
} }
} }
//长期不断循环获取cid,并更新cid //长期不断循环获取cid,并更新cid
// static async getCid(successCallback, errorCallback){ static async UpdateCid(successCallback, errorCallback){
// var cid = null; var cid = null;
// var oldCid = null; var oldCid = null;
// try{ try{
// cid = await this.getCidPeriotic(9); cid = await this.getCidPeriotic(999);
// if(cid != null && cid != oldCid){ if(cid != null && cid != oldCid){
// successCallback('cid updateSuccess'); iot.business.api.send('user/updateCid',{
// iot.business.api.send('user/updateCid',{ data: {
// data: { clienId: cid
// clienId: cid },
// }, success: (response) => {
// success: (response) => { console.log(response);
// if(typeof successCallback == 'function'){ if(typeof successCallback == 'function'){
// uccessCallback('cid updateSuccess'); successCallback('cid updateSuccess');
// } }
// }, },
// error: (error) => { error: (error) => {
// console.log(error); console.log(error);
// errorCallback(error); errorCallback(error);
// } }
// }, true, false); }, true, false);
// }else{ }else{
// successCallback('cid not updated'); successCallback('cid not updated');
// } }
// } }
// catch (err){ catch (err){
// console.log(err); console.log(err);
// if(typeof errorCallback == 'function'){ if(typeof errorCallback == 'function'){
// errorCallback(err); errorCallback(err);
// } }
// } }
// } }
} }
export default unotify; export default unotify;
\ No newline at end of file
...@@ -13,7 +13,7 @@ iot.ready(init); ...@@ -13,7 +13,7 @@ iot.ready(init);
function init() { function init() {
//通用 dialog、loading组件 //通用 dialog、loading组件
uPublic.componentsInit(['u-dialog','u-loading']); uPublic.componentsInit(['u-dialog','u-loading']);
uPublic.closeSlideBack(); // uPublic.closeSlideBack();
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
...@@ -61,18 +61,11 @@ function backTap(){ ...@@ -61,18 +61,11 @@ function backTap(){
//tap 扫描绑定设备 //tap 扫描绑定设备
function scanAddTap(){ function scanAddTap(){
// iot.navigator.openWindow({ iot.navigator.openWindow({
// url: './scanCodeAdd.html',
// id: 'scanCodeAdd'
// });
mui.openWindow({
url: './scanCodeAdd.html', url: './scanCodeAdd.html',
id: 'scanCodeAdd', id: 'scanCodeAdd',
show: { show: {
aniShow: "none" aniShow: "none"
},
waiting: {
autoShow: false
} }
}); });
} }
......
...@@ -13,7 +13,7 @@ iot.ready(init); ...@@ -13,7 +13,7 @@ iot.ready(init);
function init() { function init() {
//通用 按钮、dialog、loading组件 //通用 按钮、dialog、loading组件
uPublic.componentsInit(['u-button','u-dialog','u-loading']); uPublic.componentsInit(['u-button','u-dialog','u-loading']);
uPublic.closeSlideBack(); // uPublic.closeSlideBack();
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
...@@ -79,15 +79,4 @@ function wifiAddButtonTap(){ ...@@ -79,15 +79,4 @@ function wifiAddButtonTap(){
url: './wifiAdd.html', url: './wifiAdd.html',
id: 'wifiAdd' id: 'wifiAdd'
}); });
console.log("in");
// iot.business.sds.wifiDeviceConfig({
// success: function (response) {
// console.log('wifiDeviceConfig success');
// console.log(response);
// },
// error: function (error) {
// console.log('wifiDeviceConfig error');
// console.log(error);
// }
// });
} }
\ No newline at end of file
/**
* newnotify-dialog.vue
* Version: 0.1
* User: wujie
* Date: 2017-12-26
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* newnotify-dialog
*
******************************************************************************
* 依赖
通知栏插件 isNotifycationOpen toNotifycationSetting
多语言 需要配置多语言
* 支持环境
App
*
*/
<template>
<div id="app" v-cloak>
<div class="header">
<p>开启通知</p>
</div>
<div class="content">
<ul class="u-android-notify">
<li class="u-android-notify-row" v-bind:class = "setp1Active">
<span class="u-android-notify-icon">&#xe6c1;</span>
<span class="u-android-notify-finish-icon" v-show="isStep1Finish"></span>
<div class="u-android-notify-title">
{{toSettingTitle}}
<v-touch tag="div" class="u-android-notify-button" v-show="isToSetting" v-on:tap="onOpenNotify">{{toSettingsub}}
<span></span></v-touch>
</div>
</li>
<li class="u-android-notify-row" v-bind:class = "setp2Active">
<span class="u-android-notify-icon">&#xe6c0;</span>
<span class="u-android-notify-finish-icon" v-show="isStep2Finish"></span>
<div class="u-android-notify-title">
{{checkSetting}}
<v-touch tag="div" class="u-android-notify-button" v-show="isKnow" v-on:tap="onIKnow">{{IKonw}}</v-touch>
</div>
<div class="u-android-notify-tip">{{checkSettingsubTitle}}</div>
<div class="u-android-notify-subtitle">{{step1Title}}</div>
<div class="u-android-notify-subcontent">{{step1content}}</div>
<div class="u-android-notify-subtitle">{{step2Title}}</div>
<div class="u-android-notify-subcontent">{{step2content}}</div>
<div class="u-android-notify-subtitle">{{step3Title}}</div>
<div class="u-android-notify-subcontent">{{step3content}}</div>
</li>
<li class="u-android-notify-row" v-bind:class = "setp3Active">
<span class="u-android-notify-icon">&#xe6c2;</span>
<span class="u-android-notify-finish-icon" v-show="isStep3Finish"></span>
<div class="u-android-notify-title">
{{endSetting}}
<v-touch tag="div" class="u-android-notify-button" v-show="isToIndex" v-on:tap="onToIndex">{{toAppIndex}}
<span></span></v-touch>
</div>
</li>
</ul>
</div>
</div>
</template>
<script>
export default {
props: ['initParam','toIndex'],
data () {
return {
toSettingTitle:Vue.t('androidNotify.toSettingTitle'),
toSettingsub:Vue.t('androidNotify.toSettingsub'),
checkSetting:Vue.t('androidNotify.checkSetting'),
IKonw:Vue.t('androidNotify.IKonw'),
checkSettingsubTitle:Vue.t('androidNotify.checkSettingsubTitle'),
step1Title:Vue.t('androidNotify.step1Title'),
step1content:Vue.t('androidNotify.step1content'),
step2Title:Vue.t('androidNotify.step2Title'),
step2content:Vue.t('androidNotify.step2content'),
step3Title:Vue.t('androidNotify.step3Title'),
step3content:Vue.t('androidNotify.step3content'),
endSetting:Vue.t('androidNotify.endSetting'),
toAppIndex:Vue.t('androidNotify.toIndex'),
//notifyState:false, // 当前是否开启了通知
//gotoIndex:this.toIndex,// 处理点击到index按钮事件
//isKnow:iot.native.isNotifycationOpen(),//是否需要显示 我已阅读
//isToIndex:false,// 是否需要显示去首页按钮
isStep1Finish:iot.native.isNotifycationOpen(),//是否需要显示步骤1的勾
isStep2Finish:false,//是否需要显示步骤2的勾
isStep3Finish:false,//是否需要显示步骤3的勾
isToSetting:!iot.native.isNotifycationOpen(),//是否需要显示去设置按钮
setp1Active:null,
setp2Active:null,// 默认为灰色 不显示active
setp3Active:null,
notifyState:false, // 当前是否开启了通知
gotoIndex:this.toIndex,// 处理点击到index按钮事件
isKnow:iot.native.isNotifycationOpen(),//是否需要显示 我已阅读
isToIndex:false,// 是否需要显示去首页按钮
}
},
mounted: function () {
this.setp1Active=this.isStep1Finish?"active changeBorder":null;
this.setp2Active=this.isStep1Finish?"active changeBorder":null;
console.log("notifyState:"+iot.native.isNotifycationOpen());
onTest(this);
// 监听程序恢复前台
document.addEventListener("resume", ()=>{
onAppReume(this);
}, false);
},
watch: {
},
methods: {
// 点击按钮关闭弹出框
onOpenNotify(){
openNotify(this);
},
onIKnow(){
IKonw(this);
},
onToIndex(){
toIndex(this);
}
}
};
function onTest(self){
console.log(self.isStep1Finish);
console.log(self.setp2Active);
}
function openNotify(self) {
console.log("去开启");
iot.native.toNotifycationSetting("notify");
self.setp1Active = 'active changeBorder';
}
function IKonw(self){
console.log("点击了我已阅读");
self.isStep2Finish = true; // 点击阅读后显示步骤2的勾
// self.setp2Active = "active changeBorder";// 点击阅读后显示步骤2的字体亮度调高
self.setp3Active = "active";// 同时步骤3的字体亮度也调高
self.isStep3Finish = true; // 步骤3的勾勾选
self.isToIndex = true;//显示去首页按钮
self.isKnow = false; // 点击我已阅读隐藏我已阅读按钮
}
function toIndex(self){
console.log("gotoIndex...");
self.gotoIndex();
}
function onAppReume(self){
let notifyState = iot.native.isNotifycationOpen();
console.log("notifyState:"+notifyState);
if (notifyState) {
self.setp2Active = "active changeBorder";
}else{// 恢复默认
self.setp2Active = null;
self.setp3Active = null;
self.isStep2Finish = false;
self.isStep3Finish = false;
self.isToIndex = false;
}
self.isStep1Finish = iot.native.isNotifycationOpen();// 再次判断当前通知是否开启
self.isToSetting = !iot.native.isNotifycationOpen(); // 再次判断是否需要显示去设置按钮
self.isKnow = iot.native.isNotifycationOpen(),// 再次判断是否需要显示 我已阅读
self.$nextTick(function () {
console.log("重新渲染");
});
}
</script>
/**
* app-update.vue
* Version: 0.1
* User: wujie
* Date: 2018-01-08
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* app-update
*
******************************************************************************
* 依赖
* 支持环境
App
*
*/
<template>
<div>
</div>
</template>
<script>
/**
* @vue
* @name notify-dialog 通知栏弹出框组件
* @author wj
* @version 0.1
* @copyright 2018. U-GEN Tech.Co,Ltd. All Rights Reserved.
* @property {String} url -请求应用版本信息的接口地址
* @property {String} showFlag -是否检查版本更新
* @example <u-app-update :show-flag="true"> </u-app-update>
*/
export default {
props: ['showFlag'],
data () {
return {
reqUrl:"device/getVersion",
isNeedShow:this.showFlag?this.showFlag:true
}
},
mounted: function () {
console.log(this.showFlag);
this.onCheckVersion();
},
watch: {
},
methods: {
onCheckVersion(){
checkVersion(this);
}
}
};
function checkVersion(self){
console.log(self.reqUrl);
console.log("是否需要进行版本更新检查:"+self.isNeedShow);
if (!self.showFlag) return;
console.log("检查版本...");
let type = null;
if (plus.os.name == "iOS") {
type = "ios";
}else{
type = "android";
}
iot.business.api.send(self.reqUrl,
{
data: {
"type":type
},
success: (response) => {
console.log(response);
if (response.code == 0) {
dealWithVersion(self,response,type);
}
},
error: (error) => {
console.log(error);
},
complete: () => {}
},false);
}
function dealWithVersion(self,response,type){
var v = plus.runtime.version;
var curVersion = transformVersion(v);
let newVersion = response.data[type].version;// 新版本 无论是安卓还是iOS都用此变量存储
newVersion = transformVersion(newVersion);
let downloadUrl = response.data[type].url;// 下载地址 无论是安卓还是iOS都用此变量存储
console.log("curVersion:"+curVersion);
console.log("newVersion:"+newVersion)
console.log(curVersion);
console.log(newVersion);
if(Number(newVersion) > Number(curVersion)){
console.log("有新版本更新");
plus.nativeUI.confirm( Vue.t('newFeature.newVersion'), (e)=>{
console.log("Close confirm: "+e.index);
if (e.index == 0) {// 点击了确定按钮
plus.runtime.openURL(downloadUrl);
}else if (e.index == 1) {// 点击了取消按钮
}
},Vue.t('newFeature.tip'), [Vue.t('newFeature.update'),Vue.t('newFeature.miss')] );
}else{
console.log("不需要更新版本");
}
}
// 将系统版本转换为可读写版本
function transformVersion(v){
var array = v.split(".");
var floatVersion = "";
console.log("下面是获取系统版本");
console.log(array);
if(array.length>2){
for (var i = 0; i < array.length; i++) {
if(i == 1){
floatVersion = floatVersion + ".";
}
floatVersion = floatVersion + array[i];
}
}else{
floatVersion = v;
}
if(isNaN(floatVersion)){
return null;
}
return floatVersion;
}
</script>
...@@ -23,10 +23,16 @@ function init() { ...@@ -23,10 +23,16 @@ function init() {
list:[], list:[],
startId: 0, startId: 0,
deviceId: null, deviceId: null,
flag: true flag: true,
noticeTipShowFlag: false
}, },
mounted(){ mounted(){
uComponents.showLoading(this);
this.noticeTipShowFlag = !iot.native.isNotifycationOpen();
resolve(this); resolve(this);
window.addEventListener('returnPage',() => {
this.noticeTipShowFlag = !iot.native.isNotifycationOpen();
});
}, },
methods:{ methods:{
getList(){ getList(){
...@@ -47,8 +53,15 @@ function init() { ...@@ -47,8 +53,15 @@ function init() {
setDeviceId(id){ setDeviceId(id){
this.deviceId = id; this.deviceId = id;
}, },
onListLoadTap(){ //tap 点击加载更多
listLoadTap(this); onListLoad(){
listLoad(this);
},
onRefreshFresh(){
refreshFresh(this);
},
onNotifycationSetting(){
notifycationSetting();
}, },
//tap < //tap <
onBackTap(){ onBackTap(){
...@@ -66,7 +79,8 @@ function initComponentsConfig() { ...@@ -66,7 +79,8 @@ function initComponentsConfig() {
class: 'custom-list', class: 'custom-list',
list: [], list: [],
tip: Vue.t('alarmInfo.noInfoTip'), tip: Vue.t('alarmInfo.noInfoTip'),
pagesize: PAGE_SIZE pagesize: PAGE_SIZE,
pullup: true
} }
}, },
dialog: { dialog: {
...@@ -78,77 +92,70 @@ function initComponentsConfig() { ...@@ -78,77 +92,70 @@ function initComponentsConfig() {
initParam: { initParam: {
class: 'custom-loading' class: 'custom-loading'
} }
} }
} }
} }
function resolve(self) { // 获取历史记录
self.setDeviceId(iot.navigator.getExtras().deviceId); function resolve(self) {
uComponents.showLoading(self); self.setDeviceId(iot.navigator.getExtras().deviceId);
iot.business.api.sendCustom('lock/getHistoryRecord', // uComponents.showLoading(self);
{ iot.business.api.sendCustom('lock/getHistoryRecord',
data: { {
device_id: self.getDeviceId(), data: {
action: 2, device_id: self.getDeviceId(),
start_id: self.getStartId(), action: 2,
page_size: PAGE_SIZE start_id: self.getStartId(),
}, page_size: PAGE_SIZE,
success: (response) => { pullUpLoading: true
console.log(response); },
if(self.flag){ success: async (response) => {
let data = uPublic.checkResponseData(response.data); console.log(response);
if(data && data.record.length > 0){ if(self.flag){
let record = data.record;
iot.storage.setMap('notifyTime', moment(record[0].time).toISOString(), (res) => {
console.log(res);
self.flag = false;
}, () => {
});
}
}
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data && data.record.length > 0){
let list = [];
let record = data.record; let record = data.record;
for(let i=0; i<record.length; i++){ self.flag = await uPublic.upDateRead('notify', moment(record[0].time).unix());
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_alarmInfo'+record[i].mode+'_icon.png',
subtitle: Vue.t('alarmInfo.'+config.alarmMode[record[i].mode]+''),
rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
};
}
self.setList(self.getList().concat(list));
if(record.length > 0){
self.setStartId(record[record.length-1].id);
}
//更新列表数据
uComponents.changeList(self, self.getList());
}else{
} }
uComponents.hideLoading(self);
},
error: (error) => {
console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 获取报警信息失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'获取报警信息失败');
// }
uPublic.openRequestErrorAlert(self);
},
complete: () => {
uComponents.hideLoading(self);
} }
}); let data = uPublic.checkResponseData(response.data);
} if(data){
let list = [];
let record = data.record;
for(let i=0; i<record.length; i++){
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_alarmInfo'+record[i].mode+'_icon.png',
subtitle: Vue.t('alarmInfo.'+config.alarmMode[record[i].mode]+''),
rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
};
}
self.setList(self.getList().concat(list));
if(record.length > 0){
self.setStartId(record[record.length-1].id);
}
//更新列表数据
uComponents.changeList(self, self.getList());
}else{
}
uComponents.hideLoading(self);
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.aback(); iot.navigator.aback();
} }
//重写mui.back
mui.back = function(){ mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{}); iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("fire"); console.log("fire");
...@@ -156,6 +163,23 @@ mui.back = function(){ ...@@ -156,6 +163,23 @@ mui.back = function(){
} }
//tap 点击加载更多 //tap 点击加载更多
function listLoadTap(self) { function listLoad(self) {
resolve(self); resolve(self);
} }
\ No newline at end of file
//ios跳转到系统设置页面
//android跳转到通知页面
function notifycationSetting(){
if(plus.os.name == 'Android'){
// alert("打开通知页面");
iot.navigator.openWindow({
url: './notify.html',
id: 'notify',
styles: {
popGesture: 'none'
}
});
}else{
iot.native.toNotifycationSetting();
}
}
...@@ -25,10 +25,16 @@ function init() { ...@@ -25,10 +25,16 @@ function init() {
startId: 0, startId: 0,
deviceId: null, deviceId: null,
userInfo: [], userInfo: [],
flag: true flag: true,
noticeTipShowFlag: false
}, },
mounted(){ mounted(){
uComponents.showLoading(this);
this.noticeTipShowFlag = !iot.native.isNotifycationOpen();
resolve(this); resolve(this);
window.addEventListener('returnPage',() => {
this.noticeTipShowFlag = !iot.native.isNotifycationOpen();
});
}, },
methods:{ methods:{
getList(){ getList(){
...@@ -55,8 +61,14 @@ function init() { ...@@ -55,8 +61,14 @@ function init() {
setUserInfo(info){ setUserInfo(info){
this.userInfo = info; this.userInfo = info;
}, },
onListLoadTap(){ onListLoad(){
listLoadTap(this); listLoad(this);
},
onRefreshFresh(){
refreshFresh(this);
},
onNotifycationSetting(){
notifycationSetting();
}, },
//tap < //tap <
onBackTap(){ onBackTap(){
...@@ -74,7 +86,8 @@ function initComponentsConfig() { ...@@ -74,7 +86,8 @@ function initComponentsConfig() {
class: 'custom-list', class: 'custom-list',
list: [], list: [],
tip: Vue.t('hijackRecord.noRecordTip'), tip: Vue.t('hijackRecord.noRecordTip'),
pagesize: PAGE_SIZE pagesize: PAGE_SIZE,
pullup: true
} }
}, },
dialog: { dialog: {
...@@ -86,13 +99,13 @@ function initComponentsConfig() { ...@@ -86,13 +99,13 @@ function initComponentsConfig() {
initParam: { initParam: {
class: 'custom-loading' class: 'custom-loading'
} }
} }
} }
} }
function resolve(self) { function resolve(self) {
self.setDeviceId(iot.navigator.getExtras().deviceId); self.setDeviceId(iot.navigator.getExtras().deviceId);
uComponents.showLoading(self); //
iot.business.api.sendCustom('lock/getHistoryRecord', iot.business.api.sendCustom('lock/getHistoryRecord',
{ {
data: { data: {
...@@ -101,16 +114,12 @@ function initComponentsConfig() { ...@@ -101,16 +114,12 @@ function initComponentsConfig() {
start_id: self.getStartId(), start_id: self.getStartId(),
page_size: PAGE_SIZE page_size: PAGE_SIZE
}, },
success: (response) => { success: async (response) => {
if(self.flag){ if(self.flag){
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data && data.record.length > 0){ if(data && data.record.length > 0){
let record = data.record; let record = data.record;
iot.storage.setMap('alarmTime', moment(record[0].time).toISOString(), (res) => { self.flag = await uPublic.upDateRead('alarm', moment(record[0].time).unix());
console.log(res);
self.flag = false;
}, () => {
});
} }
} }
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
...@@ -151,12 +160,6 @@ function initComponentsConfig() { ...@@ -151,12 +160,6 @@ function initComponentsConfig() {
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 获取劫持报警信息'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'获取劫持报警信息');
// }
uPublic.openRequestErrorAlert(self); uPublic.openRequestErrorAlert(self);
}, },
complete: () => { complete: () => {
...@@ -170,6 +173,7 @@ function backTap(){ ...@@ -170,6 +173,7 @@ function backTap(){
iot.navigator.aback(); iot.navigator.aback();
} }
//重写mui.back
mui.back = function(){ mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{}); iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("fire"); console.log("fire");
...@@ -177,6 +181,27 @@ mui.back = function(){ ...@@ -177,6 +181,27 @@ mui.back = function(){
} }
//tap 点击加载更多 //tap 点击加载更多
function listLoadTap(self) { function listLoad(self) {
resolve(self);
}
function refreshFresh(self){
resolve(self); resolve(self);
} }
\ No newline at end of file
//ios跳转到系统设置页面
//android跳转到通知页面
function notifycationSetting(){
if(plus.os.name == 'Android'){
// alert("打开通知页面");
iot.navigator.openWindow({
url: './notify.html',
id: 'notify',
styles: {
popGesture: 'none'
}
});
}else{
iot.native.toNotifycationSetting();
}
}
import {iot, uPublic, uComponents} from '../../public/public.js';
import config from '../../public/public.js';
iot.ready(init);
function init() {
uPublic.componentsExtend(['android-notify']);
var form = new Vue({
el: '#content',
data:{
initButtonText: "测试按钮",
componentsConfig: initComponentsConfig(),//初始化数据
dialogFlag:true,
showFlags:false,
onNotifyToIndex:notifyToIndex //改方法传入
},
mounted:function(){
},
methods: {
onTapButton(){
tapButton(this);
},
onAddDeviceButtonTap(){
console.log("onAddDeviceButtonTap......");
},
onToSetting(){
console.log("点击了toSetting");
}
}
});
function notifyToIndex(){
iot.navigator.fire(plus.webview.getWebviewById('device'),'returnPage',{
needClose: true
});
iot.navigator.openWindow({
url: './index.html',
id: 'device',
styles: {
popGesture: 'none'
},
extras: {
needClose: true
}
});
}
function tapButton(self){
console.log("tapButton.......");
}
//初始化组件参数
function initComponentsConfig() {
return {
// 设置通知弹出框参数
notifyDialog: {
// 默认参数
initParam: {
// appName:"js.通用门锁",
// time:"js.刚刚",
// title:'js.开启通知',
// content1:'js.开启通知后您将可以及时获取门锁报警',
// content2:'js.提醒、门锁开门消息通知',
// accept:'js.我知道了!',
// buttonTitle:'js.前往开启通知设置'
}
},
addDeviceButton:{
// 默认参数
initParam: {
class: 'edit-name-button',
text: "这是测试button"
}
}
};
}
}
//重写mui.back
mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("fire");
iot.navigator.back();
}
...@@ -24,10 +24,16 @@ function init() { ...@@ -24,10 +24,16 @@ function init() {
startId: 0, startId: 0,
deviceId: null, deviceId: null,
userInfo: [], userInfo: [],
flag: true flag: true,
noticeTipShowFlag: false
}, },
mounted(){ mounted(){
uComponents.showLoading(this);
this.noticeTipShowFlag = !iot.native.isNotifycationOpen();
resolve(this); resolve(this);
window.addEventListener('returnPage',() => {
this.noticeTipShowFlag = !iot.native.isNotifycationOpen();
});
}, },
methods:{ methods:{
getList(){ getList(){
...@@ -54,8 +60,14 @@ function init() { ...@@ -54,8 +60,14 @@ function init() {
setDeviceId(id){ setDeviceId(id){
this.deviceId = id; this.deviceId = id;
}, },
onListLoadTap(){ onListLoad(){
listLoadTap(this); listLoad(this);
},
onRefreshFresh(){
refreshFresh(this);
},
onNotifycationSetting(){
notifycationSetting();
}, },
//tap < //tap <
onBackTap(){ onBackTap(){
...@@ -73,7 +85,8 @@ function initComponentsConfig() { ...@@ -73,7 +85,8 @@ function initComponentsConfig() {
class: 'custom-list', class: 'custom-list',
list: [], list: [],
tip: Vue.t('opendoorRecord.noRecordTip'), tip: Vue.t('opendoorRecord.noRecordTip'),
pagesize: PAGE_SIZE pagesize: PAGE_SIZE,
pullup: true
} }
}, },
dialog: { dialog: {
...@@ -85,14 +98,14 @@ function initComponentsConfig() { ...@@ -85,14 +98,14 @@ function initComponentsConfig() {
initParam: { initParam: {
class: 'custom-loading' class: 'custom-loading'
} }
} }
} }
} }
//调用接口获取开门记录 //调用接口获取开门记录
function resolve(self) { function resolve(self) {
console.log("in"); console.log("in");
uComponents.showLoading(self); // uComponents.showLoading(self);
self.setDeviceId(iot.navigator.getExtras().deviceId); self.setDeviceId(iot.navigator.getExtras().deviceId);
console.log(iot.navigator.getExtras()); console.log(iot.navigator.getExtras());
if(iot.navigator.getExtras().relId){ if(iot.navigator.getExtras().relId){
...@@ -107,6 +120,7 @@ function backTap(){ ...@@ -107,6 +120,7 @@ function backTap(){
iot.navigator.aback(); iot.navigator.aback();
} }
//重写mui.back
mui.back = function(){ mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{}); iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("fire"); console.log("fire");
...@@ -114,10 +128,11 @@ mui.back = function(){ ...@@ -114,10 +128,11 @@ mui.back = function(){
} }
//tap 点击加载更多 //tap 点击加载更多
function listLoadTap(self) { function listLoad(self) {
resolve(self); resolve(self);
} }
//获取历史记录(整个设备)
function getHistoryRecord(self){ function getHistoryRecord(self){
iot.business.api.sendCustom('lock/getHistoryRecord', iot.business.api.sendCustom('lock/getHistoryRecord',
{ {
...@@ -127,28 +142,18 @@ function getHistoryRecord(self){ ...@@ -127,28 +142,18 @@ function getHistoryRecord(self){
start_id: self.getStartId(), start_id: self.getStartId(),
page_size: PAGE_SIZE page_size: PAGE_SIZE
}, },
success: (response) => { success: async (response) => {
setListData(self, response); setListData(self, response);
if(self.flag){ if(self.flag){
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data && data.record.length > 0){ if(data && data.record.length > 0){
let record = data.record; let record = data.record;
iot.storage.setMap('openTime', moment(record[0].time).toISOString(), (res) => { self.flag = await uPublic.upDateRead('open', moment(record[0].time).unix());
console.log(res);
self.flag = false;
}, () => {
});
} }
} }
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 获取开门记录失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'获取开门记录失败');
// }
uPublic.openRequestErrorAlert(self); uPublic.openRequestErrorAlert(self);
}, },
complete: () => { complete: () => {
...@@ -157,6 +162,7 @@ function getHistoryRecord(self){ ...@@ -157,6 +162,7 @@ function getHistoryRecord(self){
}); });
} }
//获取个人历史记录
function getPersonalHistory(self, id){ function getPersonalHistory(self, id){
iot.business.api.sendCustom('lock/getPersonalHistory', iot.business.api.sendCustom('lock/getPersonalHistory',
{ {
...@@ -172,13 +178,7 @@ function getPersonalHistory(self, id){ ...@@ -172,13 +178,7 @@ function getPersonalHistory(self, id){
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
// if(window.iotDebug){ uPublic.openRequestErrorAlert(self);
// iotDebug.push('end: 获取个人开门历史记录'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'获取个人开门历史记录');
// }
uPublic.openRequestErrorAlert(self);
}, },
complete: () => { complete: () => {
uComponents.hideLoading(self); uComponents.hideLoading(self);
...@@ -186,6 +186,7 @@ function getPersonalHistory(self, id){ ...@@ -186,6 +186,7 @@ function getPersonalHistory(self, id){
}); });
} }
//设置历史记录渲染列表
function setListData(self, response){ function setListData(self, response){
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
...@@ -198,7 +199,7 @@ function setListData(self, response){ ...@@ -198,7 +199,7 @@ function setListData(self, response){
for(let i=0; i<record.length; i++){ for(let i=0; i<record.length; i++){
list[i] = { list[i] = {
value: record[i].openId, value: record[i].openId,
title: "ID:"+record[i].openId, title: ((record[i].mode == 30 ) || (record[i].mode == 5 )) ? '':"ID:"+record[i].openId,
leftImage: '../../resources/image/green_opendoor'+record[i].mode+'_icon.png', leftImage: '../../resources/image/green_opendoor'+record[i].mode+'_icon.png',
subtitle: Vue.t('opendoorRecord.'+config.openDoorMode[record[i].mode]+''), subtitle: Vue.t('opendoorRecord.'+config.openDoorMode[record[i].mode]+''),
rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss") rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
...@@ -221,3 +222,19 @@ function setListData(self, response){ ...@@ -221,3 +222,19 @@ function setListData(self, response){
}else{ }else{
} }
} }
//ios跳转到系统设置页面
//android跳转到通知页面
function notifycationSetting(){
if(plus.os.name == 'Android'){
iot.navigator.openWindow({
url: './notify.html',
id: 'notify',
styles: {
popGesture: 'none'
}
});
}else{
iot.native.toNotifycationSetting();
}
}
...@@ -18,7 +18,7 @@ function init() { ...@@ -18,7 +18,7 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
textName: iot.navigator.getExtras().nickname, textName: iot.navigator.getExtras().nickname,
textErrorTip: null, textErrorTip: '',
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig(),
extras: {} extras: {}
...@@ -37,6 +37,9 @@ function init() { ...@@ -37,6 +37,9 @@ function init() {
setTextErrorTip(text){ setTextErrorTip(text){
this.textErrorTip = text; this.textErrorTip = text;
}, },
getTextErrorTip(){
return this.textErrorTip;
},
onNameChange(text){ onNameChange(text){
nameChange(this,text); nameChange(this,text);
}, },
...@@ -82,12 +85,8 @@ function initComponentsConfig() { ...@@ -82,12 +85,8 @@ function initComponentsConfig() {
} }
} }
function alert(){
alert('aaa');
}
function nameChange(self,text){ function nameChange(self,text){
self.setTextName(text); self.setTextName(text);
self.setTextErrorTip(''); self.setTextErrorTip('');
console.log('nameChange: ' + self.textName); console.log('nameChange: ' + self.textName);
} }
...@@ -97,11 +96,20 @@ function backTap(){ ...@@ -97,11 +96,20 @@ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
////重写mui.back
//mui.back = function(){
// iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
// console.log("fire");
// iot.navigator.back();
//}
//tap 保存 //tap 保存
function saveTap(self){ function saveTap(self){
if(self.getTextName() == null || self.getTextName().trim() == ''){ if(self.getTextName() == null || self.getTextName().trim() == ''){
self.setTextErrorTip(Vue.t('editName.error.nameCanNotBeBlank')); self.setTextErrorTip(Vue.t('editName.error.nameCanNotBeBlank'));
}else{ }else if(uPublic.checkString(self.getTextName())){
self.setTextErrorTip(Vue.t('textTip.textType'));
}else if(self.getTextErrorTip() == ''){
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.device.setName({ iot.business.device.setName({
data: { data: {
...@@ -112,10 +120,10 @@ function saveTap(self){ ...@@ -112,10 +120,10 @@ function saveTap(self){
console.log(response); console.log(response);
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log('returnPage');
uComponents.openAlert(self, Vue.t('editName.editNameSuccess'), { uComponents.openAlert(self, Vue.t('editName.editNameSuccess'), {
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log('returnPage');
iot.navigator.back(); iot.navigator.back();
} }
}); });
...@@ -123,12 +131,6 @@ function saveTap(self){ ...@@ -123,12 +131,6 @@ function saveTap(self){
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 修改设备名称失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'修改设备名称失败');
// }
uComponents.openAlert(self, Vue.t('editName.editNameFailue'), { uComponents.openAlert(self, Vue.t('editName.editNameFailue'), {
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
let opener = plus.webview.currentWebview().opener(); let opener = plus.webview.currentWebview().opener();
......
...@@ -224,10 +224,10 @@ function resolve(self){ ...@@ -224,10 +224,10 @@ function resolve(self){
async function showGuide(self){ async function showGuide(self){
self.setGuideShowFlag(true); self.setGuideShowFlag(true);
try{ try{
let time = await sleep(1000); let time = await sleep(500);
self.setGuideStep1ShowFlag(true); self.setGuideStep1ShowFlag(true);
time = await sleep(1000); time = await sleep(500);
self.setGuideStep2ShowFlag(true); self.setGuideStep2ShowFlag(true);
} }
catch (err){ catch (err){
...@@ -244,10 +244,10 @@ function nextButtonTap(self){ ...@@ -244,10 +244,10 @@ function nextButtonTap(self){
async function nextGuide(self){ async function nextGuide(self){
try{ try{
let time = await sleep(1000); let time = await sleep(500);
self.setGuideStep3ShowFlag(true); self.setGuideStep3ShowFlag(true);
time = await sleep(1000); time = await sleep(500);
self.setGuideStep4ShowFlag(true); self.setGuideStep4ShowFlag(true);
} }
catch (err){ catch (err){
...@@ -264,10 +264,10 @@ function nextStepButtonTap(self){ ...@@ -264,10 +264,10 @@ function nextStepButtonTap(self){
async function nextStepGuide(self){ async function nextStepGuide(self){
try{ try{
let time = await sleep(1000); let time = await sleep(500);
self.setGuideStep5ShowFlag(true); self.setGuideStep5ShowFlag(true);
time = await sleep(1000); time = await sleep(500);
self.setGuideStep6ShowFlag(true); self.setGuideStep6ShowFlag(true);
} }
catch (err){ catch (err){
...@@ -292,6 +292,7 @@ function sleep(time){ ...@@ -292,6 +292,7 @@ function sleep(time){
mui.back = function(){ mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{}); iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("returnPage");
iot.navigator.back(); iot.navigator.back();
} }
......
...@@ -18,7 +18,7 @@ function init() { ...@@ -18,7 +18,7 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
textName: null, textName: null,
textErrorTip: null, textErrorTip: '',
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig(),
extras: {} extras: {}
...@@ -86,14 +86,20 @@ function initComponentsConfig() { ...@@ -86,14 +86,20 @@ function initComponentsConfig() {
} }
} }
mui.back = function() {
iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {});
console.log("returnPage");
iot.navigator.back();
}
//tap < //tap <
function backTap(){ function backTap() {
iot.navigator.back(); iot.navigator.aback();
} }
function nameChange(self,text){ function nameChange(self,text){
self.textName = text; self.textName = text;
self.setTextErrorTip(null); self.setTextErrorTip('');
console.log('nameChange: ' + self.textName); console.log('nameChange: ' + self.textName);
} }
...@@ -101,7 +107,9 @@ function nameChange(self,text){ ...@@ -101,7 +107,9 @@ function nameChange(self,text){
function confirmButtonTap(self){ function confirmButtonTap(self){
if(self.getTextName() == null || self.getTextName().trim() == ''){ if(self.getTextName() == null || self.getTextName().trim() == ''){
self.setTextErrorTip(Vue.t('addUser.error.nameCanNotEmpty')); self.setTextErrorTip(Vue.t('addUser.error.nameCanNotEmpty'));
}else{ }else if(uPublic.checkString(self.getTextName())){
self.setTextErrorTip(Vue.t('textTip.textType'));
}else if(self.getTextErrorTip() == ''){
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.api.sendCustom('lock/addLockUser',{ iot.business.api.sendCustom('lock/addLockUser',{
data: { data: {
......
...@@ -17,7 +17,7 @@ function init() { ...@@ -17,7 +17,7 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
textName: iot.navigator.getExtras().nickname, textName: iot.navigator.getExtras().nickname,
textErrorTip: null, textErrorTip: '',
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig(),
extras: {}, extras: {},
...@@ -92,7 +92,9 @@ function backTap(){ ...@@ -92,7 +92,9 @@ function backTap(){
function saveTap(self){ function saveTap(self){
if(self.getTextName() == null || self.getTextName().trim() == ''){ if(self.getTextName() == null || self.getTextName().trim() == ''){
self.setTextErrorTip(Vue.t('editName.error.nicknameCanNotBeBlank')); self.setTextErrorTip(Vue.t('editName.error.nicknameCanNotBeBlank'));
}else{ }else if(uPublic.checkString(self.getTextName())){
self.setTextErrorTip(Vue.t('textTip.textType'));
}else if(self.getTextErrorTip() == ''){
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.api.sendCustom('lock/setLockUserName',{ iot.business.api.sendCustom('lock/setLockUserName',{
data: { data: {
...@@ -149,7 +151,7 @@ function saveTap(self){ ...@@ -149,7 +151,7 @@ function saveTap(self){
} }
function nameChange(self,text){ function nameChange(self,text){
self.textName = text; self.textName = text;
self.setTextErrorTip(null); self.setTextErrorTip('');
console.log('nameChange: ' + self.textName); console.log('nameChange: ' + self.textName);
} }
\ No newline at end of file
...@@ -30,6 +30,8 @@ function init() { ...@@ -30,6 +30,8 @@ function init() {
userListData: [], userListData: [],
startId: 0, startId: 0,
role: null, role: null,
//当前用户id
currentId: null
}, },
mounted(){ mounted(){
this.extras = iot.navigator.getExtras(); this.extras = iot.navigator.getExtras();
...@@ -77,14 +79,6 @@ function init() { ...@@ -77,14 +79,6 @@ function init() {
setRole(role){ setRole(role){
this.role = role; this.role = role;
}, },
//
// onSwipeLeftRow(index){
// swipeLeftRow(this, index);
// },
// onSwipeRightRow(){
// swipeRightRow(this);
// },
//
onTapLoad(){ onTapLoad(){
// tapLoad(); // tapLoad();
}, },
...@@ -132,12 +126,6 @@ function getUserList(self){ ...@@ -132,12 +126,6 @@ function getUserList(self){
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 获取用户列表失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'获取用户列表失败');
// }
uPublic.openRequestErrorAlert(self); uPublic.openRequestErrorAlert(self);
}, },
complete: () => { complete: () => {
...@@ -146,7 +134,6 @@ function getUserList(self){ ...@@ -146,7 +134,6 @@ function getUserList(self){
}); });
} }
//
function sortRule(a,b){ function sortRule(a,b){
return a.role - b.role; return a.role - b.role;
} }
...@@ -166,9 +153,8 @@ function getUserInfoMap() { ...@@ -166,9 +153,8 @@ function getUserInfoMap() {
} }
async function sortUsers(self, data){ async function sortUsers(self, data){
let id = [];
try { try {
id = await getUserInfoMap(); self.currentId = await getUserInfoMap();
} }
catch (err) { catch (err) {
console.log(err); console.log(err);
...@@ -176,7 +162,7 @@ async function sortUsers(self, data){ ...@@ -176,7 +162,7 @@ async function sortUsers(self, data){
let users = []; let users = [];
let manage = []; let manage = [];
for(let i=0;i<data.length;i++){ for(let i=0;i<data.length;i++){
if(data[i].user_id == null ||data[i].role && data[i].user_id != id){ if(data[i].user_id == null ||data[i].role && data[i].user_id != self.currentId){
users.push(data[i]); users.push(data[i]);
}else{ }else{
manage.push(data[i]); manage.push(data[i]);
...@@ -228,16 +214,7 @@ function addUserTap(self){ ...@@ -228,16 +214,7 @@ function addUserTap(self){
} }
}); });
} }
//
//// 向左滑动用户列表,修改用户列表下标
//function swipeLeftRow(self, index) {
// self.userListIndex = index;
//}
//// 向右滑动用户列表,修改用户列表下标
//function swipeRightRow(self) {
// self.userListIndex = null;
//}
//
// 点击组件列表 通知事件和当前点击列表下标 // 点击组件列表 通知事件和当前点击列表下标
function onTapUserList(self, listIndex) { function onTapUserList(self, listIndex) {
iot.navigator.openWindow({ iot.navigator.openWindow({
...@@ -246,7 +223,7 @@ function onTapUserList(self, listIndex) { ...@@ -246,7 +223,7 @@ function onTapUserList(self, listIndex) {
extras: { extras: {
id: self.getUserListData()[listIndex].id, id: self.getUserListData()[listIndex].id,
uuid: self.extras.uuid, uuid: self.extras.uuid,
account: self.getUserListData()[listIndex].account, // account: self.getUserListData()[listIndex].account,
lockId: self.extras.lockId, lockId: self.extras.lockId,
role: self.extras.role role: self.extras.role
} }
...@@ -291,12 +268,6 @@ function deleteUser(self, index){ ...@@ -291,12 +268,6 @@ function deleteUser(self, index){
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
// if(window.iotDebug){
// iotDebug.push('end: 删除用户失败'+JSON.stringify(error));
// }
// if (window.iotDebug) {
// iotDebug.upload(iot,'删除用户失败');
// }
uComponents.openAlert(self, Vue.t('doorlockUser.deleteFailure'), { uComponents.openAlert(self, Vue.t('doorlockUser.deleteFailure'), {
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
} }
......
...@@ -81,8 +81,8 @@ function backTap(){ ...@@ -81,8 +81,8 @@ function backTap(){
} }
mui.back = function(){ mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{}); // iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("fire"); // console.log("fire");
iot.navigator.back(); iot.navigator.back();
} }
...@@ -98,30 +98,7 @@ function qrcodeButtonTap(self){ ...@@ -98,30 +98,7 @@ function qrcodeButtonTap(self){
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
let qrKey = response.data.qrKey; let qrKey = response.data.qrKey;
let data = { createQrcode(self, qrKey);
qrKey: qrKey,
lockId: self.extras.lockId,
relId: self.extras.id
}
data = JSON.stringify(data);
let qr = self.$refs.qrcode;
QRCode.toCanvas(qr, data, {
scale: 5,
margin: 2
},(error) => {
if (error) {
console.log(error)
} else {
console.log('success');
uComponents.hideLoading(self);
qr.style.width = "5.333rem";
qr.style.height = "5.333rem";
console.log(qr.style);
setTimeout(() => {
self.setQrCodeDisabled(true);
},qrcode_timeout);
}
});
}else{} }else{}
}, },
error: (error) => { error: (error) => {
...@@ -134,9 +111,38 @@ function qrcodeButtonTap(self){ ...@@ -134,9 +111,38 @@ function qrcodeButtonTap(self){
} }
//请求失败 //请求失败
uPublic.openRequestErrorAlert(self); uPublic.openRequestErrorAlert(self);
} },
complete: () => {
uComponents.hideLoading(self);
}
}); });
setTimeout(() => { setTimeout(() => {
self.setQrCodeDisabled(true); self.setQrCodeDisabled(true);
},config.qrcode_timeout) },config.qrcode_timeout)
} }
\ No newline at end of file
function createQrcode(self, qrKey){
let data = {
qrKey: qrKey,
lockId: self.extras.lockId,
relId: self.extras.id
}
data = JSON.stringify(data);
let qr = self.$refs.qrcode;
QRCode.toCanvas(qr, data, {
scale: 5,
margin: 2
},(error) => {
if (error) {
console.log(error);
} else {
console.log('success');
qr.style.width = "4.267rem";
qr.style.height = "4.267rem";
console.log(qr.style);
setTimeout(() => {
self.setQrCodeDisabled(true);
},config.qrcode_timeout);
}
});
}
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
*/ */
import {iot, uPublic, uComponents} from '../../public/public.js'; import {iot, uPublic, uComponents} from '../../public/public.js';
import unotify from '../../public/unotify.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
...@@ -30,24 +29,17 @@ function init() { ...@@ -30,24 +29,17 @@ function init() {
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('start: Debug'); iotDebug.push('start: Debug');
} }
var self = this; console.log(iot.business.user.isLogin());
unotify.getCid(function(ret){ if(iot.business.user.isLogin()){
console.log(ret); loginButtonTap(this);
self.setClientId(ret); }else{
if (plus.os.name == 'Android') { this.setShowLoginButtonFlag(true);
iot.permission.checkPermission(['READ_EXTERNAL_STORAGE'], function (res) { }
console.log('success', res); // document.addEventListener("resume", () => {
loginButtonTap(self); // if(!this.showLoginButtonFlag){
}, function (err) { // resolve(this);
console.log('error', err); // }
}); // }, false);
}else{
loginButtonTap(self);
}
},function(err){
console.log(err);
})
console.log('innnnnnn');
}, },
methods:{ methods:{
getShowLoginButtonFlag(){ getShowLoginButtonFlag(){
...@@ -93,23 +85,21 @@ function initComponentsConfig() { ...@@ -93,23 +85,21 @@ function initComponentsConfig() {
} }
} }
//sds登陆
function loginButtonTap(self){ function loginButtonTap(self){
// if(window.iotDebug){ if (plus.os.name == 'Android') {
// iotDebug.push('start: initSDSLogin'); iot.permission.checkPermission(['READ_EXTERNAL_STORAGE'], function (res) {
// } console.log('success', res);
// window.SDSPlugin.login({},(res)=>{ openSdsLogin(self);
// console.log(res); }, function (err) {
//// alert(res); console.log('error', err);
// var data = uPublic.checkResponseData(res.data); });
// if(data){ }else{
//// alert("sds登陆成功"); openSdsLogin(self);
// cloudsLogin(self, data.UserID); }
// } }
// },(err)=>{
// alert(error); function openSdsLogin(self){
// console.log(err);
// })
console.log("loginButton");
iot.business.sds.checkSDSInit({ iot.business.sds.checkSDSInit({
data: {}, data: {},
success: (response) => { success: (response) => {
...@@ -127,7 +117,7 @@ console.log("loginButton"); ...@@ -127,7 +117,7 @@ console.log("loginButton");
var data = uPublic.checkResponseData(response.data); var data = uPublic.checkResponseData(response.data);
if(data){ if(data){
if(data.hasOwnProperty('UserID')){ if(data.hasOwnProperty('UserID')){
console.log("sds登陆成功了"); uComponents.hideLoading(self);
cloudsLogin(self, data.UserID); cloudsLogin(self, data.UserID);
} }
}else{ }else{
...@@ -143,15 +133,13 @@ console.log("loginButton"); ...@@ -143,15 +133,13 @@ console.log("loginButton");
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot,'sds登陆失败'); iotDebug.upload(iot,'sds登陆失败');
} }
},
complete: () => {
uComponents.hideLoading(self); uComponents.hideLoading(self);
} },
complete: () => {}
}); });
}, },
error: (error) => { error: (error) => {
//初始化失败,重新初始化 //初始化失败,重新初始化
console.log('eroor');
console.log(error); console.log(error);
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 初始化失败'+JSON.stringify(error)); iotDebug.push('end: 初始化失败'+JSON.stringify(error));
...@@ -166,12 +154,16 @@ console.log("loginButton"); ...@@ -166,12 +154,16 @@ console.log("loginButton");
} }
}); });
}, },
complete: () => {} complete: () => {
console.log("complete");
uComponents.hideLoading(self);
}
}); });
} }
//云端登陆
function cloudsLogin(self, id){ function cloudsLogin(self, id){
console.log("showLoading");
uComponents.showLoading(self); uComponents.showLoading(self);
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('start: cloudsLogin'); iotDebug.push('start: cloudsLogin');
...@@ -179,7 +171,8 @@ function cloudsLogin(self, id){ ...@@ -179,7 +171,8 @@ function cloudsLogin(self, id){
iot.business.api.send('user/sds_login',{ iot.business.api.send('user/sds_login',{
data: { data: {
username: id, username: id,
clienId: self.getClientId() // clienId: self.getClientId()
clienId: null
}, },
success: (response) => { success: (response) => {
if(window.iotDebug){ if(window.iotDebug){
...@@ -188,30 +181,52 @@ function cloudsLogin(self, id){ ...@@ -188,30 +181,52 @@ function cloudsLogin(self, id){
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot,'登陆流程时间'); iotDebug.upload(iot,'登陆流程时间');
} }
console.log(response);
var data = uPublic.checkResponseData(response.data); var data = uPublic.checkResponseData(response.data);
var infoArray = [];
if(data){ if(data){
infoArray.push(['utoken', data.utoken]); //更新tocken userinfo
infoArray.push(['userinfo', data]); iot.business.user.handleLoginSuccess({
iot.business.websql.setMaps(infoArray, () =>{ success: (response) => {
iot.navigator.openWindow({ if(response && data.nickname == '' || data.nickname == null || data.nickname.trim() == ''){
url: '../device/index.html', iot.business.user.setInfo({
id: 'device', data: {
extras: { nickname: Vue.t('login.defaultUser',[data.username.substr(10,3)]),
needClose: true head: ''
} },
}); success: (response) => {
}, (error) => { console.log(response);
console.log(error); },
}); error: (error) => {
plus.navigator.closeSplashscreen(); console.log(error);
} uPublic.openRequestErrorAlert(self);
uComponents.hideLoading(self);
},
complete: () => {
// uComponents.hideLoading(self);
}
});
}
iot.navigator.openWindow({
url: '../device/index.html',
id: 'device',
styles: {
popGesture: 'none'
},
extras: {
needClose: true
}
});
plus.navigator.closeSplashscreen();
},
error: (error) => {
console.log(error);
}
}, response);
}
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 云端登陆失败'+JSON.stringify(error)); iotDebug.push('end: 云端 登陆失败'+JSON.stringify(error));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot,'云端登陆失败'); iotDebug.upload(iot,'云端登陆失败');
......
...@@ -19,7 +19,7 @@ function init() { ...@@ -19,7 +19,7 @@ function init() {
data:{ data:{
//配置组件 //配置组件
textNickName: iot.navigator.getExtras().nickname, textNickName: iot.navigator.getExtras().nickname,
textErrorTip: null, textErrorTip: '',
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
...@@ -79,7 +79,9 @@ function initComponentsConfig() { ...@@ -79,7 +79,9 @@ function initComponentsConfig() {
function saveTap(self){ function saveTap(self){
if(self.textNickName == null || self.textNickName.trim() == ''){ if(self.textNickName == null || self.textNickName.trim() == ''){
self.textErrorTip = Vue.t('editNickname.nickNameInputTip'); self.textErrorTip = Vue.t('editNickname.nickNameInputTip');
}else{ }else if(uPublic.checkString(self.textNickName)){
self.textErrorTip = Vue.t('textTip.textType');
}else if(self.textErrorTip == ''){
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.user.setInfo({ iot.business.user.setInfo({
data: { data: {
......
/**
* v_help.js
* Version: 0.1
* User: wy
* Date: 2017-12-27
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 帮助页面
*/
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 组件
uPublic.componentsInit(['u-button','u-dialog','u-loading']);
const app = new Vue({
data:{
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
//tap 完成
onFinishButtonTap(){
finishButtonTap();
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
finishButton: {
initParam: {
class: 'custom-button',
text: Vue.t('btn.finish')
}
},
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap 完成
function finishButtonTap(){
}
\ No newline at end of file
...@@ -13,7 +13,7 @@ iot.ready(init); ...@@ -13,7 +13,7 @@ iot.ready(init);
function init() { function init() {
//通用 dialog、loading组件 //通用 dialog、loading组件
uPublic.componentsInit(['u-button','u-dialog','u-loading']); uPublic.componentsInit(['u-button','u-dialog','u-loading']);
uPublic.closeSlideBack(); // uPublic.closeSlideBack();
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
...@@ -119,34 +119,17 @@ function logoutButtonTap(self){ ...@@ -119,34 +119,17 @@ function logoutButtonTap(self){
uComponents.openConfirm(self, Vue.t('myInfo.logoutDialogTip'), uComponents.openConfirm(self, Vue.t('myInfo.logoutDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}}, {text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.confirm'), callback: function () { {text: Vue.t('dialog.confirm'), callback: function () {
// uPublic.logout({
// data: {
// sds: true
// },
// success: (response) => {
// console.log(response);
// iot.navigator.openWindow({
// url: '../login/index.html',
// id: 'login',
// extras: {
// needClose: true
// }
// });
// },
// error: (error) => {
// console.log(error);
// },
// complete: () => {}
// });
iot.business.user.logout({ iot.business.user.logout({
data: {}, data: {
// sds: false
},
success: (response) => { success: (response) => {
console.log("sdsLogout:"+response); console.log("sdsLogout:"+response);
let sdsResponse = response; let sdsResponse = response;
iot.business.websql.delMaps(['utoken', 'userinfo'], (response) => { iot.business.websql.delMaps(['utoken', 'userinfo'], (response) => {
iot.storage.delMaps(['notifyTime','alarmTime','openTime'], (response) => { iot.storage.delMaps(['historyId','history','isFirstAddUser','isFristAddUnlockInfo'], (response) => {
console.log("clearMap"+response); console.log("clearMap"+response);
//打开首页 //打开登录页面
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../login/index.html', url: '../login/index.html',
id: 'login', id: 'login',
......
/**
* v_index.js
* Version: 0.1
* User: zjx
* Date: 2017-09-26
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 引导页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
import unotify from '../../public/unotify.js';
import uloop from '../../public/uloop.js';
iot.ready(init);
function init() {
const app = new Vue({
data:{
},
mounted(){
unotify.getCid((response) => {
console.log(response);
},(error) => {
console.log(error);
});
mui("#refreshContainer").pullRefresh({
up:{
contentrefresh : "正在加載...",//可選,正在加載狀態時,上拉加載控件上顯示的標題內容
contentnomore:'沒 有 更 多 數 據 了',//可選,請求完畢若沒有更多數據時顯示的提醒內容;
callback: beginLoopTap()
},
down : {
height:50,//可選,默認50.觸發下拉刷新拖動距離,
auto: true,//可選,默認false.首次加載自動下拉刷新一次
contentdown : "下拉可以刷新",//可選,在下拉可刷新狀態時,下拉刷新控件上顯示的標題內容
contentover : "釋放立即刷新",//可選,在釋放可刷新狀態時,下拉刷新控件上顯示的標題內容
contentrefresh : "正在刷新...",//可選,正在刷新狀態時,下拉刷新控件上顯示的標題內容
callback : beginLoopTap()
}
});
},
methods:{
// onBeginLoopTap(){
// beginLoopTap();
// }
}
}).$mount('#app');
}
function beginLoopTap(){
console.log("innnnn");
mui('#refreshContainer').pullRefresh().endPullupToRefresh(true);
}
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -5,25 +5,29 @@ ...@@ -5,25 +5,29 @@
// .noBottomGradient(); // .noBottomGradient();
.addDevice li{ .addDevice li{
margin: 10px; margin: 44px 44px 0 44px;
border: 1px solid;/*no*/ border: 1px solid;/*no*/
border-radius: 5px; border-radius: 5px;
color: @ADDDEVICE-TEXT-COLOR; color: @ADDDEVICE-TEXT-COLOR;
font-size: @ADDDEVICE-TEXT-FONTSIZE; font-size: @ADDDEVICE-TEXT-FONTSIZE;
height: 214px; height: 150px;
line-height: 214px; line-height: 150px;
padding-left: 58px; padding-left: 50px;
&:nth-child(1) img{ .tap_row(@ADDDEVICE-ROW-ACTIVE-BG);
width: 90px; font-size: 16px;
height: 90px; img{
margin-right: 40px;
}
&:nth-child(2) img{
width: 135px;
height: 64px;
margin-right: 25px; margin-right: 25px;
width: 100px;
height: 100px;
} }
.tap_row(@ADDDEVICE-ROW-ACTIVE-BG); }
.addDevice p{
width: 100%;
font-size: 12px;
line-height: 32px;
color: #cfcfd1;
text-align: center;
} }
//产品型号 //产品型号
...@@ -65,6 +69,22 @@ ...@@ -65,6 +69,22 @@
//配置Wi-Fi //配置Wi-Fi
.wifiAddHelp{ .wifiAddHelp{
.help(); .help();
position: relative;
li{
text-indent: 0;
&:last-child{
color: #FFF;
padding-left: 36px;
&:before{
color: #00FFFF;
content:'\e648';
.iconfont(16px);
line-height: 2;
position: absolute;
left: 12px;
}
}
}
} }
.u-button(); .u-button();
...@@ -183,14 +203,118 @@ ...@@ -183,14 +203,118 @@
.mediaPosition(); .mediaPosition();
.u-comm-loading(); //.u-comm-loading();
.u-process();
.custom-comm-loading(); //.custom-comm-loading();
//
.scanContent { .scanContent {
position: fixed; position: fixed;
top: 1.173rem; top: 1.173rem;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
} background: rgba(0,0,0,0);
\ No newline at end of file }
.noticeContent{
color: #c8225b;
line-height: 1.5;
text-align: center;
width: 100%;
position: absolute;
bottom: 0;
left: 0;
font-size: 12px ;
span{
&:first-child{
.iconfont(20px);
position: relative;
top: 3px;/*no*/
}
}
}
.custom-process .u-process-button{
text-align: center;
bottom: 65px;
}
.custom-process-button{
.button();
text-align: center;
line-height: 1;
margin: 0 auto;
padding: 10px 0;
.transition(background-color 0.2s linear);
background-clip: padding-box;
}
.custom-process-cancelButton{
position: relative;
color: @LINKTEXT-TEXT-COLOR;
font-size: @LINKTEXT-TEXT-FONTSIZE;
display: inline-block;
min-width: 100px;
padding: 16px 26px 2px;
margin-top: 10px;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;/*no*/
.blue_gradient_border();
}
&.disabled{
background-color: transparent;
}
}
.u-process{
.u-process-content{
.loader{
&:before{
.transform(translateZ(0) scale(0.7));
}
}
}
}
.custom-process{
.u-process-content{
top: 180px;
bottom: 175px;
.transform(none);
}
}
.u-process.u-process-status-0{
.u-process-content{
.loading{
position: relative;
.loading-text{
position: absolute;
left: 0;
top: 0;
font-size: 16px;
line-height: 3.750em;
width: 100%;
text-align: center;
}
}
}
}
.u-process.u-process-status-1,.u-process.u-process-status-2{
.u-process-content{
.loading{
.loading-text{
display: none;
}
}
}
}
...@@ -99,16 +99,24 @@ ...@@ -99,16 +99,24 @@
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
} }
p{ div{
position: absolute; position: absolute;
top: 30px; top: 30px;
left: 0; left: 0;
right: 0; right: 0;
margin: 0 auto; margin: 0 auto;
.bgImgSize(40px,40px,"green_doorbell_icon.png",center,cover); // .bgImgSize(40px,40px,"green_default_icon.png",center,cover);
width: 40px;
height: 40px;
background-size: 40px 40px;
.transform-origin(center 5px); .transform-origin(center 5px);
} }
} }
.active{
div{
.animation(shake 1s linear infinite);
}
}
} }
.doorbellTip{ .doorbellTip{
position: absolute; position: absolute;
...@@ -123,6 +131,83 @@ ...@@ -123,6 +131,83 @@
} }
} }
.wifiRemote{
display: none;
}
.default_img{
.bgImg("green_default_icon.png");
}
.doorbell_img{
.bgImg("green_doorbell_icon.png");
}
.remoteOpendoor_img{
.bgImg("green_remoteOpendoor_icon.png");
.wifiRemote{
display: block;
.margin_center(30px,30px);
left: 6px;
li{
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
border: 2px solid #00FFFF;/*no*/
border-top-color: transparent;
border-bottom-color: transparent;
border-left-color: transparent;
border-radius: 60px;
.animation(stretchdelay 1.5s infinite);
&:nth-child(1){
width: 100%;
height: 100%;
.animation-delay(-0.9s);
}
&:nth-child(2){
width: 20px;
height: 20px;
.animation-delay(-1.2s);
}
&:nth-child(3){
width: 10px;
height: 10px;
}
}
}
}
.hijack_img{
.bgImg("red_hijack_icon.png");
}
.securityAlarm_img{
.bgImg("red_securityAlarm_icon.png");
&:before{
content: '';
display: block;
position: absolute;
top: 0;
left: 0;
.bgImgSize(100%,100%,"red_securityAlarmLight_icon.png",center,cover);
.animation(alarmLight 2.5s linear infinite);
}
}
.redDoorbellBg{
.linear-gradient(#ff4799,#fff,#fff,#fff,#ff4799);
background: linear-gradient(#ff4799,#fff,#fff,#fff,#ff4799);
.doorbellCircle{
background-color: #2f283a;
.doorbell{
border: 2px solid #ff4799;/*no*/
}
}
}
.active .doorbellCircle .doorbell{ .active .doorbellCircle .doorbell{
&:before, &:before,
&:after{ &:after{
...@@ -131,11 +216,27 @@ ...@@ -131,11 +216,27 @@
&:after{ &:after{
.animation-delay(-1s); .animation-delay(-1s);
} }
p{
.animation(shake 1s linear infinite);
}
} }
.warmingActive .doorbellCircle .doorbell{
&:before,
&:after{
.animation(redAperture 2s linear infinite);
}
&:after{
.animation-delay(-1s);
}
}
.keyframes(redAperture,{
0%{
.box-shadow(0 0 0 0 rgba(255,71,153,1));
}
100%{
.box-shadow(0 0 0 10px rgba(255,71,153,0));
}
});
.keyframes(shake,{ .keyframes(shake,{
0%,50%,100%{ 0%,50%,100%{
.transform(rotate(0deg)); .transform(rotate(0deg));
...@@ -148,6 +249,41 @@ ...@@ -148,6 +249,41 @@
} }
}); });
.keyframes(remoteOpendoor,{
0%{
background-position: 0 0;
}
33.33%{
background-position: -37.5px 0;
}
66.66%{
background-position: -75px 0;
}
100% {
background-position: 0 0;
}
});
.keyframes(stretchdelay,{
0%,
100% {
border-right-color: transparent;
}
40% {
border-right-color: #00FFFF;
}
});
.keyframes(alarmLight,{
0%,
100%{
opacity: 1;
}
50% {
opacity: 0.5;
}
});
.batteryState{ .batteryState{
text-align: right; text-align: right;
padding-right: 25px; padding-right: 25px;
...@@ -232,6 +368,7 @@ ...@@ -232,6 +368,7 @@
right: 0; right: 0;
height: 1px;/*no*/ height: 1px;/*no*/
.white_gradient_border(); .white_gradient_border();
z-index: 1;
} }
&:after{ &:after{
content: ''; content: '';
...@@ -423,14 +560,21 @@ ...@@ -423,14 +560,21 @@
} }
} }
.newMsg .custom-switch:before{ .newMsg .custom-switch{
content: '\e681'; .u-switch-handle{
position: absolute; position: relative;
top: 0; &:after{
right: 104px; content: '';
.iconfont(@NEWMSG-ICON-FONTSIZE); position: absolute;
color: @NEWMSG-ICON-COLOR; top: 3.55px;
z-index: 3; right: 3.55px;
width: 9px;/*no*/
height: 9px;/*no*/
border-radius: 50%;
background-color: #fc2168;
z-index: 3;
}
}
} }
.followServiceNumber-dialog{ .followServiceNumber-dialog{
...@@ -468,4 +612,112 @@ ...@@ -468,4 +612,112 @@
.remoteOpendoorPage{ .remoteOpendoorPage{
.mask(1051,@BODY-BG-COLOR); .mask(1051,@BODY-BG-COLOR);
}
//
.custom-marquee .u-marquee-text {
display: block;
line-height: 0.96rem;
}
.active .u-marquee-text {
-webkit-animation: none;
animation: none;
}
.u-notification{
.mask(1051,@CUSTOM-BACKDROP-BG);
.u-notification-box{
width: 335px;
height: 300px;
.transform_center();
background-color: #242635;
color: #00ffff;
border: 1px solid;/*no*/
border-radius: 5px;
.u-notification-title{
position: relative;
padding-top: 10px;
font-size: 16px;
text-align: center;
}
.u-notification-close{
position: absolute;
top: 0;
right: 0;
width: 40px;
height: 100%;
padding-top: 10px;
.iconfont(25px);
}
.u-notification-content{
.bgImgSize(100%,147px,"noticeContBg.png",center,auto 100%);
padding-top: 61px;
}
.u-notification-switch{
width: 150px;
margin: 15px auto;
padding: 10px 0;
text-align: center;
font-size: 12px;
.u-notification-switch-handle{
display: inline-block;
vertical-align: middle;
position: relative;
margin-right: 10px;
width: 17px;
height: 17px;
&:before{
position: absolute;
top: 0;
left: 0;
.iconfont(17px);
}
}
&.u-notification-switch-on .u-notification-switch-handle:before{
content: '\e6aa';
}
&.u-notification-switch-off .u-notification-switch-handle:before{
content: '\e6a9';
}
}
.u-notification-button{
li{
.button(235px);
line-height: 1;
margin: 0 auto;
text-align: center;
padding: 10px 0;
}
}
.clearfix{
overflow: hidden;
padding: 0 54px;
}
.leftCont{
float: left;
}
.rightCont{
float: right;
}
.logo{
.bgImgSize(15px,15px,"logo1.png",center,cover);
display: inline-block;
vertical-align: middle;
margin: 0 -8px 0 8px;
}
.smallFont{
color: #00b2b2;
font-size: 16px;
.transform(scale(0.5));
display: inline-block;
vertical-align: middle;
}
.tip{
text-align: center;
font-size: 12px;
margin-top: 9px;
line-height: 16px;
}
}
} }
\ No newline at end of file
@import "../public/public.less";
@import "../public/header.less";
.u-android-notify{
margin: 53px 40px 0;
.u-android-notify-row{
color: rgba(204,204,204,.5);
padding-left: 34px;
position: relative;
.u-android-notify-title{
font-size: 16px;
position: relative;
}
.u-android-notify-tip{
font-size: 12px;
line-height: 15px;
padding: 3px 5px 1px;
margin: 6px -4px -7px;
border-radius: 5px;
position: relative;
border: 1px dashed transparent;/*no*/
&:before{
content: '';
position: absolute;
top: -6px;
left: 90px;
.bgImgSize(10px,6px,"blue_arrow_icon.png",center,cover);
display: none;
}
}
.u-android-notify-subtitle{
margin-top: 15px;
}
.u-android-notify-subcontent{
font-size: 12px;
line-height: 15px;
padding-left: 21px;
margin-top: 6px;
}
//1、2、3
.u-android-notify-icon{
position: absolute;
left: 0;
display: inline-block;
// width: 22px;
// height: 22px;
border: 1px solid;/*no*/
border-radius: 50%;
text-align: center;
.iconfont(12px);
padding: 4px;
background-color: #242635;
outline: 3px solid #242635;/*no*/
}
// √
.u-android-notify-finish-icon{
position: absolute;
top: 10px;
left: 12px;
&:before{
content:'\e730';
color: #00ffff;
.defaultIconfont(16px);
background-color: #242635;
border-radius: 50%;
.transform(scale(0.6));
display: block;
}
}
.u-android-notify-button{
.transformV_center(right,0);
color: #00ffff;
font-size: 12px;
line-height: 1;
border-bottom: 1px solid;/*no*/
padding-bottom: 1px;/*no*/
// >>
span{
margin-left: 6px;
&:before{
content:'\e6c4';
.iconfont(12px);
}
}
}
&:not(:last-child){
padding-bottom: 55px;
}
&:before{
content: '';
position: absolute;
top: 0;
bottom: 0;
left: 11px;
width: 1px;/*no*/
background-color: #595b63;
}
}
.active{
color: #fff;
.u-android-notify-tip{
color: #91929a;
border-color: #91929a;
&:before{
display: block;
}
}
.u-android-notify-subcontent{
color: #91929a;
}
.u-android-notify-icon{
color: #00ffff;
}
}
.changeBorder:before{
background-color: #00ffff;
}
}
\ No newline at end of file
...@@ -33,8 +33,74 @@ ...@@ -33,8 +33,74 @@
} }
.u-list-load{ .u-list-load{
.listLoad(); .listLoad();
.u-list-load-animation{
width: 24px;
height: 24px;
display: inline-block;
.bgImg("loading.png");
-webkit-animation: refresh 1s steps(8, end) infinite;
animation: refresh 1s steps(8, end) infinite;
background-size: cover;
vertical-align: middle;
}
} }
.u-list-tip{ .u-list-tip{
.listNoCont(); .listNoCont();
} }
}
@-webkit-keyframes refresh {
0% {
-webkit-transform: rotate3d(0, 0, 1, 0deg);
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
-webkit-transform: rotate3d(0, 0, 1, 360deg);
transform: rotate3d(0, 0, 1, 360deg);
}
}
@keyframes refresh {
0% {
-webkit-transform: rotate3d(0, 0, 1, 0deg);
transform: rotate3d(0, 0, 1, 0deg);
}
100% {
-webkit-transform: rotate3d(0, 0, 1, 360deg);
transform: rotate3d(0, 0, 1, 360deg);
}
}
.notice{
height: 62px;
line-height: 62px;
border-bottom: 2px solid #50515D;/*no*/
text-align: center;
color: #00ffff;
font-size: 12px;
> span{
color: #fc2168;
.iconfont(20px);
vertical-align: middle;
margin-right: 9px;
}
p{
display: inline-block;
color: #00ffff;
font-size: 12px;
line-height: 1;
border-bottom: 1px solid;/*no*/
padding-bottom: 1px;/*no*/
margin-left: 24px;
// >>
span{
margin-left: 6px;
&:before{
content:'\e6c4';
.iconfont(12px);
}
}
}
~ .custom-list{
top: 106px;
}
} }
\ No newline at end of file
...@@ -220,12 +220,17 @@ ...@@ -220,12 +220,17 @@
} }
} }
//
.nameDisabled:before{
display: none;
}
.custom-isClearSwitch-switch { .custom-isClearSwitch-switch {
width: 5.333rem; width: 5.333rem;
height: auto; height: auto;
text-align: center; text-align: center;
color: #00ffff; color: #00ffff;
margin: 0.72rem auto 0; margin: 0 auto;
padding: 0.267rem 0; padding: 0.267rem 0;
} }
...@@ -283,3 +288,16 @@ ...@@ -283,3 +288,16 @@
.unbindState-dialog(); .unbindState-dialog();
.custom-dialog{
.u-dialog-box{
.u-dialog-content{
// span{
// .bgImgSize(51px,51px,"green_unbindSuccess_icon.png",center,cover);
// }
img{
width: 51px;
height: 51px;
}
}
}
}
...@@ -71,15 +71,14 @@ ...@@ -71,15 +71,14 @@
.userInfo-title{ .userInfo-title{
font-size: @USERINFOLINK-TITLE-FONTSIZE; font-size: @USERINFOLINK-TITLE-FONTSIZE;
.text_oneRow_ellipsis(); .text_oneRow_ellipsis();
margin-bottom: 5px;
position: relative; position: relative;
padding-right: 65px; padding-right: 104px;
// > icon // > icon
&:after{ // &:after{
content: '\e6a7'; // content: '\e6a7';
.transformV_center(right,35px); // .transformV_center(right,35px);
.iconfont(@USERINFOLINK-ICON-FONTSIZE); // .iconfont(@USERINFOLINK-ICON-FONTSIZE);
} // }
} }
.userInfo-subtitle{ .userInfo-subtitle{
position: relative; position: relative;
...@@ -104,26 +103,16 @@ ...@@ -104,26 +103,16 @@
display: inline-block; display: inline-block;
color: @USERINFOLINK-INVITEBIND-COLOR; color: @USERINFOLINK-INVITEBIND-COLOR;
font-size: @USERINFOLINK-INVITEBIND-FONTSIZE; font-size: @USERINFOLINK-INVITEBIND-FONTSIZE;
.transform(scale(0.7));
padding: 0 22px 2px;
margin-left: -15px; margin-left: -15px;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;/*no*/
.blue_gradient_border();
}
} }
//解绑 //解绑
.custom-unbind-button{ .custom-unbind-button{
position: absolute; position: absolute;
top: -4px; top: 50%;
margin-left: 6px; bottom: auto;
right: 35px;
.button(72px); .button(72px);
.transform(scale(0.7)); .transform(translateY(-50%) scale(0.7));
padding: 5px 0; padding: 5px 0;
display: inline-block; display: inline-block;
} }
...@@ -138,31 +127,51 @@ ...@@ -138,31 +127,51 @@
} }
} }
} }
.disabled{
color: #575a6d;
}
} }
//邀请绑定 //邀请绑定
.inviteBind{ .inviteBind{
margin: 40px 38px 0; margin: 41px 42px 0;
li{ li{
&:first-child{ color: @INVITEBIND-TEXT-COLOR;
width: 200px; font-size: @INVITEBIND-TEXT-FONTSIZE;
height: 200px; position: relative;
&.qrcode{
width: 160px;
height: 160px;
margin: 0 auto; margin: 0 auto;
position: relative; position: relative;
} }
&:not(:first-child){ &.title{
color: @INVITEBIND-TEXT-COLOR; color: #fff;
font-size: @INVITEBIND-TEXT-FONTSIZE; font-size: 18px;
padding-left: 12px; margin: 34px 0 22px;
text-indent: -12px; }
line-height: 20px; &.tip{
margin-top: 18px; font-size: 12px;
//注意事项 text-align: center;
&:nth-child(2){ margin-top: 34px;
color: inherit; }
font-size: @INVITEBIND-TITLE-FONTSIZE; //1、2、3
margin-top: 32px; > span{
} display: inline-block;
// width: 22px;/*no*/
// height: 22px;/*no*/
border: 1px solid;/*no*/
border-radius: 50%;
text-align: center;
.iconfont(12px,1);
// line-height: 22px;/*no*/
background-color: #242635;
outline: 3px solid #242635;/*no*/
color: #00ffff;
margin-right: 14px;
position: relative;
padding: 4px;
} }
//二维码已过期,请重新生成 //二维码已过期,请重新生成
p{ p{
...@@ -178,64 +187,110 @@ ...@@ -178,64 +187,110 @@
width: 100%; width: 100%;
} }
} }
&:not(.qrcode):not(.title):not(.tip):not(.noBorder){
padding-bottom: 17px;
&:before{
content: '';
position: absolute;
top: 2px;
bottom: 0;
left: 11px;
width: 1px;/*no*/
background-color: #00ffff;
}
}
}
.tip{
span{
display: inline;
border-radius: 0;
border-width: 0 0 1px 0;/*no*/
background: none;
outline: none;
margin: 0;
padding: 0;
}
}
}
.invite-usertip{
margin: 41px 42px 0 62px;
&:before{
color: #00FFFF;
content:'\e648';
.iconfont(16px);
line-height: 2;
position: absolute;
left: 41px;
} }
} }
.unbindState-dialog(); .unbindState-dialog();
.guide-dialog{ .guide-dialog{
.mask(1051,@CUSTOM-BACKDROP-BG); .mask();
.guideStep1{ .guideStep1{
position: absolute; position: absolute;
top: 44px; top: 44px;
left: 0; left: 0;
width: 100%; width: 100%;
.guideStep1Cont{ .guideStep1Cont{
padding: 13px 0 13px 42px; padding: 25px 0 25px 42px;
position: relative; position: relative;
p{ .userInfo-title{
&:nth-child(1){ font-size: @USERINFOLINK-TITLE-FONTSIZE;
font-size: @USERINFOLINK-TITLE-FONTSIZE; .text_oneRow_ellipsis();
.text_oneRow_ellipsis(); position: relative;
margin-bottom: 5px; padding-right: 104px;
position: relative; }
padding-right: 65px; //管理员头像
// > icon .userInfo-image{
&:after{ width: 27px;
content: '\e6a7'; height: 27px;
.transformV_center(right,35px); margin-right: 14px;
.iconfont(@USERINFOLINK-ICON-FONTSIZE); }
} //绑定/未绑定 头像
} .userInfo-subimage{
&:nth-child(2){ width: 20px;
position: relative; height: 20px;
} margin-right: 9px;
//绑定/未绑定 头像 }
img{
width: 20px; .userInfo-subtitle{
height: 20px; position: relative;
margin-right: 13px; }
} //绑定/未绑定 头像
//邀请绑定 .userInfo-subimage{
span{ width: 20px;
position: absolute; height: 20px;
bottom: 0; margin-right: 9px;
display: inline-block; }
color: @USERINFOLINK-INVITEBIND-COLOR; //昵称
font-size: @USERINFOLINK-INVITEBIND-FONTSIZE; .userInfo-name{
.transform(scale(0.7)); display: inline-block;
padding: 0 22px 2px; vertical-align: middle;
margin-left: -15px; max-width: 145px;
&:after{ .text_oneRow_ellipsis();
content: ''; }
position: absolute; //邀请绑定
bottom: 0; .userInfo-toBind{
left: 0; position: absolute;
right: 0; bottom: 0;
height: 1px;/*no*/ display: inline-block;
.blue_gradient_border(); color: @USERINFOLINK-INVITEBIND-COLOR;
} font-size: @USERINFOLINK-INVITEBIND-FONTSIZE;
} margin-left: -15px;
}
//解绑
.custom-unbind-button{
position: absolute;
top: 50%;
bottom: auto;
right: 35px;
.button(72px);
.transform(translateY(-50%) scale(0.7));
padding: 5px 0;
display: inline-block;
} }
//虚线框 //虚线框
&:after{ &:after{
...@@ -328,4 +383,20 @@ ...@@ -328,4 +383,20 @@
} }
} }
.mediaPosition(true); .mediaPosition(true);
\ No newline at end of file
//
.userInfo-title-disabled:after {
display: none;
}
.custom-dialog{
.u-dialog-box{
.u-dialog-content{
img{
width: 51px;
height: 51px;
}
}
}
}
\ No newline at end of file
...@@ -50,52 +50,113 @@ ...@@ -50,52 +50,113 @@
.u-swipe-list(); .u-swipe-list();
.custom-swipe-list{ .tab{
position: absolute; .display-box();
top: 44px; position: relative;
bottom: 0; border-bottom: 1px solid #575a6d;/*no*/
left: 0; li{
height: auto; .flex();
.u-swipe-list-scroll .u-swipe-list-row{ text-align: center;
.u-swipe-list-handle{ height: 45px;
background-color: @CUSTOM-UNLOCKINFO-SWIPELIST-COMPONENT-ROW-BG; line-height: 45px;
padding: 0 42px; position: relative;
height: 55px; color: #575a6d;
font-size: @CUSTOM-UNLOCKINFO-SWIPELIST-COMPONENT-TEXT-FONTSIZE; font-size: 16px;
.u-swipe-list-title{ &:after{
float: left; content: '';
} position: absolute;
.u-swipe-list-subtitle{ bottom: 0;
float: right; left: 0;
} right: 0;
} height: 2px /*except*/;
.u-swipe-list-button{ background-color: transparent;
right: 32px; }
div{ }
width: 85px; .newMsg {
color: @CUSTOM-UNLOCKINFO-SWIPELIST-COMPONENT-BUTTON-COLOR; &:before{
font-size: @CUSTOM-UNLOCKINFO-SWIPELIST-COMPONENT-BUTTON-FONTSIZE; content: '';
&:nth-last-of-type(1), position: absolute;
&:nth-last-of-type(2){ top: 9px;
background-color: @CUSTOM-UNLOCKINFO-SWIPELIST-COMPONENT-BUTTON-BG; right: 22px;
} width: 7px;/*no*/
} height: 7px;/*no*/
} border-radius: 50%;
&:after{ background-color: #fc2168;
.white_gradient_border(); z-index: 3;
} }
&.active .u-swipe-list-handle{ }
left: -202px; .active{
} color: #fff;
} &:after{
//上拉加载 background-color: #FFF;
.u-swipe-list-load{ }
.listLoad(); }
} }
//swipeList 无内容
.u-swipeList-tip{ .infoList-list{
.listNoCont("unlockNoCont.png",70px 70px); width: 100%;
} overflow: auto;
position: absolute;
top: 90px;
bottom: 0;
left: 0;
.infoList-list-scroll .infoList-list-row{
position: relative;
height: 55px;
padding: 0 42px;
.display-box();
.box-vertical-alignment();
.infoList-list-handle{
.u-swipe-list-title{
.text_oneRow_ellipsis();
font-size: 16px;
}
.u-swipe-list-subtitle{
.text_oneRow_ellipsis();
}
}
.infoList-list-button{
position: absolute;
top: 0;
bottom: 0;
right: 25px;
z-index: 1;
.display-box();
.box-vertical-alignment();
.infoList-list-buttonCont{
float: left;
padding: 10px;
margin: 0 5px;
color: #00f8dd;
font-size: 14px;
img{
width: 23px;
height: 23px;
}
}
}
&:after{
.defaultBorder();
.white_gradient_border();
}
}
//上拉加载
.infoList-list-load{
text-align: center;
}
//list 无内容
.infoList-list-tip{
.transformV_center(left,0);
width: 100%;
text-align: center;
.listNoCont("unlockNoCont.png",70px 70px);
}
//list 无历史记录
.noHistory-list-tip{
.listNoCont("noCont.png",70px 70px);
}
} }
//绑定开锁信息 //绑定开锁信息
...@@ -142,7 +203,11 @@ ...@@ -142,7 +203,11 @@
.u-select(); .u-select();
.custom-select{ .custom-select{
height: 170px; position: absolute;
top: 266px;
bottom: 211px;
left: 0;
height: auto;
.u-select-scroll{ .u-select-scroll{
.u-select-row{ .u-select-row{
display: block; display: block;
...@@ -180,10 +245,16 @@ ...@@ -180,10 +245,16 @@
} }
} }
.position{
position: absolute;
bottom: 122px;
left: 0;
width: 100%;
}
.tip{ .tip{
text-align: center; text-align: center;
color: #A0A0A7; color: #A0A0A7;
margin-top: 3px;
} }
.u-switch(); .u-switch();
...@@ -224,14 +295,14 @@ ...@@ -224,14 +295,14 @@
&.u-switch-on .u-switch-handle{ &.u-switch-on .u-switch-handle{
background-color: transparent; background-color: transparent;
&:before{ &:before{
content: '\e6a9'; content: '\e6aa';
left: 0; left: 0;
} }
} }
&.u-switch-off .u-switch-handle{ &.u-switch-off .u-switch-handle{
background-color: transparent; background-color: transparent;
&:before{ &:before{
content: '\e6aa'; content: '\e6a9';
left: 0; left: 0;
} }
} }
...@@ -248,7 +319,7 @@ ...@@ -248,7 +319,7 @@
.mask(1051,@CUSTOM-BACKDROP-BG); .mask(1051,@CUSTOM-BACKDROP-BG);
.guideStep1{ .guideStep1{
position: absolute; position: absolute;
top: 44px; top: 46px;
left: 0; left: 0;
width: 100%; width: 100%;
.modeSelect:after{ .modeSelect:after{
...@@ -353,7 +424,7 @@ ...@@ -353,7 +424,7 @@
} }
.guideStep5{ .guideStep5{
position: absolute; position: absolute;
top: 248px; bottom: 116px;
left: 0; left: 0;
width: 100%; width: 100%;
.guideStep5Tip{ .guideStep5Tip{
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
.user-list-title{ .user-list-title{
font-size: @USERLIST-TITLE-FONTSIZE; font-size: @USERLIST-TITLE-FONTSIZE;
.text_oneRow_ellipsis(); .text_oneRow_ellipsis();
margin-bottom: 5px; // margin-bottom: 5px;
} }
//昵称 //昵称
.user-list-subtitle span{ .user-list-subtitle span{
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
display: none; display: none;
} }
} }
} }
.user-list-button{ .user-list-button{
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -133,4 +133,8 @@ ...@@ -133,4 +133,8 @@
.buttonPosition(); .buttonPosition();
} }
.mediaPosition(); .mediaPosition();
\ No newline at end of file
.currentUser{
color: @CUSTOM-SWIPELIST-COMPONENT-TITLE-COLOR;
}
@import "../public/public.less";
@import "../public/header.less";
.title{
span{
.iconfont(16px);
margin-right: 12px;
}
font-size: 16px;
text-align: center;
padding-top: 28px;
}
.helpCont{
margin: 28px 35px 0;
li{
margin-bottom: 17px;
color: #91929a;
font-size: 12px;
line-height: 15px;
text-align: justify;
.contSubtitle{
font-size: 14px;
}
p{
margin-bottom: 8px;
}
}
.white{
color: #fff;
}
.contTitle{
font-size: 16px;
margin-top: 28px;
margin-bottom: 20px;
}
}
.u-button();
.custom-button{
.button();
.buttonPosition();
}
.mediaPosition();
\ No newline at end of file
...@@ -200,17 +200,24 @@ p{ ...@@ -200,17 +200,24 @@ p{
&when(@guideStepBool){ &when(@guideStepBool){
.guide-dialog{ .guide-dialog{
.guideStep5{ .guideStep5{
top: 228px; bottom: 96px;
.guideStep5Cont p{ // .guideStep5Cont p{
padding: 12px 0; // padding: 12px 0;
} // }
} }
} }
} }
&when(@switchBool){ &when(@switchBool){
.custom-select{
bottom: 178px;
}
.position{
bottom: 102px;
}
.custom-setHijack-switch{ .custom-setHijack-switch{
margin-top: 0; margin-top: 14px;
} }
} }
...@@ -368,6 +375,34 @@ p{ ...@@ -368,6 +375,34 @@ p{
} }
} }
.custom-process(){
.custom-process{
background-color: @CUSTOM-BACKDROP-BG;
.u-process-button{
bottom: 134px;
width: 100px;
color: #00ffff;
font-size: 12px;
background-color: transparent;
padding: 18px 0 5px;
&:after{
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;/*no*/
.blue_gradient_border();
}
.tap_row(transparent);
&.disabled{
background-color: transparent;
}
}
}
}
//自定义弹出框组件 //自定义弹出框组件
.custom-dialog(){ .custom-dialog(){
.custom-dialog{ .custom-dialog{
......
...@@ -283,7 +283,7 @@ ...@@ -283,7 +283,7 @@
} }
} }
@media (max-height: 400px/*no*/){ @media (max-height: 500px/*no*/){
#app{ #app{
height: 647px; height: 647px;
position: relative; position: relative;
...@@ -894,6 +894,142 @@ ...@@ -894,6 +894,142 @@
}); });
} }
.u-process(){
.u-process{
.mask(1050);
.u-process-content{
.transformV_center(left,0);
width: 100%;
.loader{
font-size: 16px;
width: 3.750em;
height: 3.750em;
margin: 0 auto;
position: relative;
&:before{
content: '';
.margin_center(0.500em,0.500em);
border-radius: 50%;
.transform(translateZ(0) scale(0.55));
}
}
.icon{
font-size: 16px;
width: 3.750em;
height: 3.750em;
margin: 0 auto;
position: relative;
&:before{
.transform_center();
.iconfont(4.125em);
}
}
.u-process-text{
margin-top: 20px;
text-align: center;
}
}
.u-process-button{
position: absolute;
bottom: 65px;
left: 0;
width: 100%;
li{
// display: table-cell;
// color: @BUTTON-COMPONENT-COLOR;
// font-size: inherit;
// background-color: @BUTTON-COMPONENT-BG;
// border-radius: 5px;
// text-align: center;
// line-height: 1;
// padding: 10px 0;
// .transition(all 0.2s linear);
// background-clip: padding-box;
// //按钮 active
// .tap_row(@BUTTON-COMPONENT-ACTIVE-BG);
// //按钮 不可控
// &.disabled{
// background-color: @BUTTON-COMPONENT-DISABLED-BG;
// }
}
}
//loading
&.u-process-status-0{
.u-process-content{
color: #00ffff;
.loader{
display: block;
&:before{
.animation(commLoading 1.3s linear infinite);
}
}
.icon{
display: none;
}
}
}
//成功 state
&.u-process-status-1{
.u-process-content{
color: #00ffff;
.loader{
display: none;
}
.icon{
display: block;
&:before{
content: '\e800';
}
}
}
}
//失败 state
&.u-process-status-2{
.u-process-content{
color: #fff;
.loader{
display: none;
}
.icon{
display: block;
&:before{
content: '\e646';
}
}
}
}
}
.keyframes(commLoading,{
0%,
100% {
.box-shadow(0 -3em 0 0.2em, 2em -2em 0 0em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 0);
}
12.5% {
.box-shadow(0 -3em 0 0, 2em -2em 0 0.2em, 3em 0 0 0, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em);
}
25% {
.box-shadow(0 -3em 0 -0.5em, 2em -2em 0 0, 3em 0 0 0.2em, 2em 2em 0 0, 0 3em 0 -1em, -2em 2em 0 -1em, -3em 0 0 -1em, -2em -2em 0 -1em);
}
37.5% {
.box-shadow(0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 0, 2em 2em 0 0.2em, 0 3em 0 0em, -2em 2em 0 -1em, -3em 0em 0 -1em, -2em -2em 0 -1em);
}
50% {
.box-shadow(0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 0em, 0 3em 0 0.2em, -2em 2em 0 0, -3em 0em 0 -1em, -2em -2em 0 -1em);
}
62.5% {
.box-shadow(0 -3em 0 -1em, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 0, -2em 2em 0 0.2em, -3em 0 0 0, -2em -2em 0 -1em);
}
75% {
.box-shadow(0em -3em 0 -1em, 2em -2em 0 -1em, 3em 0em 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0.2em, -2em -2em 0 0);
}
87.5% {
.box-shadow(0em -3em 0 0, 2em -2em 0 -1em, 3em 0 0 -1em, 2em 2em 0 -1em, 0 3em 0 -1em, -2em 2em 0 0, -3em 0em 0 0, -2em -2em 0 0.2em);
}
});
}
.edit-name(){ .edit-name(){
.edit-name-text{ .edit-name-text{
width: 100%; width: 100%;
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
@font-face{ @font-face{
font-family: 'iconfont'; font-family: 'iconfont';
src: url('@{ICONFONT_PATH}/iconfont.ttf') format('truetype'); src: url('@{ICONFONT_PATH}/iconfont.ttf') format('truetype');
//src: url('//at.alicdn.com/t/font_372681_j5n6zgpz0py14i.ttf') format('truetype'); //src: url('//at.alicdn.com/t/font_372681_jxwih2qfoaafko6r.ttf') format('truetype');
} }
@font-face{ @font-face{
...@@ -43,17 +43,17 @@ ...@@ -43,17 +43,17 @@
@C_RED_1: #fc2168; @C_RED_1: #fc2168;
@C_GRAY: #bbb; @C_GRAY: #bbb;
@C_GRAY_1: #ddd; @C_GRAY_1: #ddd;
@C_GRAY_2: #999; @C_GRAY_2: #575a6d;
@C_GRAY_3: #91929a; @C_GRAY_3: #91929a;
@C_GRAY_4: #959595; @C_GRAY_4: #959595;
@C_GRAY_5: #898989; @C_GRAY_5: #898989;
@C_GRAY_6: #50515d; @C_GRAY_6: #50515d;
@C_GRAY_7: #C2C2C2; @C_GRAY_7: #C2C2C2;
@OPACITY: transparent; @OPACITY: transparent;
@BLACK_OPACITY: fade(@C_BLACK,80%); @BLACK_OPACITY: fade(@C_BLACK,90%);
@BLACK_OPACITY_1: fade(@C_BLACK,40%); @BLACK_OPACITY_1: fade(@C_BLACK,40%);
@WHITE_OPACITY: fade(@C_WHITE,0); @WHITE_OPACITY: fade(@C_WHITE,0);
@BLUE_OPACITY: fade(@C_BLUE_2,90%); @BLUE_OPACITY: fade(@C_BLUE_2,80%);
@GRAY_OPACITY: fade(@C_GRAY_2,5%); @GRAY_OPACITY: fade(@C_GRAY_2,5%);
//font-sizes //font-sizes
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
@CUSTOM-EDITTEXT-COMPONENT-INPUT-FONTSIZE: @F_SIZE_16; @CUSTOM-EDITTEXT-COMPONENT-INPUT-FONTSIZE: @F_SIZE_16;
//自定义弹出框组件 //自定义弹出框组件
@CUSTOM-DIALOG-COMPONENT-BOX-BG: @OPACITY; @CUSTOM-DIALOG-COMPONENT-BOX-BG: @C_BLUE_2;
@CUSTOM-DIALOG-COMPONENT-COLOR: @C_BLUE_4; @CUSTOM-DIALOG-COMPONENT-COLOR: @C_BLUE_4;
@CUSTOM-DIALOG-COMPONENT-CONTENT-FONTSIZE: @F_SIZE_16; @CUSTOM-DIALOG-COMPONENT-CONTENT-FONTSIZE: @F_SIZE_16;
...@@ -254,6 +254,7 @@ ...@@ -254,6 +254,7 @@
@CUSTOM-SWIPELIST-COMPONENT-BUTTON-COLOR: @C_BLUE_4; @CUSTOM-SWIPELIST-COMPONENT-BUTTON-COLOR: @C_BLUE_4;
@CUSTOM-SWIPELIST-COMPONENT-BUTTON-ICON-FONTSIZE: @F_SIZE_16; @CUSTOM-SWIPELIST-COMPONENT-BUTTON-ICON-FONTSIZE: @F_SIZE_16;
@CUSTOM-SWIPELIST-COMPONENT-DELETEBUTTON-BG: @BODY-BG-COLOR; @CUSTOM-SWIPELIST-COMPONENT-DELETEBUTTON-BG: @BODY-BG-COLOR;
@CUSTOM-SWIPELIST-COMPONENT-TITLE-COLOR: @C_BLUE_4;
//门锁用户列表 //门锁用户列表
@USERLIST-ROW-BG: @BODY-BG-COLOR; @USERLIST-ROW-BG: @BODY-BG-COLOR;
......
web/resources/image/noCont.png

3.54 KB | W: | H:

web/resources/image/noCont.png

3.62 KB | W: | H:

web/resources/image/noCont.png
web/resources/image/noCont.png
web/resources/image/noCont.png
web/resources/image/noCont.png
  • 2-up
  • Swipe
  • Onion skin
web/resources/image/scanCodeAdd.png

3.07 KB | W: | H:

web/resources/image/scanCodeAdd.png

2.91 KB | W: | H:

web/resources/image/scanCodeAdd.png
web/resources/image/scanCodeAdd.png
web/resources/image/scanCodeAdd.png
web/resources/image/scanCodeAdd.png
  • 2-up
  • Swipe
  • Onion skin
web/resources/image/unlockNoCont.png

5.4 KB | W: | H:

web/resources/image/unlockNoCont.png

5.35 KB | W: | H:

web/resources/image/unlockNoCont.png
web/resources/image/unlockNoCont.png
web/resources/image/unlockNoCont.png
web/resources/image/unlockNoCont.png
  • 2-up
  • Swipe
  • Onion skin
web/resources/image/wifiAdd.png

5.57 KB | W: | H:

web/resources/image/wifiAdd.png

4.5 KB | W: | H:

web/resources/image/wifiAdd.png
web/resources/image/wifiAdd.png
web/resources/image/wifiAdd.png
web/resources/image/wifiAdd.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
</div> </div>
<div class="content"> <div class="content">
<ul class="addDevice"> <ul class="addDevice">
<v-touch tag="li" v-on:tap="onScanAddTap"> <v-touch class="scanAdd" tag="li" v-on:tap="onScanAddTap">
<img src="../../resources/image/scanCodeAdd.png">{{ $t('addDevice.scanCodeAdd') }} <img src="../../resources/image/scanCodeAdd.png">{{ $t('addDevice.scanCodeAdd') }}
</v-touch> </v-touch>
<v-touch tag="li" v-on:tap="onWifiAddTap"> <p>{{ $t('addDevice.scanCodeAddTip') }}</p>
<v-touch class="wifiAdd" tag="li" v-on:tap="onWifiAddTap">
<img src="../../resources/image/wifiAdd.png">{{ $t('addDevice.wifiAdd') }} <img src="../../resources/image/wifiAdd.png">{{ $t('addDevice.wifiAdd') }}
</v-touch> </v-touch>
<p>{{ $t('addDevice.wifiAddTip') }}</p>
</ul> </ul>
</div> </div>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog> <u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
......
...@@ -27,6 +27,14 @@ ...@@ -27,6 +27,14 @@
</div> </div>
<div class="scanContent" id="bcid" > <div class="scanContent" id="bcid" >
</div> </div>
<u-process ref="uprocess" :init-param="componentsConfig.processLoading.initParam">
<p class="loader"></p>
<p class="icon"></p>
<p class="noticeContent" v-show = "noticeTipShowFlag">
<span>&#xe637;</span>
<span v-html="$t('wifiAdd.noticeTip')"></span>
</p>
</u-process>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog> <u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading> <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div> </div>
......
...@@ -43,10 +43,21 @@ ...@@ -43,10 +43,21 @@
</ul> </ul>
<u-button :init-param="componentsConfig.connectButton.initParam" v-on:u-button-tap="onConnectButtonTap"></u-button> <u-button :init-param="componentsConfig.connectButton.initParam" v-on:u-button-tap="onConnectButtonTap"></u-button>
</div> </div>
<u-comm-loading ref="ucommloading" :init-param="componentsConfig.ucommloading.initParam" v-on:u-comm-loading-tap="onCommLoadingButtonTap()"> <!--<u-comm-loading ref="ucommloading" :init-param="componentsConfig.ucommloading.initParam" v-on:u-comm-loading-tap="onCommLoadingButtonTap()">
<p class="loader"></p> <p class="loader"></p>
<p class="icon"></p> <p class="icon"></p>
</u-comm-loading> </u-comm-loading> -->
<u-process ref="uprocess" :init-param="componentsConfig.processLoading.initParam">
<div class="loading">
<p class="loader"></p>
<p class="loading-text">{{ $t('wifiAdd.countDownText',[countDownText]) }}</p>
</div>
<p class="icon"></p>
<p class="noticeContent" v-show = "noticeTipShowFlag">
<span>&#xe637;</span>
<span v-html="$t('wifiAdd.noticeTip')"></span>
</p>
</u-process>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog> <u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading> <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div> </div>
......
...@@ -44,7 +44,7 @@ p { ...@@ -44,7 +44,7 @@ p {
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 1050; z-index: 1050;
background-color: rgba(0, 0, 0, 0.8); background-color: rgba(0, 0, 0, 0.9);
} }
.u-loading .u-loading-box { .u-loading .u-loading-box {
...@@ -100,7 +100,7 @@ p { ...@@ -100,7 +100,7 @@ p {
} }
.custom-loading { .custom-loading {
background-color: rgba(36, 38, 53, 0.9); background-color: rgba(36, 38, 53, 0.8);
} }
.custom-loading .u-loading-box { .custom-loading .u-loading-box {
...@@ -232,7 +232,7 @@ p { ...@@ -232,7 +232,7 @@ p {
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 1051; z-index: 1051;
background-color: rgba(0, 0, 0, 0.8); background-color: rgba(0, 0, 0, 0.9);
} }
.u-dialog .u-dialog-box { .u-dialog .u-dialog-box {
...@@ -303,13 +303,13 @@ p { ...@@ -303,13 +303,13 @@ p {
} }
.custom-dialog { .custom-dialog {
background-color: rgba(36, 38, 53, 0.9); background-color: rgba(36, 38, 53, 0.8);
} }
.custom-dialog .u-dialog-box { .custom-dialog .u-dialog-box {
width: 8.933rem; width: 8.933rem;
border-radius: 0.133rem; border-radius: 0.133rem;
background-color: transparent; background-color: #242635;
border: 1px solid; border: 1px solid;
color: #00ffff; color: #00ffff;
padding-bottom: 0.4rem; padding-bottom: 0.4rem;
...@@ -372,7 +372,7 @@ p { ...@@ -372,7 +372,7 @@ p {
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel.disabled, .custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel.disabled,
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm.disabled { .custom-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm.disabled {
background-color: transparent; background-color: transparent;
color: #999; color: #575a6d;
} }
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:after { .custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:after {
...@@ -506,7 +506,7 @@ p { ...@@ -506,7 +506,7 @@ p {
.custom-help-button.disabled, .custom-help-button.disabled,
.custom-button.disabled { .custom-button.disabled {
background-color: transparent; background-color: transparent;
color: #999; color: #575a6d;
} }
.linkText { .linkText {
...@@ -643,7 +643,7 @@ p { ...@@ -643,7 +643,7 @@ p {
background: #bbb; background: #bbb;
} }
@media (max-height: 400px /*no*/) { @media (max-height: 500px /*no*/) {
#app { #app {
height: 17.253rem; height: 17.253rem;
position: relative; position: relative;
......
...@@ -25,7 +25,15 @@ ...@@ -25,7 +25,15 @@
<v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch> <v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>
<p>{{ $t('title.alarmInfo') }}</p> <p>{{ $t('title.alarmInfo') }}</p>
</div> </div>
<u-list ref="ulist" :init-param="componentsConfig.alarmInfoList.initParam" v-on:u-list-load-tap="onListLoadTap()"></u-list> <div class="content">
<div class="notice" v-if="noticeTipShowFlag">
<span>&#xe637;</span>
{{ $t('notice.tip') }}
<v-touch tag="p" v-on:tap="onNotifycationSetting()">{{ $t('notice.button') }}
<span></span></v-touch>
</div>
<u-list ref="ulist" :init-param="componentsConfig.alarmInfoList.initParam" v-on:u-list-load="onListLoad()"></u-list>
</div>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog> <u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading> <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div> </div>
......
...@@ -25,8 +25,16 @@ ...@@ -25,8 +25,16 @@
<v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch> <v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>
<p>{{ $t('title.hijackRecord') }}</p> <p>{{ $t('title.hijackRecord') }}</p>
</div> </div>
<u-list ref="ulist" :init-param="componentsConfig.hijackRecordList.initParam" v-on:u-list-load-tap="onListLoadTap()"></u-list> <div class="content">
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog> <div class="notice" v-if="noticeTipShowFlag">
<span>&#xe637;</span>
{{ $t('notice.tip') }}
<v-touch tag="p" v-on:tap="onNotifycationSetting()">{{ $t('notice.button') }}
<span></span></v-touch>
</div>
<u-list ref="ulist" :init-param="componentsConfig.hijackRecordList.initParam" v-on:u-list-load="onListLoad()"></u-list>
</div>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading> <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div> </div>
......
...@@ -22,19 +22,26 @@ ...@@ -22,19 +22,26 @@
<div id="app" v-cloak> <div id="app" v-cloak>
<div class="header"> <div class="header">
<v-touch tag="span" class="header-left icon" v-on:tap="onMyInfoTap">&#xe69b;</v-touch> <v-touch tag="span" class="header-left icon" v-on:tap="onLogoutButtonTap">&#xe6ce;</v-touch>
<p>{{ $t('title.device') }}</p> <p>{{ $t('title.device') }}</p>
</div> </div>
<div class="content"> <div class="content">
<div class="topCpnt"> <div class="topCpnt">
<div v-show="lockId"> <div v-show="lockId">
<v-touch tag="div" class="doorbellBg" v-bind:class="{ active: doorbellRingingFlag }" v-on:tap="onStopDoorbellRing()"> <v-touch tag="div" class="doorbellBg" v-bind:class="[{ redDoorbellBg: warmingShowFlag },{ active: normalApertureShow },{warmingActive: warmingApertureShow}]" v-on:tap="onStopDoorbellRing()">
<div class="doorbellCircle"> <div class="doorbellCircle">
<div class="doorbell"> <div class="doorbell" v-bind:class="{ active: doorbellRingingFlag }">
<p></p> <!--<img :src="msgIconSrc">-->
<div :class=" msgClass ">
<ul class="wifiRemote">
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div> </div>
</div> </div>
<div class="doorbellTip"><span>{{ ringingTime }}</span>{{ ringingTime ? $t('device.doorLockRinging'):'' }}</div> <div class="doorbellTip"><span>{{ msgTime }}</span>{{ msgText }}</div>
</v-touch> </v-touch>
<p class="batteryState" :class="[{yellowWarning: batteryPercent<=20},{redWarning: batteryPercent<10}]"><span v-html="batteryState" ></span><span>{{ batteryPercent }}%</span></p> <p class="batteryState" :class="[{yellowWarning: batteryPercent<=20},{redWarning: batteryPercent<10}]"><span v-html="batteryState" ></span><span>{{ batteryPercent }}%</span></p>
</div> </div>
...@@ -104,7 +111,8 @@ ...@@ -104,7 +111,8 @@
<div class="content"> <div class="content">
<div class="inputBox"> <div class="inputBox">
<u-text :init-param="componentsConfig.passwordInput.initParam" :text="textPassword" <u-text :init-param="componentsConfig.passwordInput.initParam" :text="textPassword"
v-on:u-text-change="onPasswordChange(arguments[0])"></u-text> v-on:u-text-change="onPasswordChange(arguments[0])"
v-on:u-text-match-minlength="onPasswordMatchlength(arguments[0])"></u-text>
<p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p> <p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p>
</div> </div>
<u-button :init-param="componentsConfig.confirmButton.initParam" v-on:u-button-tap="onConfirmButtonTap"></u-button> <u-button :init-param="componentsConfig.confirmButton.initParam" v-on:u-button-tap="onConfirmButtonTap"></u-button>
...@@ -115,6 +123,7 @@ ...@@ -115,6 +123,7 @@
</u-comm-loading> </u-comm-loading>
</div> </div>
</transition> </transition>
<!--<update-app :show-flag="true"></update-app>-->
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog> <u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading> <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div> </div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/>
<title></title>
<link rel="stylesheet" type="text/css" href="../../lib/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./notify.css">
<style type="text/css">
[v-cloak]{
display: none;
}
</style>
<script type="text/javascript" src="../../lib/js/start.js"></script>
<script type="text/javascript" src="../../lib/js/p.js"></script>
<script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head>
<body>
<div id="content" v-cloak>
<android-notify :to-index="onNotifyToIndex"> </android-notify>
</div>
<script type="text/javascript" src="notify.js"></script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment