89 lines
1.9 KiB
Vue
Raw Normal View History

<template>
<view>
<view class="title">摸亮触摸屏</view>
<image
src="https://oss-lock.xhjcn.ltd/mp/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 {
margin-top: 200rpx;
font-size: 36rpx;
font-weight: bold;
2025-03-28 10:00:27 +08:00
text-align: center;
2025-02-06 11:37:41 +08:00
}
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 {
margin-bottom: 100rpx;
2025-03-28 10:00:27 +08:00
font-size: 28rpx;
2025-02-06 11:37:41 +08:00
font-weight: bold;
2025-03-28 10:00:27 +08:00
color: #999;
text-align: center;
2025-02-06 11:37:41 +08:00
}
2025-02-06 11:37:41 +08:00
.button {
width: 600rpx;
height: 100rpx;
2025-03-28 10:00:27 +08:00
margin: 0 auto;
font-size: 36rpx;
2025-02-06 11:37:41 +08:00
line-height: 100rpx;
2025-03-28 10:00:27 +08:00
color: #fff;
2025-02-06 11:37:41 +08:00
text-align: center;
background-color: #63b8af;
border-radius: 50rpx;
}
</style>