Commit 3d30bb28 by wangying

1.0.8 / 2017-10-10

==================
 * 1.上传门锁用户、门锁管理框架(标签、多语言、基本功能)
 * 2.主页添加绑定门锁
parent 1300ad17
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>doorlock</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
</natures>
</projectDescription>
1.0.7 / 2017-09-30 1.0.8 / 2017-10-10
==================
* 1.上传门锁用户、门锁管理框架(标签、多语言、基本功能)
* 2.主页添加绑定门锁
1.0.7 / 2017-09-30
================== ==================
* 1.智能指纹锁页面添加动画效果 * 1.智能指纹锁页面添加动画效果
......
...@@ -18,11 +18,20 @@ ...@@ -18,11 +18,20 @@
"bindUser": "绑定姓名", "bindUser": "绑定姓名",
"bind": "我要绑定", "bind": "我要绑定",
"reBound": "请重新绑定", "reBound": "请重新绑定",
"saveQRcode": "保存二维码到相册" "saveQRcode": "保存二维码到相册",
"unbind": "解绑",
"deleteUser": "删除该用户",
"qrcodeReset": "重新生成二维码",
"add": "添加",
"next": "下一步",
"iSee": "我知道了",
"unbindDoorlock": "解绑门锁"
}, },
"dialog":{ "dialog":{
"confirm": "确认", "confirm": "确认",
"cancel": "取消" "cancel": "取消",
"unbind": "解绑",
"delete": "删除"
}, },
"title":{ "title":{
"login": "登录", "login": "登录",
...@@ -34,7 +43,6 @@ ...@@ -34,7 +43,6 @@
"remoteOpendoor": "远程开门", "remoteOpendoor": "远程开门",
"hijackRecord": "劫持记录", "hijackRecord": "劫持记录",
"doorlockManage": "门锁管理", "doorlockManage": "门锁管理",
"doorlockUsers": "门锁用户",
"editName": "修改名称", "editName": "修改名称",
"qrcode": "生成绑定二维码", "qrcode": "生成绑定二维码",
"addDevice": "添加设备", "addDevice": "添加设备",
...@@ -43,7 +51,12 @@ ...@@ -43,7 +51,12 @@
"wifiAdd": "连接Wi-Fi", "wifiAdd": "连接Wi-Fi",
"bindUserHelp": "ID-姓名绑定", "bindUserHelp": "ID-姓名绑定",
"bindUser": "绑定用户", "bindUser": "绑定用户",
"userList": "用户列表" "userList": "用户列表",
"doorlockUsers": "门锁用户",
"addUser": "添加用户",
"editName": "修改名称",
"inviteBind": "邀请绑定",
"unlockInfo": "绑定开锁信息"
}, },
"guide":{ "guide":{
"footer": "指纹改变生活" "footer": "指纹改变生活"
...@@ -56,8 +69,7 @@ ...@@ -56,8 +69,7 @@
"error": { "error": {
"telNull": "请输入手机号", "telNull": "请输入手机号",
"passWordNull": "请输入密码" "passWordNull": "请输入密码"
}, }
"failure": "登陆失败"
}, },
"register":{ "register":{
"telInputTip": "请输入手机号", "telInputTip": "请输入手机号",
...@@ -90,52 +102,31 @@ ...@@ -90,52 +102,31 @@
"followCont1": "关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧", "followCont1": "关注 “i智信” 微信服务号可随时随地掌握设备动态<br>再也不担心错过重要通知,赶紧按下方提示试试吧",
"followCont2": "1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注", "followCont2": "1.保存二维码-2.用微信从<span>相册选取扫码</span>-3.关注",
"laterFollow": "稍后关注", "laterFollow": "稍后关注",
"newMsgDoorlock": "门锁最新消息", "bindDoorlock": "绑定门锁"
"doorLockRinging": "门铃响了"
}, },
"opendoorRecord":{ "opendoorRecord":{
"noRecordTip": "暂无记录", "noRecordTip": "暂无记录"
"passwordOpenDoor": "密码开门",
"fingerprintOpenDoor": "指纹开门",
"ICcardOpenDoor": "IC卡开门",
"remoteOpenDoor": "遥控器开门",
"keyOpenDoor": "钥匙开门",
"hijackingAlarm": "劫持报警",
"appRemoteOpenDoor": "app远程开门"
}, },
"alarmInfo":{ "alarmInfo":{
"noInfoTip": "暂无信息", "noInfoTip": "暂无信息"
"tamperAlarm": "防撬报警",
"trialAlarm": "试错报警",
"powerAlarm": "欠电报警",
"fackLockAlram": "假锁报警"
}, },
"remoteOpendoor":{ "remoteOpendoor":{
"passwordInputTip": "请输入远程开门密码", "passwordInputTip": "请输入远程开门密码",
"openDoorSuccess": "远程开门成功",
"openDoorFailure": "远程开门失败",
"error": { "error": {
"noPasswordTip": "远程密码不能为空"
} }
}, },
"hijackRecord":{ "hijackRecord":{
"noRecordTip": "暂无记录", "noRecordTip": "暂无记录"
"hijackingAlarm": "劫持指纹报警"
}, },
"doorlockManage":{ "doorlockManage":{
"noDeviceTip": "暂无设备", "name": "名称",
"deleteDialogTip": "<span>{0}</span>将被删除", "unbindDialogTip": "<span></span>解锁门锁后,您将失去对该门锁<br>所有查看、管理等功能操作"
"logoutDialogTip": "确定要退出系统吗?",
"deleteSuccess": "删除成功",
"deleteFailue": "删除失败",
"defaultNickname": "门锁"
}, },
"editName":{ "editName":{
"nameInputTip": "请输入门锁名称", "nameInputTip": "请输入门锁名称",
"editNameSuccess": "名字修改成功",
"editNameFailue": "名字修改失败",
"error": { "error": {
"nameCanNotBeBlank": "昵称不能为空"
} }
}, },
"qrcode":{ "qrcode":{
...@@ -147,9 +138,7 @@ ...@@ -147,9 +138,7 @@
}, },
"addDevice": { "addDevice": {
"scanCodeAdd": "扫描绑定设备", "scanCodeAdd": "扫描绑定设备",
"wifiAdd": "配置Wi-Fi", "wifiAdd": "配置Wi-Fi"
"bindSuccess": "绑定成功",
"bindFailue": "绑定失败"
}, },
"wifiAddHelp": { "wifiAddHelp": {
"helpTitle": "配置Wi-Fi说明:", "helpTitle": "配置Wi-Fi说明:",
...@@ -192,24 +181,56 @@ ...@@ -192,24 +181,56 @@
"id": "指纹ID:<span>{0}</span>密码ID:<span>{1}</span>IC卡ID:<span>{2}</span>", "id": "指纹ID:<span>{0}</span>密码ID:<span>{1}</span>IC卡ID:<span>{2}</span>",
"noUserTip": "暂无用户" "noUserTip": "暂无用户"
}, },
"myInfo":{
"editNickname": "修改昵称",
"editPassword": "修改密码"
},
"editNickname": {
"nickNameInputTip": "请输入昵称"
},
"editPassword": {
"newPasswordInputTip": "请输入新密码",
"oldPasswordInputTip": "请输入旧密码",
"oldPasswordInputTipAgain": "请再次输入旧密码"
},
"commstatusLoading":{ "commstatusLoading":{
"connectSuccess": "Wi-Fi连接成功,正在绑定...", "connectSuccess": "Wi-Fi连接成功,正在绑定...",
"bindSuccess": "绑定成功", "bindSuccess": "绑定成功",
"bindFailed": "绑定失败" "bindFailed": "绑定失败"
}, },
"request":{ "userList":{
"error": "请求发送失败" "name": "昵称:",
"noUserTip": "暂无用户"
},
"addUser":{
"nameInputTip": "请输入您想添加的用户名",
"error": {
}
},
"doorlockUsers":{
"name": "昵称:",
"inviteBind": "邀请绑定",
"bindUnlockInfo": "绑定开锁信息",
"opendoorRecord": "历史开门记录",
"unbindDialogTip": "<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中",
"deleteUserDialogTip": "删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中",
"unbindSuccess": "解绑成功",
"guideStep1Tip1": "邀请绑定成功",
"guideStep1Tip2": "(可查看开门记录,报警记录等<br>相关门锁信息)",
"guideStep3Tip": "绑定后看可了解<br>该用户的开门情况"
},
"editName":{
"nameInputTip": "请输入用户名",
"error": {
}
},
"inviteBind":{
"title": "注意事项:",
"cont1": "1.直接通过微信扫一扫添加门锁",
"cont2": "2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"
},
"unlockInfo":{
"bindUnlockInfo": "已绑定的开锁信息",
"noInfoTip": "目前无绑定任何信息,请添加"
},
"addUnlockInfo":{
"opendoorMode": "开门方式",
"fingerprint": "指纹",
"password": "密码",
"icCard": "IC卡",
"key": "钥匙",
"hijackFingerprint": "劫持指纹",
"opendoorRecord": "今日开门记录",
"tip": "仅显示未绑定开门记录"
} }
} }
\ No newline at end of file
let projectMethods = {};
projectMethods.changeGridList = function (vmObj, list) {
vmObj.$refs.gridlist.changeList(list);
};
projectMethods.changeTimeline = function (vmObj, list) {
vmObj.$refs.timeline.changeList(list);
};
export {projectMethods}
\ No newline at end of file
export default { let uComponents = {};
"powerIcon":["&#xe6e5;", "&#xe62b;", "&#xe627;", "&#xe628;", "&#xe62a;", "&#xe629;"],
"openDoorMode": { uComponents.changeGridList = function (vmObj, list) {
0: "passwordOpenDoor", vmObj.$refs.gridlist.changeList(list);
1: "fingerprintOpenDoor", };
2: "ICcardOpenDoor",
3: "remoteOpenDoor", uComponents.changeTimeline = function (vmObj, list) {
4: "keyOpenDoor", vmObj.$refs.timeline.changeList(list);
5: "hijackingAlarm", };
6: "appRemoteOpenDoor"
}, export {uComponents}
"alarmMode": { \ No newline at end of file
0: "tamperAlarm",
1: "trialAlarm",
2: "powerAlarm",
3: "fackLockAlram"
}
}
\ No newline at end of file
...@@ -11,12 +11,12 @@ const iot = new UIOT({ ...@@ -11,12 +11,12 @@ const iot = new UIOT({
lang: ['zh', 'en'], lang: ['zh', 'en'],
vue: Vue, vue: Vue,
i18n: VueI18n, i18n: VueI18n,
appId: '10004', appId: '10003',
wx: { wx: {
appId: '' appId: ''
}, },
cloud: { cloud: {
url: 'http://192.168.2.96:20000' url: 'http://192.168.2.97:20007'
}, },
plugin: { plugin: {
log: { log: {
...@@ -54,155 +54,7 @@ uPublic.componentsExtend = function (array) { ...@@ -54,155 +54,7 @@ uPublic.componentsExtend = function (array) {
}); });
}; };
//请求发送失败弹框
uPublic.openRequestErrorAlert = function (vmObj, content = Vue.t('request.error')) {
uComponents.openAlert(vmObj, content, {
text: Vue.t('dialog.confirm'), callback: function () {
}
});
};
// 检查请求成功后data参数
uPublic.checkResponseData = function (data) {
// json
if (data != null && typeof data === 'object') {
if (Object.keys(data).length == 0 || data.hasOwnProperty('msg')) {
return false;
} else {
return data;
}
// array
} else if (Array.isArray(data)) {
if (data.length > 0) {
return data;
} else {
return false;
}
}
};
iot.ready(() => { iot.ready(() => {
uPublic.recalc(); uPublic.recalc();
}); });
iot.navigator.getAllWebviw = function () {
return plus.webview.all();
}
iot.navigator.fire = function (webview, eventType, data) {
if (webview) {
if (typeof data === 'undefined') {
data = '';
} else if (typeof data === 'boolean' || typeof data === 'number') {
webview.evalJS("typeof mui!=='undefined'&&mui.receive('" + eventType + "'," + data + ")");
return;
} else if (typeof data === 'object' && Object.keys(data).length == 0) {
data = JSON.stringify(data || {}).replace(/\'/g, "\\u0027").replace(/\\/g, "\\u005c");
}
webview.evalJS('iot.navigator.receive("' + eventType + '","' + data + '")');
}
};
window.iot = iot;
iot.navigator.receive = function (eventType, data) {
console.log("receive。。。");
if (eventType) {
try {
if (data && typeof data === 'string') {
data = JSON.parse(data);
}
} catch (e) {
}
iot.navigator.trigger(document, eventType, data);
}
};
iot.navigator.trigger = function (element, eventType, eventData) {
console.log("trigger。。。");
console.log(element);
console.log(eventType);
element.dispatchEvent(new CustomEvent(eventType, {
detail: eventData,
bubbles: true,
cancelable: true
}));
return this;
};
iot.navigator.closeAllBesidesItself = function () {
var wvs = plus.webview.all();
// var curWb = plus.webview.currentWebview();
for (var i = 0; i < wvs.length-1; i++) {
// if (wvs[i].id != curWb.id) {
wvs[i].close();
// }
}
}
iot.navigator.closeAll = function (){
var wvs = plus.webview.all();
var curWb = plus.webview.currentWebview();
for (var i = 0; i < wvs.length; i++) {
wvs[i].close();
}
}
iot.ready(function(){
plus.key.addEventListener('backbutton',iot.navigator.aback,false);
// plus.key.addEventListener('backbutton',iot.navigator.aback,false);
})
iot.navigator.aback =function(){
var wobj = plus.webview.currentWebview();
var parent = wobj.parent();
var wbs = iot.navigator.getAllWebviw();
if (wbs.length>1) {
// console.log("不止一个webview...");
// return;
iot.navigator.back();
// console.log("有父webview...");
// return;
// parent.evalJS('iot.navigator.back()');
// parent.evalJS('mui&&mui.back();');
} else {
console.log("只有一个webView");
// return;
wobj.canBack(function(e) {
console.log("是否可以返回canback...");
console.log(window.history);
window.history.back();
console.log(e);
//by chb 暂时注释,在碰到类似popover之类的锚点的时候,需多次点击才能返回;
if (e.canBack) { //webview history back
console.log("e.canback....");
// return;
window.history.back();
// iot.navigator.back();
} else { //webview close or hide
console.log("不能back。。。");
if (!__back__first) {
__back__first = new Date().getTime();
console.log("给back_first设值....");
plus.nativeUI.toast( "再按一次退出应用");
// mui.toast('再按一次退出应用');
setTimeout(function() {
__back__first = null;
}, 2000);
} else {
console.log("back_first不为空....");
if (new Date().getTime() - __back__first < 2000) {
console.log("两次的间隔时间少于2秒");
plus.runtime.quit();
}else{
console.log("时间间隔大于2s");
}
}
return;
}
});
}
}
export {iot, uPublic, uComponents} export {iot, uPublic, uComponents}
\ No newline at end of file
...@@ -19,7 +19,6 @@ function init() { ...@@ -19,7 +19,6 @@ function init() {
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
openScanCode(this);
}, },
methods:{ methods:{
//tap < //tap <
...@@ -50,52 +49,3 @@ function initComponentsConfig() { ...@@ -50,52 +49,3 @@ function initComponentsConfig() {
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
\ No newline at end of file
function openScanCode(self){
iot.utils.scanBarcode({
data: {
id: 'bcid',
styles: {
frameColor: '#00ffff',
scanbarColor: '#00ffff',
background: '#242b35'
}
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
//扫描成功
let qrKey = data.result;
//绑定设备
iot.business.sds.scanqr({
data: {
qrKey: qrKey
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(response);
uComponents.openAlert(self, Vue.t('addDevice.bindSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
}
});
}else{}
},
error: (error) => {
//请求失败
uPublic.openRequestErrorAlert(self);
}
});
}else{}
},
error: (error) => {
console.log(error);
//请求失败
uPublic.openRequestErrorAlert(self);
}
});
}
...@@ -12,43 +12,30 @@ import {iot, uPublic, uComponents} from '../../public/public.js'; ...@@ -12,43 +12,30 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
//通用 input、按钮、dialog、loading组件 //通用 input、按钮、dialog、loading组件
uPublic.componentsInit(['u-text','u-button','u-comm-loading','u-dialog','u-loading']); uPublic.componentsInit(['u-text','u-button','u-commstatus-loading','u-dialog','u-loading']);
const app = new Vue({ const app = new Vue({
data:{ data:{
textWiFiName: null,
textPassword: null, textPassword: null,
textErrorTip: null, textErrorTip: null,
textLoading: 'loading...',
status: 0,
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
status: 0
}, },
mounted(){ mounted(){
resolve(this);
}, },
methods:{ methods:{
getTextWiFiName(){ getTextLoading(){
return this.textWiFiName; return this.textLoading;
}, },
setTextWiFiName(text){ setTextLoading(text){
this.textWiFiName = text; this.textLoading = text;
},
getTextPassword(){
return this.textPassword;
},
setTextPassword(pwd){
this.textPassword = pwd;
},
gettTextErrorTip(){
return this.textErrorTip;
},
setTextErrorTip(tip){
this.textErrorTip = tip;
}, },
getStatus(){ getStatus(){
return this.status; return this.status;
}, },
setStatus(status){ setStatus(value){
this.status = status; this.status = value;
}, },
onPasswordChange(text){ onPasswordChange(text){
passwordChange(this,text); passwordChange(this,text);
...@@ -62,8 +49,8 @@ function init() { ...@@ -62,8 +49,8 @@ function init() {
connectButtonTap(this); connectButtonTap(this);
}, },
//tap loading button //tap loading button
onCommLoadingButtonTap(){ onCommstatusLoadingButtonTap(){
commLoadingButtonTap(this); commstatusLoadingButtonTap(this);
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -97,32 +84,15 @@ function initComponentsConfig() { ...@@ -97,32 +84,15 @@ function initComponentsConfig() {
class: 'custom-loading' class: 'custom-loading'
} }
}, },
ucommloading: { ucommstatusloading: {
initParam: { initParam: {
class: 'custom-comm-loading', class: 'custom-commstatus-loading',
buttonText: Vue.t('btn.confirm'), buttonText: Vue.t('btn.confirm')
text: 'loading',
status: 0
} }
} }
} }
} }
function resolve(self){
iot.business.sds.getSSId({
success: (response) => {
console.log(response);
let data = JSON.parse(response);
self.textWiFiName = data.ssid;
console.log(self.textWiFiName);
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
}
});
}
function passwordChange(self,text){ function passwordChange(self,text){
self.textPassword = text; self.textPassword = text;
console.log('passwordChange: ' + self.textPassword); console.log('passwordChange: ' + self.textPassword);
...@@ -135,94 +105,29 @@ function backTap(){ ...@@ -135,94 +105,29 @@ function backTap(){
//tap 连接 //tap 连接
function connectButtonTap(self){ function connectButtonTap(self){
// uComponents.showCommstatusloading(self); uComponents.showCommstatusloading(self);
// setTimeout(function(){ setTimeout(function(){
// self.setTextLoading(Vue.t('commstatusLoading.connectSuccess')); self.setTextLoading(Vue.t('commstatusLoading.connectSuccess'));
// setTimeout(function(){ setTimeout(function(){
// //绑定成功 //绑定成功
// self.setStatus(1);
// self.setTextLoading(Vue.t('commstatusLoading.bindSuccess'));
// //绑定失败
// //self.setStatus(2);
// //self.setTextLoading(Vue.t('commstatusLoading.bindFailed'));
// //uComponents.changeCommstatusButtonText(self,Vue.t('btn.reBound'));
// },3000);
// },3000);
console.log(self.getTextWiFiName());
// self.setTextPassword('macro_scope00');
console.log(self.getTextPassword());
if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
self.setTextErrorTip(Vue.t('wifiAdd.passwordInputTip'));
}else{
iot.business.sds.findWifi({
data: {
model: 'THM_LIVING_ELECTRICALBLANKET_TH_1507',
ssid: self.getTextWiFiName(),
wifiPwd: self.getTextPassword(),
timeout: 20000
},
success: (response) => {
console.log("findWifi");
console.log(response);
if(response.data == 'onProvisioning'){
//wifi链接中
uComponents.showCommLoading(self);
}else if(response.data == 'provisioned success'){
//wifi连接成功,停止连接wifi
// iot.business.sds.stopFindWifi({
// success: (response) => {},
// error: (error) => {}
// });
}
},
error: (error) => {
console.log(error);
}
});
iot.business.sds.findDevices({
success: (response) => {
console.log("findDevices");
console.log(response);
if(response.data == "joined success"){
//连接成功
uComponents.changeCommLoadingStatusAndText(self, 1, '绑定成功');
self.setStatus(1); self.setStatus(1);
// //停止查找设备 self.setTextLoading(Vue.t('commstatusLoading.bindSuccess'));
iot.business.sds.stopFindDevices({ //绑定失败
success: (response) => {}, //self.setStatus(2);
error: (error) => {} //self.setTextLoading(Vue.t('commstatusLoading.bindFailed'));
}); //uComponents.changeCommstatusButtonText(self,Vue.t('btn.reBound'));
}else if(response.data == "fail"){ },3000);
//连接失败 },3000);
uComponents.changeCommLoadingStatusAndText(self, 2, '绑定失败');
self.setStatus(2);
uComponents.changeCommButtonText('请重新绑定');
//停止查找设备
iot.business.sds.stopFindDevices({
success: (response) => {},
error: (error) => {}
});
}
},
error: (error) => {
console.log(error);
}
});
}
} }
//tap loading button //tap loading button
function commLoadingButtonTap(self) { function commstatusLoadingButtonTap(self) {
if(self.getStatus() == 1){
//绑定成功 //绑定成功
uComponents.hideCommLoading(self); uComponents.hideCommstatusloading(self);
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: '../device/',
id: 'device' id: 'device'
}); });
}else if(self.getStatus() == 2){
//绑定失败 //绑定失败
uComponents.hideCommLoading(self); //uComponents.hideCommstatusloading(self);
}
} }
\ No newline at end of file
...@@ -67,14 +67,4 @@ function wifiAddButtonTap(){ ...@@ -67,14 +67,4 @@ function wifiAddButtonTap(){
url: './wifiAdd.html', url: './wifiAdd.html',
id: 'wifiAdd' id: 'wifiAdd'
}); });
// 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
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 报警信息页面 * 报警信息页面
*/ */
const PAGE_SIZE = 10;
import moment from 'moment';
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js'; import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
...@@ -18,36 +16,11 @@ function init() { ...@@ -18,36 +16,11 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
list:[],
startId: 0,
deviceId: null,
}, },
mounted(){ mounted(){
resolve(this);
}, },
methods:{ methods:{
getList(){
return this.list;
},
setList(list){
this.list = list;
},
getStartId(){
return this.startId;
},
setStartId(id){
this.startId = id;
},
getDeviceId(){
return this.deviceId;
},
setDeviceId(id){
this.deviceId = id;
},
onListLoadTap(){
listLoadTap(this);
},
//tap < //tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
...@@ -62,13 +35,12 @@ function initComponentsConfig() { ...@@ -62,13 +35,12 @@ function initComponentsConfig() {
alarmInfoList:{ alarmInfoList:{
initParam: { initParam: {
class: 'custom-list', class: 'custom-list',
// list: [ list: [
// {value: 1, leftImage: '../../resources/image/green_alarmInfo0_icon.png', title:'', subtitle:'禁试报警', rightText: '2017.06.2315:56:26'}, {value: 1, leftImage: '../../resources/image/green_alarmInfo0_icon.png', title:'', subtitle:'禁试报警', rightText: '2017.06.2315:56:26'},
// {value: 2, leftImage: '../../resources/image/green_alarmInfo1_icon.png', title:'', subtitle:'防撬报警', rightText: '2017.06.2315:01:01'}, {value: 2, leftImage: '../../resources/image/green_alarmInfo1_icon.png', title:'', subtitle:'防撬报警', rightText: '2017.06.2315:01:01'},
// {value: 3, leftImage: '../../resources/image/green_alarmInfo2_icon.png', title:'', subtitle:'欠电报警', rightText: '2017.05.2315:56:26'}, {value: 3, leftImage: '../../resources/image/green_alarmInfo2_icon.png', title:'', subtitle:'欠电报警', rightText: '2017.05.2315:56:26'},
// {value: 4, leftImage: '../../resources/image/green_alarmInfo3_icon.png', title:'', subtitle:'假锁报警', rightText: '2017.03.2315:01:01'} {value: 4, leftImage: '../../resources/image/green_alarmInfo3_icon.png', title:'', subtitle:'假锁报警', rightText: '2017.03.2315:01:01'}
// ], ],
list: [],
tip: Vue.t('alarmInfo.noInfoTip') tip: Vue.t('alarmInfo.noInfoTip')
} }
}, },
...@@ -85,57 +57,7 @@ function initComponentsConfig() { ...@@ -85,57 +57,7 @@ function initComponentsConfig() {
} }
} }
function resolve(self) {
self.setDeviceId(iot.navigator.getExtras().deviceId);
uComponents.showLoading(self);
iot.business.api.sendCustom('lock/getHistoryRecord',
{
data: {
device_id: self.getDeviceId(),
action: 2,
start_id: self.getStartId(),
page_size: PAGE_SIZE
},
success: (response) => {
console.log(response);
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: (err) => {
uPublic.openRequestErrorAlert(self);
console.log(err);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
\ No newline at end of file
//tap 点击加载更多
function listLoadTap(self) {
resolve(self);
}
\ No newline at end of file
...@@ -6,11 +6,8 @@ ...@@ -6,11 +6,8 @@
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 劫持记录页面 * 劫持记录页面
*/ */
import moment from 'moment';
const PAGE_SIZE = 10;
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js';
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
...@@ -19,43 +16,11 @@ function init() { ...@@ -19,43 +16,11 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
list: [],
startId: 0,
deviceId: null,
userInfo: []
}, },
mounted(){ mounted(){
resolve(this);
}, },
methods:{ methods:{
getList(){
return this.list;
},
setList(list){
this.list = list;
},
getStartId(){
return this.startId;
},
setStartId(id){
this.startId = id;
},
getDeviceId(){
return this.deviceId;
},
setDeviceId(id){
this.deviceId = id;
},
getUserInfo(){
return this.userInfo;
},
setUserInfo(info){
this.userInfo = info;
},
onListLoadTap(){
listLoadTap(this);
},
//tap < //tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
...@@ -70,11 +35,10 @@ function initComponentsConfig() { ...@@ -70,11 +35,10 @@ function initComponentsConfig() {
hijackRecordList:{ hijackRecordList:{
initParam: { initParam: {
class: 'custom-list', class: 'custom-list',
// list: [ list: [
// {value: 1, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'测试用户02', subtitle: '劫持指纹开门', rightText: '2017.07.1306:10:10'}, {value: 1, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'测试用户02', subtitle: '劫持指纹开门', rightText: '2017.07.1306:10:10'},
// {value: 2, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'ID:117', subtitle: '劫持指纹开门', rightText: '2017.07.0322:57:44'} {value: 2, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'ID:117', subtitle: '劫持指纹开门', rightText: '2017.07.0322:57:44'}
// ], ],
list: [],
tip: Vue.t('hijackRecord.noRecordTip') tip: Vue.t('hijackRecord.noRecordTip')
} }
}, },
...@@ -91,70 +55,7 @@ function initComponentsConfig() { ...@@ -91,70 +55,7 @@ function initComponentsConfig() {
} }
} }
function resolve(self) {
self.setDeviceId(iot.navigator.getExtras().deviceId);
uComponents.showLoading(self);
iot.business.api.sendCustom('lock/getHistoryRecord',
{
data: {
device_id: self.getDeviceId(),
action: 3,
start_id: self.getStartId(),
page_size: PAGE_SIZE
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(data);
let list = [];
let record = data.record;
if(data.hasOwnProperty('info')){
self.setUserInfo(data.info);
}
for(let i=0; i<record.length; i++){
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_opendoor5_icon.png',
subtitle: Vue.t('hijackRecord.'+config.openDoorMode[record[i].mode]+''),
// title: ('ID:'+record[i].id),
rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
};
for(let j=0; j<self.getUserInfo().length; j++){
if(record[i].openId == self.getUserInfo()[j].openId && record[i].mode == self.getUserInfo()[j].mode){
if(self.getUserInfo()[j].nickname != null && self.getUserInfo()[j].id != null){
list[i].title = self.getUserInfo()[j].nickname + " ID:"+self.getUserInfo()[j].id;
}else if(self.getUserInfo()[j].nickname != null){
list[i].title = "ID:"+self.getUserInfo()[j].id;
}
}
}
}
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: (err) => {
uPublic.openRequestErrorAlert(self);
console.log(err);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
\ No newline at end of file
//tap 点击加载更多
function listLoadTap(self) {
resolve(self);
}
\ No newline at end of file
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 主控页面 * 主控页面
*/ */
import moment from 'moment';
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js'; import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
...@@ -31,96 +30,9 @@ function init() { ...@@ -31,96 +30,9 @@ function init() {
activeFlag: true, activeFlag: true,
followShowFlag: false, followShowFlag: false,
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
//电量
batteryState: null,
//电量百分比
batteryPercent: 0,
//响铃时间
ringingTime: null,
//门铃是否响起
doorbellRingingFlag: true,
//远程开门是否开启
remoteOpendoorFlag: true,
//设备ID
deviceId: null,
//设备uuid
uuid: null
}, },
mounted(){ mounted(){
let self = this;
iot.navigator.closeAllBesidesItself();
//获取设备信息
iot.business.sds.getDevicesByUser({
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
self.uuid = data[0].uuid;
self.deviceId = data[0].sn;
iot.business.sds.getDeviceStatus({
data: {
uuid: self.uuid
},
success: (response) => {
console.log(response);
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
}
});
iot.business.api.sendCustom('lock/getLockInfo',{
data: {
// device_id:"600194283588"
device_id: self.deviceId
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(data.info);
let newMsg = moment(data.info[0].time).format("YY.MM.DD HH:mm") + data.info[0].nickname + Vue.t('opendoorRecord.'+config.openDoorMode[data.info[0].mode]+'')
uComponents.changeMarqueeText(self, newMsg);
}else{
}
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
}
});
}else{
}
},
error: (error) => {}
});
//注册监听上报
iot.business.sds.registerPushListener({
success: (response) => {
console.log(response);
if(response.hasOwnProperty('params')){
console.log(JSON.parse(response));
setDevceInfo(self, response.params);
}
},
error: (error) => {
console.log(error);
uPublic.openRequestErrorAlert(self);
}
});
let power = 5;
this.batteryPercent = power/5*100;
this.batteryState = config.powerIcon[power];
let newMsg = '2017.08.02 18:45 宝贝指纹开门';
// uComponents.changeMarqueeText(this, newMsg);
let time = new Date();
this.ringingTime = moment(time).format("HH:mm");
// getNewOpenDoorRecord(this);
}, },
methods:{ methods:{
getValueOpendoorRecord(){ getValueOpendoorRecord(){
...@@ -153,45 +65,8 @@ function init() { ...@@ -153,45 +65,8 @@ function init() {
setFollowShowFlag(boolean){ setFollowShowFlag(boolean){
this.followShowFlag = boolean; this.followShowFlag = boolean;
}, },
getBatteryState(){
return this.batteryState();
},
setBatteryState(number){
this.batteryState = number
},
getBatteryPercent(){
return this.batteryPercent;
},
setBatteryPercent(percent){
this.batteryPercent = percent;
},
getRingingTime(){
return this.ringingTime;
},
setRingingTime(time){
this.ringingTime = time
},
getDoorbellRingingFlag(){
return this.doorbellRingingFlag;
},
setDoorbellRingingFlag(boolean){
this.doorbellRingingFlag = boolean;
},
getRemoteOpendoorFlag(){
return this.remoteOpendoorFlag;
},
setRemoteOpendoorFlag(flag){
this.remoteOpendoorFlag = flag;
},
getUuid(){
return this.uuid;
},
setUuid(){
this.uuid = id;
},
//tap 个人信息
onMyInfoTap(){ onMyInfoTap(){
myInfoTap(this); myInfoTap();
}, },
//tap 门锁管理 //tap 门锁管理
onDoorlockManageTap(){ onDoorlockManageTap(){
...@@ -199,11 +74,11 @@ function init() { ...@@ -199,11 +74,11 @@ function init() {
}, },
//tap 开门记录 //tap 开门记录
onOpendoorRecordTap(){ onOpendoorRecordTap(){
opendoorRecordTap(this); opendoorRecordTap();
}, },
//tap 安全报警 //tap 安全报警
onSecurityAlarmTap(){ onSecurityAlarmTap(){
securityAlarmTap(this); securityAlarmTap();
}, },
//tap 门锁用户 //tap 门锁用户
onDoorlockUserTap(){ onDoorlockUserTap(){
...@@ -211,11 +86,11 @@ function init() { ...@@ -211,11 +86,11 @@ function init() {
}, },
//tap 远程开门 //tap 远程开门
onRemoteOpendoorTap(){ onRemoteOpendoorTap(){
remoteOpendoorTap(this); remoteOpendoorTap();
}, },
//tap 劫持报警 //tap 劫持报警
onHijackAlarmTap(){ onHijackAlarmTap(){
hijackAlarmTap(this); hijackAlarmTap();
}, },
//tap 保存二维码到相册 //tap 保存二维码到相册
onSaveQRcodeButtonTap(){ onSaveQRcodeButtonTap(){
...@@ -224,6 +99,9 @@ function init() { ...@@ -224,6 +99,9 @@ function init() {
//tap 稍后关注 //tap 稍后关注
onLaterFollowTap(){ onLaterFollowTap(){
laterFollowTap(this); laterFollowTap(this);
},
onBindDoorlockTap(){
bindDoorlockTap();
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -316,46 +194,10 @@ function initComponentsConfig() { ...@@ -316,46 +194,10 @@ function initComponentsConfig() {
} }
} }
//设置设备信息 function myInfoTap(){
function setDevceInfo(self, data) {
self.setBatteryState(config.powerIcon[data.power]);
self.setBatteryPercent(data.power/5*100);
self.setRingingTime(moment(data.time).format("HH:mm"));
self.setDoorbellRingingFlag(data);
self.setRemoteOpendoorFlag(flag);
}
//获取最新开门记录
function getNewOpenDoorRecord(self){
iot.business.api.sendCustom('',{
data: {
uuid: 'uuid',
start_id: 0,
page_size: 0
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
uComponents.changeMarqueeText(self, data.message);
}
},
error: (error) => {
uPublic.openRequestErrorAlert(self);
console.log(error);
},
complete: () => {}
});
}
//tap 个人信息
function myInfoTap(self){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../myInfo/', url: '../myInfo/',
id: 'myInfo', id: 'myInfo'
extras: {
nickname: self.nickname
}
}); });
} }
...@@ -368,24 +210,18 @@ function doorlockManageTap(){ ...@@ -368,24 +210,18 @@ function doorlockManageTap(){
} }
//tap 开门记录 //tap 开门记录
function opendoorRecordTap(self){ function opendoorRecordTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './opendoorRecord.html', url: './opendoorRecord.html',
id: 'opendoorRecord', id: 'opendoorRecord'
extras: {
deviceId: self.deviceId
}
}); });
} }
//tap 安全报警 //tap 安全报警
function securityAlarmTap(self){ function securityAlarmTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './alarmInfo.html', url: './alarmInfo.html',
id: 'alarmInfo', id: 'alarmInfo'
extras: {
deviceId: self.deviceId
}
}); });
} }
...@@ -393,29 +229,23 @@ function securityAlarmTap(self){ ...@@ -393,29 +229,23 @@ function securityAlarmTap(self){
function doorlockUserTap(){ function doorlockUserTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockUsers/', url: '../doorlockUsers/',
id: 'doorlockUsers', id: 'doorlockUsers'
}); });
} }
//tap 远程开门 //tap 远程开门
function remoteOpendoorTap(self){ function remoteOpendoorTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './remoteOpendoor.html', url: './remoteOpendoor.html',
id: 'remoteOpendoor', id: 'remoteOpendoor'
extras: {
uuid: self.getUuid()
}
}); });
} }
//tap 劫持报警 //tap 劫持报警
function hijackAlarmTap(self){ function hijackAlarmTap(){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './hijackRecord.html', url: './hijackRecord.html',
id: 'hijackRecord', id: 'hijackRecord'
extras: {
deviceId: self.deviceId
}
}); });
} }
...@@ -428,3 +258,10 @@ function saveQRcodeButtonTap(){ ...@@ -428,3 +258,10 @@ function saveQRcodeButtonTap(){
function laterFollowTap(self){ function laterFollowTap(self){
self.setFollowShowFlag(false); self.setFollowShowFlag(false);
} }
function bindDoorlockTap(){
iot.navigator.openWindow({
url: '../addDevice/',
id: 'addDevice'
});
}
\ No newline at end of file
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 开门记录页面 * 开门记录页面
*/ */
import moment from 'moment';
const PAGE_SIZE = 10;
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js'; import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
...@@ -18,43 +16,11 @@ function init() { ...@@ -18,43 +16,11 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
list: [],
startId: 0,
deviceId: null,
userInfo: []
}, },
mounted(){ mounted(){
resolve(this);
}, },
methods:{ methods:{
getList(){
return this.list;
},
setList(list){
this.list = list;
},
getStartId(){
return this.startId;
},
setStartId(id){
this.startId = id;
},
getDeviceId(){
return this.deviceId;
},
getUserInfo(){
return this.userInfo;
},
setUserInfo(info){
this.userInfo = info;
},
setDeviceId(id){
this.deviceId = id;
},
onListLoadTap(){
listLoadTap(this);
},
//tap < //tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
...@@ -69,7 +35,16 @@ function initComponentsConfig() { ...@@ -69,7 +35,16 @@ function initComponentsConfig() {
opendoorRecordList:{ opendoorRecordList:{
initParam: { initParam: {
class: 'custom-list', class: 'custom-list',
list: [], list: [
{value: 1, leftImage: '../../resources/image/green_opendoor0_icon.png', title:'', subtitle: '手机远程开门', rightText: '2017.08.0310:29:53'},
{value: 2, leftImage: '../../resources/image/green_opendoor0_icon.png', title:'', subtitle: '手机远程开门', rightText: '2017.08.0310:27:56'},
{value: 3, leftImage: '../../resources/image/green_opendoor1_icon.png', title:'ID:6', subtitle: '指纹开门', rightText: '2017.08.0310:25:47'},
{value: 4, leftImage: '../../resources/image/green_opendoor0_icon.png', title:'', subtitle: '手机远程开门', rightText: '2017.07.3117:13:03',},
{value: 5, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'测试用户02', subtitle: '劫持指纹开门', rightText: '2017.07.3117:10:10'},
{value: 6, leftImage: '../../resources/image/green_opendoor3_icon.png', title:'测试用户', subtitle: '密码开门', rightText: '2017.07.3117:09:59'},
{value: 7, leftImage: '../../resources/image/green_opendoor2_icon.png', title:'ID:117', subtitle: '劫持指纹开门', rightText: '2017.07.3117:05:19'},
{value: 8, leftImage: '../../resources/image/green_opendoor3_icon.png', title:'测试用户', subtitle: '密码开门', rightText: '2017.07.3117:03:50',}
],
tip: Vue.t('opendoorRecord.noRecordTip') tip: Vue.t('opendoorRecord.noRecordTip')
} }
}, },
...@@ -86,71 +61,7 @@ function initComponentsConfig() { ...@@ -86,71 +61,7 @@ function initComponentsConfig() {
} }
} }
//调用接口获取开门记录
function resolve(self) {
uComponents.showLoading(self);
self.setDeviceId(iot.navigator.getExtras().deviceId);
iot.business.api.sendCustom('lock/getHistoryRecord',
{
data: {
device_id: self.getDeviceId(),
action: 0,
start_id: self.getStartId(),
page_size: PAGE_SIZE
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(data);
let list = [];
let record = data.record;
if(data.hasOwnProperty('info')){
self.setUserInfo(data.info);
}
for(let i=0; i<record.length; i++){
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_opendoor'+record[i].mode+'_icon.png',
subtitle: Vue.t('opendoorRecord.'+config.openDoorMode[record[i].mode]+''),
rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
};
for(let j=0; j<self.getUserInfo().length; j++){
if(record[i].openId == self.getUserInfo()[j].openId && record[i].mode == self.getUserInfo()[j].mode){
if(self.getUserInfo()[j].nickname != null && self.getUserInfo()[j].id != null){
list[i].title = self.getUserInfo()[j].nickname + " ID:"+self.getUserInfo()[j].id;
}else if(self.getUserInfo()[j].nickname != null){
list[i].title = "ID:"+self.getUserInfo()[j].id;
}
}
}
}
self.setList(self.getList().concat(list));
if(record.length > 0){
self.setStartId(record[record.length-1].id);
}
//更新列表数据
uComponents.changeList(self, self.getList());
console.log("in");
}else{
}
uComponents.hideLoading(self);
},
error: (err) => {
uPublic.openRequestErrorAlert(self);
console.log(err);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
\ No newline at end of file
//tap 点击加载更多
function listLoadTap(self) {
resolve(self);
}
\ No newline at end of file
...@@ -20,23 +20,11 @@ function init() { ...@@ -20,23 +20,11 @@ function init() {
textLoading: 'loading...', textLoading: 'loading...',
status: 0, status: 0,
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
//设备uuid
uuid: null
}, },
mounted(){ mounted(){
resolve(this);
}, },
methods:{ methods:{
getTextPassword(){
return this.textPassword;
},
setTextPassword(pwd){
this.textPassword = pwd;
},
setTextErrorTip(tip){
this.textErrorTip = tip;
},
getTextLoading(){ getTextLoading(){
return this.textLoading; return this.textLoading;
}, },
...@@ -55,12 +43,6 @@ function init() { ...@@ -55,12 +43,6 @@ function init() {
onPasswordChange(text){ onPasswordChange(text){
passwordChange(this,text); passwordChange(this,text);
}, },
getUuid(){
return this.uuid;
},
setUuid(id){
this.uuid = id;
},
//tap < //tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
...@@ -68,6 +50,10 @@ function init() { ...@@ -68,6 +50,10 @@ function init() {
//tap 确定 //tap 确定
onConfirmButtonTap(){ onConfirmButtonTap(){
confirmButtonTap(this); confirmButtonTap(this);
},
//tap loading button
onCommstatusLoadingButtonTap(){
commstatusLoadingButtonTap(this);
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -109,15 +95,8 @@ function initComponentsConfig() { ...@@ -109,15 +95,8 @@ function initComponentsConfig() {
} }
} }
function resolve(self){
let extras = iot.navigator.getExtras();
self.setUuid(extras.uuid);
console.log(self.getUuid());
}
function passwordChange(self,text){ function passwordChange(self,text){
self.setTextPassword(text); self.textPassword = text;
self.setTextErrorTip('');
console.log('passwordChange: ' + self.textPassword); console.log('passwordChange: ' + self.textPassword);
} }
...@@ -128,39 +107,26 @@ function backTap(){ ...@@ -128,39 +107,26 @@ function backTap(){
//tap 确定 //tap 确定
function confirmButtonTap(self){ function confirmButtonTap(self){
console.log(self.getTextPassword()); uComponents.showCommstatusloading(self);
if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){ setTimeout(function(){
self.setTextErrorTip(Vue.t('remoteOpendoor.error.noPasswordTip')); self.setTextLoading(Vue.t('commstatusLoading.connectSuccess'));
}else{ setTimeout(function(){
uComponents.showLoading(self); //绑定成功
iot.business.sds.setDeviceStatus({ self.setStatus(1);
data: { self.setTextLoading(Vue.t('commstatusLoading.bindSuccess'));
uuid: self.getUuid(), //绑定失败
setParams: { //self.setStatus(2);
'POW': { //self.setTextLoading(Vue.t('commstatusLoading.bindFailed'));
'value': '20' //uComponents.changeCommstatusButtonText(self,Vue.t('btn.reBound'));
} },3000);
} },3000);
}, }
success: (response) => {
console.log(response); //tap loading button
uComponents.openAlert(self, Vue.t('remoteOpendoor.openDoorSuccess'), { function commstatusLoadingButtonTap(self) {
text: Vue.t('dialog.confirm'), callback: function () { //绑定成功
//返回首页 uComponents.hideCommstatusloading(self);
iot.navigator.back(); iot.navigator.back();
} //绑定失败
}); //uComponents.hideCommstatusloading(self);
},
error: (error) => {
console.log(error);
uComponents.openAlert(self, Vue.t('remoteOpendoor.openDoorFailure'), {
text: Vue.t('dialog.confirm'), callback: function () {
}
});
},
complete(){
uComponents.hideLoading(self);
}
});
}
} }
\ No newline at end of file
...@@ -11,30 +11,18 @@ import {iot, uPublic, uComponents} from '../../public/public.js'; ...@@ -11,30 +11,18 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
//通用 input、按钮、dialog、loading组件 //通用 input、dialog、loading组件
uPublic.componentsInit(['u-text','u-button','u-dialog','u-loading']); uPublic.componentsInit(['u-text','u-dialog','u-loading']);
const app = new Vue({ const app = new Vue({
data:{ data:{
textName: iot.navigator.getExtras().nickName, textName: '智能指纹锁1',
textErrorTip: null, textErrorTip: null,
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
extras: {}
}, },
mounted(){ mounted(){
this.extras = iot.navigator.getExtras();
this.textName = self.extras.nickname;
}, },
methods:{ methods:{
getTextName(){
return this.textName;
},
setTextName(text){
this.textName = text;
},
setTextErrorTip(text){
this.textErrorTip = text;
},
onNameChange(text){ onNameChange(text){
nameChange(this,text); nameChange(this,text);
}, },
...@@ -43,8 +31,8 @@ function init() { ...@@ -43,8 +31,8 @@ function init() {
backTap(); backTap();
}, },
//tap 保存 //tap 保存
onSaveButtonTap(){ onSaveTap(){
saveButtonTap(this); saveTap();
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -59,13 +47,6 @@ function initComponentsConfig() { ...@@ -59,13 +47,6 @@ function initComponentsConfig() {
placeholder: Vue.t('editName.nameInputTip') placeholder: Vue.t('editName.nameInputTip')
} }
}, },
//保存 button 参数
saveButton: {
initParam: {
class: 'custom-button',
text: Vue.t('btn.save')
}
},
dialog: { dialog: {
initParam: { initParam: {
class: 'custom-dialog' class: 'custom-dialog'
...@@ -79,13 +60,8 @@ function initComponentsConfig() { ...@@ -79,13 +60,8 @@ function initComponentsConfig() {
} }
} }
function alert(){
alert('aaa');
}
function nameChange(self,text){ function nameChange(self,text){
self.setTextName(text); self.textName = text;
self.setTextErrorTip('');
console.log('nameChange: ' + self.textName); console.log('nameChange: ' + self.textName);
} }
...@@ -95,46 +71,6 @@ function backTap(){ ...@@ -95,46 +71,6 @@ function backTap(){
} }
//tap 保存 //tap 保存
function saveButtonTap(self){ function saveTap(){
if(self.getTextName() == null || self.getTextName().trim() == ''){
self.setTextErrorTip(Vue.t('editName.error.nameCanNotBeBlank'));
}else{
uComponents.showLoading(self);
iot.business.device.setNickname({
data: {
sds: true,
uuid: self.extras.uuid,
model: self.extras.model,
nickname: self.textName
},
success: (response) => {
console.log("inn");
uComponents.hideLoading(self);
uComponents.openAlert(self, Vue.t('editName.editNameSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
let opener = plus.webview.currentWebview().opener();
let view = plus.webview.getWebviewById(opener.id);
console.log(view);
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{
name: 'zhu'
});
console.log('returnPage');
iot.navigator.back();
}
});
},
error: (error) => {
uComponents.hideLoading(self);
uComponents.openAlert(self, Vue.t('editName.editNameFailue'), {
text: Vue.t('btn.confirm'), callback: function () {
let opener = plus.webview.currentWebview().opener();
iot.navigator.back(); iot.navigator.back();
}
});
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
} }
\ No newline at end of file
...@@ -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 {projectMethods} from '../../public/components.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
...@@ -18,74 +17,46 @@ function init() { ...@@ -18,74 +17,46 @@ function init() {
uPublic.componentsExtend(['grid-list']); uPublic.componentsExtend(['grid-list']);
const app = new Vue({ const app = new Vue({
data:{ data:{
textDoorlock: '智能指纹锁1',
stateShowFlag: false,
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
//设备列表
deviceList: [],
showDeviceList: []
}, },
mounted(){ mounted(){
let self = this;
window.addEventListener('returnPage',function(event){
self.showDeviceList = [];
getDeviceList(self);
});
//获取设备列表
getDeviceList(self);
}, },
methods:{ methods:{
getDeviceList(){ getStateShowFlag(){
return this.deviceList; return this.stateShowFlag;
},
setDeviceList(list){
this.deviceList = list;
}, },
getShowDeviceList(){ setStateShowFlag(boolean){
return this.showDeviceList; this.stateShowFlag = boolean;
},
setShowDeviceList(list){
this.showDeviceList = list;
}, },
//tap < //tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
}, },
//tap + onEditNameTap(){
onAddTap(){ editNameTap();
addTap();
}, },
//tap list row device //tap 解绑门锁
onDoorlockListTap(){ onUnbindDoorlockButtonTap(){
doorlockListTap(); unbindDoorlockButtonTap(this);
}, },
//tap list row button onUnbindStateDialogTap(){
onDoorlockListButtonTap(value, buttonValue){ unbindStateDialogTap(this);
doorlockListButtonTap(this, value, buttonValue);
}, },
//tap 退出系统
onLogoutButtonTap(){
logoutButtonTap(this);
}
} }
}).$mount('#app'); }).$mount('#app');
} }
//配置组件参数 //配置组件参数
function initComponentsConfig() { function initComponentsConfig() {
return { return {
doorlockList: { //解绑门锁 button 参数
initParam: { unbindDoorlockButton: {
class: '',
list: [],
tip: Vue.t('doorlockManage.noDeviceTip')
}
},
//退出系统 button 参数
logoutButton: {
initParam: { initParam: {
class: 'custom-button', class: 'custom-button',
text: Vue.t('btn.logout') text: Vue.t('btn.unbindDoorlock')
} }
}, },
dialog: { dialog: {
...@@ -101,185 +72,28 @@ function initComponentsConfig() { ...@@ -101,185 +72,28 @@ function initComponentsConfig() {
} }
} }
//获取所有的设备
function getDeviceList(self){
//显示loading
uComponents.showLoading(self);
iot.business.device.getList({
data: {
sds: true,
// product_id: 'product_id',
// parent_id: 0,
// start_id: 0,
// number: 10
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
self.setDeviceList(data);
for(let i=0; i<data.length; i++){
self.getShowDeviceList().push({
value: data[i].uuid,
leftImage: '../../resources/image/device.png',
title: (data[i].nickName && data[i].nickName != 'null') ? data[i].nickName : Vue.t('doorlockManage.defaultNickname'),
buttons: [{'icon': '&#xe728;'},{'icon': '&#xe61b;'},{'icon': '&#xe63e;'},{'icon': '&#xe742;'}]
});
}
//更新设备列表
projectMethods.changeGridList(self, self.getShowDeviceList());
uComponents.hideLoading(self);
}else{
uComponents.hideLoading(self);
}
},
error: (error) => {
console.log(error);
//请求失败
uPublic.openRequestErrorAlert(self);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
//tap < //tap <
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
//tap + function editNameTap(){
function addTap(){
iot.navigator.openWindow({
url: '../addDevice/',
id: 'addDevice'
});
}
//tap list row device
function doorlockListTap(){
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
}
//tap list row button
function doorlockListButtonTap(self, value, buttonValue) {
//tap 修改名称
if(buttonValue == '0'){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: './editName.html', url: './editName.html',
id: 'editName', id: 'editName'
extras: {
uuid: self.getDeviceList()[value].uuid,
model: self.getDeviceList()[value].model,
nickName: self.getDeviceList()[value].nickName
}
});
}
//tap 生成绑定二维码
else if(buttonValue == '1'){
iot.navigator.openWindow({
url: './qrcode.html',
id: 'qrcode',
extras: {
uuid: self.getDeviceList()[value].uuid
}
}); });
}
//tap ID-姓名绑定
else if(buttonValue == '2'){
iot.navigator.openWindow({
url: '../bindUser/',
id: 'bindUser'
});
}
//tap 删除门锁
else if(buttonValue == '3'){
uComponents.openConfirm(self, Vue.t('doorlockManage.deleteDialogTip', ['门锁-001']),
{text: Vue.t('dialog.cancel'), callback: function () {
}},
{text: Vue.t('dialog.confirm'), callback: function () {
deleteDoorlook(self, value);
}}
);
}
} }
//tap 退出系统 //tap 解绑门锁
function logoutButtonTap(self){ function unbindDoorlockButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockManage.logoutDialogTip'), uComponents.openConfirm(self, Vue.t('doorlockManage.unbindDialogTip'),
{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.unbind'), callback: function () {
iot.business.user.logout({ self.setStateShowFlag(true);
data: {
sds: true
},
success: (response) => {
iot.navigator.openWindow({
url: '../login/',
id: 'login'
});
let wvs = plus.webview.all();
for (var i = 0; i < wvs.length-1; i++) {
plus.webview.close(wvs[i]);
}
},
error: (error) => {},
complete: () => {
console.log("complete");
}
});
}} }}
); );
} }
//17621209360
//yyl111
function deleteDoorlook(self, index){ function unbindStateDialogTap(self){
// 显示loading self.setStateShowFlag(false);
let uuId = self.getDeviceList()[index].id;
uComponents.showLoading(self);
iot.business.sds.unbindDevice({
data: {
sds: true,
uuid: self.getDeviceList()[index].uuid
},
success: function (response){
console.log(response);
if(response.data == 'success'){
//删除成功
self.getDeviceList().splice(index, 1);
self.getShowDeviceList().splice(index, 1);
projectMethods.changeGridList(self, self.getDeviceList());
uComponents.openAlert(self, Vue.t('doorlockManage.deleteSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
console.log("删除成功");
projectMethods.changeGridList(self, self.getShowDeviceList());
uComponents.hideLoading(self);
}
});
}else{
//删除失败
uComponents.openAlert(self, Vue.t('doorlockManage.deleteFailue'), {
text: Vue.t('btn.confirm'), callback: function () {
console.log("删除失败");
uComponents.hideLoading(self);
}
});
}
},
error: function (err){
console.log(err);
//请求失败
uPublic.openRequestErrorAlert(self);
},
complete: function (){
console.log("complete");
uComponents.hideLoading(self);
}
});
} }
\ No newline at end of file
/** /**
* v_editPassword.js * v_addUnlockInfo.js
* Version: 0.1 * Version: 0.1
* User: zjx * User: wy
* Date: 2017-09-29 * Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 引导页面 * 绑定开锁信息页面
*/ */
import {iot, uPublic, uComponents} from '../../public/public.js'; import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
//通用 dialog、loading组件 //通用 select、按钮、dialog、loading组件
uPublic.componentsInit(['u-dialog','u-loading','u-text']); uPublic.componentsInit(['u-select','u-button','u-dialog','u-loading']);
const app = new Vue({ const app = new Vue({
data:{ data:{
recordSelectIndex: 0,
recordSelectList: [],
//配置组件 //配置组件
textNewPassword: null,
textOldPassword: null,
textOldPasswordAgain: null,
textErrorTip: '密码不能为空',
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
}, },
methods:{ methods:{
onSaveTap(){ //tap <
saveTap();
},
onBackTap(){ onBackTap(){
backTap(); backTap();
},
onRecordSelectChange(value) {
recordSelectChange(this, value);
},
//tap 添加
onAddButtonTap(){
addButtonTap();
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -39,29 +41,22 @@ function init() { ...@@ -39,29 +41,22 @@ function init() {
//配置组件参数 //配置组件参数
function initComponentsConfig() { function initComponentsConfig() {
return { return {
newPassword: { recordSelect: {
initParam: {
class: 'custom-editPassword-text',
placeholder: Vue.t('editPassword.newPasswordInputTip')
}
},
oldPassword: {
initParam: { initParam: {
class: 'custom-editPassword-text', class: 'custom-select',
placeholder: Vue.t('editPassword.oldPasswordInputTip') list: [
{value: 1, title: '16:35',subtitle: 'ID:001'},
{value: 2, title: '15:33',subtitle: 'ID:002'},
{value: 3, title: '15:06',subtitle: 'ID:007'}
],
pagesize: Number.MAX_VALUE
} }
}, },
oldPasswordAgain: { //添加 button 参数
initParam: { addButton: {
class: 'custom-editPassword-text',
placeholder: Vue.t('editPassword.oldPasswordInputTipAgain')
}
},
//保存 button 参数
saveButton: {
initParam: { initParam: {
class: 'custom-button', class: 'custom-button',
text: Vue.t('btn.save') text: Vue.t('btn.add')
} }
}, },
dialog: { dialog: {
...@@ -77,12 +72,17 @@ function initComponentsConfig() { ...@@ -77,12 +72,17 @@ function initComponentsConfig() {
} }
} }
//保存昵称 //tap <
function saveTap(){ function backTap(){
iot.navigator.back();
}
function recordSelectChange(self, value) {
self.recordSelectIndex = value;
console.log('recordSelectChange:' + self.recordSelectIndex);
} }
//返回上一页 //tap 添加
function backTap(){ function addButtonTap(){
iot.navigator.back(); iot.navigator.back();
} }
\ No newline at end of file
/**
* v_addUser.js
* Version: 0.1
* User: wy
* Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 添加用户页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 input、按钮、dialog、loading组件
uPublic.componentsInit(['u-text','u-button','u-dialog','u-loading']);
const app = new Vue({
data:{
textName: null,
textErrorTip: null,
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
//tap <
onBackTap(){
backTap();
},
onNameChange(text){
nameChange(this,text);
},
//tap 确定
onConfirmButtonTap(){
confirmButtonTap();
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
nameInput: {
initParam: {
class: 'custom-text',
icon: '&#xe6b0;',
placeholder: Vue.t('addUser.nameInputTip')
}
},
//确定 button 参数
confirmButton: {
initParam: {
class: 'custom-button',
text: Vue.t('btn.confirm')
}
},
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap <
function backTap(){
iot.navigator.back();
}
function nameChange(self,text){
self.textName = text;
console.log('nameChange: ' + self.textName);
}
//tap 确定
function confirmButtonTap(){
iot.navigator.openWindow({
url: './doorlockUsers.html',
id: 'doorlockUsers'
});
}
\ No newline at end of file
/**
* v_doorlockUsers.js
* Version: 0.1
* User: wy
* Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 门锁用户页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 按钮、dialog、loading组件
uPublic.componentsInit(['u-button','u-dialog','u-loading']);
const app = new Vue({
data:{
userInfo: {
image: '../../resources/image/gray_unbindHead_icon.png',
role: 1,
title: '我是个用户二号',
subtitle: ''
},
bindShowFlag: true,
unbindShowFlag: false,
stateShowFlag: false,
guideShowFlag: false,
guideStep1ShowFlag: false,
guideStep2ShowFlag: false,
guideStep3ShowFlag: false,
guideStep4ShowFlag: false,
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
getBindShowFlag(){
return this.bindShowFlag;
},
setBindShowFlag(boolean){
this.bindShowFlag = boolean;
},
getUnbindShowFlag(){
return this.unbindShowFlag;
},
setUnbindShowFlag(boolean){
this.unbindShowFlag = boolean;
},
getStateShowFlag(){
return this.stateShowFlag;
},
setStateShowFlag(boolean){
this.stateShowFlag = boolean;
},
getGuideShowFlag(){
return this.guideShowFlag;
},
setGuideShowFlag(boolean){
this.guideShowFlag = boolean;
},
getGuideStep1ShowFlag(){
return this.guideStep1ShowFlag;
},
setGuideStep1ShowFlag(boolean){
this.guideStep1ShowFlag = boolean;
},
getGuideStep2ShowFlag(){
return this.guideStep2ShowFlag;
},
setGuideStep2ShowFlag(boolean){
this.guideStep2ShowFlag = boolean;
},
getGuideStep3ShowFlag(){
return this.guideStep3ShowFlag;
},
setGuideStep3ShowFlag(boolean){
this.guideStep3ShowFlag = boolean;
},
getGuideStep4ShowFlag(){
return this.guideStep4ShowFlag;
},
setGuideStep4ShowFlag(boolean){
this.guideStep4ShowFlag = boolean;
},
//tap <
onBackTap(){
backTap();
},
onEditNameTap(){
editNameTap();
},
//tap 邀请绑定
onBindTap(){
bindTap();
},
//tap 解绑
onUnbindButtonTap(){
unbindButtonTap(this);
},
//tap 绑定开锁信息
onBindUnlockInfoTap(){
bindUnlockInfoTap();
},
//tap 历史开门记录
onOpendoorRecordTap(){
opendoorRecordTap();
},
//tap 删除该用户
onDeleteUserButtonTap(){
deleteUserButtonTap(this);
},
onUnbindStateDialogTap(){
unbindStateDialogTap(this);
},
//tap 下一步
onNextButtonTap(){
nextButtonTap(this);
},
//tap 我知道了
onISeeButtonTap(){
iSeeButtonTap(this);
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
//解绑 button 参数
unbindButton: {
initParam: {
class: 'custom-unbind-button',
text: Vue.t('btn.unbind')
}
},
//删除该用户 button 参数
deleteUserButton: {
initParam: {
class: 'custom-button',
text: Vue.t('btn.deleteUser')
}
},
//下一步 button 参数
nextButton: {
initParam: {
class: 'custom-dialog-button',
text: Vue.t('btn.next')
}
},
//我知道了 button 参数
iSeeButton: {
initParam: {
class: 'custom-dialog-button',
text: Vue.t('btn.iSee')
}
},
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap <
function backTap(){
iot.navigator.back();
}
function editNameTap(){
iot.navigator.openWindow({
url: './editName.html',
id: 'editName'
});
}
//tap 邀请绑定
function bindTap(){
iot.navigator.openWindow({
url: './inviteBind.html',
id: 'inviteBind'
});
}
//tap 解绑
function unbindButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUsers.unbindDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.unbind'), callback: function () {
self.setStateShowFlag(true);
}}
);
}
function unbindStateDialogTap(self){
self.setStateShowFlag(false);
self.setBindShowFlag(true);
self.setUnbindShowFlag(false);
}
//tap 绑定开锁信息
function bindUnlockInfoTap(){
iot.navigator.openWindow({
url: './unlockInfo.html',
id: 'unlockInfo'
});
}
//tap 历史开门记录
function opendoorRecordTap(){
iot.navigator.openWindow({
url: '../device/opendoorRecord.html',
id: 'opendoorRecord'
});
}
//tap 删除该用户
function deleteUserButtonTap(self){
uComponents.openConfirm(self, Vue.t('doorlockUsers.deleteUserDialogTip'),
{text: Vue.t('dialog.cancel'), callback: function () {}},
{text: Vue.t('dialog.delete'), callback: function () {}}
);
}
//tap 下一步
function nextButtonTap(self){
self.setGuideStep1ShowFlag(false);
self.setGuideStep2ShowFlag(false);
self.setGuideStep3ShowFlag(true);
self.setGuideStep4ShowFlag(true);
}
//tap 我知道了
function iSeeButtonTap(self){
self.setGuideShowFlag(false);
}
\ No newline at end of file
/**
* v_editName.js
* Version: 0.1
* User: wy
* Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 修改名称页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 input、dialog、loading组件
uPublic.componentsInit(['u-text','u-dialog','u-loading']);
const app = new Vue({
data:{
textName: '我是个用户二号',
textErrorTip: null,
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
//tap <
onBackTap(){
backTap();
},
//tap 保存
onSaveTap(){
saveTap();
},
onNameChange(text){
nameChange(this,text);
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
nameInput: {
initParam: {
class: 'custom-text',
placeholder: Vue.t('editName.nameInputTip')
}
},
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap <
function backTap(){
iot.navigator.back();
}
//tap 保存
function saveTap(){
iot.navigator.back();
}
function nameChange(self,text){
self.textName = text;
console.log('nameChange: ' + self.textName);
}
\ No newline at end of file
/** /**
* v_index.js * v_index.js
* Version: 0.1 * Version: 0.1
* User: zjx * User: wy
* Date: 2017-09-29 * Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * 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'; import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
//通用 图片轮播、跑马灯、开关、按钮、dialog、loading组件 //通用 dialog、loading组件
uPublic.componentsInit(['u-swipe-list','u-dialog','u-loading']); uPublic.componentsInit(['u-dialog','u-loading']);
const app = new Vue({ const app = new Vue({
data:{ data:{
//用户列表 userList: [{value: 1, role: 0, image: '../../resources/image/green_admin_icon.png', title: '我是个用户', subtitle: '管理员'},
userList: [], {value: 2, role: 1, image: '../../resources/image/gray_unbindHead_icon.png', title: '我是个用户二号', subtitle: ''}],
userListIndex: null, userListIndex: null,
loadShowFlag: false, loadShowFlag: false,
loadFlag: false, loadFlag: false,
loadText: 'loading', loadText: Vue.t('scroll.clickToLoadMore'),
pagesize: 10, pagesize: 10,
tip: '无数据' tip: Vue.t('userList.noUserTip'),
//配置组件
componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
this.userList = [{value: 1, role: 0, image: '../../resources/image/green_head_icon.png', title: '我是用户', subtitle: "昵称: MM"},
{value: 1, role: 1, image: '../../resources/image/green_head_icon.png', title: '我是用户', subtitle: "昵称: MM"}]
}, },
methods:{ methods:{
//tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
}, },
onUserTap(){ //tap +
addUser(); onAddUserTap(){
}, addUserTap();
setLoadShowFlag(number){
this.loadShowFlag = (number >= this.pagesize);
}, },
onSwipeLeftRow(index){ onSwipeLeftRow(index){
swipeLeftRow(this, index); swipeLeftRow(this, index);
...@@ -48,50 +47,69 @@ function init() { ...@@ -48,50 +47,69 @@ function init() {
tapLoad(); tapLoad();
}, },
onTapUserList(index){ onTapUserList(index){
onTapUserList(this, index); tapUserList(this, index);
}, },
onTapButton(buttonIndex){ onTapButton(buttonIndex){
tapButton(buttonIndex); tapButton(buttonIndex);
},
changeUserList(list){
changeUserList(this, list);
} }
} }
}).$mount('#app'); }).$mount('#app');
} }
//返回上一页 //配置组件参数
function initComponentsConfig() {
return {
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap <
function backTap(){ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
//添加用户 //tap +
function addUser(){ function addUserTap(){
// iot.navigator.openWindow({ iot.navigator.openWindow({
// url: '../doorlockUsers/addUser', url: './addUser.html',
// id: 'addUser', id: 'addUser'
// }); });
} }
// 向左滑动用户列表,修改用户列表下标 // 向左滑动用户列表,修改用户列表下标
function swipeLeftRow(self, index) { function swipeLeftRow(self, index) {
self.userListIndex = index; self.userListIndex = index;
} }
// 向右滑动用户列表,修改用户列表下标 // 向右滑动用户列表,修改用户列表下标
function swipeRightRow(self) { function swipeRightRow(self) {
self.userListIndex = null; self.userListIndex = null;
} }
// 点击组件列表 通知事件和当前点击列表下标 // 点击组件列表 通知事件和当前点击列表下标
function onTapUserList(self, listIndex) { function tapUserList(self, listIndex) {
if (self.userListIndex != null) { if (self.userListIndex != null) {
self.userListIndex = null; return;
} }
iot.navigator.openWindow({
url: './doorlockUsers.html',
id: 'doorlockUsers'
});
} }
//点击加载更多 //点击加载更多
function tapLoad(){ function tapLoad(){
if (!self.loadFlag) { if (!self.loadFlag) {
self.loadText = 'loading'; self.loadText = Vue.t('scroll.loading');
self.loadFlag = true; self.loadFlag = true;
//再次发送获取用户列表请求 //再次发送获取用户列表请求
} }
...@@ -101,13 +119,3 @@ function tapLoad(){ ...@@ -101,13 +119,3 @@ function tapLoad(){
function tapButton(buttonIndex){ function tapButton(buttonIndex){
console.log(buttonIndex); console.log(buttonIndex);
} }
\ No newline at end of file
// 修改userList列表
function changeUserList(self, list) {
self.setLoadShowFlag(list.length - self.swipeList.length);
self.userList = list;
self.$nextTick(function () {
self.loadText = '点击加载更多';
self.loadFlag = false;
});
}
\ No newline at end of file
/** /**
* v_qrcode.js * v_inviteBind.js
* Version: 0.1 * Version: 0.1
* User: wy * User: wy
* Date: 2017-09-06 * Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved. * Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 生成绑定二维码页面 * 邀请绑定页面
*/ */
var QRCode = require('qrcode');
console.log(QRCode);
import {iot, uPublic, uComponents} from '../../public/public.js'; import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
//通用 按钮、dialog、loading组件 //通用 按钮、dialog、loading组件
...@@ -17,34 +16,18 @@ function init() { ...@@ -17,34 +16,18 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
componentsConfig: initComponentsConfig(), componentsConfig: initComponentsConfig()
//页面传递参数
extras: [],
uuid: null,
qrCodeDisabled: false
}, },
mounted(){ mounted(){
this.extras = iot.navigator.getExtras();
console.log(this.extras);
this.setUuid(this.extras.uuid);
}, },
methods:{ methods:{
getUuid(){
return this.uuid;
},
setUuid(id){
this.uuid = id;
},
setQrCodeDisabled(boolean){
this.qrCodeDisabled = boolean;
},
//tap < //tap <
onBackTap(){ onBackTap(){
backTap(); backTap();
}, },
//tap 生成二维码 //tap 重新生成二维码
onQRcodeButtonTap(){ onQRcodeButtonTap(){
qrcodeButtonTap(this); qrcodeButtonTap();
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -53,11 +36,11 @@ function init() { ...@@ -53,11 +36,11 @@ function init() {
//配置组件参数 //配置组件参数
function initComponentsConfig() { function initComponentsConfig() {
return { return {
//生成二维码 button 参数 //重新生成二维码 button 参数
qrcodeButton: { qrcodeButton: {
initParam: { initParam: {
class: 'custom-button', class: 'custom-button',
text: Vue.t('btn.qrcode') text: Vue.t('btn.qrcodeReset')
} }
}, },
dialog: { dialog: {
...@@ -78,41 +61,7 @@ function backTap(){ ...@@ -78,41 +61,7 @@ function backTap(){
iot.navigator.back(); iot.navigator.back();
} }
//tap 生成二维码 //tap 重新生成二维码
function qrcodeButtonTap(self){ function qrcodeButtonTap(){
uComponents.showLoading(self); alert('重新生成二维码');
iot.business.sds.saveqr({
data: {
uuid: self.getUuid()
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
let qrKey = response.data.qrKey;
let qr = self.$refs.qrcode;
QRCode.toCanvas(qr, qrKey, {
scale: 5,
margin: 2
},(error) => {
if (error) {
console.log(error)
} else {
console.log('success');
uComponents.hideLoading(self);
qr.style.width = "5.280rem";
qr.style.height = "5.280rem";
console.log(qr.style);
setTimeout(() => {
self.setQrCodeDisabled(true);
},1000*60*10);
}
});
}else{}
},
error: (error) => {
console.log(error);
//请求失败
uPublic.openRequestErrorAlert(self);
}
});
} }
\ No newline at end of file
/**
* v_unlockInfo.js
* Version: 0.1
* User: wy
* Date: 2017-10-09
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 绑定开锁信息页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 dialog、loading组件
uPublic.componentsInit(['u-dialog','u-loading']);
const app = new Vue({
data:{
unlockInfoList: [{value: 1, title: '指纹1', rightText: 123456},
{value: 2, title: '指纹2', rightText: 123456}],
loadShowFlag: false,
loadFlag: false,
loadText: Vue.t('scroll.clickToLoadMore'),
pagesize: 10,
tip: Vue.t('unlockInfo.noInfoTip'),
//配置组件
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
//tap <
onBackTap(){
backTap();
},
//tap 添加
onAddTap(){
addTap();
},
onTapLoad(){
tapLoad();
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap <
function backTap(){
iot.navigator.back();
}
//tap 添加
function addTap(){
iot.navigator.openWindow({
url: './addUnlockInfo.html',
id: 'addUnlockInfo'
});
}
//点击加载更多
function tapLoad(){
if (!self.loadFlag) {
self.loadText = Vue.t('scroll.loading');
self.loadFlag = true;
//再次发送获取用户列表请求
}
}
\ No newline at end of file
...@@ -11,25 +11,19 @@ import {iot, uPublic, uComponents} from '../../public/public.js'; ...@@ -11,25 +11,19 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init); iot.ready(init);
function init() { function init() {
//通用 dialog、loading组件 //通用 按钮、dialog、loading组件
uPublic.componentsInit(['u-dialog','u-loading','u-button']); uPublic.componentsInit(['u-button','u-dialog','u-loading']);
const app = new Vue({ const app = new Vue({
data:{ data:{
//配置组件 //配置组件
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
// setTimeout(function(){
// iot.navigator.openWindow({
// url: './login.html',
// id: 'login'
// });
// },2000)
let self = this;
}, },
methods:{ methods:{
//tap 账号/密码登录
onLoginButtonTap(){ onLoginButtonTap(){
loginButtonTap(this); loginButtonTap();
} }
} }
}).$mount('#app'); }).$mount('#app');
...@@ -58,123 +52,9 @@ function initComponentsConfig() { ...@@ -58,123 +52,9 @@ function initComponentsConfig() {
} }
} }
function loginButtonTap(self){ function loginButtonTap(){
uComponents.showLoading(self);
iot.business.sds.init({
data: {
oa: true
},
success: (response) => {
console.log(response);
iot.business.user.login({
data: {
sds: true
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
cloudsLogin(self, data.UserID);
}else{
}
},
error: (error) => {
console.log(error);
//请求失败
uPublic.openRequestErrorAlert(self);
},
complete: () => {}
});
},
error: (error) => {
console.log(error);
//请求失败
uPublic.openRequestErrorAlert(self);
}
});
}
//云端登陆
function cloudsLogin(self, id){
iot.business.user.autoLogin({
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
uComponents.hideLoading(self);
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
}else{
}
},
error: (error) => {
console.log(error);
iot.business.user.login({
data: {
username: id,
pwd: id,
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
uComponents.hideLoading(self);
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../device/', url: './login.html',
id: 'device' id: 'login'
});
}else{
}
},
error: (error) => {
console.log(error);
//不存在此用户
// if(code == 10002){
//用户注册
iot.business.user.reg({
data: {
username: id,
pwd: id,
vcode: id
},
success: (response) => {
console.log(response);
//注册成功
let data = uPublic.checkResponseData(response.data);
if(data){
uComponents.hideLoading(self);
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
}else{
}
},
error: (error) => {
console.log(error);
//注册失败
uComponents.openAlert(self, 'login.failure', {
text: Vue.t('dialog.confirm'), callback: function () {
plus.webview.currentWebview().reload();
}
});
},
complete: () => {}
});
// }
//请求失败
uPublic.openRequestErrorAlert(self);
},
complete: () => {}
});
},
complete: () => {}
}); });
//
} }
\ No newline at end of file
...@@ -22,55 +22,6 @@ function init() { ...@@ -22,55 +22,6 @@ function init() {
componentsConfig: initComponentsConfig() componentsConfig: initComponentsConfig()
}, },
mounted(){ mounted(){
iot.business.sds.init({
data: {
oa: true
},
success: (response) => {
console.log(response);
iot.business.user.login({
data: {
sds: true
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
iot.business.user.login({
data: {
username: data.UserId,
pwd: data.UserId,
},
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
iot.navigator.openWindow({
url: '../device/',
id: 'device'
});
}else{
}
},
error: (error) => {
},
complete: () => {}
});
}else{
}
},
error: (error) => {
console.log(error);
},
complete: () => {}
});
},
error: (error) => {
console.log(error);
}
});
}, },
methods:{ methods:{
onTelChange(number){ onTelChange(number){
...@@ -155,11 +106,10 @@ function loginButtonTap(){ ...@@ -155,11 +106,10 @@ function loginButtonTap(){
//tap 快速注册 //tap 快速注册
function registerTap(){ function registerTap(){
iot.navigator.openWindow({
// iot.navigator.openWindow({ url: './register.html',
// url: './register.html', id: 'register'
// id: 'register' });
// });
} }
//tap 忘记密码 //tap 忘记密码
......
/**
* v_editNickname.js
* Version: 0.1
* User: zjx
* Date: 2017-09-29
* Copyright(c) 2017. U-GEN Tech.Co,Ltd. All Rights Reserved.
* 引导页面
*/
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
//通用 dialog、loading组件
uPublic.componentsInit(['u-dialog','u-loading','u-text']);
const app = new Vue({
data:{
//配置组件
textNickName: iot.navigator.getExtras().nickname,
textErrorTip: null,
componentsConfig: initComponentsConfig()
},
mounted(){
},
methods:{
getTextNickName(){
return this.textNickName;
},
setTextNickName(text){
this.textNickName = this;
},
onSaveTap(){
saveTap(this);
},
onBackTap(){
backTap();
},
onNicknameChange(text){
nicknameChange(this, text);
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
nameInput: {
initParam: {
class: 'custom-editNickname-text',
placeholder: Vue.t('editNickname.nickNameInputTip')
}
},
//保存 button 参数
saveButton: {
initParam: {
class: 'custom-button',
text: Vue.t('btn.save')
}
},
dialog: {
initParam: {
class: 'custom-dialog'
}
},
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//保存昵称
function saveTap(self){
if(self.textNickName == null || self.textNickName.trim() == ''){
self.textErrorTip = Vue.t('editNickname.nickNameInputTip');
}else{
uComponents.showLoading(self);
iot.business.user.setInfo({
data: {
nickname: self.textNickName,
head: '',
info: {}
},
success: (response) => {
if(response.data = 'success'){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{
// name: 'zhu'
});
iot.navigator.back();
}
},
error: (error) => {
console.log(error);
},
complete: () => {
uComponents.hideLoading(self);
}
});
}
}
//返回上一页
function backTap(){
iot.navigator.back();
}
function nicknameChange(self, text){
self.textNickName = text;
self.textErrorTip = '';
}
/**
* 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';
iot.ready(init);
function init() {
//通用 dialog、loading组件
uPublic.componentsInit(['u-dialog','u-loading']);
const app = new Vue({
data:{
//配置组件
nickname: 'bank',
componentsConfig: initComponentsConfig()
},
mounted(){
let self = this;
getInfo(this);
window.addEventListener('returnPage',function(event){
console.log("in");
getInfo(self);
});
},
methods:{
//tap 修改昵称
onEditNicknameTap(){
editNicknameTap(this);
},
//tap 修改密码
onEditPasswordTap(){
editPasswordTap();
},
onBackTap(){
backTap();
}
}
}).$mount('#app');
}
//配置组件参数
function initComponentsConfig() {
return {
loading: {
initParam: {
class: 'custom-loading'
}
}
}
}
//tap 修改昵称
function editNicknameTap(self){
iot.navigator.openWindow({
url: '../myInfo/editNickname.html',
id: 'editNickname',
extras: {
nickname: self.nickname
}
});
}
//tap 修改密码
function editPasswordTap(){
iot.navigator.openWindow({
url: '../myInfo/editPassword.html',
id: 'editPassword'
});
}
function backTap(){
iot.navigator.back();
}
function getInfo(self){
iot.business.user.getInfo({
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(data);
self.nickname = data.nickname;
}else{
}
},
error: (error) => {},
complete: () => {}
});
}
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -141,10 +141,10 @@ ...@@ -141,10 +141,10 @@
.transform(rotate(0deg)); .transform(rotate(0deg));
} }
25%{ 25%{
.transform(rotate(-40deg)); .transform(rotate(-30deg));
} }
75%{ 75%{
.transform(rotate(40deg)); .transform(rotate(30deg));
} }
}); });
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
content: '\e681'; content: '\e681';
position: absolute; position: absolute;
top: 0; top: 0;
right: 52px; right: 104px;
.iconfont(@NEWMSG-ICON-FONTSIZE); .iconfont(@NEWMSG-ICON-FONTSIZE);
color: @NEWMSG-ICON-COLOR; color: @NEWMSG-ICON-COLOR;
z-index: 3; z-index: 3;
......
...@@ -161,3 +161,7 @@ ...@@ -161,3 +161,7 @@
.errorTip{ .errorTip{
.errorTip(); .errorTip();
} }
.unbindState-dialog{
.mask();
}
\ No newline at end of file
@import "../public/public.less"; @import "../public/public.less";
@import "../public/header.less"; @import "../public/header.less";
//侧滑列表 .u-text();
.user-list{
width: 100%; .u-button();
height: 100%;
overflow: auto; .unbindState-dialog{
position: absolute; .mask();
top: 44px; }
bottom: 0;
left: 0; .guide-dialog{
height: auto; .mask();
} }
.user-list-scroll .user-list-row{ \ No newline at end of file
position: relative;
overflow: hidden;
.user-list-handle{
position: relative;
.transition(left 0.4s ease);
left: 0;
background-color: @BODY-BG-COLOR;
padding: 15px 20px;
.display-box();
.box-vertical-alignment();
z-index: 2;
.user-list-image{
width: 50px;
height: 50px;
margin-right: 10px;
}
.user-list-icon{
margin-right: 10px;
.iconfont(@SWIPELIST-COMPONENT-ICON-FONTSIZE);
}
div{
.flex();
min-width: 0;
}
.user-list-title{
.text_oneRow_ellipsis();
}
.user-sub-image{
width: 17px;
height: 17px;
}
.user-list-subtitle{
.text_oneRow_ellipsis();
display: inline-block;
}
&.user-list-selected{
left: -120px;
}
&:after{
content: "\e611";
display: block;
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
.transform(rotate(180deg));
}
}
.user-list-button{
position: absolute;
top: 0;
bottom: 0;
right: 0;
z-index: 1;
div{
width: 60px;
height: 100%;
.display-box();
.box-horizontal-alignment();
.box-vertical-alignment();
color: @SWIPELIST-COMPONENT-BUTTON-COLOR;
float: left;
&:nth-last-of-type(1){
background-color: transparent;
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
color: #00FFFF;
}
}
}
&:after{
.defaultBorder();
z-index: 2;
.white_gradient_border();
}
}
@import "../public/public.less";
@import "../public/header.less";
.u-select();
.u-button();
\ No newline at end of file
@import "../public/public.less";
@import "../public/header.less";
//侧滑列表
.user-list{
width: 100%;
height: 100%;
overflow: auto;
position: absolute;
top: 44px;
bottom: 0;
left: 0;
height: auto;
}
.user-list-scroll .user-list-row{
position: relative;
overflow: hidden;
.user-list-handle{
position: relative;
.transition(left 0.4s ease);
left: 0;
background-color: @BODY-BG-COLOR;
padding: 15px 20px;
.display-box();
.box-vertical-alignment();
z-index: 2;
.user-list-image{
width: 50px;
height: 50px;
margin-right: 10px;
}
.user-list-icon{
margin-right: 10px;
.iconfont(@SWIPELIST-COMPONENT-ICON-FONTSIZE);
}
div{
.flex();
min-width: 0;
}
.user-list-title{
.text_oneRow_ellipsis();
}
.user-sub-image{
width: 17px;
height: 17px;
}
.user-list-subtitle{
.text_oneRow_ellipsis();
display: inline-block;
}
&.user-list-selected{
left: -120px;
}
&:after{
content: "\e611";
display: block;
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
.transform(rotate(180deg));
}
}
.user-list-button{
position: absolute;
top: 0;
bottom: 0;
right: 0;
z-index: 1;
div{
width: 60px;
height: 100%;
.display-box();
.box-horizontal-alignment();
.box-vertical-alignment();
color: @SWIPELIST-COMPONENT-BUTTON-COLOR;
float: left;
&:nth-last-of-type(1){
background-color: transparent;
.iconfont(@TEXT-COMPONENT-ICON-FONTSIZE);
color: #00FFFF;
}
}
}
&:after{
.defaultBorder();
z-index: 2;
.white_gradient_border();
}
}
\ No newline at end of file
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script type="text/javascript" src="../../lib/js/p.js"></script> <script type="text/javascript" src="../../lib/js/p.js"></script>
<script type="text/javascript" src="../../lib/js/UIOT.js"></script> <script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head> </head>
<body ontouchstart=""> <body ontouchstart="" class="noBottomGradient">
<div id="app" v-cloak> <div id="app" v-cloak>
<div class="header"> <div class="header">
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<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.scanCodeAdd') }}</p> <p>{{ $t('title.scanCodeAdd') }}</p>
</div> </div>
<div class="content" id="bcid" style="width: 100%; height: 560px; margin-top: 40px;"> <div class="content">
</div> </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>
......
...@@ -41,10 +41,11 @@ ...@@ -41,10 +41,11 @@
</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-commstatus-loading ref="ucommstatusloading" :text="textLoading" :status="status"
:init-param="componentsConfig.ucommstatusloading.initParam" v-on:u-commstatus-loading-tap="onCommstatusLoadingButtonTap()">
<p class="loader"></p> <p class="loader"></p>
<p class="icon"></p> <p class="icon"></p>
</u-comm-loading> </u-commstatus-loading>
<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>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<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> <u-list :init-param="componentsConfig.alarmInfoList.initParam"></u-list>
<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>
......
...@@ -1080,13 +1080,13 @@ p { ...@@ -1080,13 +1080,13 @@ p {
} }
25% { 25% {
-webkit-transform: rotate(-40deg); -webkit-transform: rotate(-30deg);
transform: rotate(-40deg); transform: rotate(-30deg);
} }
75% { 75% {
-webkit-transform: rotate(40deg); -webkit-transform: rotate(30deg);
transform: rotate(40deg); transform: rotate(30deg);
} }
} }
...@@ -1097,13 +1097,13 @@ p { ...@@ -1097,13 +1097,13 @@ p {
} }
25% { 25% {
-webkit-transform: rotate(-40deg); -webkit-transform: rotate(-30deg);
transform: rotate(-40deg); transform: rotate(-30deg);
} }
75% { 75% {
-webkit-transform: rotate(40deg); -webkit-transform: rotate(30deg);
transform: rotate(40deg); transform: rotate(30deg);
} }
} }
...@@ -1474,7 +1474,7 @@ p { ...@@ -1474,7 +1474,7 @@ p {
content: '\e681'; content: '\e681';
position: absolute; position: absolute;
top: 0; top: 0;
right: 1.387rem; right: 2.773rem;
font-family: iconfont; font-family: iconfont;
font-size: 0.427rem; font-size: 0.427rem;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<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> <u-list :init-param="componentsConfig.hijackRecordList.initParam"></u-list>
<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>
......
...@@ -18,26 +18,30 @@ ...@@ -18,26 +18,30 @@
<script type="text/javascript" src="../../lib/js/UIOT.js"></script> <script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head> </head>
<body ontouchstart=""> <body ontouchstart="">
<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()">&#xe66f;</v-touch> <v-touch tag="span" class="header-left icon" v-on:tap="onMyInfoTap">&#xe66f;</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 class="doorbellBg active"> <!-- <div class="doorbellBg active">
<div class="doorbellCircle"> <div class="doorbellCircle">
<div class="doorbell"> <div class="doorbell">
<p></p> <p></p>
</div> </div>
</div> </div>
<div class="doorbellTip" v-bind:class="[{active: doorbellRingingFlag}]"><span>{{ ringingTime }}</span>{{ $t('device.doorLockRinging') }}</div> <div class="doorbellTip"><span>17:30</span>门铃响了</div>
</div> </div>
<p class="batteryState"><span v-html="batteryState"></span>{{ batteryPercent }}%</p> <p class="batteryState"><span>&#xe629;</span>100%</p> -->
<v-touch tag="div" class="bindDoorlock" v-on:tap="onBindDoorlockTap">
<p>{{ $t('device.bindDoorlock') }}</p>
</v-touch>
</div> </div>
<div class="deviceHandle"> <div class="deviceHandle">
<p class="title">{{ $t('device.newMsgDoorlock') }}</p> <p class="title">门锁最新消息</p>
<u-marquee ref="umarquee" :init-param="componentsConfig.marquee.initParam" :active="activeFlag"></u-marquee> <u-marquee :init-param="componentsConfig.marquee.initParam" :active="activeFlag"></u-marquee>
<div class="switchGroup"> <div class="switchGroup">
<div class="guoupRow"> <div class="guoupRow">
<!-- 开门记录 --> <!-- 开门记录 -->
...@@ -61,7 +65,7 @@ ...@@ -61,7 +65,7 @@
</div> </div>
<div class="guoupRow"> <div class="guoupRow">
<!-- 远程开门 --> <!-- 远程开门 -->
<div class="col-xs-6 remoteOpendoor" :class="[{newMsg: remoteOpendoorFlag}]"> <div class="col-xs-6 remoteOpendoor">
<u-switch :value="valueRemoteOpendoor" :init-param="componentsConfig.remoteOpendoorSwitch.initParam" v-on:u-switch-tap="onRemoteOpendoorTap"></u-switch> <u-switch :value="valueRemoteOpendoor" :init-param="componentsConfig.remoteOpendoorSwitch.initParam" v-on:u-switch-tap="onRemoteOpendoorTap"></u-switch>
</div> </div>
<!-- 门锁管理 --> <!-- 门锁管理 -->
...@@ -84,7 +88,7 @@ ...@@ -84,7 +88,7 @@
</li> </li>
</ul> </ul>
<u-button :init-param="componentsConfig.saveQRcodeButton.initParam" v-on:u-button-tap="onSaveQRcodeButtonTap"></u-button> <u-button :init-param="componentsConfig.saveQRcodeButton.initParam" v-on:u-button-tap="onSaveQRcodeButtonTap"></u-button>
<v-touch tag="p" v-on:tap="onLaterFollowTap">{{ $t('device.laterFollow') }}</v-touch> <p class="linkText"><v-touch tag="span" v-on:tap="onLaterFollowTap">{{ $t('device.laterFollow') }}</v-touch></p>
</div> </div>
</div> </div>
</transition> </transition>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<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.opendoorRecord') }}</p> <p>{{ $t('title.opendoorRecord') }}</p>
</div> </div>
<u-list ref="ulist" :init-param="componentsConfig.opendoorRecordList.initParam" v-on:u-list-load-tap="onListLoadTap()"></u-list> <u-list :init-param="componentsConfig.opendoorRecordList.initParam"></u-list>
<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>
......
...@@ -32,6 +32,11 @@ ...@@ -32,6 +32,11 @@
</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>
</div> </div>
<u-commstatus-loading ref="ucommstatusloading" :text="textLoading" :status="status"
:init-param="componentsConfig.ucommstatusloading.initParam" v-on:u-commstatus-loading-tap="onCommstatusLoadingButtonTap()">
<p class="loader"></p>
<p class="icon"></p>
</u-commstatus-loading>
<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>
......
...@@ -772,3 +772,13 @@ p { ...@@ -772,3 +772,13 @@ p {
height: 1.067rem; height: 1.067rem;
line-height: 1.067rem; line-height: 1.067rem;
} }
.unbindState-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1051;
background-color: rgba(0, 0, 0, 0.8);
}
\ No newline at end of file
@font-face {
font-family: 'defaultIconfont';
src: url('../../resources/font/defaultIconfont.ttf') format('truetype');
}
@font-face {
font-family: 'iconfont';
src: url('//at.alicdn.com/t/font_372681_ifeqlzhn1k9e8kt9.ttf') format('truetype');
}
html,
body {
width: 100%;
height: 100%;
}
body {
-webkit-user-select: none;
user-select: none;
color: #fff;
font-size: 0.373rem;
background: -webkit-linear-gradient(left, #242635, #fff, #242635);
background: linear-gradient(to right, #242635, #fff, #242635);
background-color: #242635;
-webkit-background-size: 100% 1px;
background-size: 100% 1px;
background-repeat: no-repeat;
background-position: bottom center;
}
ul {
padding-left: 0;
list-style: none;
margin-bottom: 0;
}
p {
margin-bottom: 0;
}
.u-loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1050;
background-color: rgba(0, 0, 0, 0.8);
}
.u-loading .u-loading-box {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.u-loading .u-loading-box .u-loading-icon {
width: 30px;
height: 30px;
background-position: center;
background-repeat: no-repeat;
background-image: url("../../resources/image/white_loading_icon.png");
-webkit-background-size: cover;
background-size: cover;
margin: 0 auto;
-webkit-animation: uLoading 1s steps(12, end) infinite;
animation: uLoading 1s steps(12, end) infinite;
}
.u-loading .u-loading-box .u-loading-text {
color: #fff;
margin-top: 0.32rem;
text-align: center;
}
@-webkit-keyframes uLoading {
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 uLoading {
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);
}
}
.u-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1050;
background-color: rgba(0, 0, 0, 0.8);
}
.u-dialog .u-dialog-box {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 6.667rem;
background-color: #fff;
border-radius: 0.32rem;
}
.u-dialog .u-dialog-box .u-dialog-content {
padding: 0.4rem;
text-align: center;
position: relative;
}
.u-dialog .u-dialog-box .u-dialog-content:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background: #bbb;
}
.u-dialog .u-dialog-box .u-dialog-button {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.u-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel,
.u-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm {
display: table-cell;
color: #007aff;
text-align: center;
padding: 0.4rem 0;
line-height: 1;
position: relative;
}
.u-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 1px;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
background-color: #bbb;
}
.fade-enter-active,
.fade-leave-active {
-webkit-transition: opacity 0.5s linear;
transition: opacity 0.5s linear;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
.custom-dialog .u-dialog-box {
width: 7.2rem;
height: 4rem;
border-radius: 0.133rem;
}
.custom-dialog .u-dialog-box .u-dialog-content {
width: 100%;
height: 2.667rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
font-size: 0.48rem;
line-height: 0.587rem;
padding: 0 0.4rem;
}
.custom-dialog .u-dialog-box .u-dialog-content:after {
height: 0;
}
.custom-dialog .u-dialog-box .u-dialog-button {
border-spacing: 0.613rem 0;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel,
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm {
background-color: ;
padding: 0.213rem 0;
border-radius: 0.8rem;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:active,
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm:active {
background-color: ;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel {
color: ;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:after {
width: 0;
}
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 1.173rem;
z-index: 1030;
background-color: #010d19;
}
.header p {
position: absolute;
top: 0;
left: 1.467rem;
right: 1.467rem;
line-height: 1.173rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
font-size: 0.507rem;
text-align: center;
}
.header span {
color: #fff;
width: 1.467rem;
line-height: 1.173rem;
display: block;
}
.header span:active {
opacity: 0.5;
}
.header .header-left {
float: left;
padding-left: 0.133rem;
}
.header .header-right {
float: right;
padding-right: 0.133rem;
text-align: right;
}
.header .icon {
font-family: iconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased;
line-height: 1.173rem;
}
.header ~ .content {
padding-top: 1.173rem;
}
.u-text {
width: 100%;
display: table;
position: relative;
}
.u-text input {
display: table-cell;
width: 100%;
border: 0;
outline: 0;
-webkit-appearance: none;
padding: 0.533rem 1.867rem 0.533rem 0.533rem;
background-color: transparent;
}
.u-text input[type=text] ~ .u-text-see {
color: #007aff;
}
.u-text .u-text-icon {
font-family: iconfont;
font-size: 0.533rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
width: 1.173rem;
padding-left: 0.453rem;
display: table-cell;
vertical-align: middle;
}
.u-text .u-text-icon ~ input {
padding-left: 0;
}
.u-text .u-text-title {
width: 1.92rem;
padding-left: 0.533rem;
display: table-cell;
vertical-align: middle;
}
.u-text .u-text-title ~ input {
padding-left: 0;
}
.u-text .u-text-clear,
.u-text .u-text-see {
position: absolute;
top: 0;
width: 0.8rem;
height: 100%;
}
.u-text .u-text-clear:before,
.u-text .u-text-see:before {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-family: defaultIconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
}
.u-text .u-text-clear {
right: 0.8rem;
}
.u-text .u-text-clear:before {
content: '\e724';
}
.u-text .u-text-see {
right: 0;
}
.u-text .u-text-see:before {
content: '\e73c';
}
.u-text:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background: #bbb;
}
@media (max-height: 400px /*no*/) {
#app {
height: 17.253rem;
position: relative;
}
}
.u-button {
width: 6.4rem;
color: #fff;
font-size: inherit;
background-color: #007aff;
border-radius: 0.533rem;
text-align: center;
line-height: 1;
margin: 0 auto;
padding: 0.267rem 0;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
background-clip: padding-box;
}
.u-button:active {
background-color: #0065ff;
}
.u-button.disabled {
background-color: #bbb;
}
\ No newline at end of file
@font-face {
font-family: 'defaultIconfont';
src: url('../../resources/font/defaultIconfont.ttf') format('truetype');
}
@font-face {
font-family: 'iconfont';
src: url('//at.alicdn.com/t/font_372681_ifeqlzhn1k9e8kt9.ttf') format('truetype');
}
html,
body {
width: 100%;
height: 100%;
}
body {
-webkit-user-select: none;
user-select: none;
color: #fff;
font-size: 0.373rem;
background: -webkit-linear-gradient(left, #242635, #fff, #242635);
background: linear-gradient(to right, #242635, #fff, #242635);
background-color: #242635;
-webkit-background-size: 100% 1px;
background-size: 100% 1px;
background-repeat: no-repeat;
background-position: bottom center;
}
ul {
padding-left: 0;
list-style: none;
margin-bottom: 0;
}
p {
margin-bottom: 0;
}
.u-loading {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1050;
background-color: rgba(0, 0, 0, 0.8);
}
.u-loading .u-loading-box {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.u-loading .u-loading-box .u-loading-icon {
width: 30px;
height: 30px;
background-position: center;
background-repeat: no-repeat;
background-image: url("../../resources/image/white_loading_icon.png");
-webkit-background-size: cover;
background-size: cover;
margin: 0 auto;
-webkit-animation: uLoading 1s steps(12, end) infinite;
animation: uLoading 1s steps(12, end) infinite;
}
.u-loading .u-loading-box .u-loading-text {
color: #fff;
margin-top: 0.32rem;
text-align: center;
}
@-webkit-keyframes uLoading {
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 uLoading {
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);
}
}
.u-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1050;
background-color: rgba(0, 0, 0, 0.8);
}
.u-dialog .u-dialog-box {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
width: 6.667rem;
background-color: #fff;
border-radius: 0.32rem;
}
.u-dialog .u-dialog-box .u-dialog-content {
padding: 0.4rem;
text-align: center;
position: relative;
}
.u-dialog .u-dialog-box .u-dialog-content:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background: #bbb;
}
.u-dialog .u-dialog-box .u-dialog-button {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: separate;
}
.u-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel,
.u-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm {
display: table-cell;
color: #007aff;
text-align: center;
padding: 0.4rem 0;
line-height: 1;
position: relative;
}
.u-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:after {
content: '';
position: absolute;
top: 0;
bottom: 0;
right: 0;
width: 1px;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
background-color: #bbb;
}
.fade-enter-active,
.fade-leave-active {
-webkit-transition: opacity 0.5s linear;
transition: opacity 0.5s linear;
}
.fade-enter,
.fade-leave-active {
opacity: 0;
}
.custom-dialog .u-dialog-box {
width: 7.2rem;
height: 4rem;
border-radius: 0.133rem;
}
.custom-dialog .u-dialog-box .u-dialog-content {
width: 100%;
height: 2.667rem;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
font-size: 0.48rem;
line-height: 0.587rem;
padding: 0 0.4rem;
}
.custom-dialog .u-dialog-box .u-dialog-content:after {
height: 0;
}
.custom-dialog .u-dialog-box .u-dialog-button {
border-spacing: 0.613rem 0;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel,
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm {
background-color: ;
padding: 0.213rem 0;
border-radius: 0.8rem;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:active,
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-confirm:active {
background-color: ;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel {
color: ;
}
.custom-dialog .u-dialog-box .u-dialog-button .u-dialog-cancel:after {
width: 0;
}
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 1.173rem;
z-index: 1030;
background-color: #010d19;
}
.header p {
position: absolute;
top: 0;
left: 1.467rem;
right: 1.467rem;
line-height: 1.173rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
color: #fff;
font-size: 0.507rem;
text-align: center;
}
.header span {
color: #fff;
width: 1.467rem;
line-height: 1.173rem;
display: block;
}
.header span:active {
opacity: 0.5;
}
.header .header-left {
float: left;
padding-left: 0.133rem;
}
.header .header-right {
float: right;
padding-right: 0.133rem;
text-align: right;
}
.header .icon {
font-family: iconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased;
line-height: 1.173rem;
}
.header ~ .content {
padding-top: 1.173rem;
}
.u-text {
width: 100%;
display: table;
position: relative;
}
.u-text input {
display: table-cell;
width: 100%;
border: 0;
outline: 0;
-webkit-appearance: none;
padding: 0.533rem 1.867rem 0.533rem 0.533rem;
background-color: transparent;
}
.u-text input[type=text] ~ .u-text-see {
color: #007aff;
}
.u-text .u-text-icon {
font-family: iconfont;
font-size: 0.533rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
width: 1.173rem;
padding-left: 0.453rem;
display: table-cell;
vertical-align: middle;
}
.u-text .u-text-icon ~ input {
padding-left: 0;
}
.u-text .u-text-title {
width: 1.92rem;
padding-left: 0.533rem;
display: table-cell;
vertical-align: middle;
}
.u-text .u-text-title ~ input {
padding-left: 0;
}
.u-text .u-text-clear,
.u-text .u-text-see {
position: absolute;
top: 0;
width: 0.8rem;
height: 100%;
}
.u-text .u-text-clear:before,
.u-text .u-text-see:before {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-family: defaultIconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased;
line-height: 1;
}
.u-text .u-text-clear {
right: 0.8rem;
}
.u-text .u-text-clear:before {
content: '\e724';
}
.u-text .u-text-see {
right: 0;
}
.u-text .u-text-see:before {
content: '\e73c';
}
.u-text:after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background: #bbb;
}
@media (max-height: 400px /*no*/) {
#app {
height: 17.253rem;
position: relative;
}
}
.u-button {
width: 6.4rem;
color: #fff;
font-size: inherit;
background-color: #007aff;
border-radius: 0.533rem;
text-align: center;
line-height: 1;
margin: 0 auto;
padding: 0.267rem 0;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
background-clip: padding-box;
}
.u-button:active {
background-color: #0065ff;
}
.u-button.disabled {
background-color: #bbb;
}
\ No newline at end of file
...@@ -23,12 +23,14 @@ ...@@ -23,12 +23,14 @@
<div class="header"> <div class="header">
<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.editName') }}</p> <p>{{ $t('title.editName') }}</p>
<v-touch tag="span" class="header-right" v-on:tap="onSaveTap">{{ $t('btn.save') }}</v-touch>
</div> </div>
<div class="content"> <div class="content">
<div class="inputBox">
<u-text :init-param="componentsConfig.nameInput.initParam" :text="textName" <u-text :init-param="componentsConfig.nameInput.initParam" :text="textName"
v-on:u-text-change="onNameChange(arguments[0])"></u-text> v-on:u-text-change="onNameChange(arguments[0])"></u-text>
<p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p> <p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p>
<u-button :init-param="componentsConfig.saveButton.initParam" v-on:u-button-tap="onSaveButtonTap"></u-button> </div>
</div> </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>
......
...@@ -23,10 +23,21 @@ ...@@ -23,10 +23,21 @@
<div class="header"> <div class="header">
<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.doorlockManage') }}</p> <p>{{ $t('title.doorlockManage') }}</p>
<v-touch tag="span" class="header-right icon" v-on:tap="onAddTap">&#xe600;</v-touch>
</div> </div>
<grid-list ref="gridlist" :init-param="componentsConfig.doorlockList.initParam" v-on:grid-list-tap="onDoorlockListTap(arguments[0])" v-on:grid-list-button-tap="onDoorlockListButtonTap(arguments[0],arguments[1])"></grid-list> <div class="content">
<u-button :init-param="componentsConfig.logoutButton.initParam" v-on:u-button-tap="onLogoutButtonTap"></u-button> <v-touch tag="div" class="doorlockManage" v-on:tap="onEditNameTap">
{{ $t('doorlockManage.name') }}
<p>{{ textDoorlock }}</p>
</v-touch>
<u-button :init-param="componentsConfig.unbindDoorlockButton.initParam" v-on:u-button-tap="onUnbindDoorlockButtonTap"></u-button>
</div>
<transition name="fade">
<v-touch tag="div" class="unbindState-dialog" v-show="stateShowFlag" v-on:tap="onUnbindStateDialogTap">
<div>
<p>{{ $t('doorlockUsers.unbindSuccess') }}</p>
</div>
</<v-touch>
</transition>
<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 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="./unlockInfo.css">
<style type="text/css">
[v-cloak]{
display: none;
}
</style>
<script type="text/javascript" src="../../lib/js/p.js"></script>
<script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head>
<body ontouchstart="">
<div id="app" v-cloak>
<div class="header">
<v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>
<p>{{ $t('title.unlockInfo') }}</p>
</div>
<div class="content">
<div class="opendoorMode">
<p class="title">{{ $t('addUnlockInfo.opendoorMode') }}</p>
<ul>
<li class="active">{{ $t('addUnlockInfo.fingerprint') }}</li>
<li>{{ $t('addUnlockInfo.password') }}</li>
<li>{{ $t('addUnlockInfo.icCard') }}</li>
<li>{{ $t('addUnlockInfo.key') }}</li>
<li>{{ $t('addUnlockInfo.hijackFingerprint') }}</li>
</ul>
</div>
<div class="opendoorRecord">
<p class="title">{{ $t('addUnlockInfo.opendoorRecord') }}</p>
<u-select ref="uselect" :value="recordSelectIndex" :init-param="componentsConfig.recordSelect.initParam"
v-on:u-select-change="onRecordSelectChange(arguments[0])"></u-select>
<p class="tip">{{ $t('addUnlockInfo.tip') }}</p>
</div>
<u-button :init-param="componentsConfig.addButton.initParam" v-on:u-button-tap="onAddButtonTap"></u-button>
</div>
<u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
<u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
</div>
<script type="text/javascript" src="./addUnlockInfo.js" defer async></script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <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="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-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/> <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="format-detection" content="telephone=no"/> <meta name="format-detection" content="telephone=no"/>
<title></title> <title></title>
<link rel="stylesheet" type="text/css" href="../../lib/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="../../lib/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./myInfo.css"> <link rel="stylesheet" type="text/css" href="./doorlockUsers.css">
<style type="text/css"> <style type="text/css">
[v-cloak]{ [v-cloak]{
display: none; display: none;
...@@ -16,26 +16,27 @@ ...@@ -16,26 +16,27 @@
</style> </style>
<script type="text/javascript" src="../../lib/js/p.js"></script> <script type="text/javascript" src="../../lib/js/p.js"></script>
<script type="text/javascript" src="../../lib/js/UIOT.js"></script> <script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head> </head>
<body ontouchstart=""> <body ontouchstart="">
<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="onBackTap">&#xe611;</v-touch> <v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>
<p>{{ $t('title.doorlockUsers') }}</p> <p>{{ $t('title.addUser') }}</p>
<v-touch tag="span" class="header-right" v-on:tap="onSaveTap">{{ $t('btn.save') }}</v-touch>
</div> </div>
<div class="content"> <div class="content">
<u-text :init-param="componentsConfig.newPassword.initParam" :text="textNewPassword" <div class="inputBox">
v-on:u-text-change="onNewPasswordChange(arguments[0])"></u-text> <u-text :init-param="componentsConfig.nameInput.initParam" :text="textName"
<u-text :init-param="componentsConfig.oldPassword.initParam" :text="textOldPassword" v-on:u-text-change="onNameChange(arguments[0])"></u-text>
v-on:u-text-change="onOldPasswordChange(arguments[0])"></u-text>
<u-text :init-param="componentsConfig.oldPasswordAgain.initParam" :text="textOldPasswordAgain"
v-on:u-text-change="onOldPasswordAgainChange(arguments[0])"></u-text>
<p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p> <p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p>
</div>
<u-button :init-param="componentsConfig.confirmButton.initParam" v-on:u-button-tap="onConfirmButtonTap"></u-button>
</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>
</div>
<script type="text/javascript" src="./editPassword.js" defer async></script> <script type="text/javascript" src="./addUser.js" defer async></script>
</body>
</body>
</html> </html>
\ No newline at end of file
...@@ -430,126 +430,90 @@ p { ...@@ -430,126 +430,90 @@ p {
padding-top: 1.173rem; padding-top: 1.173rem;
} }
.user-list { .u-text {
width: 100%; width: 100%;
height: 100%; display: table;
overflow: auto;
position: absolute;
top: 1.173rem;
bottom: 0;
left: 0;
height: auto;
}
.user-list-scroll .user-list-row {
position: relative; position: relative;
overflow: hidden;
} }
.user-list-scroll .user-list-row .user-list-handle { .u-text input {
position: relative; display: table-cell;
-webkit-transition: left 0.4s ease; width: 100%;
transition: left 0.4s ease; border: 0;
left: 0; outline: 0;
background-color: #242635; -webkit-appearance: none;
padding: 0.4rem 0.533rem; padding: 0.533rem 1.867rem 0.533rem 0.533rem;
display: -webkit-box; background-color: transparent;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
z-index: 2;
} }
.user-list-scroll .user-list-row .user-list-handle .user-list-image { .u-text input[type=text] ~ .u-text-see {
width: 1.333rem; color: #007aff;
height: 1.333rem;
margin-right: 0.267rem;
} }
.user-list-scroll .user-list-row .user-list-handle .user-list-icon { .u-text .u-text-icon {
margin-right: 0.267rem;
font-family: iconfont; font-family: iconfont;
font-size: 0.533rem; font-size: 0.533rem;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
line-height: 1; line-height: 1;
width: 1.12rem;
padding-left: 0.453rem;
display: table-cell;
vertical-align: middle;
} }
.user-list-scroll .user-list-row .user-list-handle div { .u-text .u-text-icon ~ input {
-webkit-box-flex: 1; padding-left: 0;
-webkit-flex: 1;
flex: 1;
min-width: 0;
}
.user-list-scroll .user-list-row .user-list-handle .user-list-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.user-list-scroll .user-list-row .user-list-handle .user-sub-image { .u-text .u-text-title {
width: 0.453rem; width: 1.92rem;
height: 0.453rem; padding-left: 0.533rem;
display: table-cell;
vertical-align: middle;
} }
.user-list-scroll .user-list-row .user-list-handle .user-list-subtitle { .u-text .u-text-title ~ input {
overflow: hidden; padding-left: 0;
white-space: nowrap;
text-overflow: ellipsis;
display: inline-block;
} }
.user-list-scroll .user-list-row .user-list-handle.user-list-selected { .u-text .u-text-clear,
left: -3.2rem; .u-text .u-text-see {
position: absolute;
top: 0;
width: 0.8rem;
height: 100%;
} }
.user-list-scroll .user-list-row .user-list-handle:after { .u-text .u-text-clear:before,
content: "\e611"; .u-text .u-text-see:before {
display: block; position: absolute;
font-family: iconfont; top: 50%;
font-size: 0.533rem; left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
font-family: defaultIconfont;
font-size: 0.667rem;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
line-height: 1; line-height: 1;
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
} }
.user-list-scroll .user-list-row .user-list-button { .u-text .u-text-clear {
position: absolute; right: 0.8rem;
top: 0;
bottom: 0;
right: 0;
z-index: 1;
} }
.user-list-scroll .user-list-row .user-list-button div { .u-text .u-text-clear:before {
width: 1.6rem; content: '\e724';
height: 100%;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
color: #fff;
float: left;
} }
.user-list-scroll .user-list-row .user-list-button div:nth-last-of-type(1) { .u-text .u-text-see {
background-color: transparent; right: 0;
font-family: iconfont; }
font-size: 0.533rem;
-webkit-font-smoothing: antialiased; .u-text .u-text-see:before {
line-height: 1; content: '\e73c';
color: #00FFFF;
} }
.user-list-scroll .user-list-row:after { .u-text:after {
content: ''; content: '';
position: absolute; position: absolute;
bottom: 0; bottom: 0;
...@@ -557,7 +521,54 @@ p { ...@@ -557,7 +521,54 @@ p {
right: 0; right: 0;
height: 1px; height: 1px;
background: #bbb; background: #bbb;
z-index: 2; }
background: -webkit-linear-gradient(left, #242635, #fff, #242635);
background: linear-gradient(to right, #242635, #fff, #242635); @media (max-height: 400px /*no*/) {
#app {
height: 17.253rem;
position: relative;
}
}
.u-button {
width: 6.4rem;
color: #fff;
font-size: inherit;
background-color: #007aff;
border-radius: 0.533rem;
text-align: center;
line-height: 1;
margin: 0 auto;
padding: 0.267rem 0;
-webkit-transition: all 0.2s linear;
transition: all 0.2s linear;
background-clip: padding-box;
}
.u-button:active {
background-color: #0065ff;
}
.u-button.disabled {
background-color: #bbb;
}
.unbindState-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1051;
background-color: rgba(0, 0, 0, 0.8);
}
.guide-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1051;
background-color: rgba(0, 0, 0, 0.8);
} }
\ 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