reminder.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view style="padding: 30upx 5%;">
  3. <TextArea ref="getValue" :tips="tips" @submitValue="submitValue"/>
  4. <view class="submitRemin" @click="submitRemin">提交</view>
  5. </view>
  6. </template>
  7. <script>
  8. import TextArea from '@/component/textarea.vue'
  9. export default {
  10. components: {
  11. TextArea
  12. },
  13. data() {
  14. return{
  15. reminder: '',
  16. order_id:''
  17. }
  18. },
  19. onLoad(e) {
  20. this.order_id = e.order_id;
  21. let a = e.a;
  22. if(a == 1) {
  23. uni.setNavigationBarTitle({
  24. title: '催单'
  25. });
  26. this.tips="填写催单内容";
  27. }else if(a == 2) {
  28. uni.setNavigationBarTitle({
  29. title: '联系酒店'
  30. });
  31. this.tips="填写内容";
  32. }
  33. },
  34. methods: {
  35. submitValue(e) {
  36. this.reminder = e.detail.value;
  37. },
  38. submitRemin() {
  39. if(this.reminder == '') {
  40. this.$msg("请填写催单内容");
  41. return;
  42. }
  43. this.request({
  44. url: '/v1/order/urge',
  45. method:'post',
  46. data: {
  47. order_id: this.order_id,
  48. content: this.reminder
  49. },
  50. success:(res) => {
  51. if(res.data.code == 1000) {
  52. this.$msg("催单成功");
  53. setTimeout(() => {
  54. uni.navigateBack();
  55. }, 2000)
  56. }
  57. }
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style>
  64. .submitRemin {
  65. color: #fff;
  66. background-color: #D9332E;
  67. height: 70upx;
  68. text-align: center;
  69. line-height: 70upx;
  70. margin-top: 25upx;
  71. }
  72. </style>