Browse Source

修改bug

wangxy 6 days ago
parent
commit
57b5e7dfb3
2 changed files with 23 additions and 2 deletions
  1. 13 2
      pages/client/hetong/HetongInfo.vue
  2. 10 0
      pages/kehu/hetong/HetongInfo.vue

+ 13 - 2
pages/client/hetong/HetongInfo.vue

@@ -33,7 +33,7 @@
 
 <script setup>
 	import {
-		ref,reactive,onMounted
+		ref,reactive,onMounted,onUnmounted
 	} from "vue";
 	import * as httpApi from "@/api/jzHetong.js"
 	import cacheManager from '@/utils/cacheManager.js'
@@ -43,7 +43,7 @@
 	} from "@dcloudio/uni-app"
 	import writeSign from "@/components/writeSign/index.vue"
 	import {
-		throttleAdvanced
+		throttleAdvanced, toast
 	} from "@/utils/common.js"
 	import {
 		base64ToPath
@@ -61,6 +61,7 @@
 			loadingIcon: '',
 	})
 	const fromPage = ref('')
+	const timer2 = ref(null);
 
 	onMounted(() => {
 			uni.getSystemInfo({
@@ -69,6 +70,12 @@
 			}
 			});
 		});
+		
+	onUnmounted(() => {
+		clearTimeout(timer2.value);
+		timer2.value = null;
+	})	
+		
 	onLoad((options) => {
 		tId.value = options.id;
 		fromPage.value = options.from;
@@ -87,6 +94,10 @@
 		}).then(res => {
 			info.value = res.data;
 			imgList.value = res.data.base64List;
+		}).catch(err => {
+			timer2.value = setTimeout(() => {
+				handleGoLishi()
+			},3000)
 		}).finally(() => {
 			isLoading.value = false;
 		})

+ 10 - 0
pages/kehu/hetong/HetongInfo.vue

@@ -61,6 +61,8 @@
 			loadingIcon: '',
 	})
 	const fromPage = ref('')
+	const timer2 = ref(null);
+	
 	onMounted(() => {
 				uni.getSystemInfo({
 				success: (res) => {
@@ -68,6 +70,10 @@
 				}
 				});
 			});
+	onUnmounted(() => {
+		clearTimeout(timer2.value);
+		timer2.value = null;
+	})	
 	onLoad((options) => {
 		tId.value = options.id;
 		fromPage.value = options.from
@@ -86,6 +92,10 @@
 		}).then(res => {
 			info.value = res.data;
 			imgList.value = res.data.base64List;
+		}).catch(err => {
+			timer2.value = setTimeout(() => {
+				handleGoLishi()
+			},3000)
 		}).finally(() => {
 			isLoading.value = false;
 		})