reminder.vue 1.6 KB

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