跳转控制台,只有能够已经绑定的设备才能跳转控制台
This commit is contained in:
parent
348187b031
commit
82a2b2e634
|
|
@ -53,7 +53,7 @@
|
||||||
<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="goToControl"> 去控制台</view>
|
<view v-if="isBandFromRoute" class="btn1" @click="goToControl"> 去控制台</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>-->
|
||||||
|
|
||||||
|
|
@ -139,6 +139,7 @@ export default {
|
||||||
kashow: false,
|
kashow: false,
|
||||||
kaname: "",
|
kaname: "",
|
||||||
kaid: "",
|
kaid: "",
|
||||||
|
isBandFromRoute: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
|
@ -147,6 +148,7 @@ export default {
|
||||||
});
|
});
|
||||||
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
|
||||||
this.mac = e.mac;
|
this.mac = e.mac;
|
||||||
|
this.isBandFromRoute = e.isBand == 1 || e.isBand === "1" || e.isBand === true;
|
||||||
this.findDevice();
|
this.findDevice();
|
||||||
this.isbands = false;
|
this.isbands = false;
|
||||||
this.carstause = false;
|
this.carstause = false;
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ export default {
|
||||||
xBlufi.notifyStartDiscoverBle({ isStart: true });
|
xBlufi.notifyStartDiscoverBle({ isStart: true });
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
xBlufi.notifyStartDiscoverBle({ isStart: false });
|
xBlufi.notifyStartDiscoverBle({ isStart: false });
|
||||||
if (this.devicesList.length == 0) {
|
if (this.devicesList.length === 0) {
|
||||||
this.tishiflag = true;
|
this.tishiflag = true;
|
||||||
this.texts = "扫描完毕,请操作";
|
this.texts = "扫描完毕,请操作";
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -219,7 +219,10 @@ export default {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
let Bluetoothmac = e.name.substring(5);
|
let Bluetoothmac = e.name.substring(5);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/page_user/luru/bind_mac?mac=" + Bluetoothmac,
|
url:
|
||||||
|
"/page_user/luru/bind_mac?mac=" +
|
||||||
|
Bluetoothmac +
|
||||||
|
"&isBand=" + (e.isBand ? 1 : 0),
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
send() {
|
send() {
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,8 @@ function handleResponseError(res, reject, options = {}) {
|
||||||
export function request(options = {}) {
|
export function request(options = {}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// 获取token,优先使用本地存储的token,如果没有则使用临时token
|
// 获取token,优先使用本地存储的token,如果没有则使用临时token
|
||||||
const localToken = uni.getStorageSync("token");
|
|
||||||
let token = localToken;
|
let token = uni.getStorageSync("token");
|
||||||
|
|
||||||
// 如果本地没有token且启用了临时token,则使用临时token
|
// 如果本地没有token且启用了临时token,则使用临时token
|
||||||
if (!token && shouldUseTempToken() && !options.noToken) {
|
if (!token && shouldUseTempToken() && !options.noToken) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user