myAchievement.vue 2.6 KB
<template>
	<view class="page">
		<view class="navbox">
			<view class="navitem" :class="type==1?'active':''" @click="selmon" :data-id="1">月度业绩</view>
			<view class="navitem" :class="type==2?'active':''" @click="selmon" :data-id="2">年度业绩</view>
		</view>
		<view class="nodata" v-if="achievement.length==0">暂无数据</view>
		<view class="box" v-else>
			<view class="tittle">
				<view class="titem">
					查询时间
				</view>
				<view class="titem">
					收益金额(元)
				</view>
			</view>
			<view class="numbox" v-for="(item,index) in achievement" :key="index">
				<view class="nitem">{{item.time}}</view>
				<view class="nitem">{{item.total}}</view>
			</view>
			
			
		</view>
	</view>
</template>

<script>
	import app from "../../App.vue";
	export default {
		data() {
			return {
				type:1,
				achievement:[]
			}
		},
		onLoad() {
			this.getmyyeji()
		},
		methods: {
			selmon(e){
				this.type=e.currentTarget.dataset.id;
				this.getmyyeji()
				
			},
			// 获取我的业绩
			getmyyeji(){
				let that = this;
				var url = 'salesman/get_my_performance';
				var params = {
					type:that.type		
				}
				console.log('7766554', params)
				app.post(url, params).then((res) => {
					console.log(res);
					that.achievement=res.data.data
					
				}).catch((err) => {
					console.log(err)		
				})
			}
		}
	}
</script>

<style>
	page{
		background: #F7F7F7;
	}
	.navbox{
		width: 100%;
		height: 88rpx;
		background: #fff;
		padding: 0 32rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}
	.navitem{
		width: 50%;
		font-size:32rpx;
		font-family:PingFangSC-Regular,PingFang SC;
		font-weight:400;
		color:rgba(35,35,35,1);
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.active{
		color: #FF9417;
	}
	.box{
		padding: 32rpx;
		box-sizing: border-box;
	}
	.tittle,.numbox{
		display: flex;
		align-items: center;
	}	
	.titem{
		width: 50%;
		height: 96rpx;
		font-size:32rpx;
		font-family:PingFangSC-Regular,PingFang SC;
		font-weight:600;
		color:rgba(35,35,35,1);
		display: flex;
		align-items: center;
		justify-content: center;
		border: 1px dashed #000;
	}
	.titem:first-child{
		border-right-color: transparent;
	}
	.numbox{
		background: #fff;
	}
	.nitem{
		width: 50%;
		height: 96rpx;
		font-size:32rpx;
		font-family:PingFangSC-Regular,PingFang SC;
		font-weight:400;
		color:rgba(35,35,35,1);
		display: flex;
		align-items: center;
		justify-content: center;
		border: 1px dashed #000;
		border-top-color: transparent;
	}
	.numbox .nitem:first-child{
		border-right-color: transparent;
	}
</style>