跳转控制台,只有能够已经绑定的设备才能跳转控制台

This commit is contained in:
WindowBird 2025-10-14 14:06:31 +08:00
parent 348187b031
commit 82a2b2e634
3 changed files with 10 additions and 5 deletions

View File

@ -53,7 +53,7 @@
<view class="btn" @click="bind()"> 确认添加</view>
<view class="bot_btn">
<view class="btn1" @click="btnfh"> 返回</view>
<view class="btn1" @click="goToControl"> 去控制台</view>
<view v-if="isBandFromRoute" class="btn1" @click="goToControl"> 去控制台</view>
<!-- <view class="btn1" @click="findDevice()"> 蓝牙链接</view>-->
<!-- <view v-if="carstause" class="btn1" @click="ring()"> 响铃寻车</view>-->
@ -139,6 +139,7 @@ export default {
kashow: false,
kaname: "",
kaid: "",
isBandFromRoute: false,
};
},
onLoad(e) {
@ -147,6 +148,7 @@ export default {
});
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
this.mac = e.mac;
this.isBandFromRoute = e.isBand == 1 || e.isBand === "1" || e.isBand === true;
this.findDevice();
this.isbands = false;
this.carstause = false;

View File

@ -124,7 +124,7 @@ export default {
xBlufi.notifyStartDiscoverBle({ isStart: true });
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({ isStart: false });
if (this.devicesList.length == 0) {
if (this.devicesList.length === 0) {
this.tishiflag = true;
this.texts = "扫描完毕,请操作";
} else {
@ -219,7 +219,10 @@ export default {
console.log(e);
let Bluetoothmac = e.name.substring(5);
uni.navigateTo({
url: "/page_user/luru/bind_mac?mac=" + Bluetoothmac,
url:
"/page_user/luru/bind_mac?mac=" +
Bluetoothmac +
"&isBand=" + (e.isBand ? 1 : 0),
});
},
send() {

View File

@ -143,8 +143,8 @@ function handleResponseError(res, reject, options = {}) {
export function request(options = {}) {
return new Promise((resolve, reject) => {
// 获取token优先使用本地存储的token如果没有则使用临时token
const localToken = uni.getStorageSync("token");
let token = localToken;
let token = uni.getStorageSync("token");
// 如果本地没有token且启用了临时token则使用临时token
if (!token && shouldUseTempToken() && !options.noToken) {