fenxiaomyteam.vue 2.6 KB
<template>
	<view class="content">
		<view class="tapnav flextwo">
			<view class="tapnavitem" :class="order==0?'tapnavactive':''" @click="ordersel" :data-id="0">一级分销员</view>
			<view class="tapnavitem" :class="order==1?'tapnavactive':''" @click="ordersel" :data-id="1">二级分销员</view>

		</view>
		<view class="nodata" v-if="fenxiaolist.length==0">暂无数据</view>
		<view class="listk" v-else>
			<view class="fenxiaoti flextwo" v-for="(item,index) in fenxiaolist" :key="index">
				<view class="flexone">
					<view class="tiimg">
						<image :src="item.avatar" mode=""></image>
					</view>
					<view class="fenxiaotileft">{{item.nickname}}</view>

				</view>

				<view class="fenxiaotir">{{item.createtime}}</view>
			</view>
		</view>
	
	
	</view>
</template>

<script>
	import app from "../../App.vue";
	export default {
		data() {
			return {
				order: 0,
				page: 1,
				fenxiaolist: []
			}
		},
		onLoad() {
			console.log(33493)
			this.getoneyuan();
			

		},
		methods: {
			ordersel(e) {
				this.order = e.currentTarget.dataset.id;
				this.page = 1;
				this.fenxiaolist = []
				if (this.order == 0) {
					this.getoneyuan()
				} else {
					this.geterji()
				}
			},
			// 一级分销员
			getoneyuan() {
				let that = this;
				console.log(44747)
				var url = 'distribution/get_team1';
				var params = {
					page: this.page,
					pageNum: 10
				}
				console.log('7766554', params)
				app.post(url, params).then((res) => {
					console.log(res);
					that.fenxiaolist = that.fenxiaolist.concat(res.data.data.list)


				}).catch((err) => {

				})
			},
			geterji() {
				let that = this;
				var url = 'distribution/get_team2';
				var params = {
					page: this.page,
					pageNum: 10
				}
				console.log('7766554', params)
				app.post(url, params).then((res) => {
					console.log(res);
					that.fenxiaolist = that.fenxiaolist.concat(res.data.data.list)


				}).catch((err) => {

				})
			}


		},
		onReachBottom() {
			let newpage = this.page;
			newpage++;
			this.page = newpage;
			if (this.order == 0) {
				this.getoneyuan()
			} else {
				this.geterji()
			}
		}

	}
</script>

<style>
	@import url('../../base/homepage');

	page {
		background: #F7F7F7;
	}

	.tapnav {
		background: #fff;
	}

	.tiimg {
		width: 88rpx;
		height: 88rpx;
		border-radius: 50%;
		margin-right: 36rpx;
	}

	.tiimg image {
		border-radius: 50%;
	}

	.fenxiaotileft {
		color: #08121F;
		font-size: 28rpx;

	}

	.fenxiaotir {
		color: #8C9198;
		font-size: 22rpx;
	}

	.fenxiaoti {
		padding: 34rpx 40rpx;
		box-sizing: border-box;
		background: #fff;
		margin-top: 16rpx;
	}
</style>