diff --git a/api/lock.js b/api/lock.js index 9a15f3e..5fd30c7 100644 --- a/api/lock.js +++ b/api/lock.js @@ -46,3 +46,12 @@ export function lockUserListRequest(data) { data }) } + +// 获取锁详情 +export function getLockDetailRequest(data) { + return request({ + url: '/lock/detail', + method: 'POST', + data + }) +} diff --git a/components/SwitchLoading/SwitchLoading.vue b/components/SwitchLoading/SwitchLoading.vue index f6e916d..ecaf6cc 100644 --- a/components/SwitchLoading/SwitchLoading.vue +++ b/components/SwitchLoading/SwitchLoading.vue @@ -26,26 +26,26 @@ - diff --git a/pages/setting/setting.vue b/pages/setting/setting.vue index ae37782..49ff5a1 100644 --- a/pages/setting/setting.vue +++ b/pages/setting/setting.vue @@ -64,6 +64,24 @@ + + 常开模式 + + + {{ + $bluetooth.currentLockSetting.lockSettingInfo.passageMode === 1 ? '已开启' : '已关闭' + }} + + + + 上传数据 - - - - + + 锁升级 + + { + uni.showModal({ + title: '提示', + content: '小程序暂不支持升级功能,请下载星星锁APP进行升级', + showCancel: false + }) + } + const asyncSetting = async () => { const { code, data } = await $bluetooth.getLockDataList({ type: 'setting', @@ -325,8 +355,38 @@ }) let featureBit if (key === 'unlockReminder') { - featureBit = 47 - } else if (key === 'appUnlockOnline') { + const { code, message } = await updateLockSettingRequest({ + lockId: $bluetooth.currentLockInfo.lockId, + [key]: $bluetooth.currentLockSetting.lockSettingInfo[key] === 1 ? 0 : 1 + }) + pending.value = false + uni.hideLoading() + if (code === 0) { + $bluetooth.updateCurrentLockSetting({ + ...$bluetooth.currentLockSetting, + lockSettingInfo: { + ...$bluetooth.currentLockSetting.lockSettingInfo, + [key]: $bluetooth.currentLockSetting.lockSettingInfo[key] === 1 ? 0 : 1 + } + }) + $lock.updateLockSearch({ + ...$lock.lockSearch, + pageNo: 1 + }) + $lock.getLockList($lock.lockSearch) + uni.showToast({ + title: '更新成功', + icon: 'none' + }) + } else { + uni.showToast({ + title: message, + icon: 'none' + }) + } + return + } + if (key === 'appUnlockOnline') { featureBit = 55 } else if (key === 'remoteUnlock') { featureBit = 28 @@ -373,6 +433,9 @@ icon: 'none' }) } + } else if (code === -21) { + pending.value = false + uni.hideLoading() } else { pending.value = false uni.hideLoading() diff --git a/pages/temporaryDate/temporaryDate.vue b/pages/temporaryDate/temporaryDate.vue index ca4f7b8..7f9df47 100644 --- a/pages/temporaryDate/temporaryDate.vue +++ b/pages/temporaryDate/temporaryDate.vue @@ -112,11 +112,10 @@ const data = JSON.parse(options.info) if (data.startDate) { startDate.value = data.startDate - endDate.value = data.endDate === 0 ? data.startDate + 24 * 60 * 60 * 1000 : data.endDate + endDate.value = data.endDate === 0 ? data.startDate : data.endDate info.value = data defaultStartDate.value = data.startDate - defaultEndDate.value = - data.endDate === 0 ? data.startDate + 24 * 60 * 60 * 1000 : data.endDate + defaultEndDate.value = data.endDate === 0 ? data.startDate : data.endDate } } }) diff --git a/static/images/icon_remind.png b/static/images/icon_remind.png new file mode 100644 index 0000000..d693196 Binary files /dev/null and b/static/images/icon_remind.png differ diff --git a/stores/basic.js b/stores/basic.js index 8ee3321..36b52aa 100644 --- a/stores/basic.js +++ b/stores/basic.js @@ -376,6 +376,11 @@ const pages = [ name: 'videoSlot', path: '/pages/videoSlot/videoSlot', tabBar: false + }, + { + name: 'passageMode', + path: '/pages/passageMode/passageMode', + tabBar: false } ] diff --git a/stores/bluetooth.js b/stores/bluetooth.js index 131f2ef..594f8bf 100644 --- a/stores/bluetooth.js +++ b/stores/bluetooth.js @@ -1073,7 +1073,6 @@ export const useBluetoothStore = defineStore('ble', { for (let i = 0; i < deviceList.length; i++) { if (deviceList[i]?.name === that.currentLockInfo.name) { const uuid = deviceList[i]?.advertisServiceUUIDs[0] - console.log('设备UUID', uuid, uuid.slice(2, 8), uuid.slice(30, 32)) if ( uuid && uuid.slice(2, 8) === '758824' && @@ -1476,7 +1475,7 @@ export const useBluetoothStore = defineStore('ble', { console.log('写入未执行', this.bluetoothStatus) this.getBluetoothStatus() return { - code: -1 + code: -21 } } @@ -2920,7 +2919,7 @@ export const useBluetoothStore = defineStore('ble', { console.log('写入未执行', this.bluetoothStatus) this.getBluetoothStatus() return { - code: -1 + code: -21 } }