Przeglądaj źródła

Merge branch 'feature_业主工会' of http://192.168.4.246:3000/elab-damai-h5/h5-elab-open-ownerUnion into feature_业主工会

王晓晨 3 lat temu
rodzic
commit
24b0334429

+ 9 - 10
App.vue

@@ -5,8 +5,9 @@
 			let href = location.href;
 			let code  = this.getQueryString('code');
 			if(!code){
-				href = encodeURIComponent(href.split('#')[0].substring(0,href.split('#')[0].length-1));
-				let url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+config.appid+"&redirect_uri="+href+"&response_type=code&scope=snsapi_base&state=123&connect_redirect=1#wechat_redirect"
+				let url =  href.split('#')[0];
+				url = encodeURIComponent(url);
+				url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+config.appid+"&redirect_uri="+url+"&response_type=code&scope=snsapi_base&state=123&connect_redirect=1#wechat_redirect"
 				window.location.href = url;
 			}
 			let BASE_URL = "";
@@ -53,10 +54,8 @@
 		onShow: function() {
 			let token = this.$cache.get('_token_owner_union');
 			let userId =  this.$cache.get('_user_id');
-			uni.showModal({
-				content:"调注册"
-			})
-			if (!token) {
+			if (!token||!userId) {
+				this.globalData.userId = userId;
 				this.regist();
 			} else {
 				this.globalData.token = token;
@@ -77,11 +76,14 @@
 			},
 			async regist() {
 				let code  = this.getQueryString('code');
+				let shareToken  = this.getQueryString('shareToken');
+				let projectId  = this.getQueryString('projectId');
 				let ret = await this.$myRequest({
 					url: "/regist",
 					data: {
 						"code": code,
-						"shareToken": ""
+						"shareToken":shareToken||"",
+						"projectId":projectId||"",
 					}
 				});
 				if (ret.data.success) {
@@ -93,9 +95,6 @@
 						this.$cache.set('_token_owner_union', token);
 						this.globalData.token = token
 					}
-					uni.$emit('request')
-				}else{
-					uni.$emit('request')
 				}
 			},
 		},

+ 2 - 2
components/leve-view/leve-view.vue

@@ -2,7 +2,7 @@
 	<view class="level">
 		<view class="leve_left">
 			<view class="level_left_txt">
-				{{currentLevelTxt}}
+				{{currentLevelTxt?'Lv'+currentLevelTxt:''}}
 			</view>
 			<view class="level_progress">
 				<view class="leve_progress_" :style="{width:currentLevel/nextLevel*300+'rpx'}">
@@ -13,7 +13,7 @@
 				</view>
 			</view>
 			<view class="level_right_txt">
-				{{nextLevelTxt}}
+				{{nextLevelTxt?'Lv'+nextLevelTxt:''}}
 			</view>
 		</view>
 		<view class="level_right">

+ 4 - 4
components/subComponents/dmLogin.vue

@@ -40,7 +40,6 @@
 </template>
 
 <script>
-	let app = getApp();
 	import dmDialog from "./dmDialog.vue"
 	export default{
 		
@@ -158,11 +157,12 @@
 						icon:"none",
 						title:"登录成功"
 					});
-					this.token = ret.data.single;
-					this.$cache.set('_token_owner_union', this.token);
-					app.globalData.token = this.token;
+					let token = ret.data.single;
+					getApp().globalData.token = token;
 					uni.$emit('request');
 					this.knowAction();
