张文飞 3 years ago
parent
commit
75887ddb39
3 changed files with 15 additions and 8 deletions
  1. 1 1
      manifest.json
  2. 12 5
      pages/homePage/homePage.vue
  3. 2 2
      pages/houseDetail/houseDetail.vue

+ 1 - 1
manifest.json

@@ -129,7 +129,7 @@
             "enable" : true
         },
         "router" : {
-            "base" : "/Union/",
+            "base" : "./",
             "mode" : "history"
         }
     },

+ 12 - 5
pages/homePage/homePage.vue

@@ -226,6 +226,13 @@
 			uni.$on("request",()=>{
 				this.getData();
 			})
+			let projectId = this.getQueryString('projectId');
+			if(projectId){
+				let e = {
+					projectId
+				}
+				this.goDetailAction(e)
+			}
 		},
 		onReachBottom() {
 			if(this.houseList.length<this.total){
@@ -235,6 +242,10 @@
 			
 		},
 		methods: {
+			getQueryString(name){
+				var reg = new RegExp("(^|\\?|&)"+ name +"=([^&]*)(\\s|&|$)", "i");
+				return reg.test(location.href) ? unescape(RegExp.$2.replace(/\+/g, " ")) : ""
+			},
 			clearToken(){
 				this.$cache.delete('_token_owner_union')
 			},
@@ -338,12 +349,8 @@
 				if (href.indexOf("?")){
 					href = href.split('?')[0]
 				}
-				let projectPath = href;
-				if(type==2){
-					projectPath = href + "pages/houseDetail/houseDetail"
-				}
 				uni.navigateTo({
-					url:'../shareCardPage/shareCardPage?page='+projectPath+"&projectId="+projectId+"&type="+type
+					url:'../shareCardPage/shareCardPage?page='+href+"&projectId="+projectId+"&type="+type
 				})
 			},
 			toLogin(){

+ 2 - 2
pages/houseDetail/houseDetail.vue

@@ -204,8 +204,8 @@
 			},
 			
 			backAction() {
-				uni.navigateBack({
-					delta: 1
+				uni.reLaunch({
+					url:'../homePage/homePage'
 				})
 			}