wx-starlock/pages/setting/updateSetting.vue

67 lines
2.0 KiB
Vue
Raw Permalink Normal View History

<template>
<view>
<view class="mx-4 pt-5 text-base">
<view class="text-sm">
<view v-if="type === 'remoteUnlock'">
功能开启后你将可以通过网关远程开锁此功能的开启和关闭只能在锁附近通过手机蓝牙进行
</view>
<view v-if="type === 'resetSwitch'">
开启后可通过长按锁上的设置键重新上电用APP重新添加
</view>
<view v-if="type === 'resetSwitch'" class="mt-3">
关闭后重置键无效锁要通过app删除后才能重新添加
</view>
<view v-if="type === 'antiPrySwitch'"> 开启后锁被撬动时会发出报警声 </view>
<view class="mt-5 font-bold"
>当前模式{{
$bluetooth.currentLockSetting.lockSettingInfo[type] === 1 ? '已开启' : '已关闭'
}}</view
>
</view>
<view
@click="update"
2025-07-29 11:07:43 +08:00
class="w-full bg-#4777ee text-white line-height-80rpx h-80 rounded-40rpx text-center mt-4 text-lg font-bold"
>{{ $bluetooth.currentLockSetting.lockSettingInfo[type] === 1 ? '关闭' : '开启' }}</view
>
</view></view
>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { getCurrentInstance, ref } from 'vue'
import { useBluetoothStore } from '@/stores/bluetooth'
const instance = getCurrentInstance().proxy
const eventChannel = instance.getOpenerEventChannel()
const $bluetooth = useBluetoothStore()
const type = ref('')
const update = async () => {
eventChannel.emit('changeSetting', {})
}
onLoad(options => {
type.value = options.key
let title = ''
if (type.value === 'resetSwitch') {
title = '重置键'
} else if (type.value === 'remoteUnlock') {
title = '远程开锁'
} else if (type.value === 'antiPrySwitch') {
title = '防撬报警'
}
uni.setNavigationBarTitle({
title
})
})
</script>
<style lang="scss">
page {
background-color: $uni-bg-color-grey;
}
</style>