Commit d09f4a01 by 朱建香

0928

parent a3f44d8c
......@@ -94,30 +94,32 @@
},
"opendoorRecord":{
"noRecordTip": "暂无记录",
"mode_0": "密码开门",
"mode_1": "指纹开门",
"mode_2": "IC卡开门",
"mode_3": "遥控器开门",
"mode_4": "钥匙开门",
"mode_5": "劫持报警",
"mode_6": "app远程开门"
"passwordOpenDoor": "密码开门",
"fingerprintOpenDoor": "指纹开门",
"ICcardOpenDoor": "IC卡开门",
"remoteOpenDoor": "遥控器开门",
"keyOpenDoor": "钥匙开门",
"hijackingAlarm": "劫持报警",
"appRemoteOpenDoor": "app远程开门"
},
"alarmInfo":{
"noInfoTip": "暂无信息",
"mode_0": "防撬报警",
"mode_1": "试错报警",
"mode_2": "欠电报警",
"mode_3": "假锁报警"
"tamperAlarm": "防撬报警",
"trialAlarm": "试错报警",
"powerAlarm": "欠电报警",
"fackLockAlram": "假锁报警"
},
"remoteOpendoor":{
"passwordInputTip": "请输入远程开门密码",
"openDoorSuccess": "远程开门成功",
"openDoorFailure": "远程开门失败",
"error": {
"noPasswordTip": "远程密码不能为空"
}
},
"hijackRecord":{
"noRecordTip": "暂无记录",
"mode_5": "劫持指纹报警"
"hijackingAlarm": "劫持指纹报警"
},
"doorlockManage":{
"noDeviceTip": "暂无设备",
......@@ -132,6 +134,7 @@
"editNameSuccess": "名字修改成功",
"editNameFailue": "名字修改失败",
"error": {
"nameCanNotBeBlank": "昵称不能为空"
}
},
"qrcode":{
......
export default {
"powerIcon":["", "", "", "", "", ""]
"powerIcon":["", "", "", "", "", ""],
"openDoorMode": {
0: "passwordOpenDoor",
1: "fingerprintOpenDoor",
2: "ICcardOpenDoor",
3: "remoteOpenDoor",
4: "keyOpenDoor",
5: "hijackingAlarm",
6: "appRemoteOpenDoor"
},
"alarmMode": {
0: "tamperAlarm",
1: "trialAlarm",
2: "powerAlarm",
3: "fackLockAlram"
}
}
\ No newline at end of file
......@@ -6,10 +6,10 @@
* 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';
const PAGE_SIZE = 10;
iot.ready(init);
function init() {
......@@ -106,7 +106,7 @@ function initComponentsConfig() {
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_alarmInfo'+record[i].mode+'_icon.png',
subtitle: Vue.t('alarmInfo.mode_'+record[i].mode+''),
subtitle: Vue.t('alarmInfo.'+config.alarmMode[record[i].mode]+''),
rightText: moment(record[i].time).format("YYYY.MM.DD HH:mm:ss")
};
}
......
......@@ -7,8 +7,10 @@
* 劫持记录页面
*/
import moment from 'moment';
import {iot, uPublic, uComponents} from '../../public/public.js';
const PAGE_SIZE = 10;
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
function init() {
......@@ -113,16 +115,17 @@ function initComponentsConfig() {
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_opendoor5_icon.png',
subtitle: Vue.t('hijackRecord.mode_'+record[i].mode+''),
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){
list[i].title = self.getUserInfo()[j].nickname == null ? '': self.getUserInfo()[j].nickname;
}else{
console.log(record[i].id);
list[i].title = self.getUserInfo()[j].id == null ? '':"ID:"+self.getUserInfo()[j].id;
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;
}
}
}
}
......
......@@ -43,7 +43,9 @@ function init() {
//远程开门是否开启
remoteOpendoorFlag: true,
//设备ID
deviceId: null
deviceId: null,
//设备uuid
uuid: null
},
mounted(){
let self = this;
......@@ -52,11 +54,11 @@ function init() {
success: (response) => {
let data = uPublic.checkResponseData(response.data);
if(data){
let uuid = data[0].uuid;
self.uuid = data[0].uuid;
self.deviceId = data[0].sn;
iot.business.sds.getDeviceStatus({
data: {
uuid: uuid
uuid: self.uuid
},
success: (response) => {
console.log(response);
......@@ -77,7 +79,7 @@ function init() {
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.mode_'+data.info[0].mode+'')
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{
......@@ -179,6 +181,12 @@ function init() {
setRemoteOpendoorFlag(flag){
this.remoteOpendoorFlag = flag;
},
getUuid(){
return this.uuid;
},
setUuid(){
this.uuid = id;
},
//tap 门锁管理
onDoorlockManageTap(){
doorlockManageTap();
......@@ -197,7 +205,7 @@ function init() {
},
//tap 远程开门
onRemoteOpendoorTap(){
remoteOpendoorTap();
remoteOpendoorTap(this);
},
//tap 劫持报警
onHijackAlarmTap(){
......@@ -369,10 +377,13 @@ function doorlockUserTap(){
}
//tap 远程开门
function remoteOpendoorTap(){
function remoteOpendoorTap(self){
iot.navigator.openWindow({
url: './remoteOpendoor.html',
id: 'remoteOpendoor'
id: 'remoteOpendoor',
extras: {
uuid: self.getUuid()
}
});
}
......
......@@ -8,6 +8,7 @@
*/
import moment from 'moment';
const PAGE_SIZE = 10;
import config from '../../public/config.js';
import {iot, uPublic, uComponents} from '../../public/public.js';
iot.ready(init);
......@@ -110,14 +111,16 @@ function initComponentsConfig() {
list[i] = {
value: record[i].openId,
leftImage: '../../resources/image/green_opendoor'+record[i].mode+'_icon.png',
subtitle: Vue.t('opendoorRecord.mode_'+record[i].mode+''),
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){
list[i].title = self.getUserInfo()[j].nickname == null ? '': self.getUserInfo()[j].nickname;
}else{
list[i].title = self.getUserInfo()[j].id == null ? '':"ID:"+self.getUserInfo()[j].id;
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;
}
}
}
}
......
......@@ -20,9 +20,12 @@ function init() {
textLoading: 'loading...',
status: 0,
//配置组件
componentsConfig: initComponentsConfig()
componentsConfig: initComponentsConfig(),
//设备uuid
uuid: null
},
mounted(){
resolve(this);
},
methods:{
getTextPassword(){
......@@ -52,6 +55,12 @@ function init() {
onPasswordChange(text){
passwordChange(this,text);
},
getUuid(){
return this.uuid;
},
setUuid(id){
this.uuid = id;
},
//tap <
onBackTap(){
backTap();
......@@ -59,10 +68,6 @@ function init() {
//tap 确定
onConfirmButtonTap(){
confirmButtonTap(this);
},
//tap loading button
onCommstatusLoadingButtonTap(){
commstatusLoadingButtonTap(this);
}
}
}).$mount('#app');
......@@ -104,6 +109,12 @@ function initComponentsConfig() {
}
}
function resolve(self){
let extras = iot.navigator.getExtras();
self.setUuid(extras.uuid);
console.log(self.getUuid());
}
function passwordChange(self,text){
self.setTextPassword(text);
self.setTextErrorTip('');
......@@ -121,44 +132,35 @@ function confirmButtonTap(self){
if(self.getTextPassword() == null || self.getTextPassword().trim() == ''){
self.setTextErrorTip(Vue.t('remoteOpendoor.error.noPasswordTip'));
}else{
// iot.business.sds.setDeviceStatus({
// data: {
// uuid: 'uuid',
// setParams: {
// 'OnOff_Power': {
// 'value': '1'
// }
// }
// },
// success: (response) => {
// console.log(response);
// },
// error: (error) => {
// console.log(error);
// }
// });
uComponents.showLoading(self);
iot.business.sds.setDeviceStatus({
data: {
uuid: self.getUuid(),
setParams: {
'POW': {
'value': '20'
}
// uComponents.showCommstatusloading(self);
// setTimeout(function(){
// self.setTextLoading(Vue.t('commstatusLoading.connectSuccess'));
// 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);
}
//tap loading button
function commstatusLoadingButtonTap(self) {
//绑定成功
uComponents.hideCommstatusloading(self);
}
},
success: (response) => {
console.log(response);
uComponents.openAlert(self, Vue.t('remoteOpendoor.openDoorSuccess'), {
text: Vue.t('dialog.confirm'), callback: function () {
//返回首页
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);
}
});
}
}
......@@ -23,6 +23,7 @@ function init() {
},
mounted(){
this.extras = iot.navigator.getExtras();
this.textName = self.extras.nickname;
},
methods:{
getTextName(){
......@@ -31,6 +32,9 @@ function init() {
setTextName(text){
this.textName = text;
},
setTextErrorTip(text){
this.textErrorTip = text;
},
onNameChange(text){
nameChange(this,text);
},
......@@ -80,7 +84,8 @@ function alert(){
}
function nameChange(self,text){
self.textName = text;
self.setTextName(text);
self.setTextErrorTip('');
console.log('nameChange: ' + self.textName);
}
......@@ -91,6 +96,9 @@ function backTap(){
//tap 保存
function saveButtonTap(self){
if(self.getTextName() == null || self.getTextName().trim() == ''){
self.setTextErrorTip(Vue.t('editName.error.nameCanNotBeBlank'));
}else{
uComponents.showLoading(self);
iot.business.device.setNickname({
data: {
......@@ -128,4 +136,5 @@ function saveButtonTap(self){
uComponents.hideLoading(self);
}
});
}
}
\ No newline at end of file
......@@ -243,18 +243,18 @@ function deleteDoorlook(self, index){
// 显示loading
let uuId = self.getDeviceList()[index].id;
uComponents.showLoading(self);
iot.business.device.unbind({
iot.business.sds.unbindDevice({
data: {
sds: true,
uuid: self.getDeviceList()[index].uuid
},
success: function (response){
let data = uPublic.checkResponseData(response.data);
if(data){
console.log(response);
if(response.data == 'success'){
//删除成功
self.getDeviceList().splice(index, 1);
self.getShowDeviceList().splice(index, 1);
rojectMethods.changeGridList(self, self.getDeviceList());
projectMethods.changeGridList(self, self.getDeviceList());
uComponents.openAlert(self, Vue.t('doorlockManage.deleteSuccess'), {
text: Vue.t('btn.confirm'), callback: function () {
console.log("删除成功");
......@@ -264,7 +264,7 @@ function deleteDoorlook(self, index){
});
}else{
//删除失败
uComponents.openAlert(self, Vue.t('doorlockManage.editNameFailue'), {
uComponents.openAlert(self, Vue.t('doorlockManage.deleteFailue'), {
text: Vue.t('btn.confirm'), callback: function () {
console.log("删除失败");
uComponents.hideLoading(self);
......
......@@ -9470,7 +9470,7 @@ Vue$3.compile = compileToFunctions;
/* harmony default export */ __webpack_exports__["default"] = (Vue$3);
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(124), __webpack_require__(135), __webpack_require__(132)))
/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(125), __webpack_require__(135), __webpack_require__(132)))
/***/ }),
/* 2 */
......@@ -9486,7 +9486,7 @@ exports.uComponents = exports.uPublic = exports.iot = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _config = __webpack_require__(131);
var _config = __webpack_require__(124);
var _config2 = _interopRequireDefault(_config);
......@@ -9894,6 +9894,35 @@ module.exports = function normalizeComponent (
/* 122 */,
/* 123 */,
/* 124 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
"powerIcon": ["&#xe6e5;", "&#xe62b;", "&#xe627;", "&#xe628;", "&#xe62a;", "&#xe629;"],
"openDoorMode": {
0: "passwordOpenDoor",
1: "fingerprintOpenDoor",
2: "ICcardOpenDoor",
3: "remoteOpenDoor",
4: "keyOpenDoor",
5: "hijackingAlarm",
6: "appRemoteOpenDoor"
},
"alarmMode": {
0: "tamperAlarm",
1: "trialAlarm",
2: "powerAlarm",
3: "fackLockAlram"
}
};
/***/ }),
/* 125 */
/***/ (function(module, exports) {
// shim for using process in browser
......@@ -10083,26 +10112,12 @@ process.umask = function() { return 0; };
/***/ }),
/* 125 */,
/* 126 */,
/* 127 */,
/* 128 */,
/* 129 */,
/* 130 */,
/* 131 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
"powerIcon": ["&#xe6e5;", "&#xe62b;", "&#xe627;", "&#xe628;", "&#xe62a;", "&#xe629;"]
};
/***/ }),
/* 131 */,
/* 132 */
/***/ (function(module, exports, __webpack_require__) {
......@@ -11265,7 +11280,7 @@ return Promise;
})));
//# sourceMappingURL=es6-promise.map
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(124), __webpack_require__(132), __webpack_require__(135)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(125), __webpack_require__(132), __webpack_require__(135)))
/***/ }),
/* 133 */
......@@ -20974,7 +20989,7 @@ if (typeof window !== 'undefined' && window.Vue) {
module.exports = plugin;
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(124)))
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(125)))
/***/ }),
/* 199 */
......@@ -22384,8 +22399,13 @@ module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c
staticClass: "u-select",
class: _vm.initClass
}, [_c('ul', {
staticClass: "u-select-scroll",
class: _vm.initClass
directives: [{
name: "show",
rawName: "v-show",
value: (_vm.selectList.length),
expression: "selectList.length"
}],
staticClass: "u-select-scroll"
}, [_vm._l((_vm.selectList), function(item, index) {
return _c('v-touch', {
key: index,
......
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