From 964faa1077a89713910063c39ebe08fac4e4c56e Mon Sep 17 00:00:00 2001
From: Houjie <714924425@qq.com>
Date: 星期四, 24 七月 2025 17:44:18 +0800
Subject: [PATCH] 企业维修适配修改

---
 pages/spare/spare.vue |   34 +++-------------------------------
 1 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/pages/spare/spare.vue b/pages/spare/spare.vue
index fb3ea79..6b2ca81 100644
--- a/pages/spare/spare.vue
+++ b/pages/spare/spare.vue
@@ -25,40 +25,12 @@
 				hasNavigated: false // 鏍囪鏄惁宸茬粡璺宠浆
 			};
 		},
-		// mounted() {
-		// 	window.addEventListener('hashchange', this.handleHashChange);
-		// 	// 鍒濆瑙f瀽 hash
-		// 	this.handleHashChange();
-		// },
-		// beforeDestroy() {
-		// 	window.removeEventListener('hashchange', this.handleHashChange);
-		// },
+
 
 		methods: {
-			// handleHashChange() {
-			// 	if (this.hasNavigated) {
-			// 		console.log('Already navigated, skipping hash change handling');
-			// 		return;
-			// 	}
-
-			// 	const hash = window.location.hash;
-			// 	console.log('Hash changed:', hash); // 娣诲姞鏃ュ織
-			// 	if (!hash || hash.length === 0) {
-			// 		console.warn('Hash is empty or undefined');
-			// 		return;
-			// 	}
-			// 	const params = new URLSearchParams(hash.split('?')[1]);
-			// 	const equipmentId = params.get('equipmentId');
-			// 	console.log('Parsed equipmentId:', equipmentId); // 娣诲姞鏃ュ織
-			// 	if (equipmentId) {
-			// 		this.navigateToDeviceDetails(equipmentId);
-			// 	} else {
-			// 		console.warn('No equipmentId found in hash');
-			// 	}
-			// },
 			navigateToDeviceDetails(equipmentId) {
 				this.hasNavigated = true; // 鏍囪宸茬粡璺宠浆
-				uni.navigateTo({
+				uni.redirectTo({
 					url: `/pages/device/deviceWebDeils/deviceWebDeils?equipmentId=${encodeURIComponent(equipmentId)}`,
 					success: () => {
 						console.log('Navigated to device details');
@@ -159,4 +131,4 @@
 		left: 50%;
 		transform: translate(-50%, -50%);
 	}
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.9.3