+					this.$cache.set('_token_owner_union', token);
+					
 				}else{
 					uni.showToast({
 						icon:"none",

+ 3 - 1
components/subComponents/dmWithDrawal.vue

@@ -102,7 +102,9 @@
 					uni.showToast({
 						icon:"none",
 						title:"提现成功"
-					})
+					});
+					this.$emit("updata")
+					this.knowAction()
 				}else{
 					uni.showToast({
 						icon:"none",

+ 90 - 33
pages/homePage/homePage.vue

@@ -8,7 +8,7 @@
 				<view class="subTitle" @click="setEnv">新手赚钱帮助 ></view>
 				<view class="levelDiv"
 					style="background: url('https://dm.static.elab-plus.com/yezhu/h5/icon_line_back.png') center/100% 100% no-repeat;">
-					<view class="level_top" v-if="token">
+					<view class="level_top" v-if="userInfo.userId">
 						<image class="level_icon" src="https://dm.static.elab-plus.com/yezhu/h5/icon_Level.png" mode="">
 						</image>
 						<view class="level_text">{{userInfo.curlevel}}</view>
@@ -30,7 +30,7 @@
 								src="https://dm.static.elab-plus.com/yezhu/h5/icon_right.png" mode=""></image>
 						</view>
 					</view>
-					<view class="level_bottom" v-if="token">
+					<view class="level_bottom" v-if="userInfo.userId">
 						<levelView :currentLevel='userInfo.curIncome' :nextLevel='userInfo.nextIncome' :currentLevelTxt='userInfo.curlevel' :nextLevelTxt='userInfo.nextLevel'>
 						</levelView>
 					</view>
@@ -55,7 +55,7 @@
 					<view class="item_guide">
 						<image class="guide_img" src="https://dm.static.elab-plus.com/yezhu/icon_yezhu.png" mode="">
 						</image>
-						<text class="guide_title">注册业主</text>
+						<text class="guide_title" @click="clearToken">注册业主</text>
 						<text class="guide_desc">业主注册审核\n实时等级升级</text>
 					</view>
 					<image class="icon_guide" src="https://dm.static.elab-plus.com/yezhu/icon_to_guide.png" mode="">
@@ -84,19 +84,19 @@
 			</view>
 			<view class="content_tab">
 				<view class="tab_item" @click="toYezhu">
-					<image class="icon_tab" src="https://dm.static.elab-plus.com/yezhu/icon_zcyz.png" mode=""></image>
+					<image class="icon_tab"  src="../../static/icons/icon_zcyz_user.png" mode=""></image>
 					<text class="txt_tab">注册业主</text>
 				</view>
 				<view class="tab_item" @click="toShouYiPage">
-					<image class="icon_tab" src="https://dm.static.elab-plus.com/yezhu/icon_shouyi.png" mode=""></image>
+					<image class="icon_tab" src="../../static/icons/icon_shouyi_user.png" mode=""></image>
 					<text class="txt_tab">收益排行榜</text>
 				</view>
 				<view class="tab_item" @click="goReportPage">
-					<image class="icon_tab" src="https://dm.static.elab-plus.com/yezhu/icon_report.png" mode=""></image>
+					<image class="icon_tab" src="../../static/icons/icon_report_user.png" mode=""></image>
 					<text class="txt_tab">效果报表</text>
 				</view>
 				<view class="tab_item" @click="showMine">
-					<image class="icon_tab" src="https://dm.static.elab-plus.com/yezhu/icon_myinfo.png" mode=""></image>
+					<image class="icon_tab" src="../../static/icons/icon_user_mine.png" mode=""></image>
 					<text class="txt_tab">我的信息</text>
 				</view>
 			</view>
@@ -144,7 +144,7 @@
 				</view>
 
 				<view class="list_item" v-for="(item,index) in  houseList" :key='index'>
-					<image class="house_img" :src="item.image" mode=""></image>
+					<image class="house_img" :src="item.image" mode="aspectFill"></image>
 					<view class="item_content" @click="goDetailAction(item)">
 						<text class="house_name">{{item.name}}</text>
 						<view class="house_hk" v-if="item.taskCategory">
@@ -153,11 +153,11 @@
 						<text class="house_hk" v-else></text>
 						<view class="house_address">
 							<image src="https://dm.static.elab-plus.com/yezhu/icon_location.png" mode=""></image>
-							<text>{{item.city}} · {{item.minPrice}}-{{item.maxPrice}}万/m² · {{item.bizFormat}}</text>
+							<text style="width: 100%;">{{item.city}} · {{item.minPrice}}-{{item.maxPrice}}万/m²  {{item.bizFormat?'· '+item.bizFormat:''}}</text>
 						</view>
 						<view class="house_num">
 							<image src="https://dm.static.elab-plus.com/yezhu/icon_family.png" mode=""></image>
-							<text>{{item.projectLayout}}</text>
+							<text style="width: 100%;">{{item.projectLayout}}</text>
 						</view>
 						<text class="house_desc">{{item.shareRemark}}</text>
 					</view>
@@ -168,11 +168,17 @@
 					</view>
 					<view class="item_bg"></view>
 				</view>
+				
+				<view class="com_noMore_text" v-if="noMore && houseList.length > 0">没有更多了</view>
+				
+				<view class="empty" v-if="houseList.length == 0">
+					<image class="emptyImg" src="https://dm.static.elab-plus.com/yezhu/h5/icon_empty.png" mode=""></image>
+					<view class="text">暂无数据</view>
+				</view>
 			</view>
 
 
 		</view>
-		<login-notice></login-notice>
 		<login></login>
 		<dmMine ref='mine' :userInfo='userInfo'></dmMine>
 	</view>
@@ -210,19 +216,23 @@
 				showGuide:false,
 				total:0,
 				pageNo:1,
-				pageSize:10
+				pageSize:10,
+				noMore:false
 			}
 		},
 		mounted() {
 			this.color4 = app.globalData.color4;
-			let token = this.$cache.get('_token_owner_union');
-			this.token = token;
 			this.getData();
 			uni.$on("request",()=>{
-				let token2 = this.$cache.get('_token_owner_union');
-				this.token = token2;
 				this.getData();
 			})
+			let projectId = this.getQueryString('projectId');
+			if(projectId){
+				let e = {
+					projectId
+				}
+				this.goDetailAction(e)
+			}
 		},
 		onReachBottom() {
 			if(this.houseList.length<this.total){
@@ -232,6 +242,13 @@
 			
 		},
 		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')
+			},
 			getData(){
 				this.pageNo = 1;
 				this.getUserInfo();
@@ -254,7 +271,8 @@
 						this.houseList = [];
 					}
 					this.houseList = this.houseList.concat(houseList);
-					this.total = pageModel.total||0
+					this.total = pageModel.total||0;
+					this.noMore = this.houseList.length==this.total
 				}
 			},
 			async getUserInfo() {
@@ -296,15 +314,23 @@
 				})
 				if (ret.data.success) {
 				   let single = ret.data.single||null;//:0待审核1通过2拒绝
-					if(single.approvalStatus==0||single.approvalStatus==1){
-						uni.navigateTo({
-							url: '../certificationResultPage/certificationResultPage'
-						})
-					}else{
-						uni.navigateTo({
-							url: '../ownerCertification/ownerCertification'
-						})
-					}
+				   if(single){
+					   if(single.approvalStatus==0||single.approvalStatus==1){
+							uni.navigateTo({
+								url: '../certificationResultPage/certificationResultPage'
+							})
+					   }
+				   }else{
+					   uni.navigateTo({
+					   	url: '../ownerCertification/ownerCertification'
+					   })
+				   }
+					
+				}else{
+					uni.showToast({
+						icon:"none",
+						title:ret.data.message
+					})
 				}
 				
 			},
