| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 | <template>	<view class="ranking_body">		<view class="title">			收益排行 TOP10		</view>		<view class="rank_tab">			<view class="tab_item" @click="tab(1)" :class="{active1:currentTab==1}" :style="{background:currentTab==1?color1:''}">				总量			</view>			<view class="tab_line"></view>			<view class="tab_item" @click="tab(2)"  :class="{active2:currentTab==2}" :style="{background:currentTab==2?color1:''}">				本月			</view>			<view class="tab_line"></view>			<view class="tab_item" @click="tab(3)"  :class="{active3:currentTab==3}" :style="{background:currentTab==3?color1:''}">				今日			</view>		</view>		<view class="rank_list">			<view class="rank_title">				<view class="rank_title_name" style="width: 20%;">					排名				</view>				<view class="rank_title_name" style="width: 30%;">					用户名				</view>				<view class="rank_title_name" style="width: 20%;">					用户等级				</view>				<view class="rank_title_name" style="width: 30%;">					累计收益(元)				</view>			</view>						<view class="rank_item" v-for="(item,index) in rankingList" :key='index'>				<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>					<image class="icon" v-if="index==2"  src="https://dm.static.elab-plus.com/yezhu/icon_thrid.png" mode=""></image>				    <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|nameFilter}}				</view>				<view class="rank_item_name" style="width: 20%;">					{{item.level?'Lv'+item.level:''}}				</view>				<view class="rank_item_name" style="width: 30%;" :style="{color:(index==0||index==1||index==2)?color1:'auto'}">					{{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>			<backHome></backHome>		</view>		<login-notice></login-notice>		<login></login>	</view></template><script>	let app = getApp();	import backHome from "@/components/backHome/backHome.vue"	export default {		data() {			return {				rankingList:[],			    color1:"",				color2:"",				currentTab:1,			};		},		filters:{			nameFilter(val){				if(val){					return val.charAt(0)+("*".repeat(val.length-1))				}				return ""			}		},		components:{			backHome		},		created() {					},		mounted() {			this.color1 = app.globalData.color1;			this.color2 = app.globalData.color2;			this.incomeRankTop10Amounts();			wx.hideMenuItems({			  menuList: ['menuItem:share:qq','menuItem:share:QZone','menuItem:favorite','menuItem:originPage','menuItem:copyUrl','menuItem:openWithSafari','menuItem:openWithQQBrowser'] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3			});		},		onPullDownRefresh() {			this.incomeRank();		},		methods:{			tab(index){				this.currentTab = index;				this.incomeRank();			},			incomeRank(){				if(this.currentTab==1){					this.incomeRankTop10Amounts();				}else if(this.currentTab==2){					this.incomeRankTop10ThisMonth();				}else if(this.currentTab==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({					delta:1,				})			}		}	}</script><style lang="scss">.ranking_body{	margin-left: 20rpx;	margin-right: 20rpx;	background: #ffffff;	border-radius: 16rpx;	padding-top: 20rpx;	margin-top: 20rpx;	min-height: 1200rpx;	.title{		text-align: center;		font-size: 32rpx;		font-family: Verdana, Verdana-Bold;		font-weight: 700;		text-align: center;		color: #262626;	}		.rank_tab{		display: flex;		margin: 0 auto;		margin-top: 40rpx;		width: 450rpx;		height: 60rpx;		background: #ffffff;		border: 2rpx solid #ededed;		border-radius: 8rpx;		.tab_item{			height: 100%;			text-align: center;			flex: auto;			line-height: 60rpx;			font-size: 24rpx;			font-family: Verdana, Verdana-Regular;			font-weight: 400;			color: #b1b1b1;		}		.tab_line{			width: 2rpx;			height: 60rpx;			background: #ededed;		}		.active1{			border-radius: 8rpx 0 0 8rpx;			color: #FFFFFF;		}		.active2{			border-radius: 0;			color: #FFFFFF;		}		.active3{			border-radius: 0 8rpx 8rpx 0 ;			color: #FFFFFF;		}	}		.rank_list{		width: 100%;		.rank_title{			display: flex;			width: 100%;			margin: 0 auto;			margin-top: 40rpx;			.rank_title_name{				font-size: 28rpx;				flex: auto;				font-family: Verdana, Verdana-Bold;				font-weight: 700;				text-align: center;				color: #b1b1b1;			}		}		.rank_item{			display: flex;			align-items: center;			width: 100%;			height: 104rpx;			margin: 0 auto;			position: relative;			.rank_item_name{				font-size: 28rpx;				flex: auto;				font-family: Verdana, Verdana-Bold;				font-weight: 400;				text-align: center;				color: #666666;				.icon{					width: 36rpx;					height: 40rpx;				}			}			.item_line{				position: absolute;				bottom: 0;				left: 50%;				transform: translateX(-50%);				width: 630rpx;				height: 2rpx;				background-color: rgba(0,0,0,0.05);			}		}	}		.back_home{		position: fixed;		bottom: 180rpx;		right: 0;		width: 100rpx;		height: 120rpx;		border-radius: 20rpx 0rpx 0rpx 20rpx;		box-shadow: 0rpx 10rpx 20rpx 0rpx rgba(119,55,12,0.20); 		display: flex;		flex-direction: column;		justify-content: center;		align-items: center;		.back_home_icon{			width: 30rpx;			height: 28rpx;			margin-bottom: 9rpx;		}		font-size: 20rpx;		font-family: PingFang SC, PingFang SC-Semibold;		font-weight: 600;		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>
 |