<template>
	  <view style="padding: 0upx 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{
				tips: '填写催单内容',
				reminder: '',
				order_id:'',
				types: 0
			}
		},
		onLoad(e) {
			console.log(e.a);
			this.order_id = e.order_id;
			this.types = e.a;
			if(this.types== 1) {
				uni.setNavigationBarTitle({
				    title: '催单'
				});
				this.tips="填写催单内容";
			}else if(this.types== 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) {
						   if(this.types == 1) {
							   this.$msg("催单成功");
						   }else if(this.types== 2) {
							    this.$msg("联系酒店成功");
						   }
						   
						   setTimeout(() => {
							  uni.navigateBack();
						   }, 500)
						 
					   }
 				   }
			   })
			}
		}
	}
</script>

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