<template>
	<view class='use-page'>
		<view class='use-mian'>
			<view class='main-con'>
				<view class='box-title'>
					<view class='label-icon'>*</view>
					<view class='label-text'>描述</view>
				</view>
				<view class='box-tarea'>
					<textarea class='box-con' placeholder="请详细描述您的问题或建议，我们将及时跟进" maxlength="100" @input="sufontnum($event)"></textarea>
					<text class='contain-length'>{{fountNum}}/<text class="length-total">100</text>字</text>
				</view>
			</view>
		</view>
		<view class='my-n-footer'>
			<view class='footer-btn' @click="needSubmit">提交</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				fountNum:0,
				desQuest:''
			}
		},
		methods: {
			needSubmit(){
				const self=this
				if(self.desQuest==''){
					self.toast('描述不能为空')
					return false
				}
				const params={
					content:self.desQuest
				}
				self.$request('/pawn/feed/addFeed','POST',params).then(res => {
					console.log(res.result,'followGood');
					self.toast('提交成功')
					self.Go('uni:/pages/index/index','tab')
				}).catch(err=>{
				  console.log(err,'请求出错')
				})
			},
			sufontnum(e){
				if(e.detail.value.length>100){
					self.toast('不可超过100字')
					return false
				}
				this.desQuest=e.detail.value
				this.fountNum=e.detail.value.length
			},
		}
	}
</script>

<style src='./index.less' lang="less" scoped></style>
