reminder.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <template>
  2. <view style="padding: 0upx 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. tips: '填写催单内容',
  16. reminder: '',
  17. order_id:''
  18. }
  19. },
  20. onLoad(e) {
  21. console.log(a);
  22. this.order_id = e.order_id;
  23. let a = e.a;
  24. if(a == 1) {
  25. uni.setNavigationBarTitle({
  26. title: '催单'
  27. });
  28. this.tips="填写催单内容";
  29. }else if(a == 2) {
  30. uni.setNavigationBarTitle({
  31. title: '联系酒店'
  32. });
  33. this.tips="填写内容";
  34. }
  35. },
  36. methods: {
  37. submitValue(e) {
  38. this.reminder = e.detail.value;
  39. },
  40. submitRemin() {
  41. if(this.reminder == '') {
  42. this.$msg("请填写催单内容");
  43. return;
  44. }
  45. this.request({
  46. url: '/v1/order/urge',
  47. method:'post',
  48. data: {
  49. order_id: this.order_id,
  50. content: this.reminder
  51. },
  52. success:(res) => {
  53. if(res.data.code == 1000) {
  54. this.$msg("催单成功");
  55. setTimeout(() => {
  56. uni.navigateBack();
  57. }, 500)
  58. }
  59. }
  60. })
  61. }
  62. }
  63. }
  64. </script>
  65. <style>
  66. .submitRemin {
  67. color: #fff;
  68. background-color: #D9332E;
  69. height: 70upx;
  70. text-align: center;
  71. line-height: 70upx;
  72. margin-top: 25upx;
  73. }
  74. </style>