fix:调整远程开锁参数

This commit is contained in:
liyi 2025-04-18 09:39:38 +08:00
parent 2911b32664
commit 891ba072d0
4 changed files with 40 additions and 30 deletions

View File

@ -43,7 +43,7 @@ Page({
return return
} }
this.setData({ isSearching: true }) this.setData({isSearching: true})
searchDevice((result) => { searchDevice((result) => {
if (result.code === Result.Success.code) { if (result.code === Result.Success.code) {
this.setData({ this.setData({
@ -52,7 +52,7 @@ Page({
getApp().globalData.deviceList = result.data.list getApp().globalData.deviceList = result.data.list
} }
}) })
wx.showToast({ wx.showToast({
title: '开始搜索设备', title: '开始搜索设备',
icon: 'none' icon: 'none'
@ -61,9 +61,9 @@ Page({
stopSearching() { stopSearching() {
if (!this.data.isSearching) return if (!this.data.isSearching) return
stopSearchDevice() stopSearchDevice()
this.setData({ isSearching: false }) this.setData({isSearching: false})
wx.showToast({ wx.showToast({
title: '已停止搜索', title: '已停止搜索',
icon: 'none' icon: 'none'
@ -88,12 +88,12 @@ Page({
password: app.globalData.accountInfo.password || '', password: app.globalData.accountInfo.password || '',
aesKey: app.globalData.accountInfo.aesKey || '', aesKey: app.globalData.accountInfo.aesKey || '',
}; };
this.setData({ this.setData({
list: app.globalData.deviceList, list: app.globalData.deviceList,
accountInfo: accountInfo accountInfo: accountInfo
}); });
// 打印检查accountInfo结构 // 打印检查accountInfo结构
console.log('Current accountInfo:', accountInfo); console.log('Current accountInfo:', accountInfo);
}, },
@ -132,13 +132,13 @@ Page({
// 添加通用的loading处理方法 // 添加通用的loading处理方法
async handleApiCall(apiFunc, loadingText = '处理中...') { async handleApiCall(apiFunc, loadingText = '处理中...') {
this.setData({ loading: true }) this.setData({loading: true})
wx.showLoading({ title: loadingText, mask: true }) wx.showLoading({title: loadingText, mask: true})
try { try {
await apiFunc() await apiFunc()
} finally { } finally {
this.setData({ loading: false }) this.setData({loading: false})
wx.hideLoading() wx.hideLoading()
} }
}, },
@ -383,11 +383,11 @@ Page({
}, },
async remoteUnLockRequest() { async remoteUnLockRequest() {
await selectLock({
console.log('remoteUnLockRequest', await remoteUnLock({
accountInfo: this.data.accountInfo, accountInfo: this.data.accountInfo,
lockId: this.data.lock.lockId lockId: this.data.lock.lockId
}) }));
console.log('remoteUnLockRequest', await remoteUnLock());
}, },
async enableAntiPryAlarm(e) { async enableAntiPryAlarm(e) {
const operate = e.currentTarget.dataset.operate; const operate = e.currentTarget.dataset.operate;
@ -417,8 +417,8 @@ Page({
}, },
onPassageModeInput(e) { onPassageModeInput(e) {
const { field } = e.currentTarget.dataset; const {field} = e.currentTarget.dataset;
const { value } = e.detail; const {value} = e.detail;
this.setData({ this.setData({
[`passageModeForm.${field}`]: value [`passageModeForm.${field}`]: value
}); });
@ -457,7 +457,7 @@ Page({
default: default:
throw new Error('请选择循环类型'); throw new Error('请选择循环类型');
} }
const params = { const params = {
passageMode: parseInt(form.passageMode), passageMode: parseInt(form.passageMode),
startDate: startTime, startDate: startTime,
@ -466,7 +466,7 @@ Page({
weekDay, weekDay,
autoUnlock: parseInt(form.autoUnlock) autoUnlock: parseInt(form.autoUnlock)
}; };
await this._updatePassageModeSetting(params); await this._updatePassageModeSetting(params);
this.hidePassageMode(); this.hidePassageMode();
} catch (error) { } catch (error) {
@ -483,7 +483,7 @@ Page({
accountInfo: this.data.accountInfo, accountInfo: this.data.accountInfo,
lockId: this.data.lock.lockId lockId: this.data.lock.lockId
}); });
const result = await updateSupportFunctionsWithParams({ const result = await updateSupportFunctionsWithParams({
accountInfo: this.data.accountInfo, accountInfo: this.data.accountInfo,
featureBit: 50, featureBit: 50,

8
package-lock.json generated
View File

@ -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.12", "star-cloud-uni": "^1.0.13",
"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.12", "version": "1.0.13",
"resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.12.tgz", "resolved": "https://registry.npmjs.org/star-cloud-uni/-/star-cloud-uni-1.0.13.tgz",
"integrity": "sha512-QhBsp8kF0aOaveFohaDTVibX6v9zJAczMvC5G1faPH++B48LmgPTmsqihlD0TwEip8nTWuNQDT89xZ84nbWg5g==", "integrity": "sha512-F1LLDwcEAqMkbUDwnbyvqYAbMMhiAJG3rQbduxkOdzdHT3lpxPOxqep6XVi4AfbRbRwbuWXChle81iBLZiK6vw==",
"dependencies": { "dependencies": {
"buffer": "^6.0.3", "buffer": "^6.0.3",
"crc": "^4.3.2", "crc": "^4.3.2",

View File

@ -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.12", "star-cloud-uni": "^1.0.13",
"vue": "^3.5.13", "vue": "^3.5.13",
"vue-i18n": "^9.1.9" "vue-i18n": "^9.1.9"
}, },

View File

@ -198,17 +198,22 @@ module.exports = {
async getRemoteList(params) { async getRemoteList(params) {
return await getRemoteList(params) return await getRemoteList(params)
}, },
/**
* 更新锁支持项目
* @param params
* @returns {Promise<*>}
*/
async updateSupportFunctionsWithParams(params) { async updateSupportFunctionsWithParams(params) {
return await updateSupportFunctionsWithParams(params) return await updateSupportFunctionsWithParams(params)
}, },
/**
* 读取锁设置
* @param params
* @returns {Promise<*>}
*/
async readSupportFunctions(params) { async readSupportFunctions(params) {
return await readSupportFunctionsSetting(params) return await readSupportFunctionsSetting(params)
}, },
/** /**
* 事件触发 * 事件触发
* @param eventName 事件昵称 * @param eventName 事件昵称
@ -306,7 +311,12 @@ module.exports = {
} }
}, },
async remoteUnLock(){ /**
return await remoteUnLock() * 远程开锁
* @param params
* @returns {Promise<*>}
*/
async remoteUnLock(params){
return await remoteUnLock(params)
} }
} }