<template>
	<view class="">
		<view class="border">
			<!-- <view class="list">
				<view class="title">
					标题:
				</view>
				<view class="put">
					<input type="text" value="" placeholder="清晰完整的标题会更快被解答" placeholder-class="place" class="put1" />
				</view>
			</view> -->
			<view class="list">

				<view class="title">
					<text class="xing">*</text>反馈问题:
				</view>

			</view>
			<view class="put">
				<textarea value="" placeholder="在此输入您想反馈的问题" placeholder-class="place" class="put2" v-model="content" />
				</view>
			<view class="list">
				
				<view class="title">
					<text class="xing">*</text>联系方式:
				</view>
			</view>
			<view class="put">
				<input type="text" value="" placeholder="输入手机号" placeholder-class="place" class="put1" v-model="mobile"/>
			</view>
		</view>
		<view class="bottom-bt">
			<view class="bt" @click="submit">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				content:"",
				mobile:""
			}
		},
	methods:{
		submit(){
			var phone=/^1(3|4|5|6|7|8|9)\d{9}$/;
			if(!this.content){
				uni.showToast({
					title:'请输入您要反馈的问题',
					icon:'none'
				})
			}
			else if(!this.mobile){
				uni.showToast({
					title:'电话号码不能为空',
					icon:'none'
				})
			}
			else if(!phone.test(this.mobile)){
				console.log('正确')
				uni.showToast({
					title:'电话号码格式错误',
					icon:'none'
				})
				
			}else{
				uni.request({
					url: 'http://epidemic.site.ximengnaikang.com/api/v1/retroaction', //仅为示例，并非真实接口地址。
					method: 'POST',
					data:{
						body:this.content,
						mobile:this.mobile
					},
					success: (res) => {
						console.log(res,"oooo")
						if(res.data.code ==200){
							uni.showToast({
								title:"提交成功",
								icon:'none'
							})
						}else{
							uni.showToast({
								title:res.message,
								icon:'none'
							})
						}
					}
				})
				
			}
			
			
		}
	}
		
	}
</script>

<style>
	page {
		height: 100vh;
	
	}
	
	.border {
		height: 100vh;
		/* padding-bottom: 70upx; */
		/* position: relative; */
	
	}
	.xing{
		color: red;font-size: 28upx;
		font-weight: 550;
		margin-right: 10upx;
	}
	.border{
		padding: 30upx;
	}
	.list{
		/* display: flex; */
		/* margin-top: 30upx; */
		height: 100upx;
		line-height: 100upx;
		line-height:84upx ;
	}
	.title{
		
		display: inline-block;
		vertical-align: middle;
		
		font-size:32upx;
		font-weight: 500;
		color: #333333;
		opacity: 1;
	}
	
	.put1{
		height: 84upx;
		line-height: 84upx;
		background-color: #F7F7F7;
		padding-left: 30upx;
	}
	.place{
		font-size: 28upx;
		font-weight: 400;
		color: #999999;
		opacity: 1;
		}
		.put2{
			min-height: 400upx;
			background-color: #F7F7F7;
			font-size: 28upx;
			padding:15upx;
			width: auto;
		}
		.bottom-bt {
			padding: 10upx 0;
			width: 100%;
			position: fixed;
			bottom: 0;
			height:100upx;
			display: flex;
			background-color: #FFFFFF;
			z-index: 999;
			border-top: solid 4upx #EEEEEE;
		}
		.bt{
			width: 60%;
			height: 80upx;
			line-height: 80upx;
			background-color: #23459D;
			color: #FFFFFF;
			font-size: 32upx;
			text-align: center;
			margin-left: 20%;
			border-radius: 40upx;
			}
		
		
</style>
