From 6087ba7d24f2353c2d01a5e5a384d5a20f97a19b Mon Sep 17 00:00:00 2001
From: qingyiay <2386314947@qq.com>
Date: 星期一, 15 五月 2023 08:10:53 +0800
Subject: [PATCH] 增加路线规划,样式修改

---
 pages/tabbar-page/index-tabbar/index-tabbar.vue |   32 ++++++++++++--------------------
 1 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/pages/tabbar-page/index-tabbar/index-tabbar.vue b/pages/tabbar-page/index-tabbar/index-tabbar.vue
index da810e4..b15ebb7 100644
--- a/pages/tabbar-page/index-tabbar/index-tabbar.vue
+++ b/pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -40,7 +40,10 @@
 		freightForwarderIndex
 	},
 	computed: {
-		...mapState(['globalweighHouseCode', 'globalweigh'])
+		...mapState(['globalweighHouseCode', 'globalweigh', 'globalisconnect'])
+	},
+	watch: {
+		globalisconnect(v, oldv) {}
 	},
 	//棣栭〉涓嬫媺鍒锋柊
 	onPullDownRefresh() {
@@ -111,18 +114,6 @@
 				console.log('寮�鍚弻浜洪�氳瘽鎴愬姛Complete');
 			}
 		});
-		let amap = require('../../../utils/amap-wx.130.js');
-		let amapPlugin = new amap.AMapWX({
-			key: 'e3106700a6225e6a25727d3a41fa54c5'
-		});
-		amapPlugin.getRegeo({
-			success: data => {
-				console.log(data, '鑾峰彇浣嶇疆');
-			},
-			fail: info => {
-				console.log(info, '閿欒淇℃伅');
-			}
-		});
 	},
 	data() {
 		return {
@@ -134,15 +125,12 @@
 			messagePushShow: false,
 			messageList: {},
 			isconnect: false,
-			dotShow: false,
-			amapPlugin: null,
-			key: 'e3106700a6225e6a25727d3a41fa54c5',
-			addressName: ''
+			dotShow: false
 		};
 	},
 	onShow() {
 		this.init();
-		if (!this.isconnect) {
+		if (!this.globalisconnect || !this.isconnect) {
 			this.initWebsocket();
 		}
 		this.userAuthorization();
@@ -150,7 +138,10 @@
 	},
 	onHide() {
 		console.log('椤甸潰闅愯棌');
-		if (!this.isconnect) {
+		// this.isconnect = false;
+		// this.changeisconnect(false);
+		// socket.close();
+		if (!this.globalisconnect || !this.isconnect) {
 			this.initWebsocket();
 		}
 	},
@@ -160,7 +151,7 @@
 		clearInterval(this.intervalId);
 	},
 	methods: {
-		...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus']),
+		...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus', 'changeisconnect']),
 		messagePage() {
 			uni.navigateTo({
 				url: '/pages/public-page/message/message'
@@ -239,6 +230,7 @@
 				complete: res => {
 					console.log(res, 'socket缁撴灉');
 					if (res.errMsg == 'connectSocket:ok') {
+						this.changeisconnect(true);
 						this.isconnect = true;
 					}
 				}

--
Gitblit v1.9.1