You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
806 B

2 years ago
<template>
<div>
<div class="closeBtn">
<u-button type="primary" @click="closeBloone">断开连接</u-button>
<u-toast ref="uToast"></u-toast>
</div>
</div>
</template>
<script>
export default{
data(){
return{
}
},
methods:{
closeBloone(){
let id = getApp().globalData.deviceInfo.id
let that = this
console.log(id);
uni.closeBLEConnection({
deviceId: id,
success: function(res) {
getApp().globalData.id = ''
that.$refs.uToast.show({
message: "关闭蓝牙连接成功!",
type: "success",
icon: false,
});
},
})
// uni.closeBluetoothAdapter({
// })
}
}
}
</script>
<style scoped>
.closeBtn{
width: 150px;
margin: 20px;
}
</style>