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