<template>
	<view class='page'>
		<view class="detail_name_container">
			<view :class="[current_num==1?'current':'']" @click="changecurrent(1)">处理记录</view>
			<view :class="[current_num==2?'current':'']" @click="changecurrent(2)">验收详情</view>
		</view>
		<view v-if="current_num==1">
			<view class="myCon myContentBox">
				<view class="top_container">原因分析</view>
				<view class="resultContent">{{taskMain.reason}}</view>
			</view>
			<view class="myCon myContentBox">
				<view class="top_container">解决方案</view>
				<view class="resultContent">{{taskMain.solution}}</view>
			</view>
			<view class="myContainer myContentBox">
				<view class="top_container">其他信息</view>
				<view class="list_item">
					<view class="list_item_name">处理人</view>
					<view class="list_item_content content_right">{{taskMain.dealreplyerName}}</view>
				</view>
				<view class="list_item">
					<view class="list_item_name">处理时间</view>
					<view class="list_item_content content_right">{{taskMain.dealCreateTime}}</view>
				</view>
			</view>
		</view>
		<view v-else-if="current_num==2">
			<view class="myContainer myContentBox">
				<view class="list_item" style="padding: 20upx">
					<view class="list_item_name" style="padding-top: 28upx; color:#333;">{{taskMain.statusName||'-'}}</view>
					<view class="list_item_content content_right">
						<view>验收人：{{taskMain.checkreplyerName||'-'}}</view>
						<view>验收时间：{{taskMain.checkCreateTime||'-'}}</view>
					</view>
				</view>
			</view>
			<view class="myContainer myContentBox">
				<view class="top_container">验收评价</view>
				<view class="star_content">
					<view class="star_name">完成效率</view>
					<view class="star">
						<uni-rate :value="taskMain.completeRate||'-'" active-color="#3382FF" :disabled="true" color="#C1C1C1"></uni-rate>
					</view>
				</view>
				<view class="star_content">
					<view class="star_name">完成质量</view>
					<view class="star">
						<uni-rate :value="taskMain.completeQuality||'-'" active-color="#3382FF" :disabled="true" color="#C1C1C1"></uni-rate>
					</view>
				</view>
				<view class="star_content">
					<view class="star_name">工作态度</view>
					<view class="star">
						<uni-rate :value="taskMain.workState||'-'" active-color="#3382FF" :disabled="true" color="#C1C1C1" ></uni-rate>
					</view>
				</view>
			</view>
			<view class="myContainer myContentBox">
				<view class="top_container">验收意见</view>
				<view class="resultContent" style="padding-bottom: 5px;">{{taskMain.checkSolution||'-'}}</view>
			</view>
		</view>
		<view class="goHome" @click='goMain("taskInfo")'>
			<img src="../../static/img/gohome.png">
		</view>
	</view>
</template>

<script>
	import uniRate from "@/components/uni-rate/uni-rate.vue"
	export default{
		components: {
			uniRate
		},
		data(){
			return {
				current_num:1,
				id:'',
				taskMain:{},
			}
		},
		onLoad(option) {
			  this.id=option.id;
			if(this.id==undefined){
				uni.reLaunch({
				    url: 'task'
				});
				return false;
			}
			   var _this = this;
			   this.$http.request({
			     url: '/apis/taskMain/detailDealReplyInfo',
			     params: {
			       id:option.id
			     },
			   }).then(res=>{
					if(res.data.code == 0){
						this.taskMain=res.data;
					}
			   }).catch(err=>{
				  uni.showToast({
				  	title: '获取信息失败',
				  	duration: 	1000,
				  	icon:"none"
				  });
			   });
			
		},
		methods:{
			changecurrent(num){
				this.current_num=num;
			}
		}
	}
</script>

<style scoped>
	
	.btn{
		width: 160upx;
		height:68upx;
		text-align: center;
		line-height: 68upx;
		border-radius: 10upx;
		background-color: #3382FF;
		color: #fff;
		font-size: 28upx;
		float: left;
		margin-right: 30upx;
	}
	
</style>
