<template>
	<view class="feedback">
		<view class="title">您的宝贵建议能帮助我们提供更好产品和服务</view>
		<view class="rate">
			<u-row>
				<u-col span="8">
					<text style="color:#c3c7cf;">产品评分</text>
				</u-col>
				<u-col span="4">
					<u-rate active-icon="heart-fill" inactive-icon="heart" v-model="value"></u-rate>
				</u-col>
			</u-row>
		</view>
		<view class="advise">
			<u-input v-model="content" type="textarea" :border="true" placeholder="请留下您宝贵的建议(140字)" height="210"></u-input>
		</view>
		<view class="btn">
			<u-button hover-class="none" :custom-style="btnStyle" @click="confirm">确定</u-button>
		</view>
	</view>
</template>

<script>
	import {loading,hidden,toast} from '../../tips/myTips.js'
	import {feedback} from '../../api/api.js'
	export default {
		onLoad() {
			uni.$u.mpShare.title = '页面分享';
		},
		data(){
			return{
				btnStyle:{
					background:"#7D5AFC",
					color:"#FFFFFF"
				},
				content:'',
				value:''
			}
		},
		methods:{
			confirm(){
				let params = {
					FContent:this.content,
					FScore:this.value
				}
				console.log(params)
				loading()
				feedback(params).then((res) => {
					hidden()
					console.log(res)
					uni.navigateBack()
				})
			}
		}
	}
</script>

<style>
	.feedback{
		padding: 2% 5%;
	}
	.title{
		color: #c3c7cf;
	}
	.rate{
		margin: 5% 0;
	}
	.btn{
		margin: 5% auto;
	}
</style>
