wangxy 2 månader sedan
förälder
incheckning
9b45d11702

+ 17 - 9
pages/client/Chengji/ksScoreShijuan.vue

@@ -268,15 +268,23 @@
 	
 	
 	function handleBack() {
-		if (data.from == 'chengjiList') {
-			uni.redirectTo({
-				url: "/pages/client/Chengji/list"
-			})
-		} else if (data.from == 'kaoshi'){
-			uni.redirectTo({
-				url: "/pages/client/Kaoshi/list"
-			})
-		} 
+		
+		const pages = getCurrentPages();
+		if (pages.length>1) {
+			uni.navigateBack()
+		} else {
+			if (data.from == 'chengjiList') {
+				uni.redirectTo({
+					url: "/pages/client/Chengji/list"
+				})
+			} else if (data.from == 'kaoshi'){
+				uni.redirectTo({
+					url: "/pages/client/Kaoshi/list"
+				})
+			} 
+		}
+		
+
 	}
 	
 	

+ 4 - 4
pages/client/Chengji/list.vue

@@ -71,19 +71,19 @@
 
 	function goUpPage() {
 		if (data.from == 'my') {
-			uni.redirectTo({
+			uni.navigateTo({
 				url: '/pages/client/my/index'
 			})
 		} else if (data.from == 'kaoshi') {
-			uni.redirectTo({
+			uni.navigateTo({
 				url: '/pages/client/Kaoshi/list'
 			})
 		} else if (data.from == 'shouye'){
-			uni.redirectTo({
+			uni.navigateTo({
 				url: '/pages/client/ShouYe/shouye'
 			})
 		} else {
-			uni.redirectTo({
+			uni.navigateTo({
 				url: '/pages/client/ShouYe/shouye'
 			})
 		}

+ 9 - 3
pages/client/Chengji/lxScoreShijuan.vue

@@ -288,9 +288,15 @@
 
 
 	function handleBack() {
-		uni.redirectTo({
-			url: "/pages/client/Lianxi/list"
-		})
+		const pages = getCurrentPages();
+		if (pages.length>1) {
+			uni.navigateBack()
+		} else {
+			uni.redirectTo({
+				url: "/pages/client/Lianxi/list"
+			})
+		}
+		
 	}
 
 

+ 22 - 16
pages/client/Kaoshi/exam.vue

@@ -225,9 +225,7 @@
 	
 	
 	function handleScoreClose() {
-		uni.redirectTo({
-			url: '/pages/client/Kaoshi/list'
-		})
+		handleBack()
 	}
 	
 	// 考试得分相关 start
@@ -478,19 +476,27 @@
 	}
 
 	function handleBack() {
-		if (data.from == 'shouye') {
-			uni.redirectTo({
-				url: "/pages/client/ShouYe/shouye"
-			})
-		} else if (data.from == 'kaoshiList') {
-			uni.redirectTo({
-				url: "/pages/client/Kaoshi/list"
-			})
-		} else {
-			uni.redirectTo({
-				url: "/pages/client/ShouYe/shouye"
-			})
-		}
+		
+		 const pages = getCurrentPages();
+		 if (pages.length>1) {
+			 uni.navigateBack()
+		 } else {
+			 if (data.from == 'shouye') {
+			 	uni.redirectTo({
+			 		url: "/pages/client/ShouYe/shouye"
+			 	})
+			 } else if (data.from == 'kaoshiList') {
+			 	uni.redirectTo({
+			 		url: "/pages/client/Kaoshi/list"
+			 	})
+			 } else {
+			 	uni.redirectTo({
+			 		url: "/pages/client/ShouYe/shouye"
+			 	})
+			 }
+		 }
+		
+		
 	}
 
 	function showAnswerCard() {

+ 8 - 2
pages/client/Kaoshi/list.vue

@@ -54,7 +54,7 @@
 		reactive
 	} from "vue";
 	import {
-		onLoad
+		onLoad, onShow
 	} from "@dcloudio/uni-app";
 	import * as kaoshiApi from "@/api/kaoshi.js";
 	
@@ -86,7 +86,7 @@
 	}
 	// 修改身份
 	function handleChangeIdentification() {
-		uni.redirectTo({
+		uni.navigateTo({
 			url:'/pages/client/my/info?from=kaoshiList'
 		})
 	}
@@ -124,6 +124,9 @@
 	}
 
 	function checkKaoshi(item) {
+		// #ifdef H5
+		history.replaceState({ ...history.state, newKey: 'newValue' }, '', window.location.href);
+		// #endif
 		uni.navigateTo({
 			url: `/pages/client/Kaoshi/exam?ksId=${item.ksId}&zhuapai=${activeks.value.zhuapai}&from=kaoshiList`
 		})
@@ -195,6 +198,9 @@
 
 	onLoad((options) => {
 		data.from = options.from
+	})
+	
+	onShow(() => {
 		getMore()
 	})
 </script>

+ 6 - 3
pages/client/Kecheng/list.vue

@@ -42,7 +42,7 @@
 		reactive
 	} from "vue";
 	import {
-		onLoad
+		onLoad, onShow
 	} from "@dcloudio/uni-app";
 	import * as kechengApi from "@/api/kecheng.js"
 	import {formatSecondsToCnhms} from "@/utils/common.js"
@@ -74,7 +74,7 @@
 	}
 
 	function checkKecheng(item) {
-		uni.redirectTo({
+		uni.navigateTo({
 			url: `/pages/client/Kecheng/study?kcId=${item.kcId}&from=kechengList`
 		})
 	}
@@ -144,8 +144,11 @@
 
 	onLoad((options) => {
 		data.from = options.from;
-		getMore()
 	})
+	
+	onShow(() => {
+		getMore()
+	}) 
 </script>
 
 <style lang="scss" scoped>

+ 16 - 11
pages/client/Kecheng/study.vue

@@ -133,18 +133,23 @@
 				console.log('end')
 			},
 			goUpPage() {
-				if (this.from == 'kechengList') {
-					uni.redirectTo({
-						url: '/pages/client/Kecheng/list'
-					})
-				} else if (this.from == 'shouye') {
-					uni.redirectTo({
-						url: '/pages/client/ShouYe/shouye'
-					})
+				const pages = getCurrentPages();
+				if (pages.length>1) {
+					uni.navigateBack()
 				} else {
-					uni.redirectTo({
-						url: '/pages/client/ShouYe/shouye'
-					})
+					if (this.from == 'kechengList') {
+						uni.redirectTo({
+							url: '/pages/client/Kecheng/list'
+						})
+					} else if (this.from == 'shouye') {
+						uni.redirectTo({
+							url: '/pages/client/ShouYe/shouye'
+						})
+					} else {
+						uni.redirectTo({
+							url: '/pages/client/ShouYe/shouye'
+						})
+					}
 				}
 				
 			},

+ 20 - 17
pages/client/Lianxi/exam.vue

@@ -197,21 +197,8 @@
 	
 	
 	function handleScoreClose() {
-		if (data.from == 'shouye') {
-			uni.redirectTo({
-				url: '/pages/client/ShouYe/shouye'
-			})
-		} else if (data.from == 'lianxiList') {
-			uni.redirectTo({
-				url: '/pages/client/Lianxi/list'
-			})
-		} else {
-			uni.redirectTo({
-				url: "/pages/client/ShouYe/shouye"
-			})
-		}
 		
-	
+		handleBack()
 	}
 	
 	// 考试得分相关 start
@@ -364,9 +351,25 @@
 	}
 
 	function handleBack() {
-		uni.redirectTo({
-			url: "/pages/client/Lianxi/list"
-		})
+		const pages = getCurrentPages();
+		if (pages.length>1) {
+			uni.navigateBack()
+		} else {
+			if (data.from == 'shouye') {
+				uni.redirectTo({
+					url: '/pages/client/ShouYe/shouye'
+				})
+			} else if (data.from == 'lianxiList') {
+				uni.redirectTo({
+					url: '/pages/client/Lianxi/list'
+				})
+			} else {
+				uni.redirectTo({
+					url: "/pages/client/ShouYe/shouye"
+				})
+			}
+		}
+		
 	}
 
 	function showAnswerCard() {

+ 5 - 2
pages/client/Lianxi/list.vue

@@ -56,7 +56,7 @@
 		reactive
 	} from "vue";
 	import {
-		onLoad
+		onLoad, onShow
 	} from "@dcloudio/uni-app";
 	
 	const lxxzRef = ref(null);
@@ -96,7 +96,7 @@
 	}
 	
 	function checkKaoshi(item) {
-		uni.redirectTo({
+		uni.navigateTo({
 			url: `/pages/client/Lianxi/exam?lxId=${item.lxId}&from=lianxiList`
 		})
 	}
@@ -167,6 +167,9 @@
 	
 	onLoad((options) => {
 		data.from = options.from;
+	})
+	
+	onShow(() => {
 		getMore()
 	})
 	

+ 4 - 1
pages/client/ShouYe/shouye.vue

@@ -22,7 +22,7 @@
 
 	import * as httpApi from "@/api/shouye.js"
 	import {
-		onLoad
+		onLoad, onShow
 	} from "@dcloudio/uni-app"
 	import {
 		reactive
@@ -63,6 +63,9 @@
 	onLoad(() => {
 		const auth = cacheManager.get('auth');
 		data.realName = auth.realName;
+	})
+	
+	onShow(() => {
 		initPage();
 	})
 </script>

+ 2 - 2
pages/client/my/index.vue

@@ -137,11 +137,11 @@
 		})
 	}
 	onLoad(() => {
-    getMyInit()
+    
 	})
 
   onShow(() => {
-
+	getMyInit()
   })
 </script>
 

+ 16 - 11
pages/client/my/myInfo.vue

@@ -171,18 +171,23 @@
 	}
 
 	function handleBack() {
-		if (data.from == 'my') {
-			uni.navigateTo({
-				url: '/pages/client/my/index'
-			})
-		} else if (data.from == 'kaoshi') {
-			uni.navigateTo({
-				url: '/pages/client/ShouYe/shouye'
-			})
+		const pages = getCurrentPages();
+		if (pages.length>1) {
+			uni.navigateBack()
 		} else {
-			uni.navigateTo({
-				url: '/pages/client/my/index'
-			})
+			if (data.from == 'my') {
+				uni.redirectTo({
+					url: '/pages/client/my/index'
+				})
+			} else if (data.from == 'kaoshi') {
+				uni.redirectTo({
+					url: '/pages/client/ShouYe/shouye'
+				})
+			} else {
+				uni.redirectTo({
+					url: '/pages/client/my/index'
+				})
+			}
 		}
 	}