<template>
	<view class="page">
		<view class="top">
			订单疑问
		</view>
		<textarea :maxlength="300" style="width: 100%;" name="" id="" cols="30" rows="10" placeholder="请描述您的问题"
			v-model="desc"></textarea>
		<view class="num" style="text-align: right;">
			<text>{{ desc.length }}/300</text>
		</view>
		<view class="phone">
			联系电话
			<text style="color: red;">*</text>
			<input style="margin-top: 32rpx;" type="text" placeholder="请输入您的联系电话" v-model="phone"></input>
		</view>
		<view class="bottom1">
			<view class="bottom" @click="next">
				提交
			</view>
			<view class="safe-area-inset-bottom"></view>
		</view>
	</view>
</template>

<script>
	import {commission_feedback} from "@/units/inquire.js"
	export default {
		data() {
			return {
				desc:"",
				phone:"",
				id:""
			}
		},
		// watch() {
		// 	descInput(e){
		// 		this.remnant = e.detail.value.length;
		// 	},
		// },
		onLoad(options) {
			this.id = options.id
		},
		methods: {
			next() {
				if(!this.desc){
					this.$u.toast("请输入疑问内容")
					return
				}
				if(!this.phone){
					this.$u.toast("请输入联系方式")
					return
				}
				commission_feedback({
					order_commission_id:this.id,
					content:this.desc,
					mobile:this.phone
				}).then(res=>{
					console.log(res);
					if(res.code==1){
						this.$u.toast("提交成功，请耐心等待反馈")
						uni.navigateBack()
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		padding: 32rpx 32rpx 0;
	}

	.bottom1 {
		background: #FFFFFF;
		height: 166rpx;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 750rpx;
		padding: 8rpx 32rpx 0;
		box-sizing: border-box;
	}

	.bottom {
		background: #0C66C2;
		border-radius: 16rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #FFFFFF;
		height: 84rpx;
		line-height: 84rpx;
		text-align: center;
		box-sizing: border-box;
	}

	.phone {
		height: 168rpx;
		border-top: 2rpx solid #F0F0F0;
		border-bottom: 2rpx solid #F0F0F0;
		padding: 26rpx 0;
		box-sizing: border-box;
	}

	.top {
		height: 44rpx;
		font-size: 32rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 500;
		color: #222222;
	}
</style>