<template>
	<view class="application-body">
		<view class="application-content" v-if="applicatinList.length!=0">
			<view class="application-item" v-for="(item,index) in applicatinList" :key="index" @click="goApplyPage(item.type,item.content)">
				<view class="apply_boldText">{{item.type | type}}</view>
				<view class="apply_normalText">{{item.applTime}}</view>
			</view>
		</view>
		<view class="noData" v-else>暂无申请信息</view>
		
	</view>
</template>

<script>
	import {getApplContentList} from '@/api/newIndex.js'
	import {mapGetters} from 'vuex'
	export default {
		data() {
			return {
				applicatinList:[],
				
			}
		},
		computed:{
			...mapGetters(['authInfo','auth'])
		},
		onPullDownRefresh() {
			this.applicatinList=[];
			this.getList();
		},
		filters:{
			type(type){
				switch (type){
					case 1:
						return '法律咨询';
						break;
					case 2:
						return '技能提升';
						break;
				}
			}
		},
		methods: {
			getList(){
				if(this.auth.realNameState){
					getApplContentList().then(res=>{
						this.applicatinList=res.data.data.records;
						uni.stopPullDownRefresh();
					})
				}
				else{
					this.applicatinList=[];
					uni.stopPullDownRefresh();
				}
			},
			goApplyPage(type,comment){
				var data=encodeURIComponent(comment)
				if(type==1){
					uni.navigateTo({
						url:`/pageMy/apply/rights?type=${type}&data=${data}`
					})
				}
				else if(type==2){
					uni.navigateTo({
						url:`/pageMy/my/resume/setWskill?type=${type}&data=${data}`
					})
				}
				
				
			}
		},
		onShow() {
			this.getList();
		}
	}
</script>

<style>
.application-body{
	width: 690rpx;
	margin: 20rpx auto;
	
}
.application-item{
	width: 100%;
	height: 120rpx;
	border-bottom:1px solid #eaeaea;
	padding: 40rpx 30rpx 0 0rpx;
}
.apply_boldText{
	font-size: 32rpx;
	font-weight: bold;
	color: #333333;
	line-height: 36rpx;
	margin-bottom: 14rpx;
}
.apply_normalText{
	font-size: 28rpx;
	font-weight: 400;
	color: #CCCCCC;
	line-height: 36rpx;
}
.noData{
	text-align: center;
	height: 100px;
	line-height: 100px;
}
</style>
