<template>
	<view class="content" :class="['qn-page-' + theme]">
		<view class="pj-top">
			<textarea placeholder="您对该项目的员工满意吗？说说你的评价." v-model="comment" placeholder-class="textholder"></textarea>
		</view>
		<view class="pj-xj">
			<view class="">
				满意度：
			</view>
			<u-rate :count="count" v-model="score"></u-rate>
		</view>
		<view class="btn primary-btn" @click="fbpj()">
			发布
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				comment: '',
				order_id: '',
				uid: '',
				yg: {},
				score: 5,
				count: 5,
			}
		},
		onLoad(opt) {
			this.order_id = opt.order_id
			this.uid = opt.uid
		},
		onShow() {

		},
		onReachBottom() {

		},
		onReady() {
			
		},
		methods: {
			fbpj() {
				if(this.comment == '') {
					return that.$u.toast('请输入评价');
				}
				console.log(this.score, this.comment)
				this.$u.api.pjYg({
					uid: this.uid, //员工id
					comment: this.comment, //评论
					score: this.score, //评分
					order_id: this.order_id //预约订单id
				}).then(res => {
					uni.showToast({
						title: '评价成功'
					});
					
					setTimeout(() => {
						uni.navigateBack()
					}, 1000);
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #f8f6f6;
		height: auto;
		min-height: 100%;
	}
	.pj-top {
		background-color: #fff;
		padding: 20rpx;
		height: 250rpx;
		textarea {
			display: block;
			width: 100%;
			height: 100%;
			font-size: 28rpx;
			font-weight: 500;
			color: #333;
		}
		.textholder {
			font-size: 28rpx;
			font-weight: 500;
			color: #999;
		}
	}
	.pj-xj {
		margin-top: 20rpx;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		background-color: #fff;
		padding: 0 20rpx;
		height: 75rpx;
	}
	.btn {
		width: 560rpx;
		height: 90rpx;
		background: #E02020;
		border-radius: 45px;
		font-size: 36rpx;
		font-weight: 500;
		color: #FFFFFF;
		text-align: center;
		line-height: 90rpx;
		margin: 88rpx auto 0;
		
	}
</style>