<template>
	<view class="concent-footer">
		<view class="content-box">
			<view class="content-box-title" v-for="item in datatitleList">
				<span class="title">{{item}}</span>
			</view>
		</view>
		<!-- //  一级循环 -->
		<view class="content-sam-box">
			<view class="" v-for="(pointItem,index) in dataList">
				<view class="content-sa" style=" " v-if="felTyle == 'achievement'">
					<view class="content-box-title"
						style="display: flex;align-items: center;margin-left: 6rpx;flex: 1;">
						<view 
							:class="index == '0' ?'cornermarker': index == '1' ? 'cornermarkertwo' : index == '2' ? 'cornermarkerthree' : 'cornermarkerother'">
							<span style="font-size: 20rpx;line-height: 20rpx;">{{index + 1}}</span>
						</view>
						<!-- <view class="cornermarkerthree">
							<span>{{index + 1}}</span>
						</view> -->
						<view style="margin-left: 8rpx;text-overflow: ellipsis;
		    overflow: hidden;
		    white-space: nowrap;">{{pointItem.name }}</view>
					</view>
					<view class="content-box-title" style="text-overflow: ellipsis;overflow: hidden;
		    white-space: nowrap;max-width: 150rpx;">
						<span>{{pointItem.areaCenterName }}</span>
					</view>
					<view class="content-box-title">
						<span style="color:#FF0000;">{{pointItem.orderNum }}</span>
					</view>
					<view class="content-box-title">
						<span style="color:#FF0000;">￥{{pointItem.coursePrice}}</span>
					</view>
					<view class="content-box-title">
						<span style="color:#FF0000;">￥{{pointItem.courseIncome}}</span>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from "../../api/api";
	export default {
		props: {
			dataList: {
				type: Array,
				default: null
			},
			datatitleList: {
				type: Array,
				default: null
			},
			tabletype: {
				type: String,
				default: null
			},
			type: {
				type: String, // 这里用来去区分是哪个页面传来的值 1直属团队 2.所辖团队 3.其他团队
				default: null
			},
			felTyle: {
				type: String,
				default: null
			}
		},
		name: "myteam-table",
		data() {
			return {
				table_index: '', // 第二级
				tableone: false,
				twoindex: '',
				tabletwo: false, // 第三层收起
				dataFoList: [],
				twoList: [],
				thList: [],
				tablefour: false, // 第四层收起
				foindex: '',
				fourList: [],
				tablefive: false, // 第五层收起
				fiveindex: '',
				fiveList: [],
				tablesix: false, // 第六层收起
				sixindex: '',
				sixList: [],
				list:[],
			};
		},
		mounted() {
			// this.alist = this.dataList
			// this.list = JSON.parse(JSON.stringify(this.dataList))
			// this.$nextTick(() => {
				
			// })
			// console.log(this.dataList, 555555)
		},
		methods: {
			subordinate(index, val, type, expand) {
				if (this.tabletype == 1 || val.levelCode == 'A1') {
					uni.showToast({
						title: '暂无下级',
						duration: 1000,
						icon: 'none'
					});
					return
				} else {
					if (expand == false) {
						let CffpOrgInfoReqVO = {
							id: val.id
						}
						api.queryTeamDetail(CffpOrgInfoReqVO).then(res => {
							if (res['success']) {
								// if (res.data.list.length == 0) {
								// 	// uni.showToast({
								// 	// 	title: '暂无数据',
								// 	// 	duration: 1000,
								// 	// 	icon: 'none'
								// 	// });
								// 	var list = [
								// 		{
								// 			areaCenterName:'第五级',
								// 			levelName:'d',
								// 			count: '25'
								// 		}
								// 	]
								// 	this.ckopennextlevel(index, type, list)
								// } else {
								// 	this.ckopennextlevel(index, type, res.data.list)
								// }
							}
						})
					} else {
						this.ckopennextlevel(index, type)
					}

				}
			},
			ckopennextlevel(index, val, list) {
				switch (val) {
					case 1:
						this.tableone = this.table_index == index ? !this.tableone : true
						this.table_index = index
						this.twoList = list
						break
					case 2:
						this.tabletwo = !this.tabletwo
						// this.twoindex = this.twoindex == index ? !this.tabletwo : true
						this.twoindex = index
						this.thList = list
						break
					case 3:
						this.tablefour = this.foindex == index ? !this.tablefour : true
						this.foindex = index
						this.fourList = list
						break
					case 4:
						this.tablefive = this.fiveindex == index ? !this.tablefive : true
						this.fiveindex = index
						this.fiveList = list
						break
					case 5:
						this.tableone = this.foindex == index ? !this.tablefour : true
						this.foindex = index
						this.fourList = list
						break

				}
			}
		}
	}
</script>

<style scoped>
	.content-box {
		background-color: #fff;
		display: flex;
		font-weight: 600;
		align-items: center;
		justify-content: space-between;
	}

	.content-sa {
		display: flex;
	}

	.content-box-title {
		padding: 5rpx 0;
		flex: 1;
		align-items: center;
		text-align: center;
		border-bottom: 1rpx solid #F2F2F2;
		padding: 20rpx 0;
	}


	.content-sam-box {
		/* 		background-color: #fff;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 10rpx 0;
		color: #333333;
		border-bottom: 1rpx solid #F2F2F2;; */
		font-size: 24rpx;
	}

	.cornermarker {
		width: 30rpx;
		height: 30rpx;
		color: #FFFFFF;
		background: #C50021;
		border-radius: 50%;
	}

	.cornermarkertwo {
		width: 30rpx;
		height: 30rpx;
		color: #FFFFFF;
		background: #FBB03B;
		text-align: center;
		border-radius: 50%;
	}

	.cornermarkerthree {
		width: 30rpx;
		height: 30rpx;
		color: #FFFFFF;
		background: #3161A8;
		text-align: center;
		border-radius: 50%;
	}

	.cornermarkerother {
		width: 30rpx;
		height: 30rpx;
		color: #FFFFFF;
		background: #D5DDE9;
		text-align: center;
		border-radius: 50%;
	}

	.concent-footer {
		margin: 0 5rpx;
	}

	.content-box-title-a {
		/* padding: 5rpx 0; */
		flex: 1;
		color: #FFFFFF;
		/* margin: 0 10rpx; */
		background: #3F52B7;
		background: url('../../static/myteam/Group1660.png');
		background-size: 100%;
		border-radius: 5rpx;
		border: 1rpx solid #fff;
	}

	/* 	.content-box-title-b{
		padding: 5rpx 0;
		flex: 1;
		margin: 0 10rpx;
		background: url('../../static/myteam/Group1662.png');
		background-size: auto 100%;
		border-radius: 5rpx;
		border: 1rpx solid #fff;
	} */
</style>
