<template>
	<view class="content">
	
		
		<view class="competeCont">
			<view class="competeContTitle">对运营经理的服务评价</view>
			<view class="xxBox">
				<uni-rate  v-model="xx" :max="5" color="#EEEEEE" active-color="#FF4F00"  :size="24" :margin="22"  @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,
			}
		},
		onLoad(opt) {
		  this.sheetID=opt.sheetID
		  
		},
		onShow() {
				
		},
		methods: {
		   
			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
					}
				}
				
				
				uni.showLoading({
					title:'上传中'
				});
				
				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,
					});
					setTimeout(function() {
					    uni.navigateBack({
					    	
					    })
					}, 2000); 
				})
			}
			
		}
	}
</script>

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

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

	/* #endif */
	
	.competeCont{
		background: #FFFFFF;
		padding: 20rpx 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>
