From d87c256a957a6a5c3b40eaf9c52ec68f2fc22c97 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 12 九月 2025 16:23:42 +0800
Subject: [PATCH] test
---
pages/index/connect.vue | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/pages/index/connect.vue b/pages/index/connect.vue
index 9fcc16b..f7ff7a2 100644
--- a/pages/index/connect.vue
+++ b/pages/index/connect.vue
@@ -37,7 +37,7 @@
</view>
<view v-if="connectState == 3" class="button-group">
<a-button type="primary" plain="true" class="button" @click="clickTry">
- {{reconnectFlag ? "閲嶆柊杩炴帴WiFi":"鍐嶈瘯"}}
+ {{reconnectFlag ? "閲嶆柊杩炴帴WiFi":"閲嶈瘯"}}
</a-button>
<a-button type="ghost" class="button" @click="clickCancel">鍙栨秷
</a-button>
@@ -181,11 +181,11 @@
const result = res.result || ""
const arCode = result.split(";")
if (arCode.length != 3) {
- showModal("鏃犳晥鐨勪簩缁寸爜锛�, "鎻愮ず")
+ this.showError("鏃犳晥鐨勪簩缁寸爜锛�)
return
}
if (!arCode[0].trim() || !arCode[0].trim()) {
- showModal("鏃犳晥鐨勪簩缁寸爜锛�, "鎻愮ず")
+ this.showError("鏃犳晥鐨勪簩缁寸爜锛�)
return
}
that.ip = arCode[0]
@@ -219,7 +219,7 @@
}
this.connectState = 1
- this.checkConnectVehicle()
+ this.checkConnectVehicle(60)
},
clickStudyMore() {
showToast("鍚庣画鍙戝紑涓�)
@@ -241,7 +241,7 @@
androidWifi.connectWifi(this.wifiSID,
this.wifiPassword
)
- this.checkConnectVehicle()
+ this.checkConnectVehicle(60)
//
} else {
if (first) {
@@ -261,7 +261,7 @@
}
this.connectState = 1
- this.checkConnectVehicle()
+ this.checkConnectVehicle(60)
}
} else {
@@ -285,9 +285,11 @@
async connectVehicle() {
try {
const info = await mtBattery(this.ip)
+ console.log(this.ip)
this.connectState = 2
this.connectedSuccess()
} catch (ex) {
+ console.log("connectVehicle faile",this.ip,ex)
this.connectState = 3
// this.showError(ex)
}
@@ -336,8 +338,13 @@
})
}, 1000)
},
- checkConnectVehicle() {
+ checkConnectVehicle(sec) {
if (this.unloadFlag) {
+ return
+ }
+ if(sec <= 0)
+ {
+ this.connectState = 3
return
}
checkIpLinkSuccess(this.ip).then((res) => {
@@ -349,7 +356,7 @@
}
}).catch((ex) => {
setTimeout(() => {
- this.checkConnectVehicle()
+ this.checkConnectVehicle(sec- 7)
}, 2000)
})
},
@@ -358,7 +365,7 @@
if (exStr == "{}")
exStr = ex
let tip = typeof ex.msg == "string" ? ex.msg : exStr
- showModal(tip, "閿欒", false)
+ showModal(tip, "閿欒", false,"纭畾")
},
}
--
Gitblit v1.9.1