wx-starlock/App.vue
范鹏 c9a7c24672 1. tabbar
2. 我的页面
3. 用户信息页面
4. 更新头像、更新昵称、更新邮箱、重置密码
2024-08-20 19:54:37 +08:00

53 lines
1.6 KiB
Vue

<script>
import { useBluetoothStore } from '@/stores/bluetooth'
import { useBasicStore } from '@/stores/basic'
import { mapState, mapActions } from 'pinia'
export default {
computed: {
...mapState(useBluetoothStore, ['bluetoothStatus'])
},
onLaunch: function() {
// 检查强制升级
this.updateMiniProgram()
// // 初始化蓝牙
// this.initBluetooth()
// // 监听蓝牙开关状态
// this.onBluetoothState()
// // 监听蓝牙连接状态
// this.onBluetoothConnectStatus()
// // 监听设备特征值变化
// this.onBluetoothCharacteristicValueChange()
this.getDeviceInfo()
this.getButtonInfo()
},
onShow: function() {
this.checkSetting()
},
methods: {
...mapActions(useBluetoothStore, ['initBluetooth', 'onBluetoothState', 'updateBluetoothStatus', 'checkSetting',
'onBluetoothConnectStatus', 'onBluetoothCharacteristicValueChange']),
...mapActions(useBasicStore, ['getDeviceInfo', 'getButtonInfo']),
// 强制升级
updateMiniProgram() {
const updateManager = uni.getUpdateManager()
updateManager.onUpdateReady(function () {
uni.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
showCancel: false,
success: function () {
updateManager.applyUpdate()
}
})
})
}
}
}
</script>
<style lang="scss">
@import "uview-plus/index.scss";
</style>