cyy
2025-09-28 fb026e6052b4d843d327312db398cf791ac57ab9
pages/index/connect.vue
@@ -11,14 +11,14 @@
      <view class="content" v-else-if="connectState == 2">
         <view class="title">连接成功</view>
         <view class="content2">
            <image class="img" src="/images/Frame 178.svg" alt=" 图片" />
            <image class="img" src="/images/Frame_178.svg" alt=" 图片" />
            <view>【{{connectedDevice}}】连接成功</view>
         </view>
      </view>
      <view class="content" v-else-if="connectState == 3">
         <view class="title">连接失败</view>
         <view class="content2">
            <image class="img" src="/images/Frame 179.svg" alt=" 图片" />
            <image class="img" src="/images/Frame_179.svg" alt=" 图片" />
            <view class="title">无法连接设备</view>
            <view>请确保车辆开机且未与其他终端配对</view>
         </view>
@@ -29,7 +29,7 @@
            <view>1、请将手机连接到‘{{ip}}’的Wifi网络</view>
            <view>2、连接后回到本应用</view>
            <image class="img-2" src="/images/Frame 180.svg" alt=" 图片" />
            <image class="img-2" src="/images/Frame_180.svg" alt=" 图片" />
         </view>
      </view>
      <view class="content" v-else>
@@ -56,7 +56,9 @@
   import {
      session,
      showToast,
      showModal
      showModal,
      showError,
      showInfo
   } from "@/comm/utils.js"
   import {
      Button
@@ -143,7 +145,7 @@
            } catch (ex) {
               this.showError(ex)
               showError(ex)
            }
         },
         checkConnectStatus() {
@@ -181,11 +183,11 @@
                     const result = res.result || ""
                     const arCode = result.split(";")
                     if (arCode.length != 3) {
                        this.showError("无效的二维码!")
                        showInfo("无效的二维码!")
                        return
                     }
                     if (!arCode[0].trim() || !arCode[0].trim()) {
                  this.showError("无效的二维码!")
                  showInfo("无效的二维码!")
                        return
                     }
                     that.ip = arCode[0]
@@ -291,7 +293,7 @@
            } catch (ex) {
               console.log("connectVehicle faile",this.ip,ex)
               this.connectState = 3
               // this.showError(ex)
               // showError(ex)
            }
         },
@@ -360,14 +362,6 @@
               }, 2000)
            })
         },
         showError(ex) {
            let exStr = JSON.stringify(ex)
            if (exStr == "{}")
               exStr = ex
            let tip = typeof ex.msg == "string" ? ex.msg : exStr
            showModal(tip, "错误", false,"确定")
         },
      }
   }
</script>