2025-03-28 10:00:27 +08:00

89 lines
1.9 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>
import { mapActions, mapState } from 'pinia'
import { useBluetoothStore } from '@/stores/bluetooth'
import { useBasicStore } from '@/stores/basic'
export default {
data() {
return {}
},
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>
.title {
margin-top: 200rpx;
font-size: 36rpx;
font-weight: bold;
text-align: center;
}
.icon {
width: 300rpx;
height: 300rpx;
margin: 150rpx 225rpx;
}
.tips {
margin-bottom: 100rpx;
font-size: 28rpx;
font-weight: bold;
color: #999;
text-align: center;
}
.button {
width: 600rpx;
height: 100rpx;
margin: 0 auto;
font-size: 36rpx;
line-height: 100rpx;
color: #fff;
text-align: center;
background-color: #63b8af;
border-radius: 50rpx;
}
</style>