Jelajahi Sumber

解决获取地址参数问题

gcz 4 tahun lalu
induk
melakukan
e24541fc45

+ 2 - 5
pages/getcarno/getcarno.vue

@@ -17,7 +17,6 @@
 </template>
 
 <script>
-	import getUrlParams from "../../utils/getUrlParams.js";
 	export default{
 		data(){
 			return{
@@ -27,10 +26,8 @@
 				vehicleClor:''
 			}
 		},
-		onLoad(){
-			let locationLocaturl = window.location.hash;
-			// console.log('locationLocaturl',locationLocaturl)
-			this.spaceId = getUrlParams(locationLocaturl,"spaceId");
+		onLoad(page){
+			this.spaceId = page.spaceId;
 			
 		},
 		methods:{

+ 1 - 1
pages/getout/getout.vue

@@ -41,7 +41,7 @@
 				
 			}
 		},
-		onLoad() {
+		onShow() {
 			let that = this;
 			this.roadNo = this.$store.state.vuex_user?.roadList?.[0].roadNo || '';
 			this.handleGetRoadspace(this.roadNo);

+ 9 - 9
pages/getout/getoutpage/getoutpage.vue

@@ -47,7 +47,6 @@
 </template>
 
 <script>
-	import getUrlParams from "../../../utils/getUrlParams.js";
 	export default {
 		data() {
 			return {
@@ -62,17 +61,18 @@
 				
 			}
 		},
-		onShow() {
-			let locationLocaturl = window.location.hash;
-			this.orderID = getUrlParams(locationLocaturl,"orderID");
-			this.orderInTime = getUrlParams(locationLocaturl,"orderInTime");
-			this.orderOutTime = getUrlParams(locationLocaturl,"orderOutTime");
-			this.orderSpaceName = getUrlParams(locationLocaturl,"orderSpaceName");
-			this.orderVehicleNo = getUrlParams(locationLocaturl,"orderVehicleNo");
-			
+		onLoad(page) {
+			this.orderID = page.orderID;
+			this.orderInTime = page.orderInTime;
+			this.orderOutTime = page.orderOutTime;
+			this.orderSpaceName = page.orderSpaceName;
+			this.orderVehicleNo = page.orderVehicleNo;
 			this.handleEntranceOutDetail();
 			
 		},
+		onShow() {
+			this.handleEntranceOutDetail();
+		},
 		methods:{
 			openPage(path) {
 				console.log('path',path);