From d8743368ffda9bc0fb2c6818f695a9a6b1079e57 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期五, 19 九月 2025 18:22:15 +0800
Subject: [PATCH] laster
---
pages/index/index.vue | 106 +++++++++++++++++++++++++++++++++--------------------
1 files changed, 66 insertions(+), 40 deletions(-)
diff --git a/pages/index/index.vue b/pages/index/index.vue
index d3e179b..3fcc182 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -42,20 +42,20 @@
</view>
</view>
<image class="vehicle-img " :class="page.link_status ?'':'gray-image'" mode="aspectFit"
- src="/images/image 11.png" alt="鍥剧墖" />
+ src="/images/che.png" alt="鍥剧墖" />
<view v-if="page.link_status" class="img-button-group">
- <view type="primary" class="img-text-button" @click="clickToTask(index,page)">
- <a-button class="img-button" color='primary' disabled>
- <text class="ico task-list" />
- </a-button>
- <text>浠诲姟鍒楄〃</text>
- </view>
<view type="primary" plain="true" class="img-text-button" @click="clickToMap(index,page)">
<a-button class="img-button" color='primary'>
<text class="ico map" />
</a-button>
- <text>杩涘叆鍦板浘</text>
+ <text>鍦烘櫙鏋勫缓</text>
+ </view>
+ <view type="primary" class="img-text-button" @click="clickToTask(page)">
+ <a-button class="img-button" color='primary'>
+ <text class="ico task-list" />
+ </a-button>
+ <text>浠诲姟璁板綍</text>
</view>
</view>
<view v-else class="unlink-content">
@@ -123,9 +123,12 @@
import {
session,
showToast,
- showModal
+ showModal,
+ showError,
+ showInfo
} from "@/comm/utils.js"
import {
+ getAllScene,
mtBattery,
getAgvState,
checkIpLinkSuccess,
@@ -279,13 +282,13 @@
}
} catch (ex) {
- this.showError(ex)
+ showError(ex)
}
},
async loadVehicleBattery() {
try {
-
+
const list = this.pageList
if (this.currentPage < list.length && this.currentPage > -1) {
const page = list[this.currentPage]
@@ -303,7 +306,7 @@
this.pageList = [...list]
} catch (ex) {
- this.showError(ex)
+ showError(ex)
}
},
@@ -408,7 +411,7 @@
}
}
} catch (ex) {
- this.showError(ex)
+ showError(ex)
}
},
async checkConnectSuccess(ip) {
@@ -459,12 +462,7 @@
this.inputPopupValue = ""
this.$refs.refPopupInput.open()
},
- clickToTask(index, page) {
- showToast("璇ュ姛鑳借繕鍦ㄥ紑鍙戜腑")
- // uni.navigateTo({
- // url: `/pages/task/index?ip=${page.ip}`
- // })
- },
+
clickMore() {
if (this.currentPage < this.pageList.length) {
this.$refs.refPopupMenu.open("top")
@@ -504,19 +502,48 @@
}
})
},
+ async clickToMap(index, page) {
+ try {
- clickToMap(index, page) {
- const _this = this
+ const _this = this
+ // const res = await getAllScene(page.ip) || []
+ // const list = res?.sceneList || []
+ // if (list.length === 0) {
+ // uni.navigateTo({
+ // url: `/pages/scene/index?ip=${page.ip}`,
+ // events: {
+ // // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+ // finish: function() {
+ // _this.clickToMap(index, page)
+ // },
+ // }
+ // })
+ // return
+ // }
+ // getApp().globalData.sceneList = list
+
+ uni.navigateTo({
+ url: `/pages/map/index?ip=${page.ip}`,
+ events: {
+ // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+ check_connect: function(flag) {
+ page.link_status = flag
+ console.log(flag)
+ _this.checkPageConnected(index)
+ },
+ }
+ })
+ } catch (ex) {
+ showError(ex)
+ }
+
+ },
+ clickToTask( page) {
+
uni.navigateTo({
- url: `/pages/map/index?ip=${page.ip}`,
- events: {
- // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
- check_connect: function(flag) {
- page.link_status = flag
- _this.checkPageConnected(index)
- },
- }
+ url: `/pages/task/log-list?ip=${page.ip}`
})
+
},
isValidIP(ip) {
// IPv4 鍦板潃姝e垯琛ㄨ揪寮�@@ -569,7 +596,7 @@
} else if (item.text == "鍒犻櫎") {
const page = this.pageList[this.currentPage]
- showModal(`纭畾瑕佸垹闄よ澶団�${ page.name}鈥濆悧`, "璀﹀憡").then((res) => {
+ showModal(`纭畾瑕佸垹闄よ澶団�${ page.name}鈥濆悧`, "璀﹀憡", true, "纭畾", "鍙栨秷").then((res) => {
if (res) {
const list = this.pageList
const curPage = this.currentPage
@@ -586,14 +613,13 @@
}
})
+ } else if (item.text == "澶囦唤") {
+ const page = this.pageList[this.currentPage]
+ uni.navigateTo({
+
+ url: `/pages/index/backup?ip=${page.ip}`
+ })
}
- },
- showError(ex) {
- let exStr = JSON.stringify(ex)
- if (exStr == "{}")
- exStr = ex
- let tip = typeof ex.msg == "string" ? ex.msg : exStr
- showModal(tip, "閿欒", false)
},
closeMenu() {
this.$refs.refPopupMenu.close()
@@ -767,10 +793,10 @@
.vehicle-img {
margin-top: 20rpx;
- margin-left: calc(50% - 280rpx);
+ margin-left: calc(50% - 325rpx);
display: block;
- width: 560rpx;
- height: 560rpx;
+ width: 650rpx;
+ height: 692rpx;
}
--
Gitblit v1.9.1