<template>
	<view id="warp">
		<view class="title">提出您宝贵的意见</view>
		<view class="content">
			<textarea  v-model="text" maxlength=200 auto-height placeholder="请输入您的意见(200字以内)"/>
		</view>
		<view class="btn_css">
			<button class="btn" @tap="registerOk">提交</button>
		</view>
	</view>
</template>

<script>
	const {urlList,https} = require('@/static/api');
	export default {
		data() {
			return {
				text:'',
			};
		},
		methods:{
			registerOk(){
				if(this.text == ''){
					uni.showToast({
						title:'请输入内容',
						icon:'none',
					})
					return
				};
				let postData = {
					reportContent:this.text
				};
				https(urlList.subFeedBack,'POST',postData,'提交中...').then(data => {
					uni.showToast({
						title: data.message || '提交成功',
						icon: 'none',
						duration: 1000
					})
					setTimeout(e => {
						uni.navigateBack()
					},1000)
				}).catch(err => {
					uni.showToast({
						title:err,
						icon:'none',
						duration:1500
					})
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
#warp{
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	.title{
		text-align: center;
		padding: 30rpx 0;
		font-size: 32rpx;
	}
	.content{
		width: 100%;
		height: 500rpx;
		box-sizing: border-box;
		padding: 30rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		textarea{
			width: 100%;
			min-height: 100%;
			box-sizing: border-box;
			padding: 30rpx;
			background: white;
			border: 1rpx solid #dadadaff;
			border-radius: 16rpx;
			font-size: 28rpx;
		}
	}
	.btn_css{
		width: 650rpx;
		position: fixed;
		bottom: 10rpx;
		display: block;
		.btn{
			background-color:#1B64F8FF;
			color: white;
		}
	}
}
</style>
