Commit 9b83a9ab by 朱建香

1113

parent 2856b73b
...@@ -38,4 +38,5 @@ export default { ...@@ -38,4 +38,5 @@ export default {
"remote_opendoor_timeout": 30000, "remote_opendoor_timeout": 30000,
//二维码失效时间 //二维码失效时间
"qrcode_timeout": 6000, "qrcode_timeout": 6000,
"remote_timeout": 300
} }
\ No newline at end of file
...@@ -87,7 +87,8 @@ uPublic.checkResponseData = function (data) { ...@@ -87,7 +87,8 @@ uPublic.checkResponseData = function (data) {
uPublic.openWindow = function (params){ uPublic.openWindow = function (params){
console.log("innnnn"); console.log("innnnn");
var wv = plus.webview.create(params.url, params.id, { styles: params.styles || {} }, { IOTData: params.extras }); var wv = plus.webview.create(params.url, params.id, {styles: params.styles || {} }, { IOTData: params.extras });
console.log(wv);
wv.addEventListener('titleUpdate', function(){ wv.addEventListener('titleUpdate', function(){
wv.show('slide-in-right'); wv.show('slide-in-right');
}); });
......
...@@ -154,7 +154,10 @@ function connectButtonTap(self){ ...@@ -154,7 +154,10 @@ function connectButtonTap(self){
console.log(response); console.log(response);
console.log(JSON.stringify(response)); console.log(JSON.stringify(response));
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: findWifi'+JSON.stringify(response)); iotDebug.push('end: findWifi');
}
if(window.iotDebug){
iotDebug.push('end: '+JSON.stringify(response));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -162,7 +165,7 @@ function connectButtonTap(self){ ...@@ -162,7 +165,7 @@ function connectButtonTap(self){
if(response.data == 'onProvisioning'){ if(response.data == 'onProvisioning'){
//wifi链接中 //wifi链接中
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 开始配网'); iotDebug.push('end: 配网中'+JSON.stringify(response));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -171,7 +174,7 @@ function connectButtonTap(self){ ...@@ -171,7 +174,7 @@ function connectButtonTap(self){
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding')); uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.wifiBinding'));
}else if(response.data == 'provisioned success'){ }else if(response.data == 'provisioned success'){
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 配网成功'); iotDebug.push('end: 配网成功'+JSON.stringify(response));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -207,7 +210,7 @@ function connectButtonTap(self){ ...@@ -207,7 +210,7 @@ function connectButtonTap(self){
let productId = iot.navigator.getExtras().model; let productId = iot.navigator.getExtras().model;
if(response.data == "onJoining"){ if(response.data == "onJoining"){
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 激活中'); iotDebug.push('end: 激活中'+JSON.stringify(response));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -215,7 +218,7 @@ function connectButtonTap(self){ ...@@ -215,7 +218,7 @@ function connectButtonTap(self){
uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating')); uComponents.changeCommLoadingStatusAndText(self, 0, Vue.t('wifiAdd.deviceActivating'));
}else if(response.data == "joined success"){ }else if(response.data == "joined success"){
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 激活成功'); iotDebug.push('end: 激活成功'+JSON.stringify(response));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -226,7 +229,7 @@ function connectButtonTap(self){ ...@@ -226,7 +229,7 @@ function connectButtonTap(self){
}else if(response.data == "fail"){ }else if(response.data == "fail"){
//连接失败 //连接失败
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: 激活失败'); iotDebug.push('end: 激活失败'+JSON.stringify(response));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -244,7 +247,7 @@ function connectButtonTap(self){ ...@@ -244,7 +247,7 @@ function connectButtonTap(self){
error: (error) => { error: (error) => {
console.log(error); console.log(error);
if(window.iotDebug){ if(window.iotDebug){
iotDebug.push('end: findDevicesError'+JSON.stringify(response)); iotDebug.push('end: findDevicesError'+JSON.stringify(error));
} }
if (window.iotDebug) { if (window.iotDebug) {
iotDebug.upload(iot); iotDebug.upload(iot);
...@@ -294,9 +297,24 @@ function unbind(self, deviceId, productId){ ...@@ -294,9 +297,24 @@ function unbind(self, deviceId, productId){
success: (response) => { success: (response) => {
console.log(response); console.log(response);
bind(self, deviceId, productId); bind(self, deviceId, productId);
if(window.iotDebug){
iotDebug.push('end: findDevicesError'+JSON.stringify(response));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
self.setStatus(2);
if(window.iotDebug){
iotDebug.push('end: findDevicesError'+JSON.stringify(error));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
}, },
complete: () => { complete: () => {
} }
...@@ -319,12 +337,24 @@ function bind(self, deviceId, productId){ ...@@ -319,12 +337,24 @@ function bind(self, deviceId, productId){
uComponents.changeCommButtonText(self, Vue.t('btn.confirm')); uComponents.changeCommButtonText(self, Vue.t('btn.confirm'));
self.setStatus(1); self.setStatus(1);
} }
if(window.iotDebug){
iotDebug.push('end: findDevicesError'+JSON.stringify(response));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure')); uComponents.changeCommLoadingStatusAndText(self, 2, Vue.t('wifiAdd.deviceActivateFailure'));
uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice')); uComponents.changeCommButtonText(self, Vue.t('addDevice.reBindDevice'));
self.setStatus(2); self.setStatus(2);
if(window.iotDebug){
iotDebug.push('end: findDevicesError'+JSON.stringify(error));
}
if (window.iotDebug) {
iotDebug.upload(iot);
}
}, },
complete: () => {} complete: () => {}
}); });
......
...@@ -21,17 +21,17 @@ function init() { ...@@ -21,17 +21,17 @@ function init() {
const app = new Vue({ const app = new Vue({
data:{ data:{
//开门记录 //开门记录
valueOpendoorRecord: 1, valueOpendoorRecord: 0,
//安全报警 //安全报警
valueSecurityAlarm: 1, valueSecurityAlarm: 0,
//门锁用户 //门锁用户
valueDoorlockUser: 1, valueDoorlockUser: 0,
//劫持报警 //劫持报警
valueHijackAlarm: 1, valueHijackAlarm: 0,
//远程开门 //远程开门
valueRemoteOpendoor: 0, valueRemoteOpendoor: 0,
//门锁管理 //门锁管理
valueDoorlockManage: 1, valueDoorlockManage: 0,
//开门记录 //开门记录
opendoorRecordDisabledFlag: false, opendoorRecordDisabledFlag: false,
//安全报警 //安全报警
...@@ -124,7 +124,6 @@ function init() { ...@@ -124,7 +124,6 @@ function init() {
uPublic.openRequestErrorAlert(self); uPublic.openRequestErrorAlert(self);
} }
}); });
}, },
methods:{ methods:{
setValueRemoteOpendoor(value){ setValueRemoteOpendoor(value){
...@@ -522,6 +521,11 @@ function setValueOfSwitch(self, flag){ ...@@ -522,6 +521,11 @@ function setValueOfSwitch(self, flag){
self.setDoorlockUserDisabledFlag(flag); self.setDoorlockUserDisabledFlag(flag);
self.setHijackAlarmDisabledFlag(flag); self.setHijackAlarmDisabledFlag(flag);
self.setDoorlockManageDisabledFlag(flag); self.setDoorlockManageDisabledFlag(flag);
self.valueOpendoorRecord = !flag;
self.valueSecurityAlarm = !flag;
self.valueDoorlockUser = !flag;
self.valueHijackAlarm = !flag;
self.valueDoorlockManage = !flag;
} }
function getDeviceStatus(self){ function getDeviceStatus(self){
...@@ -626,7 +630,10 @@ function setDevceInfo(self, data) { ...@@ -626,7 +630,10 @@ function setDevceInfo(self, data) {
// self.setRemoteOpendoorFlag(true); // self.setRemoteOpendoorFlag(true);
let now = moment(); let now = moment();
let time = moment(data.time.value, "YY-MM-DD-hh-mm-ss"); let time = moment(data.time.value, "YY-MM-DD-hh-mm-ss");
if(now.diff(time,'hours') < 24){ console.log(now);
console.log(time);
console.log(now.diff(time,'seconds'));
if(now.diff(time,'seconds') < config.remote_timeout){
self.setValueRemoteOpendoor(true); self.setValueRemoteOpendoor(true);
self.setRemoteOpendoorDisabledFlag(false); self.setRemoteOpendoorDisabledFlag(false);
} }
...@@ -702,13 +709,30 @@ function pushAction(self, msg) { ...@@ -702,13 +709,30 @@ function pushAction(self, msg) {
} }
function notificationListener(self) { function notificationListener(self) {
// if (plus.os.name == 'Android') {
// setInterval(function () {
// var pushMsgArray = plus.push.getAllMessage();
// if (pushMsgArray) {
// var pushMsgLength = pushMsgArray.length;
// if (pushMsgLength) {
// var pushMsg = pushMsgArray[(pushMsgArray.length - 1)];
// pushAction(pushMsg);
// plus.push.clear();
// }
// }
// }, 5000);
// }
// 从系统消息中心点击消息启动应用事件 // 从系统消息中心点击消息启动应用事件
plus.push.addEventListener('click', function (msg) { plus.push.addEventListener('click', function (msg) {
console.log("收到了click");
pushAction(self, msg); pushAction(self, msg);
alert("click"+JSON.stringify(msg));
}, false); }, false);
// 应用从推送服务器接收到推送消息事件 // 应用从推送服务器接收到推送消息事件
plus.push.addEventListener('receive', function (msg) { plus.push.addEventListener('receive', function (msg) {
console.log("收到了receive");
pushAction(self, msg); pushAction(self, msg);
alert("receive"+JSON.stringify(msg));
// plus.push.createMessage(msg.content, msg.payload); // plus.push.createMessage(msg.content, msg.payload);
}, false); }, false);
} }
...@@ -736,6 +760,12 @@ function myInfoTap(self){ ...@@ -736,6 +760,12 @@ function myInfoTap(self){
'background': 'transparent' 'background': 'transparent'
} }
}); });
// let wv = plus.webview.create( '../myInfo/index.html', 'myInfo',{subNViews:[{id:'subnview1',styles:{top:'0px',width: '100px',height:'100px',backgroundColor:'#FF0000'}}],background:'#ff0000',top:'100px',bottom:'0px'});
// wv.show();
// plus.webview.create('new.html', 'new', {'titleNView':{'backgroundcolor':'#FFFFFF','titletext':'标题栏','titlecolor':'#FF0000'}});
} }
//tap 绑定门锁 //tap 绑定门锁
...@@ -749,7 +779,7 @@ function bindDoorlockTap(){ ...@@ -749,7 +779,7 @@ function bindDoorlockTap(){
//tap 门锁管理 //tap 门锁管理
function doorlockManageTap(self){ function doorlockManageTap(self){
// if(self.getValueDoorlockManage() == 1){ if(self.valueDoorlockManage){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockManage/index.html', url: '../doorlockManage/index.html',
id: 'doorlockManage', id: 'doorlockManage',
...@@ -760,12 +790,12 @@ function doorlockManageTap(self){ ...@@ -760,12 +790,12 @@ function doorlockManageTap(self){
lockId: self.getLockId() lockId: self.getLockId()
} }
}); });
// } }
} }
//tap 开门记录 //tap 开门记录
function opendoorRecordTap(self){ function opendoorRecordTap(self){
if(self.openTime != null){ if(self.openTime != null && self.valueOpendoorRecord){
self.opendoorRecordFlag = false; self.opendoorRecordFlag = false;
setRecordTime('openTime', self.openTime.toISOString()); setRecordTime('openTime', self.openTime.toISOString());
} }
...@@ -780,7 +810,7 @@ function opendoorRecordTap(self){ ...@@ -780,7 +810,7 @@ function opendoorRecordTap(self){
//tap 安全报警 //tap 安全报警
function securityAlarmTap(self){ function securityAlarmTap(self){
if(self.notifyTime != null){ if(self.notifyTime != null && self.valueSecurityAlarm){
self.securityAlarmFlag = false; self.securityAlarmFlag = false;
setRecordTime('notifyTime', self.notifyTime.toISOString()); setRecordTime('notifyTime', self.notifyTime.toISOString());
} }
...@@ -795,7 +825,7 @@ function securityAlarmTap(self){ ...@@ -795,7 +825,7 @@ function securityAlarmTap(self){
//tap 门锁用户 //tap 门锁用户
function doorlockUserTap(self){ function doorlockUserTap(self){
// if(self.getValueDoorlockUser() == 1){ if(self.valueDoorlockUser){
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockUsers/index.html', url: '../doorlockUsers/index.html',
id: 'doorlockUsers', id: 'doorlockUsers',
...@@ -806,12 +836,12 @@ function doorlockUserTap(self){ ...@@ -806,12 +836,12 @@ function doorlockUserTap(self){
role: self.getRole(), role: self.getRole(),
} }
}); });
// } }
} }
//tap 远程开门 //tap 远程开门
function remoteOpendoorTap(self){ function remoteOpendoorTap(self){
// if(self.getValueRemoteOpendoor() == 1){ // if(self.valueRemoteOpendoor){
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: './remoteOpendoor.html', // url: './remoteOpendoor.html',
// id: 'remoteOpendoor', // id: 'remoteOpendoor',
...@@ -821,14 +851,16 @@ function remoteOpendoorTap(self){ ...@@ -821,14 +851,16 @@ function remoteOpendoorTap(self){
// } // }
// }); // });
// } // }
self.setRemoteOpendoorShowFlag(true); if(self.valueRemoteOpendoor){
self.setValueRemoteOpendoor(false); self.setRemoteOpendoorShowFlag(true);
self.setRemoteOpendoorDisabledFlag(true); self.setValueRemoteOpendoor(false);
self.setRemoteOpendoorDisabledFlag(true);
}
} }
//tap 劫持报警 //tap 劫持报警
function hijackAlarmTap(self){ function hijackAlarmTap(self){
if(self.alarmTime != null){ if(self.alarmTime != null && self.valueHijackAlarm){
self.hijackAlarmFlag = false; self.hijackAlarmFlag = false;
setRecordTime('alarmTime', self.alarmTime.toISOString()); setRecordTime('alarmTime', self.alarmTime.toISOString());
} }
......
...@@ -399,7 +399,22 @@ function cancelTap(self){ ...@@ -399,7 +399,22 @@ function cancelTap(self){
function confirmTap(self){ function confirmTap(self){
self.setUnbindShowDialog(false); self.setUnbindShowDialog(false);
unbind(self); iot.business.sds.unbindDevice({
data: {
uuid: self.extras.uuid
},
success: (response) => {
console.log(response);
unbind(self);
},
error: (error) => {
console.log(error)
},
complete: () => {
}
});
// unbind(self);
} }
function isClearSwitchTap(self, value){ function isClearSwitchTap(self, value){
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
let QRCode = require('qrcode'); let QRCode = require('qrcode');
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);
......
...@@ -9594,6 +9594,7 @@ uPublic.checkResponseData = function (data) { ...@@ -9594,6 +9594,7 @@ uPublic.checkResponseData = function (data) {
uPublic.openWindow = function (params) { uPublic.openWindow = function (params) {
console.log("innnnn"); console.log("innnnn");
var wv = plus.webview.create(params.url, params.id, { styles: params.styles || {} }, { IOTData: params.extras }); var wv = plus.webview.create(params.url, params.id, { styles: params.styles || {} }, { IOTData: params.extras });
console.log(wv);
wv.addEventListener('titleUpdate', function () { wv.addEventListener('titleUpdate', function () {
wv.show('slide-in-right'); wv.show('slide-in-right');
}); });
...@@ -9959,7 +9960,8 @@ exports.default = { ...@@ -9959,7 +9960,8 @@ exports.default = {
"ring_time": 30000, "ring_time": 30000,
"remote_opendoor_timeout": 30000, "remote_opendoor_timeout": 30000,
//二维码失效时间 //二维码失效时间
"qrcode_timeout": 6000 "qrcode_timeout": 6000,
"remote_timeout": 300
}; };
/***/ }), /***/ }),
......
...@@ -414,7 +414,20 @@ function cancelTap(self) { ...@@ -414,7 +414,20 @@ function cancelTap(self) {
function confirmTap(self) { function confirmTap(self) {
self.setUnbindShowDialog(false); self.setUnbindShowDialog(false);
unbind(self); _public.iot.business.sds.unbindDevice({
data: {
uuid: self.extras.uuid
},
success: function success(response) {
console.log(response);
unbind(self);
},
error: function error(_error3) {
console.log(_error3);
},
complete: function complete() {}
});
// unbind(self);
} }
function isClearSwitchTap(self, value) { function isClearSwitchTap(self, value) {
......
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
<img class="userInfo-subimage" v-if="userInfo.image && userInfo.role != 0" v-bind:src="userInfo.image"> <img class="userInfo-subimage" v-if="userInfo.image && userInfo.role != 0" v-bind:src="userInfo.image">
{{ $t('doorlockUser.name') }}<span class="userInfo-name" v-if="userInfo.subtitle">{{ userInfo.subtitle }}</span> {{ $t('doorlockUser.name') }}<span class="userInfo-name" v-if="userInfo.subtitle">{{ userInfo.subtitle }}</span>
<v-touch tag="span" class="userInfo-toBind" v-show="bindShowFlag && !role" v-on:tap="onBindTap">{{ $t('doorlockUser.inviteBind') }}</v-touch> <v-touch tag="span" class="userInfo-toBind" v-show="bindShowFlag && !role" v-on:tap="onBindTap">{{ $t('doorlockUser.inviteBind') }}</v-touch>
<u-button :init-param="componentsConfig.unbindButton.initParam" v-on:u-button-tap="onUnbindButtonTap" v-show="unbindShowFlag && !role"></u-button> <u-button :init-param="componentsConfig.unbindButton.initParam" v-on:u-button-tap="onUnbindButtonTap" v-show="(unbindShowFlag && !role && userInfo.role != 0)"></u-button>
</p> </p>
</div> </div>
</li> </li>
<v-touch tag="li" v-on:tap="onBindUnlockInfoTap">{{ $t('doorlockUser.bindUnlockInfo') }}</v-touch> <v-touch tag="li" v-on:tap="onBindUnlockInfoTap">{{ $t('doorlockUser.bindUnlockInfo') }}</v-touch>
<v-touch tag="li" v-on:tap="onOpendoorRecordTap">{{ $t('doorlockUser.opendoorRecord') }}</v-touch> <v-touch tag="li" v-on:tap="onOpendoorRecordTap">{{ $t('doorlockUser.opendoorRecord') }}</v-touch>
</ul> </ul>
<u-button :init-param="componentsConfig.deleteUserButton.initParam" v-on:u-button-tap="onDeleteUserButtonTap" v-show="!role"></u-button> <u-button :init-param="componentsConfig.deleteUserButton.initParam" v-on:u-button-tap="onDeleteUserButtonTap" v-show="!role && userInfo.role != 0"></u-button>
</div> </div>
<transition name="fade"> <transition name="fade">
<v-touch tag="div" class="unbindState-dialog" v-show="stateShowFlag" v-on:tap="onUnbindStateDialogTap"> <v-touch tag="div" class="unbindState-dialog" v-show="stateShowFlag" v-on:tap="onUnbindStateDialogTap">
......
...@@ -3094,8 +3094,14 @@ if (true) { ...@@ -3094,8 +3094,14 @@ if (true) {
"use strict"; "use strict";
/* WEBPACK VAR INJECTION */(function(Vue) { /* WEBPACK VAR INJECTION */(function(Vue) {
var _config = __webpack_require__(127);
var _config2 = _interopRequireDefault(_config);
var _public = __webpack_require__(4); var _public = __webpack_require__(4);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/** /**
* v_inviteBind.js * v_inviteBind.js
* Version: 0.1 * Version: 0.1
...@@ -3227,7 +3233,7 @@ function qrcodeButtonTap(self) { ...@@ -3227,7 +3233,7 @@ function qrcodeButtonTap(self) {
}); });
setTimeout(function () { setTimeout(function () {
self.setQrCodeDisabled(true); self.setQrCodeDisabled(true);
}, config.qrcode_timeout); }, _config2.default.qrcode_timeout);
} }
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)["default"])) /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2)["default"]))
......
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