@@ -323,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(){
@@ -338,7 +360,12 @@
 				this.showGuide = isShow;
 			},
 			showMine(){
-				this.$refs.mine.show()
+				if(this.userInfo.userId){
+					this.$refs.mine.show()
+				}else{
+					uni.$emit('login')
+				}
+				
 			}
 		},
 		components: {
@@ -883,7 +910,7 @@
 						flex-direction: column;
 						margin-left: 50rpx;
 						z-index: 11;
-						max-width: 360rpx;
+						max-width: 51%;
 
 						.house_name {
 							width: 100%;
@@ -897,6 +924,7 @@
 						}
 
 						.house_hk {
+							width: 100%;
 							font-size: 26rpx;
 							font-family: Verdana, Verdana-Regular;
 							font-weight: 400;
@@ -909,6 +937,7 @@
 						}
 
 						.house_address {
+							width: 100%;
 							display: flex;
 							font-size: 24rpx;
 							font-family: Verdana, Verdana-Regular;
@@ -1006,5 +1035,33 @@
 			}
 		}
 		
+		.com_noMore_text{
+			margin-top: 40rpx;
+			font-size: 24rpx;
+			font-family: Verdana, Verdana-Regular;
+			font-weight: 400;
+			text-align: center;
+			color: #999999;
+		}
+		
+		.empty {
+			display: flex;
+			flex-direction: column;
+			align-items: center;
+			
+			.emptyImg {
+				width: 283rpx;
+				height: 227rpx;
+			}
+			.text {
+				margin-top: -20rpx;
+				font-size: 28rpx;
+				font-family: PingFang SC, PingFang SC-Medium;
+				font-weight: 500;
+				text-align: center;
+				color: #b1b3ba;
+			}
+		}
+		
 	}
 </style>

