<template>
	  <view style="padding: 30upx 5%;">
		  <TextArea ref="getValue" :tips="tips" @submitValue="submitValue"/>
		  <view class="submitRemin" @click="submitRemin">提交</view>
	  </view>
	  
</template>

<script>
	import TextArea from '@/component/textarea.vue'
	export default {
		components: {
			TextArea
		},
		data() {
			return{
				reminder: '',
				order_id:''
			}
		},
		onLoad(e) {
			this.order_id = e.order_id;
			let a = e.a;
			console.log(a);
			if(a == 1) {
				uni.setNavigationBarTitle({
				    title: '催单'
				});
				this.tips="填写催单内容";
			}else if(a == 2) {
				uni.setNavigationBarTitle({
				    title: '联系酒店'
				});
				this.tips="填写内容";
			}
		},
		methods: {
			submitValue(e) {
				this.reminder = e.detail.value;
			},
			submitRemin() {
			   if(this.reminder == '') {
				   this.$msg("请填写催单内容");
				   return;
			   }
			   this.request({
				   url: '/v1/order/urge',
				   method:'post',
				   data: {
					   order_id: this.order_id,
					   content: this.reminder
				   },
				   success:(res) => {
					   if(res.data.code == 1000) {
						   this.$msg("催单成功");
						   setTimeout(() => {
							  uni.navigateBack();
						   }, 2000)
						 
					   }
 				   }
			   })
			}
		}
	}
</script>

<style>
	.submitRemin {
		color: #fff;
		background-color: #D9332E;
		height: 70upx;
		text-align: center;
		line-height: 70upx;
        margin-top: 25upx;
	}
</style>
