添加-添加设备调试按钮

This commit is contained in:
WindowBird 2025-09-03 13:45:50 +08:00
parent 5e49c058cd
commit 033300f027

View File

@ -29,19 +29,19 @@
type="text" type="text"
/> />
</view> </view>
<!-- <view class="iptbox" @click="kashow = true">--> <view class="iptbox" @click="kashow = true">
<!-- <view v-if="kaname" class=""> 卡商{{ kaname }}</view>--> <view v-if="kaname" class=""> 卡商{{ kaname }}</view>
<!-- <view v-else class=""> 请点击选择卡商</view>--> <view v-else class=""> 请点击选择卡商</view>
<!-- </view>--> </view>
<!-- <u-select v-model="kashow" :list="kalist" title="选择卡商" @confirm="confirmka"></u-select>--> <u-select v-model="kashow" :list="kalist" title="选择卡商" @confirm="confirmka"></u-select>
<!-- <view class="iptbox" @click="show = true">--> <view class="iptbox" @click="show = true">
<!-- <view v-if="hardwareInfo.version" class=""> 版本{{ hardwareInfo.version }}</view>--> <view v-if="hardwareInfo.version" class=""> 版本{{ hardwareInfo.version }}</view>
<!-- <view v-else class=""> 请点击选择版本</view>--> <view v-else class=""> 请点击选择版本</view>
<!-- </view>--> </view>
<!-- <view v-if="hardwareInfo.version" class="tips">--> <view v-if="hardwareInfo.version" class="tips">
<!-- 版本介绍{{ hardwareInfo.instructions }}--> 版本介绍{{ hardwareInfo.instructions }}
<!-- </view>--> </view>
<!-- <u-select v-model="show" :list="list" title="选择版本" @confirm="confirm"></u-select>--> <u-select v-model="show" :list="list" title="选择版本" @confirm="confirm"></u-select>
<view class="imgs" style="margin-top: 30rpx"> <view class="imgs" style="margin-top: 30rpx">
<image <image
@ -51,17 +51,17 @@
></image> ></image>
</view> </view>
<view class="btn" @click="bind()"> 确认添加</view> <view class="btn" @click="bind()"> 确认添加</view>
<!-- <view class="bot_btn">--> <view class="bot_btn">
<!-- <view class="btn1" @click="btnfh"> 返回</view>--> <view class="btn1" @click="btnfh"> 返回</view>
<!-- <view class="btn1" @click="findDevice()"> 蓝牙链接</view>--> <view class="btn1" @click="findDevice()"> 蓝牙链接</view>
<!-- <view v-if="carstause" class="btn1" @click="ring()"> 响铃寻车</view>--> <view v-if="carstause" class="btn1" @click="ring()"> 响铃寻车</view>
<!-- <view v-if="carstause" class="btn1" @click="open()"> 蓝牙开锁</view>--> <view v-if="carstause" class="btn1" @click="open()"> 蓝牙开锁</view>
<!-- <view v-if="carstause" class="btn1" @click="close()"> 蓝牙关锁</view>--> <view v-if="carstause" class="btn1" @click="close()"> 蓝牙关锁</view>
<!-- <view v-if="carstause" class="btn1" @click="shaoru"> 进入烧录</view>--> <view v-if="carstause" class="btn1" @click="shaoru"> 进入烧录</view>
<!-- <view v-if="carstause" class="btn1" @click="reboot()"> 设备重启</view>--> <view v-if="carstause" class="btn1" @click="reboot()"> 设备重启</view>
<!-- <view v-if="isbands" class="btn1" @click="Binddevice()"> 接口响铃</view>--> <view v-if="isbands" class="btn1" @click="Binddevice()"> 接口响铃</view>
<!-- </view>--> </view>
<u-mask :show="showbind" :z-index="100" /> <u-mask :show="showbind" :z-index="100" />
<view v-if="showbind" class="tip_box"> <view v-if="showbind" class="tip_box">
<view v-if="showbind" class="top"> <view v-if="showbind" class="top">
@ -498,27 +498,31 @@ export default {
}) })
}, },
open() { open() {
let vm = this // this vm xBlufi.notifySendCustomData({
uni.getNetworkType({ customData: '11open',
success(res) { })
if (res.networkType !== 'none') { xBlufi.notifySendCustomData({
uni.getConnectedBluetoothDevices({ customData: 'open',
success(res) { })
console.log('已连接的蓝牙设备信息:', res) // let vm = this // this vm
xBlufi.notifySendCustomData({ // uni.getNetworkType({
customData: '11open', // success(res) {
}) // if (res.networkType !== 'none') {
}, // uni.getConnectedBluetoothDevices({
fail(err) { // success(res) {
uni.hideLoading() // console.log('', res)
console.error('获取已连接蓝牙设备信息失败:', err)
}, // },
}) // fail(err) {
} else { // uni.hideLoading()
console.log('手机未连接网络') // console.error('', err)
} // },
}, // })
}) // } else {
// console.log('')
// }
// },
// })
}, },
shaoru() { shaoru() {
let vm = this // this vm let vm = this // this vm
@ -544,27 +548,33 @@ export default {
}) })
}, },
close() { close() {
let vm = this // this vm xBlufi.notifySendCustomData({
uni.getNetworkType({ customData: '11close',
success(res) { })
if (res.networkType !== 'none') { xBlufi.notifySendCustomData({
uni.getConnectedBluetoothDevices({ customData: 'close',
success(res) { })
console.log('已连接的蓝牙设备信息:', res) // let vm = this // this vm
xBlufi.notifySendCustomData({ // uni.getNetworkType({
customData: '11close', // success(res) {
}) // if (res.networkType !== 'none') {
}, // uni.getConnectedBluetoothDevices({
fail(err) { // success(res) {
uni.hideLoading() // console.log('', res)
console.error('获取已连接蓝牙设备信息失败:', err) // xBlufi.notifySendCustomData({
}, // customData: '11close',
}) // })
} else { // },
console.log('手机未连接网络') // fail(err) {
} // uni.hideLoading()
}, // console.error('', err)
}) // },
// })
// } else {
// console.log('')
// }
// },
// })
}, },
ring() { ring() {
let vm = this // this vm let vm = this // this vm