fix: 增加部分调试日志
This commit is contained in:
parent
32378c2aef
commit
8c3a83497a
@ -5,6 +5,7 @@ const {
|
|||||||
starEventOn,
|
starEventOn,
|
||||||
connectWiFi,
|
connectWiFi,
|
||||||
starEventOff,
|
starEventOff,
|
||||||
|
getLockNetworkInfo,
|
||||||
} = requirePlugin('starCloud')
|
} = requirePlugin('starCloud')
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@ -120,6 +121,13 @@ Page({
|
|||||||
password: password,
|
password: password,
|
||||||
});
|
});
|
||||||
console.log('connectWiFi result', result);
|
console.log('connectWiFi result', result);
|
||||||
|
if (result.code === 0) {
|
||||||
|
const networkInfo = await getLockNetworkInfo({
|
||||||
|
uid: this.data.accountInfo.uid,
|
||||||
|
deviceMac: this.data.lock.mac,
|
||||||
|
})
|
||||||
|
console.log('networkInfo', networkInfo)
|
||||||
|
}
|
||||||
this.setData({loading: false, showConnectDialog: false});
|
this.setData({loading: false, showConnectDialog: false});
|
||||||
wx.hideLoading();
|
wx.hideLoading();
|
||||||
},
|
},
|
||||||
|
|||||||
@ -124,11 +124,32 @@ Page({
|
|||||||
|
|
||||||
// 远程开锁
|
// 远程开锁
|
||||||
async remoteUnLockRequest() {
|
async remoteUnLockRequest() {
|
||||||
await selectLock({
|
await this.handleApiCall(async () => {
|
||||||
accountInfo: this.data.accountInfo,
|
const app = getApp();
|
||||||
lockId: this.data.lock.lockId
|
// 确保使用最新的锁信息
|
||||||
});
|
await selectLock({
|
||||||
console.log('remoteUnLockRequest', await remoteUnLock());
|
accountInfo: this.data.accountInfo,
|
||||||
|
lockId: app.globalData.lock.lockId
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await remoteUnLock({
|
||||||
|
lockId: this.data.lock.lockId,
|
||||||
|
uid: this.data.accountInfo.uid,
|
||||||
|
})
|
||||||
|
console.log('result', result)
|
||||||
|
|
||||||
|
if (result.code === Result.Success.code) {
|
||||||
|
wx.showToast({
|
||||||
|
title: '开门成功',
|
||||||
|
icon: 'success'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
wx.showToast({
|
||||||
|
title: result.message,
|
||||||
|
icon: 'fail'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, '开门中...');
|
||||||
},
|
},
|
||||||
|
|
||||||
// 读取锁设置
|
// 读取锁设置
|
||||||
@ -164,7 +185,6 @@ Page({
|
|||||||
disconnect: true,
|
disconnect: true,
|
||||||
type: 'open'
|
type: 'open'
|
||||||
});
|
});
|
||||||
console.log('openDoor result', result);
|
|
||||||
|
|
||||||
if (result.code === Result.Success.code) {
|
if (result.code === Result.Success.code) {
|
||||||
wx.showToast({
|
wx.showToast({
|
||||||
|
|||||||
8
package-lock.json
generated
8
package-lock.json
generated
@ -24,7 +24,7 @@
|
|||||||
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
||||||
"pinia": "^2.2.8",
|
"pinia": "^2.2.8",
|
||||||
"star-cloud-uni": "^1.0.22",
|
"star-cloud-uni": "^1.0.23",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.1.9"
|
"vue-i18n": "^9.1.9"
|
||||||
},
|
},
|
||||||
@ -10046,9 +10046,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/star-cloud-uni": {
|
"node_modules/star-cloud-uni": {
|
||||||
"version": "1.0.22",
|
"version": "1.0.23",
|
||||||
"resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.22.tgz",
|
"resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.23.tgz",
|
||||||
"integrity": "sha512-9iJMxGfbe1m6lyLksU7mS4NI7VcUWu4SCu/TRXgJBLbfGrHnSK9Iil1Ym6KApZLR5rQICVYOoqLH+liBrX6z1w==",
|
"integrity": "sha512-LlYwyMv2BD3Nqpy/HfusDHQNBzwIUGVTtuSk6iT0gqGoYYpnbIxVRdu8ZtY8s0qok/diVP2JzWriKOWEnxnD/A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
"crc": "^4.3.2",
|
"crc": "^4.3.2",
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
"@dcloudio/uni-mp-xhs": "3.0.0-4030620241128001",
|
||||||
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
"@dcloudio/uni-quickapp-webview": "3.0.0-4030620241128001",
|
||||||
"pinia": "^2.2.8",
|
"pinia": "^2.2.8",
|
||||||
"star-cloud-uni": "^1.0.22",
|
"star-cloud-uni": "^1.0.23",
|
||||||
"vue": "^3.5.13",
|
"vue": "^3.5.13",
|
||||||
"vue-i18n": "^9.1.9"
|
"vue-i18n": "^9.1.9"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -25,7 +25,8 @@ import {
|
|||||||
readSupportFunctionsSetting,
|
readSupportFunctionsSetting,
|
||||||
getLockList,
|
getLockList,
|
||||||
startSearchWiFi,
|
startSearchWiFi,
|
||||||
connectWiFi
|
connectWiFi,
|
||||||
|
getLockNetworkInfo,
|
||||||
} from 'star-cloud-uni'
|
} from 'star-cloud-uni'
|
||||||
|
|
||||||
// 用于存储事件监听器的Map
|
// 用于存储事件监听器的Map
|
||||||
@ -346,5 +347,9 @@ module.exports = {
|
|||||||
|
|
||||||
async connectWiFi(params){
|
async connectWiFi(params){
|
||||||
return await connectWiFi(params);
|
return await connectWiFi(params);
|
||||||
|
},
|
||||||
|
|
||||||
|
async getLockNetworkInfo(params){
|
||||||
|
return await getLockNetworkInfo(params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user