张文飞 3 năm trước cách đây
mục cha
commit
fa5d9f92bc
2 tập tin đã thay đổi với 66 bổ sung44 xóa
  1. 65 43
      pages/homePage/homePage.vue
  2. 1 1
      util/api.js

+ 65 - 43
pages/homePage/homePage.vue

@@ -180,6 +180,7 @@
 
 		</view>
 		<login></login>
+		<login-notice></login-notice>
 		<dmMine ref='mine' :userInfo='userInfo'></dmMine>
 	</view>
 </template>
@@ -213,7 +214,7 @@
 					"room":"",
 					"sex":""
 				},
-				showGuide:false,
+				showGuide:true,
 				total:0,
 				pageNo:1,
 				pageSize:10,
@@ -285,54 +286,71 @@
 				});
 				if (ret.data.success) {
 					this.userInfo = ret.data.single || null;
+					this.showGuide = this.userInfo.userId?this.userInfo.ownersUnion?false:true:true;
 				}
 			},
 			// 调准项目详情
-			goDetailAction(e) {
-				uni.navigateTo({
-					url: '../houseDetail/houseDetail?projectId='+e.projectId
-				})
+			goDetailAction(e) {
+				if(this.userInfo.userId){
+					uni.navigateTo({
+						url: '../houseDetail/houseDetail?projectId='+e.projectId
+					})
+				}else{
+					uni.$emit('unLogin')
+				}
 			},
 			// 跳转至效果报表
 			goReportPage() {
-				uni.navigateTo({
-					url: '../reportPage/reportPage'
-				})
+				if(this.userInfo.userId){
+					uni.navigateTo({
+						url: '../reportPage/reportPage'
+					})
+				}else{
+					uni.$emit('unLogin')
+				}
 			},
 			toShouYiPage() {
-				uni.navigateTo({
-					url: '../revenueRankingPage/revenueRankingPage'
-				})
+				if(this.userInfo.userId){
+					uni.navigateTo({
+						url: '../revenueRankingPage/revenueRankingPage'
+					})
+				}else{
+					uni.$emit('unLogin')
+				}
+				
 			},
 			async toYezhu(){
-				let ret = await this.$myRequest({
-					url: "/user/regist/get",
-					data: {
-						"userId": app.globalData.userId,
-					},
-					method:"GET"
-				})
-				if (ret.data.success) {
-				   let single = ret.data.single||null;//:0待审核1通过2拒绝
-				   if(single){
-					   if(single.approvalStatus==0||single.approvalStatus==1){
-							uni.navigateTo({
-								url: '../certificationResultPage/certificationResultPage'
-							})
+				if(this.userInfo.userId){
+					let ret = await this.$myRequest({
+						url: "/user/regist/get",
+						data: {
+							"userId": app.globalData.userId,
+						},
+						method:"GET"
+					})
+					if (ret.data.success) {
+					   let single = ret.data.single||null;//:0待审核1通过2拒绝
+					   if(single){
+						   if(single.approvalStatus==0||single.approvalStatus==1){
+								uni.navigateTo({
+									url: '../certificationResultPage/certificationResultPage'
+								})
+						   }
+					   }else{
+						   uni.navigateTo({
+						   	url: '../ownerCertification/ownerCertification'
+						   })
 					   }
-				   }else{
-					   uni.navigateTo({
-					   	url: '../ownerCertification/ownerCertification'
-					   })
-				   }
-					
+						
+					}else{
+						uni.showToast({
+							icon:"none",
+							title:ret.data.message
+						})
+					}
 				}else{
-					uni.showToast({
-						icon:"none",
-						title:ret.data.message
-					})
+					uni.$emit('unLogin')
 				}
-				
 			},
 			setEnv(){
 				if (this.clickCount < 0) {
@@ -345,13 +363,17 @@
 				}
 			},
 			toShareCard(projectId,type){
-				let href = location.href;
-				if (href.indexOf("?")){
-					href = href.split('?')[0]
+				if(this.userInfo.userId){
+					let href = location.href;
+					if (href.indexOf("?")){
+						href = href.split('?')[0]
+					}
+					uni.navigateTo({
+						url:'../shareCardPage/shareCardPage?page='+href+"&projectId="+projectId+"&type="+type
+					})
+				}else{
+					uni.$emit('unLogin')
 				}
-				uni.navigateTo({
-					url:'../shareCardPage/shareCardPage?page='+href+"&projectId="+projectId+"&type="+type
-				})
 			},
 			toLogin(){
 				uni.$emit('login')
@@ -363,7 +385,7 @@
 				if(this.userInfo.userId){
 					this.$refs.mine.show()
 				}else{
-					uni.$emit('login')
+					uni.$emit('unLogin')
 				}
 				
 			}

+ 1 - 1
util/api.js

@@ -34,7 +34,7 @@ export const myRequest = (options) => {
 				uni.hideLoading()
 				uni.hideNavigationBarLoading();
 				uni.stopPullDownRefresh();
-				if(res.data.errorCode=='401'){
+				if(res.data.errorCode=='401'||res.data.message.indexOf('登录')>-1){
 					uni.$emit('unLogin')
 				}
 				resolve(res)