<template>
	<view class="content">
		<view class="zdyNav">
		  <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
		  <view class="nav">
			  <view @click="back"><image src="../../../static/img/baiheiback.png" mode="" class="baiheiback" @click="back"></image></view>
			  <view >修改完成</view>
			  <view style="width:70px;"></view>
		  </view>
		</view>
		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
		<view style="height: 44px;"></view>
		<view class="top">
			<view class="toptop">
				<image src="../../../static/img/icon_chenggong@2x.png" mode="" class="toptopIMg"></image>
				<view class="topTitle">修改完成</view>
			</view>
			<view class="topCont">
				<view class="topContBtn" @click="goHome">回到首页</view>
				<view class="topContBtn" @click="godetail">查看详情</view>

			</view>
		</view>
		
		<view class="competeCont">
			<view class="competeContTitle">对运营经理的服务评价</view>
			<view class="xxBox">
				<uni-rate :max="5" v-model="xx" @change="onXXChange"/>
			</view>

			<view>
				<textarea placeholder-style="color:#CCCCCC" placeholder="请填写十字以上的评价内容～" v-model="userEvaContent" class="textareaCont"/>
			</view>
			<view class="submitBox">
				<view class="submit" @click="submit">提交</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		
		data() {
			return {
				sheetID:'',
				userEvaContent:'',
				userEvaStar:0,
				xx:0,
				iStatusBarHeight:'',
			}
		},
		onLoad(opt) {
		  this.sheetID=opt.sheetID
		  this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
		},
		onShow() {
				
		},
		methods: {
			goDetail(){
				uni.navigateTo({
					url:'../../reportManage/reportDetail?id='+this.sheetID
				})
			},
		   back(){
			 uni.navigateBack({
			 	delta:1
			 })  
		   },
		   godetail(){
			   uni.navigateTo({
			   	url:'../../reportManage/reportDetail?id='+this.sheetID
			   })
		   },
		   goHome(){
			 uni.reLaunch({
			 	url:'index'
			 })  
		   },
			onXXChange(e){
				console.log(e)
				this.userEvaStar=e.value
			},
			submit(){
         
				if(this.userEvaStar <= 4){
					if(this.userEvaContent.length <= 10){
						uni.showToast({
						    title: '请填写十字以上的评价内容',
							icon:'none',
						    duration: 2000,

						})
						return false;
					}

				}
				
				uni.showLoading({ });
				
				this.$http('accompany/SuperCheckSheet/userEva', {
					sheetID:this.sheetID,
					userEvaStar:this.userEvaStar,
					userEvaContent:this.userEvaContent
				}, 'POST').then(res => {
				    //this.submitSuperCheckSheet()
					uni.showToast({
					    title: '提交成功',
						icon:'none',
					    duration: 2000,
					});
					uni.navigateTo({
						url:'index'
					})
				})
			}
			
		}
	}
</script>

<style scoped>
	.content {
		background: #F4F5F7;
		min-height: 100vh;
	
	}

	/* #ifdef H5 */
	.content {
		background: #F4F5F7;
	
		
	}

	/* #endif */
	.status_bar{
		background: #FFFFFF;
	}
	.nav{
		width: 100vw;
		height: 44px;
		background: #FFFFFF;
		display: flex;
		justify-content: space-between;
		font-size: 34rpx;
		line-height: 44px;
	}
	.baiheiback{
		width: 70px;
		height: 44px;
	}
	.zdyNav{
		position: fixed;
		left: 0;
		top: 0;
		background: #FFFFFF;
		z-index: 11;
	}
	.top{
		background: #FFFFFF;
	}
	.toptop{
		display: flex;
		justify-content: center;
		padding-top: 20rpx;
	}
	.toptopIMg{
		width: 44rpx;height: 44rpx;
	}
	.topTitle{
		font-size: 36rpx;
		padding-left: 10rpx;
		color: #3C3C3C;
	}
	.topCont{
		display: flex;
		justify-content: space-around;
		padding: 40rpx 100rpx;
		
	}
	.topContBtn{
		width: 150rpx;
		height: 56rpx;
		border-radius: 34rpx;
		border: 2rpx solid #DDDDDD;
		line-height: 56rpx;
		text-align: center;
		font-size: 28rpx;
		color: #3C3C3C;
	}
	.competeCont{
		margin-top: 20rpx;
		background: #FFFFFF;
		padding: 40rpx 24rpx;
	}
	.competeContTitle{
		font-size: 30rpx;
		color: #3C3C3C;
		text-align: center;
	}
	.textareaCont{
		width: 662rpx;
		height: 200rpx;
		background: #F4F5F7;
		border-radius: 10rpx;
		padding: 20rpx;
		margin-top: 20rpx;
		font-size: 28rpx;
	}
	.submit{
		width: 420rpx;
		height: 74rpx;
		background: #FF4F00;
		border-radius: 50rpx;
		line-height: 74rpx;
		text-align: center;
		font-size: 30rpx;
		color: #FFFFFF;
	}
	.submitBox{
		display: flex;
		justify-content: center;
		padding-top: 40rpx;
	}
	.xxBox{
		display: flex;
		justify-content: center;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}
</style>
