2024-10-10 17:12:14 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view>
|
|
|
|
|
|
<view class="title">摸亮触摸屏</view>
|
2025-03-27 16:57:59 +08:00
|
|
|
|
<image
|
|
|
|
|
|
src="https://oss-lock.xhjcn.ltd/mp/icon_lock_touch_screen.png"
|
|
|
|
|
|
mode="aspectFill"
|
|
|
|
|
|
class="icon"
|
|
|
|
|
|
></image>
|
2024-10-10 17:12:14 +08:00
|
|
|
|
<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'
|
2024-10-10 17:12:14 +08:00
|
|
|
|
|
2025-02-06 11:37:41 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data() {
|
|
|
|
|
|
return {}
|
2024-10-10 17:12:14 +08:00
|
|
|
|
},
|
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()
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-10 17:12:14 +08:00
|
|
|
|
</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
|
|
|
|
}
|
2024-10-10 17:12:14 +08:00
|
|
|
|
|
2025-02-06 11:37:41 +08:00
|
|
|
|
.icon {
|
|
|
|
|
|
width: 300rpx;
|
|
|
|
|
|
height: 300rpx;
|
|
|
|
|
|
margin: 150rpx 225rpx;
|
|
|
|
|
|
}
|
2024-10-10 17:12:14 +08:00
|
|
|
|
|
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
|
|
|
|
}
|
2024-10-10 17:12:14 +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;
|
|
|
|
|
|
}
|
2024-10-10 17:12:14 +08:00
|
|
|
|
</style>
|