Commit 3d49faac by 朱建香

1012

parent 803870aa
...@@ -16,11 +16,11 @@ const iot = new UIOT({ ...@@ -16,11 +16,11 @@ const iot = new UIOT({
appId: '' appId: ''
}, },
cloud: { cloud: {
url: 'http://192.168.2.96:20000' url: 'http://wx.iotface.com'
}, },
plugin: { plugin: {
log: { log: {
url: 'http://192.168.2.213:3302/log' url: 'http://admin.iot.u-gen.net/admin/view/debug'
} }
} }
}); });
......
...@@ -270,7 +270,7 @@ function init() { ...@@ -270,7 +270,7 @@ function init() {
}, },
//tap 门锁用户 //tap 门锁用户
onDoorlockUserTap(){ onDoorlockUserTap(){
doorlockUserTap(); doorlockUserTap(this);
}, },
//tap 远程开门 //tap 远程开门
onRemoteOpendoorTap(){ onRemoteOpendoorTap(){
...@@ -435,8 +435,6 @@ function setDevceInfo(self, data) { ...@@ -435,8 +435,6 @@ function setDevceInfo(self, data) {
} }
} }
//tap 个人信息 //tap 个人信息
function myInfoTap(self){ function myInfoTap(self){
iot.navigator.openWindow({ iot.navigator.openWindow({
...@@ -496,12 +494,15 @@ function securityAlarmTap(self){ ...@@ -496,12 +494,15 @@ function securityAlarmTap(self){
} }
//tap 门锁用户 //tap 门锁用户
function doorlockUserTap(){ function doorlockUserTap(self){
// if(self.getValueDoorlockUser == 1){ // if(self.getValueDoorlockUser() == 1){
// iot.navigator.openWindow({ // iot.navigator.openWindow({
// url: '../doorlockUsers/', // url: '../doorlockUsers/',
// id: 'doorlockUsers', // id: 'doorlockUsers',
// }); // extras: {
// deviceId: self.deviceId
// }
// });
// } // }
} }
......
...@@ -94,10 +94,9 @@ function nameChange(self,text){ ...@@ -94,10 +94,9 @@ function nameChange(self,text){
//tap 确定 //tap 确定
function confirmButtonTap(self){ function confirmButtonTap(self){
if(self.getTextName() == null || self.getTextName().trim() == ''){ if(self.getTextName() == null || self.getTextName().trim() == ''){
self.setTextErrorTip(Vue.t('addUser.nameCanNotEmpty')); self.setTextErrorTip(Vue.t('addUser.error.nameCanNotEmpty'));
}else{ }else{
uComponents.showLoading(self); uComponents.showLoading(self);
}
iot.business.api.sendCustom('lock/addUser',{ iot.business.api.sendCustom('lock/addUser',{
data: { data: {
device_id: self.extras.deviceId device_id: self.extras.deviceId
...@@ -108,9 +107,14 @@ function confirmButtonTap(self){ ...@@ -108,9 +107,14 @@ function confirmButtonTap(self){
text: Vue.t('btn.confirm'), callback: function () { text: Vue.t('btn.confirm'), callback: function () {
console.log("添加用户成功"); console.log("添加用户成功");
//跳转到门锁用户界面 //跳转到门锁用户界面
iot.storage.setMap('lock_id', data.lock_id, () => {
self.$router.replace({path: '/myDoorlock'});
}, () => {
error();
});
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockUsers/addUser.', url: './doorlockUser.html',
id: 'addUser', id: 'doorlockUser'
}); });
} }
}); });
...@@ -127,8 +131,5 @@ function confirmButtonTap(self){ ...@@ -127,8 +131,5 @@ function confirmButtonTap(self){
uComponents.hideLoading(self); uComponents.hideLoading(self);
} }
}); });
iot.navigator.openWindow({ }
url: './doorlockUser.html',
id: 'doorlockUser'
});
} }
\ No newline at end of file
...@@ -28,11 +28,10 @@ function init() { ...@@ -28,11 +28,10 @@ function init() {
extras: {} extras: {}
}, },
mounted(){ mounted(){
self.extras = iot.navigator.getExtras(); this.extras = iot.navigator.getExtras();
//获取用户列表 //获取用户列表
getUserList(); getUserList(this);
// this.userList = [{value: 1, role: 0, image: '../../resources/image/green_admin_icon.png', title: '我是用户', subtitle: "MM"}, //
// {value: 1, role: 1, image: '../../resources/image/green_bindhead_icon.png', title: '我是用户', subtitle: "MM"}]
}, },
methods:{ methods:{
getUserList(){ getUserList(){
...@@ -91,6 +90,7 @@ function initComponentsConfig() { ...@@ -91,6 +90,7 @@ function initComponentsConfig() {
//获取用户列表 //获取用户列表
function getUserList(self){ function getUserList(self){
console.log(self.extras);
uComponents.showLoading(self); uComponents.showLoading(self);
iot.business.device.getUsers({ iot.business.device.getUsers({
data: { data: {
...@@ -98,23 +98,27 @@ function getUserList(self){ ...@@ -98,23 +98,27 @@ function getUserList(self){
}, },
success: (response) => { success: (response) => {
console.log(response); console.log(response);
let data = uPublic.checkResponseData(response.data); // let data = uPublic.checkResponseData(response.data);
if(data){ // if(data){
let list = []; // let list = [];
for(let i = 0; i < data.length ; i++){ // for(let i = 0; i < data.length ; i++){
list[i] = { // list[i] = {
value: data.userId, // value: data.userId,
role: data.role, // role: data.role,
image: data.role == 0 ? '../../resources/image/green_admin_icon.png' : data.name == null ? '../../resources/image/gray_unbindHead_icon.png' : '../../resources/image/green_bindhead_icon.png', // image: data.role == 0 ? '../../resources/image/green_admin_icon.png' : data.name == null ? '../../resources/image/gray_unbindHead_icon.png' : '../../resources/image/green_bindhead_icon.png',
title: data.nickname, // title: data.nickname,
subTitle: data.name // subTitle: data.name
} // }
} // }
let list = [{value: 1, role: 0, image: '../../resources/image/green_admin_icon.png', title: '我是用户', subtitle: "MM"},
{value: 1, role: 1, image: '../../resources/image/green_bindhead_icon.png', title: '我是用户', subtitle: "MM"}];
self.setUserList(self.getUserList().concat(list)); self.setUserList(self.getUserList().concat(list));
if(data.length > 0){ console.log(self.getUserList());
self.setStartId(data[data.length-1].id); // if(data.length > 0){
} // self.setStartId(data[data.length-1].id);
} // }
// }
}, },
error: (error) => { error: (error) => {
console.log(error); console.log(error);
...@@ -150,8 +154,8 @@ function swipeRightRow(self) { ...@@ -150,8 +154,8 @@ function swipeRightRow(self) {
// 点击组件列表 通知事件和当前点击列表下标 // 点击组件列表 通知事件和当前点击列表下标
function onTapUserList(self, listIndex) { function onTapUserList(self, listIndex) {
iot.navigator.openWindow({ iot.navigator.openWindow({
url: '../doorlockUsers/doorlockUsers.html', url: './doorlockUser.html',
id: 'doorlockUsers', id: 'doorlockUser',
}); });
if (self.userListIndex != null) { if (self.userListIndex != null) {
self.userListIndex = null; self.userListIndex = null;
......
...@@ -9519,11 +9519,11 @@ var iot = new UIOT({ ...@@ -9519,11 +9519,11 @@ var iot = new UIOT({
appId: '' appId: ''
}, },
cloud: { cloud: {
url: 'http://192.168.2.96:20000' url: 'http://wx.iotface.com'
}, },
plugin: { plugin: {
log: { log: {
url: 'http://192.168.2.213:3302/log' url: 'http://admin.iot.u-gen.net/admin/view/debug'
} }
} }
}); });
......
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