张文飞 3 éve
szülő
commit
972afd48d5

+ 3 - 0
components/subComponents/dmLogin.vue

@@ -186,6 +186,9 @@
 		mounted() {
 			uni.$on('login',()=>{
 				this.show();
+			});
+			uni.$on('request',()=>{
+				this.hide();
 			})
 		},
 		

+ 3 - 0
components/subComponents/dmLoginNotice.vue

@@ -37,6 +37,9 @@
 			uni.$on('unLogin',()=>{
 				this.show();
 			})
+			uni.$on('request',()=>{
+				this.hide();
+			})
 		},
 		components:{
 			dmDialog

+ 21 - 4
pages/homePage/homePage.vue

@@ -166,13 +166,13 @@
 					</view>
 					任务列表
 				</view>
-				<view class="content_hongbao">
+				<view class="content_hongbao" v-if="registAmount">
 					<view class="hongbao_left">
 						<image class="icon_hongbao" src="https://dm.static.elab-plus.com/yezhu/icon_hongbao.png"
 							mode=""></image>
 						<view class="hongbao_left_info">
 							<text class="hongbao_title">邀请好友注册</text>
-							<text class="hongbao_money">完成邀请,可获得 ¥1/人</text>
+							<text class="hongbao_money">完成邀请,可获得 ¥{{registAmount}}/人</text>
 						</view>
 					</view>
 					<view class="hongbao_right" @click="toShareCard('',1)">
@@ -261,7 +261,8 @@
 				city:"城市",
 				type:"",
 				typeName:"类型",
-				optionType:1
+				optionType:1,
+				registAmount:null,
 			}
 		},
 		mounted() {
@@ -302,6 +303,7 @@
 				this.pageNo = 1;
 				this.getUserInfo();
 				this.getHomePage();
+				this.getRegistTask();  
 			},
 			chooiceType(e){
 				this.city = e.city==''?"城市":(e.city).split('市')[0];
@@ -310,6 +312,21 @@
 				this.pageNo = 1;
 				this.getHomePage();
 			},
+			async getRegistTask(){
+				if(app.globalData.userId){
+					let res = await this.$myRequest({
+						url: "/task/registTask",
+						data: {
+							"userId":app.globalData.userId,
+						}
+					})
+					if(res.data.success){
+						this.registAmount = res.data.single.amount||null
+					}else{
+						this.registAmount = null;
+					}
+				}
+			},
 			async getHomePage() {
 				let ret = await this.$myRequest({
 					url: "/project/homePage",
@@ -318,7 +335,7 @@
 						"pageNo": this.pageNo,
 						"pageSize": this.pageSize,
 						"taskCategoryId": this.type,
-						"userId":this.userInfo.userId,
+						"userId":app.globalData.userId,
 					}
 				})
 				if (ret.data.success) {

+ 21 - 3
pages/houseDetail/houseDetail.vue

@@ -34,11 +34,11 @@
 				</view>
 			</view>
 		</view>
-		<view class="sectionD" >
+		<view class="sectionD" v-if="registAmount">
 			<image class="icon" src="https://dm.static.elab-plus.com/yezhu/icon_hongbao.png" mode="aspectFit"></image>
 			<view class="midSection">
 				<view class="name">邀请好友注册</view>
-				<view class="value">完成邀请,可获得¥{{dataInfo.registAmount}}/人</view>
+				<view class="value">完成邀请,可获得¥{{registAmount}}/人</view>
 			</view>
 			<view class="invitationBtn" @click="toShareCard(1)">邀请好友</view>
 		</view>
@@ -119,7 +119,8 @@
 					"xcxPage": ""
 				},
 				
-				categoryList: []
+				categoryList: [],
+				registAmount:null,
 			}
 		},
 		onLoad(param) {
@@ -146,6 +147,7 @@
 						userId:getApp().globalData.userId
 					}
 					this.createUserProjectRlat();
+					this.getRegistTask();
 					let res = await this.$myRequest({
 						url: '/project/queryProjectByH5',
 						data: parmas
@@ -159,6 +161,22 @@
 				}
 			},
 			
+			async getRegistTask(){
+				if(app.globalData.userId){
+					let res = await this.$myRequest({
+						url: "/task/registTask",
+						data: {
+							userId:getApp().globalData.userId
+						}
+					})
+					if(res.data.success){
+						this.registAmount = res.data.single.amount||null
+					}else{
+						this.registAmount = null;
+					}
+				}
+			},
+			
 			async createUserProjectRlat() {
 				if(getApp().globalData.userId){
 					var parmas = {