feat:WIFI锁 开门方向,自动闭锁,电机功率,猫眼设置,常开模式

This commit is contained in:
Liuyf 2025-03-05 18:51:12 +08:00
parent b4aeff31fd
commit 093b9a8241
10 changed files with 133 additions and 93 deletions

View File

@ -7,9 +7,9 @@
{{ {{
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]
? catEyeMode[ ? catEyeMode[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]?.catEyeMode - 1 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]?.catEyeMode
].name ].name
: '' : ""
}} }}
</view> </view>
<up-icon name="arrow-right"></up-icon> <up-icon name="arrow-right"></up-icon>
@ -75,7 +75,7 @@
const value = computed(() => { const value = computed(() => {
const list = [] const list = []
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) {
list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode - 1) list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode)
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) {
if ( if (
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig

View File

@ -5,7 +5,7 @@
class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl" class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 0
? 'bg-#d9e8fd' ? 'bg-#d9e8fd'
: 'bg-#ececec' : 'bg-#ececec'
]" ]"
@ -14,7 +14,7 @@
<up-icon <up-icon
v-if=" v-if="
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 0
" "
name="checkbox-mark" name="checkbox-mark"
color="#2a85ec" color="#2a85ec"
@ -26,7 +26,7 @@
class="text-lg font-bold" class="text-lg font-bold"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 0
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-black' : 'text-black'
]" ]"
@ -35,7 +35,7 @@
<view <view
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 0
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-gray-500' : 'text-gray-500'
]" ]"
@ -57,7 +57,7 @@
class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl" class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1
? 'bg-#d9e8fd' ? 'bg-#d9e8fd'
: 'bg-#ececec' : 'bg-#ececec'
]" ]"
@ -66,7 +66,7 @@
<up-icon <up-icon
v-if=" v-if="
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1
" "
name="checkbox-mark" name="checkbox-mark"
color="#2a85ec" color="#2a85ec"
@ -78,7 +78,7 @@
class="text-lg font-bold" class="text-lg font-bold"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-black' : 'text-black'
]" ]"
@ -88,7 +88,7 @@
<view <view
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 1
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-gray-500' : 'text-gray-500'
]" ]"
@ -109,7 +109,7 @@
class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl" class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2
? 'bg-#d9e8fd' ? 'bg-#d9e8fd'
: 'bg-#ececec' : 'bg-#ececec'
]" ]"
@ -118,7 +118,7 @@
<up-icon <up-icon
v-if=" v-if="
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2
" "
name="checkbox-mark" name="checkbox-mark"
color="#2a85ec" color="#2a85ec"
@ -130,7 +130,7 @@
class="text-lg font-bold" class="text-lg font-bold"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-black' : 'text-black'
]" ]"
@ -139,7 +139,7 @@
<view <view
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 2
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-gray-500' : 'text-gray-500'
]" ]"
@ -161,7 +161,7 @@
class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl" class="flex items-center bg-#ececec py-4 pr-2 pl-1 mx-3 my-6 rounded-2xl"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3
? 'bg-#d9e8fd' ? 'bg-#d9e8fd'
: 'bg-#ececec' : 'bg-#ececec'
]" ]"
@ -170,7 +170,7 @@
<up-icon <up-icon
v-if=" v-if="
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3
" "
name="checkbox-mark" name="checkbox-mark"
color="#2a85ec" color="#2a85ec"
@ -182,7 +182,7 @@
class="text-lg font-bold" class="text-lg font-bold"
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-black' : 'text-black'
]" ]"
@ -191,7 +191,7 @@
<view <view
:class="[ :class="[
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3
? 'text-#2a85ec' ? 'text-#2a85ec'
: 'text-gray-500' : 'text-gray-500'
]" ]"
@ -263,7 +263,7 @@
const value = computed(() => { const value = computed(() => {
const list = [] const list = []
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) {
list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode - 1) list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode)
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) {
if ( if (
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig
@ -331,7 +331,7 @@
const toCustom = () => { const toCustom = () => {
if ( if (
!$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] || !$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] ||
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode !== 4 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode !== 3
) { ) {
uni.showToast({ uni.showToast({
title: '请先选择自定义模式', title: '请先选择自定义模式',
@ -352,7 +352,7 @@
const updateCatEyeConfig = index => { const updateCatEyeConfig = index => {
if ( if (
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] && $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] &&
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === index + 1 $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === index
) { ) {
return return
} }
@ -363,7 +363,7 @@
type: 'catEyeConfig', type: 'catEyeConfig',
params: [ params: [
{ {
catEyeMode: index + 1, catEyeMode: index,
catEyeModeConfig: $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0] catEyeModeConfig: $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]
? $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig ? $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig
: { : {

View File

@ -105,8 +105,8 @@
const value = computed(() => { const value = computed(() => {
const list = [] const list = []
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) {
list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode - 1) list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode)
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 3) {
if ( if (
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig
.recordStartTime === 0 && .recordStartTime === 0 &&

View File

@ -60,7 +60,7 @@
const pending = ref(false) const pending = ref(false)
onMounted(() => { onMounted(() => {
value.value = $bluetooth.currentLockSetting.lockSettingInfo.openDirection value.value = $bluetooth.currentLockSetting.lockSettingInfo.openDirectionValue
}) })
const updateValue = async val => { const updateValue = async val => {

View File

@ -201,7 +201,7 @@
autoUnlock: autoUnlock.value autoUnlock: autoUnlock.value
} }
if (check.value && data.startDate >= data.endDate) { if (!data.isAllDay && check.value && data.startDate >= data.endDate) {
uni.showToast({ uni.showToast({
title: '开始时间不能大于结束时间', title: '开始时间不能大于结束时间',
icon: 'none' icon: 'none'

View File

@ -108,7 +108,7 @@
const value = computed(() => { const value = computed(() => {
const list = [] const list = []
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) {
list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode - 1) list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode)
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) {
if ( if (
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig

View File

@ -5,7 +5,9 @@
@click="toJump('lockInfo')" @click="toJump('lockInfo')"
> >
<view class="item-title">基本信息</view> <view class="item-title">基本信息</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view class="mt-2.5"></view> <view class="mt-2.5"></view>
<view <view
@ -128,7 +130,9 @@
@click="toJump('faceSetting')" @click="toJump('faceSetting')"
> >
<view class="item-title">面容开锁</view> <view class="item-title">面容开锁</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1" v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1"
@ -136,7 +140,9 @@
@click="toJump('messageReminder')" @click="toJump('messageReminder')"
> >
<view class="item-title">消息提醒</view> <view class="item-title">消息提醒</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
v-if=" v-if="
@ -147,7 +153,9 @@
@click="toJump('catEye')" @click="toJump('catEye')"
> >
<view class="item-title">猫眼设置</view> <view class="item-title">猫眼设置</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
v-if=" v-if="
@ -158,7 +166,9 @@
@click="toJump('openDirection')" @click="toJump('openDirection')"
> >
<view class="item-title">开门方向设置</view> <view class="item-title">开门方向设置</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
v-if=" v-if="
@ -169,7 +179,9 @@
@click="toJump('motorTorsion')" @click="toJump('motorTorsion')"
> >
<view class="item-title">电机功率设置</view> <view class="item-title">电机功率设置</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view class="mt-2.5"></view> <view class="mt-2.5"></view>
<view <view
@ -209,7 +221,9 @@
@click="toJump('lockDate')" @click="toJump('lockDate')"
> >
<view class="item-title">锁时间</view> <view class="item-title">锁时间</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1" v-if="$bluetooth.currentLockSetting.lockBasicInfo.keyRight === 1"
@ -217,7 +231,9 @@
@click="toJump('uploadLockData')" @click="toJump('uploadLockData')"
> >
<view class="item-title">上传数据</view> <view class="item-title">上传数据</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx" class="py-3 px-4 bg-white flex items-center justify-between text-base mt-4rpx"
@ -225,13 +241,15 @@
@click="upgrade" @click="upgrade"
> >
<view class="item-title">锁升级</view> <view class="item-title">锁升级</view>
<view><up-icon name="arrow-right"></up-icon></view> <view>
<up-icon name="arrow-right"></up-icon>
</view>
</view> </view>
<view <view
class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx bg-#ec433c text-white text-xl font-bold" class="mt-4 rounded-3xl w-600 h-80 line-height-80rpx text-center mx-75rpx bg-#ec433c text-white text-xl font-bold"
@click="deleteLock" @click="deleteLock"
>删除</view >删除
> </view>
<up-modal <up-modal
:show="showModal" :show="showModal"
title="是否删除授权管理员钥匙?" title="是否删除授权管理员钥匙?"
@ -286,6 +304,15 @@
}) })
uni.hideLoading() uni.hideLoading()
if (code === 0) { if (code === 0) {
if (data.lockSettingInfo.catEyeConfig[0]) {
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.recordTime = Number(
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.recordTime
)
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.detectionDistance = Number(
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.detectionDistance
)
}
requestFinished.value = true requestFinished.value = true
$bluetooth.updateCurrentLockSetting(data) $bluetooth.updateCurrentLockSetting(data)
} else { } else {
@ -323,6 +350,14 @@
lockId: $bluetooth.currentLockInfo.lockId lockId: $bluetooth.currentLockInfo.lockId
}) })
if (code === 0) { if (code === 0) {
if (data.lockSettingInfo.catEyeConfig[0]) {
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.recordTime = Number(
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.recordTime
)
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.detectionDistance = Number(
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.detectionDistance
)
}
$bluetooth.updateCurrentLockSetting(data) $bluetooth.updateCurrentLockSetting(data)
} }
} }

View File

@ -60,6 +60,10 @@
lockId: $bluetooth.currentLockInfo.lockId lockId: $bluetooth.currentLockInfo.lockId
}) })
if (code === 0) { if (code === 0) {
if (data.lockSettingInfo.catEyeConfig[0]) {
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.recordTime =Number(data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.recordTime)
data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.detectionDistance = Number(data.lockSettingInfo.catEyeConfig[0].catEyeModeConfig.detectionDistance)
}
$bluetooth.updateCurrentLockSetting(data) $bluetooth.updateCurrentLockSetting(data)
} }
uni.showToast({ uni.showToast({

View File

@ -101,7 +101,7 @@
const value = computed(() => { const value = computed(() => {
const list = [] const list = []
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0]) {
list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode - 1) list.push($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode)
if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) { if ($bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeMode === 4) {
if ( if (
$bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig $bluetooth.currentLockSetting.lockSettingInfo.catEyeConfig[0].catEyeModeConfig

View File

@ -551,10 +551,10 @@ export const useBluetoothStore = defineStore('ble', {
}) })
break break
case subCmdIds.updateSetting: case subCmdIds.updateSetting:
that.updateCurrentLockInfo({ // that.updateCurrentLockInfo({
...that.currentLockInfo, // ...that.currentLockInfo,
token: decrypted.slice(5, 9) // token: decrypted.slice(5, 9)
}) // })
characteristicValueCallback({ characteristicValueCallback({
code: decrypted[2] code: decrypted[2]
}) })
@ -2932,6 +2932,7 @@ export const useBluetoothStore = defineStore('ble', {
) )
contentArray.set(md5Array, withParams ? 71 + params.length : 71) contentArray.set(md5Array, withParams ? 71 + params.length : 71)
console.log('加密前:', Array.from(contentArray))
const cebArray = sm4.encrypt(contentArray, this.currentLockInfo.commKey, { const cebArray = sm4.encrypt(contentArray, this.currentLockInfo.commKey, {
mode: 'ecb', mode: 'ecb',