Commit 3e9d3cdc by 朱建香

1.云端发绑定接口时将auid传给云端

2.只有在当前是门铃动画时,首页扩散效果动画点击停止
3.修改昵称后返回门锁门锁用户页面时刷新门锁用户页面
parent 03f02c48
......@@ -148,8 +148,8 @@ function openScanCode(self){
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
//云端绑定
deviceBind(self, lockId, relId);
//获取设备详情
getInfo(self, lockId, relId, data.uuid);
}else{}
},
error: (error) => {
......@@ -183,11 +183,38 @@ function openScanCode(self){
});
}
function deviceBind(self, lockId, relId){
//获取设备详情
function getInfo(self, lockId, relId, uuid){
if(uuid){
iot.business.device.getInfo({
data: {
sds: true,
uuid: uuid
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
//云端绑定
deviceBind(self, lockId, relId, data.auid);
// deviceBind(self, lockId, relId);
}
},
error: (error) => {
console.log(error);
},
complete: () => {}
});
}
}
// 云端绑定
function deviceBind(self, lockId, relId, auid){
iot.business.api.sendCustom('lock/bindUser',{
data: {
device_id: lockId,
rel_id: relId,
auid: auid,
// mac: parameters.mac,
nickname: ''
},
......
......@@ -338,7 +338,7 @@ function sendDeviceStatus(self, deviceId, productId, uuid){
},
success: (response) => {
//激活成功
bind(self, deviceId, productId);
getInfo(self, deviceId, productId,uuid);
console.log(response);
},
error: (error) => {
......@@ -382,12 +382,38 @@ function unbind(self, deviceId, productId){
});
}
//获取设备详情
function getInfo(self, deviceId, productId,uuid){
if(uuid){
iot.business.device.getInfo({
data: {
sds: true,
uuid: uuid
},
success: (response) => {
console.log(response);
let data = uPublic.checkResponseData(response.data);
if(data){
//云端绑定
bind(self, deviceId, productId, data.auid);
// bind(self, deviceId, productId);
}
},
error: (error) => {
console.log(error);
},
complete: () => {}
});
}
}
//云端绑定
function bind(self, deviceId, productId){
function bind(self, deviceId, productId, auid){
iot.business.api.sendCustom('lock/bind',{
data: {
product_id: productId,
device_id: deviceId,
auid: auid,
// mac: sn,
nickname: ''
},
......
......@@ -1270,11 +1270,13 @@ function doorlockManageTap(self){
//tap 门铃(停止响铃)
function stopDoorbellRing(self){
if(self.getMsgClass() == 'doorbell_img'){
self.setDoorbellRingingFlag(false);
self.setNormalApertureShow(false);
self.setRingTime(0);
window.clearInterval(self.time);
window.clearTimeout(self.timeout);
}
}
//tap 保存二维码到相册
......
......@@ -292,6 +292,7 @@ function sleep(time){
mui.back = function(){
iot.navigator.fire(plus.webview.currentWebview().opener(),'returnPage',{});
console.log("returnPage");
iot.navigator.back();
}
......
......@@ -86,11 +86,17 @@ function initComponentsConfig() {
}
}
//tap <
function backTap(){
mui.back = function() {
iot.navigator.fire(plus.webview.currentWebview().opener(), 'returnPage', {});
console.log("returnPage");
iot.navigator.back();
}
//tap <
function backTap() {
iot.navigator.aback();
}
function nameChange(self,text){
self.textName = text;
self.setTextErrorTip('');
......
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