+ 2 - 2
pages/houseDetail/houseDetail.vue

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

+ 7 - 5
pages/reportPage/reportPage.vue

@@ -93,7 +93,7 @@
 		
 		<dm-calendar-picker-view ref='calendarPickerView' @confirmSelDate='confirmSelDate'></dm-calendar-picker-view>
 	    <dmWithDrawalRecord ref='withDrawalRecord'></dmWithDrawalRecord>
-		<dmWithDrawal ref='withDrawal' :canCashOut='headerInfo.canCashOut'></dmWithDrawal>
+		<dmWithDrawal ref='withDrawal' :canCashOut='headerInfo.canCashOut' @updata="getData"></dmWithDrawal>
 		<login-notice></login-notice>
 		<login></login>
 	</view>
@@ -153,14 +153,16 @@
 		mounted() {
 			this.color1 = app.globalData.color1;
 			this.color2 = app.globalData.color2;
-			this.getReportHeader()
-			this.getReportMenu();
+			this.getData()
 			uni.$on("request",()=>{
-				this.getReportHeader()
-				this.getReportMenu()
+				this.getData()
 			})
 		},
 		methods: {
+			getData(){
+				this.getReportHeader()
+				this.getReportMenu()
+			},
 			// 表头数据
 			async getReportHeader() {
 				const res = await this.$myRequest({

+ 68 - 30
pages/revenueRankingPage/revenueRankingPage.vue

@@ -32,7 +32,7 @@
 				</view>
 			</view>
 			
-			<view class="rank_item" v-for="(item,index) in rankingList" :key='index'>
+			<view class="rank_item" v-for="(item,index) in rankingList" :key='item.userId'>
 				<view class="rank_item_name" style="width: 20%;">
 					<image class="icon" v-if="index==0" src="https://dm.static.elab-plus.com/yezhu/icon_first.png" mode=""></image>
 					<image class="icon" v-if="index==1"  src="https://dm.static.elab-plus.com/yezhu/icon_twice.png" mode=""></image>
@@ -40,18 +40,22 @@
 				    <text  v-if="index!=0&&index!=1&&index!=2" >{{index+1}}</text>
 				</view>
 				<view class="rank_item_name" style="width: 30%;" :style="{color:(index==0||index==1||index==2)?color1:'auto'}">
-					淘房**神
+					{{item.name}}
 				</view>
 				<view class="rank_item_name" style="width: 20%;">
-					LV10
+					{{item.level?'Lv'+item.level:''}}
 				</view>
 				<view class="rank_item_name" style="width: 30%;" :style="{color:(index==0||index==1||index==2)?color1:'auto'}">
-					8273.00
+					{{Number(item.amount).toFixed(2)}}
 				</view>
 				<view class="item_line">
 					
 				</view>
 			</view>
+			<view class="empty" v-if="rankingList.length == 0">
+				<image class="emptyImg" src="https://dm.static.elab-plus.com/yezhu/h5/icon_empty.png" mode=""></image>
+				<view class="text">暂无数据</view>
+			</view>
 			
 			<view class="back_home" :style="{background:color2}" @click="backHome">
 				<image class="back_home_icon" src="https://dm.static.elab-plus.com/yezhu/icon_home.png" mode=""></image>
@@ -68,32 +72,7 @@
 	export default {
 		data() {
 			return {
-				rankingList:[
-					{
-						
-					},
-					{
-						
-					},
-					{
-						
-					},{
-						
-					},
-					{
-						
-					},{
-						
-					},{
-						
-					},{
-						
-					},{
-						
-					},{
-						
-					}
-				],
+				rankingList:[],
 			    color1:"",
 				color2:"",
 				currentTab:1,
@@ -105,10 +84,48 @@
 		mounted() {
 			this.color1 = app.globalData.color1;
 			this.color2 = app.globalData.color2;
+			this.incomeRankTop10Amounts();
 		},
 		methods:{
 			tab(index){
 				this.currentTab = index;
+				if(index==1){
+					this.incomeRankTop10Amounts();
+				}else if(index==2){
+					this.incomeRankTop10ThisMonth();
+				}else if(index==3){
+					this.incomeRankTop10Today();
+				}
+			},
+			async incomeRankTop10Today(){
+				const res = await this.$myRequest({
+					url: '/income/trigger/incomeRankTop10Today',
+					data:{}
+				});
+				this.rankingList = []
+				if(res&&res.data.success){
+					this.rankingList = res.data.list||[]
+				}
+			},
+			async incomeRankTop10ThisMonth(){
+				const res = await this.$myRequest({
+					url: '/income/trigger/incomeRankTop10ThisMonth',
+				    data:{}
+				});
+				this.rankingList = []
+				if(res&&res.data.success){
+					this.rankingList = res.data.list||[]
+				}
+			},
+			async incomeRankTop10Amounts(){
+				const res = await this.$myRequest({
+					url: '/income/trigger/incomeRankTop10Amounts',
+				    data:{}
+				});
+				this.rankingList = []
+				if(res&&res.data.success){
+					this.rankingList = res.data.list||[]
+				}
 			},
 			backHome(){
 				uni.navigateBack({
@@ -127,6 +144,7 @@
 	border-radius: 16rpx;
 	padding-top: 20rpx;
 	margin-top: 20rpx;
+	min-height: 1200rpx;
 	.title{
 		text-align: center;
 		font-size: 32rpx;
@@ -244,5 +262,25 @@
 		text-align: center;
 		color: #ffffff;
 	}
+	
+	.empty {
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		margin-top: 300rpx;
+		
+		.emptyImg {
+			width: 283rpx;
+			height: 227rpx;
+		}
+		.text {
+			margin-top: -20rpx;
+			font-size: 28rpx;
+			font-family: PingFang SC, PingFang SC-Medium;
+			font-weight: 500;
+			text-align: center;
+			color: #b1b3ba;
+		}
+	}
 }
 </style>

BIN
static/icons/icon_report_user.png


BIN
static/icons/icon_shouyi_user.png


BIN
static/icons/icon_user_mine.png


BIN
static/icons/icon_zcyz_user.png


+ 1 - 1
util/api.js

@@ -2,7 +2,7 @@ let isToLoginSend = false;
 var requestTask = null
 var elabprojectname = ''
 var elabsystem = ''
-var elabEnvironment = ''
+var elabEnvironment = '';
 export const myRequest = (options) => {
 	if (!options.hasOwnProperty("showLoading")) {
 		var localDate = uni.getStorageSync('loadingStamp') || 0