wx-starlock/pages/addLockGuid/addLockGuid.vue

85 lines
1.9 KiB
Vue
Raw Normal View History

<template>
<view>
<view class="title">摸亮触摸屏</view>
<image src="/static/images/icon_lock_touch_screen.png" mode="aspectFill" class="icon"></image>
<view class="tips">摸亮触摸屏锁进入可添加状态点击下一步</view>
<view @click="toSearchDevice" class="button">下一步</view>
</view>
</template>
<script>
2025-02-06 11:37:41 +08:00
import { mapActions, mapState } from 'pinia'
import { useBluetoothStore } from '@/stores/bluetooth'
import { useBasicStore } from '@/stores/basic'
2025-02-06 11:37:41 +08:00
export default {
data() {
return {}
},
2025-02-06 11:37:41 +08:00
computed: {
...mapState(useBluetoothStore, ['bluetoothStatus', 'isInitBluetooth'])
},
methods: {
...mapActions(useBluetoothStore, [
'getBluetoothStatus',
'initAndListenBluetooth',
'checkSetting'
]),
...mapActions(useBasicStore, ['routeJump']),
async toSearchDevice() {
if (this.bluetoothStatus !== 0) {
this.getBluetoothStatus()
return
}
let result = true
if (!this.isInitBluetooth) {
result = await this.initAndListenBluetooth()
}
if (result) {
this.routeJump({
type: 'redirectTo',
name: 'searchDevice'
})
} else {
this.checkSetting()
}
}
}
}
</script>
<style lang="scss" scoped>
2025-02-06 11:37:41 +08:00
.title {
text-align: center;
margin-top: 200rpx;
font-size: 36rpx;
font-weight: bold;
}
2025-02-06 11:37:41 +08:00
.icon {
width: 300rpx;
height: 300rpx;
margin: 150rpx 225rpx;
}
2025-02-06 11:37:41 +08:00
.tips {
text-align: center;
font-size: 28rpx;
color: #999;
margin-bottom: 100rpx;
font-weight: bold;
}
2025-02-06 11:37:41 +08:00
.button {
width: 600rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
background-color: #63b8af;
color: #fff;
border-radius: 50rpx;
margin: 0 auto;
font-size: 36rpx;
}
</style>