Commit 2856b73b by 朱建香

1110

parent 70fa574d
......@@ -59,7 +59,7 @@
"myInfo": "个人信息",
"editNickname": "修改昵称",
"editPassword": "修改密码",
"addUnlockInfo": "绑定开锁信息",
"addUnlockInfo": "关联开锁ID",
"deviceList": "产品型号"
},
"guide":{
......@@ -181,10 +181,10 @@
"reBindDevice": "请重新绑定"
},
"wifiAddHelp": {
"helpTitle": "配置Wi-Fi说明:",
"helpCont1": "1.按下指纹锁背面的按钮,进入主菜单,选择Wi-Fi设置→配置Wi-Fi,门锁进入等待配网状态",
"helpCont2": "2.点击页面 “开始配置Wi-Fi” 按钮,进入Wi-Fi配网画面",
"helpCont3": "3.输入Wi-Fi密码,点击 “l连接” 按钮,等待锁端相应,直至配网成功",
"helpTitle": "配置WIFI说明:",
"helpCont1": "1.确认设备端进入配网模式(详情操作请见产品说明书)",
"helpCont2": "2.点击页面下方“开始配置Wi-Fi”按钮,进入WiFi配网页面",
"helpCont3": "3.输入Wi-Fi密码,点击“连接”,等待锁端响应,至配网成功。",
"helpCont4": "(提示:如果指纹锁已经绑定过用户,重新绑定成功后会清除之前所有绑定信息)"
},
"wifiAdd": {
......@@ -245,8 +245,8 @@
"inviteBind": "邀请绑定",
"bindUnlockInfo": "关联开锁信息",
"opendoorRecord": "历史开门记录",
"unbindDialogTip": "<span></span>解绑后,您将失去对门锁所有查看功能该用户仍在用户列表中",
"deleteUserDialogTip": "删除后,二者不再为绑定关系,用户无法查看该门锁下的任何信息,该用户名下绑定的所有ID号仍可以显示在开门记录中",
"unbindDialogTip": "<span></span>解绑后,该用户不能对门锁下的信息进行查看",
"deleteUserDialogTip": "删除后,用户对应的开锁id取消关联,同时失去信息查看权限。",
"unbindSuccess": "解绑成功",
"unbindFailue": "解绑失败",
"guideStep1Tip1": "邀请绑定成功",
......@@ -268,12 +268,13 @@
"inviteBind":{
"qrcodeExpireTip": "二维码已过期,请重新生成",
"title": "注意事项:",
"cont1": "1.直接通过微信扫一扫添加门锁",
"cont2": "2.将此二维码保存为图片,发送给好友,好友通过长按识别二维码"
"cont1": "1.被邀请的用户选择添加设备页面中的扫二维码方式进行添加门锁",
"cont2": "2.长按二维码保存为图片,发送给被邀请用户,用户通过长按识别二维码",
"cont3": "3.有效时间10分钟,失效后请点击“重新生成二维码"
},
"unlockInfo":{
"bindUnlockInfo": "已关联的开锁信息",
"noInfoTip": "目前无绑定任何信息,请添加",
"noInfoTip": "当前无绑定开锁ID,请添加",
"passwordOpenDoor": "密码",
"fingerprintOpenDoor": "指纹",
"ICcardOpenDoor": "IC卡",
......@@ -282,11 +283,11 @@
"appRemoteOpenDoor": "app远程",
"hijackingAlarm": "劫持指纹",
"setHijack": "设为劫持",
"setHijackTip": "确认设为劫持指纹?",
"setHijackTip": "确认设为劫持指纹?",
"cancelHijack": "取消劫持",
"cancelHijackTip": "确认取消劫持指纹?",
"cancelHijackTip": "确认取消劫持指纹?",
"cancelAssociated": "取消关联",
"cancelAssociatedTip": "取消关联后,开门历史记录中将不再显示关联的用户信息",
"cancelAssociatedTip": "取消关联后,开门历史记录中将不再显示关联的用户信息",
"cancelAssociatedSuccess": "取消关联成功",
"cancelAssociatedFailue": "取消关联失败",
"setHijackSuccess": "设为劫持指纹成功",
......
......@@ -15,7 +15,7 @@ import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
notificationListener();
//通用 图片轮播、跑马灯、开关、按钮、dialog、loading组件
uPublic.componentsInit(['u-carousel','u-marquee','u-switch','u-button','u-dialog','u-loading','u-text','u-comm-loading']);
const app = new Vue({
......@@ -90,6 +90,7 @@ function init() {
status: 0
},
mounted(){
notificationListener(this);
let self = this;
iot.navigator.closeAllBesidesItself();
//获取设备信息
......@@ -445,12 +446,14 @@ async function getRecordTime(self, data){
console.log("openTime"+self.openTime);
let now = moment();
if(self.notifyTime){
console.log("notifyTime"+newNotifyTime.diff(self.notifyTime, 'seconds'));
self.notifyTime = moment(self.notifyTime,moment.ISO_8601);
if(newNotifyTime != null && newNotifyTime.diff(self.notifyTime, 'seconds') > 0){
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
}
}else{
console.log("notifyTime"+now.diff(newNotifyTime, 'hours'));
if(newNotifyTime != null && now.diff(newNotifyTime, 'hours') < 1){
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
......@@ -458,11 +461,13 @@ async function getRecordTime(self, data){
}
if(self.alarmTime){
self.alarmTime = moment(self.alarmTime,moment.ISO_8601);
console.log("Alarm"+newAlarmTime.diff(self.alarmTime, 'seconds'));
if(newAlarmTime != null && newAlarmTime.diff(self.alarmTime, 'seconds') > 0){
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime.unix();
}
}else{
console.log("Alarm"+now.diff(newAlarmTime, 'hours'));
if(newAlarmTime != null && now.diff(newAlarmTime, 'hours') < 1){
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime;
......@@ -470,13 +475,14 @@ async function getRecordTime(self, data){
}
if(self.openTime){
self.openTime = moment(self.openTime,moment.ISO_8601);
console.log(newOpenTime.diff(self.openTime, 'seconds'));
console.log("openTime"+newOpenTime.diff(self.openTime, 'seconds'));
if(newOpenTime != null && newOpenTime.diff(self.openTime, 'seconds') > 0){
console.log("innnn");
self.opendoorRecordFlag = true;
self.openTime = newOpenTime;
}
}else{
console.log("openTime"+now.diff(newOpenTime, 'hours'));
if(newOpenTime != null && now.diff(newOpenTime, 'hours') < 1){
console.log("innnnn");
self.opendoorRecordFlag = true;
......@@ -618,15 +624,19 @@ function setDevceInfo(self, data) {
}else if(data.notify_type.value == 5){
//请求远程开门
// self.setRemoteOpendoorFlag(true);
self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false);
let now = moment();
let time = moment(data.time.value, "YY-MM-DD-hh-mm-ss");
if(now.diff(time,'hours') < 24){
self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false);
}
}else if(data.notify_type.value == 2){
getLockInfo(self);
// getLockInfo(self);
}
}
if(data.action.value == 'lock_log' && (data.lock_action.value == '1' || data.lock_action.value == '4')){
//开门或远程开门成功
getLockInfo(self);
// getLockInfo(self);
if(data.lock_action.value == '4'){
uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('remoteOpendoor.openDoorSuccess'));
uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
......@@ -663,45 +673,42 @@ function sleep(time){
})
}
function pushAction(msg) {
function pushAction(self, msg) {
console.log("pushMessage");
console.log(msg);
// var payload = msg.payload;
// if (typeof payload == 'string') {
// payload = JSON.parse(msg.payload);
// }
// console.log(payload);
// if (payload.hasOwnProperty('date')) {
// console.log('in evaluation');
// } else if (payload.hasOwnProperty('report')) {
// console.log('in slim');
// }
var payload = msg.payload;
if (typeof payload == 'string') {
payload = JSON.parse(msg.payload);
}
console.log(payload);
if(payload.type == "open"){
//开门推送
getLockInfo(self);
}else if(payload.type == "notify"){
//安全报警
getLockInfo(self);
}else if(payload.type == "alarm"){
//劫持报警
getLockInfo(self);
}else if(payload.type == "ring"){
//门铃
ringBell(self);
}else if(payload.type == "remoteOpen"){
//远程开门通知
self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false);
}
}
function notificationListener() {
// if (plus.os.name == 'Android') {
// setInterval(function () {
// console.log("innn");
// var pushMsgArray = plus.push.getAllMessage();
// plus.push.setAutoNotification(false);
// console.log(pushMsgArray);
// if (pushMsgArray) {
// var pushMsgLength = pushMsgArray.length;
// console.log(pushMsgLength);
// if (pushMsgLength) {
// var pushMsg = pushMsgArray[(pushMsgArray.length - 1)];
// pushAction(pushMsg);
// plus.push.clear();
// }
// }
// }, config.GET_MSG_INTERVAL);
// }
function notificationListener(self) {
// 从系统消息中心点击消息启动应用事件
plus.push.addEventListener('click', function (msg) {
pushAction(msg);
pushAction(self, msg);
}, false);
// 应用从推送服务器接收到推送消息事件
plus.push.addEventListener('receive', function (msg) {
pushAction(msg);
pushAction(self, msg);
// plus.push.createMessage(msg.content, msg.payload);
}, false);
}
......@@ -821,7 +828,7 @@ function remoteOpendoorTap(self){
//tap 劫持报警
function hijackAlarmTap(self){
if(self.alarmTime == 1){
if(self.alarmTime != null){
self.hijackAlarmFlag = false;
setRecordTime('alarmTime', self.alarmTime.toISOString());
}
......
......@@ -23855,7 +23855,7 @@ _public.iot.ready(init); /**
*/
function init() {
notificationListener();
//通用 图片轮播、跑马灯、开关、按钮、dialog、loading组件
_public.uPublic.componentsInit(['u-carousel', 'u-marquee', 'u-switch', 'u-button', 'u-dialog', 'u-loading', 'u-text', 'u-comm-loading']);
var app = new Vue({
......@@ -23930,6 +23930,7 @@ function init() {
status: 0
},
mounted: function mounted() {
notificationListener(this);
var self = this;
_public.iot.navigator.closeAllBesidesItself();
//获取设备信息
......@@ -24329,12 +24330,14 @@ function getRecordTime(self, data) {
now = (0, _moment2.default)();
if (self.notifyTime) {
console.log("notifyTime" + newNotifyTime.diff(self.notifyTime, 'seconds'));
self.notifyTime = (0, _moment2.default)(self.notifyTime, _moment2.default.ISO_8601);
if (newNotifyTime != null && newNotifyTime.diff(self.notifyTime, 'seconds') > 0) {
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
}
} else {
console.log("notifyTime" + now.diff(newNotifyTime, 'hours'));
if (newNotifyTime != null && now.diff(newNotifyTime, 'hours') < 1) {
self.securityAlarmFlag = true;
self.notifyTime = newNotifyTime;
......@@ -24342,11 +24345,13 @@ function getRecordTime(self, data) {
}
if (self.alarmTime) {
self.alarmTime = (0, _moment2.default)(self.alarmTime, _moment2.default.ISO_8601);
console.log("Alarm" + newAlarmTime.diff(self.alarmTime, 'seconds'));
if (newAlarmTime != null && newAlarmTime.diff(self.alarmTime, 'seconds') > 0) {
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime.unix();
}
} else {
console.log("Alarm" + now.diff(newAlarmTime, 'hours'));
if (newAlarmTime != null && now.diff(newAlarmTime, 'hours') < 1) {
self.hijackAlarmFlag = true;
self.alarmTime = newAlarmTime;
......@@ -24354,13 +24359,14 @@ function getRecordTime(self, data) {
}
if (self.openTime) {
self.openTime = (0, _moment2.default)(self.openTime, _moment2.default.ISO_8601);
console.log(newOpenTime.diff(self.openTime, 'seconds'));
console.log("openTime" + newOpenTime.diff(self.openTime, 'seconds'));
if (newOpenTime != null && newOpenTime.diff(self.openTime, 'seconds') > 0) {
console.log("innnn");
self.opendoorRecordFlag = true;
self.openTime = newOpenTime;
}
} else {
console.log("openTime" + now.diff(newOpenTime, 'hours'));
if (newOpenTime != null && now.diff(newOpenTime, 'hours') < 1) {
console.log("innnnn");
self.opendoorRecordFlag = true;
......@@ -24507,15 +24513,19 @@ function setDevceInfo(self, data) {
} else if (data.notify_type.value == 5) {
//请求远程开门
// self.setRemoteOpendoorFlag(true);
self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false);
var _now = (0, _moment2.default)();
var _time = (0, _moment2.default)(data.time.value, "YY-MM-DD-hh-mm-ss");
if (_now.diff(_time, 'hours') < 24) {
self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false);
}
} else if (data.notify_type.value == 2) {
getLockInfo(self);
// getLockInfo(self);
}
}
if (data.action.value == 'lock_log' && (data.lock_action.value == '1' || data.lock_action.value == '4')) {
//开门或远程开门成功
getLockInfo(self);
// getLockInfo(self);
if (data.lock_action.value == '4') {
_public.uComponents.changeCommLoadingStatusAndText(self, 1, Vue.t('remoteOpendoor.openDoorSuccess'));
_public.uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
......@@ -24590,45 +24600,42 @@ function sleep(time) {
});
}
function pushAction(msg) {
function pushAction(self, msg) {
console.log("pushMessage");
console.log(msg);
// var payload = msg.payload;
// if (typeof payload == 'string') {
// payload = JSON.parse(msg.payload);
// }
// console.log(payload);
// if (payload.hasOwnProperty('date')) {
// console.log('in evaluation');
// } else if (payload.hasOwnProperty('report')) {
// console.log('in slim');
// }
}
function notificationListener() {
// if (plus.os.name == 'Android') {
// setInterval(function () {
// console.log("innn");
// var pushMsgArray = plus.push.getAllMessage();
// plus.push.setAutoNotification(false);
// console.log(pushMsgArray);
// if (pushMsgArray) {
// var pushMsgLength = pushMsgArray.length;
// console.log(pushMsgLength);
// if (pushMsgLength) {
// var pushMsg = pushMsgArray[(pushMsgArray.length - 1)];
// pushAction(pushMsg);
// plus.push.clear();
// }
// }
// }, config.GET_MSG_INTERVAL);
// }
var payload = msg.payload;
if (typeof payload == 'string') {
payload = JSON.parse(msg.payload);
}
console.log(payload);
if (payload.type == "open") {
//开门推送
getLockInfo(self);
} else if (payload.type == "notify") {
//安全报警
getLockInfo(self);
} else if (payload.type == "alarm") {
//劫持报警
getLockInfo(self);
} else if (payload.type == "ring") {
//门铃
ringBell(self);
} else if (payload.type == "remoteOpen") {
//远程开门通知
self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false);
}
}
function notificationListener(self) {
// 从系统消息中心点击消息启动应用事件
plus.push.addEventListener('click', function (msg) {
pushAction(msg);
pushAction(self, msg);
}, false);
// 应用从推送服务器接收到推送消息事件
plus.push.addEventListener('receive', function (msg) {
pushAction(msg);
pushAction(self, msg);
// plus.push.createMessage(msg.content, msg.payload);
}, false);
}
......@@ -24746,7 +24753,7 @@ function remoteOpendoorTap(self) {
//tap 劫持报警
function hijackAlarmTap(self) {
if (self.alarmTime == 1) {
if (self.alarmTime != null) {
self.hijackAlarmFlag = false;
setRecordTime('alarmTime', self.alarmTime.toISOString());
}
......
......@@ -35,6 +35,7 @@
<li>{{ $t('inviteBind.title') }}</li>
<li>{{ $t('inviteBind.cont1') }}</li>
<li>{{ $t('inviteBind.cont2') }}</li>
<li>{{ $t('inviteBind.cont3') }}</li>
</ul>
<u-button :init-param="componentsConfig.qrcodeButton.initParam" v-on:u-button-tap="onQRcodeButtonTap"></u-button>
</div>
......
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