Commit fd29a166 by 朱建香

1208

parent de3d8ca3
...@@ -46,6 +46,6 @@ export default { ...@@ -46,6 +46,6 @@ export default {
"ringBell_timeout": 300, "ringBell_timeout": 300,
"intervalTime": 3, "intervalTime": 3,
"getHistoryTime": 10, "getHistoryTime": 10,
// "audioUrl": "../../resources/audio/tipSound.mp3" "audioUrl": "../../resources/audio/tipSound.mp3"
"audioUrl": "_www/resources/audio/tipSound.mp3" // "audioUrl": "_www/resources/audio/tipSound.mp3"
} }
\ No newline at end of file
...@@ -23,6 +23,7 @@ function init() { ...@@ -23,6 +23,7 @@ function init() {
list:[], list:[],
startId: 0, startId: 0,
deviceId: null, deviceId: null,
flag: true
}, },
mounted(){ mounted(){
resolve(this); resolve(this);
...@@ -94,6 +95,17 @@ function initComponentsConfig() { ...@@ -94,6 +95,17 @@ function initComponentsConfig() {
}, },
success: (response) => { success: (response) => {
console.log(response); console.log(response);
if(self.flag){
let data = uPublic.checkResponseData(response.data);
if(data && data.record.length > 0){
let record = data.record;
iot.storage.setMap('notifyTime', moment(record[0].time).toISOString(), (res) => {
console.log(res);
self.flag = false;
}, () => {
});
}
}
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
let list = []; let list = [];
......
...@@ -24,7 +24,8 @@ function init() { ...@@ -24,7 +24,8 @@ function init() {
list: [], list: [],
startId: 0, startId: 0,
deviceId: null, deviceId: null,
userInfo: [] userInfo: [],
flag: true
}, },
mounted(){ mounted(){
resolve(this); resolve(this);
...@@ -101,6 +102,17 @@ function initComponentsConfig() { ...@@ -101,6 +102,17 @@ function initComponentsConfig() {
page_size: PAGE_SIZE page_size: PAGE_SIZE
}, },
success: (response) => { success: (response) => {
if(self.flag){
let data = uPublic.checkResponseData(response.data);
if(data && data.record.length > 0){
let record = data.record;
iot.storage.setMap('alarmTime', moment(record[0].time).toISOString(), (res) => {
console.log(res);
self.flag = false;
}, () => {
});
}
}
let data = uPublic.checkResponseData(response.data); let data = uPublic.checkResponseData(response.data);
if(data){ if(data){
console.log(data); console.log(data);
......
...@@ -23,7 +23,8 @@ function init() { ...@@ -23,7 +23,8 @@ function init() {
list: [], list: [],
startId: 0, startId: 0,
deviceId: null, deviceId: null,
userInfo: [] userInfo: [],
flag: true
}, },
mounted(){ mounted(){
resolve(this); resolve(this);
...@@ -128,6 +129,17 @@ function getHistoryRecord(self){ ...@@ -128,6 +129,17 @@ function getHistoryRecord(self){
}, },
success: (response) => { success: (response) => {
setListData(self, response); setListData(self, response);
if(self.flag){
let data = uPublic.checkResponseData(response.data);
if(data && data.record.length > 0){
let record = data.record;
iot.storage.setMap('openTime', moment(record[0].time).toISOString(), (res) => {
console.log(res);
self.flag = false;
}, () => {
});
}
}
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
......
...@@ -196,7 +196,7 @@ function setUserData(self, data){ ...@@ -196,7 +196,7 @@ function setUserData(self, data){
role: data[i].role, role: data[i].role,
image: data[i].role == 0 ? '../../resources/image/green_admin_icon.png' : data[i].user_id == null ? '../../resources/image/gray_unbindHead_icon.png' : '../../resources/image/green_bindHead_icon.png', image: data[i].role == 0 ? '../../resources/image/green_admin_icon.png' : data[i].user_id == null ? '../../resources/image/gray_unbindHead_icon.png' : '../../resources/image/green_bindHead_icon.png',
title: data[i].nickname, title: data[i].nickname,
subtitle: data[i].username ? Vue.t('userList.binded'):Vue.t('userList.unbind') subtitle: data[i].hasOwnProperty('username') ? Vue.t('userList.binded'):Vue.t('userList.unbind')
} }
} }
console.log(data); console.log(data);
......
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