reminder.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view style="padding: 0upx 5%;">
  3. <TextArea ref="getValue" :tips="tips" @submitValue="submitValue"/>
  4. <button class="submitRemin" @click="submitRemin" :loading="Loading" :disabled="Loading">提交</button>
  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. Loading:false,
  20. }
  21. },
  22. onLoad(e) {
  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.Loading=true;
  47. this.request({
  48. url: '/v1/order/urge',
  49. method:'post',
  50. data: {
  51. order_id: this.order_id,
  52. content: this.reminder
  53. },
  54. success:(res) => {
  55. this.Loading=false;
  56. if(res.data.code == 1000) {
  57. if(this.types == 1) {
  58. this.$msg("催单成功");
  59. }else if(this.types== 2) {
  60. this.$msg("联系酒店成功");
  61. }
  62. setTimeout(() => {
  63. uni.navigateBack();
  64. }, 500)
  65. }
  66. },
  67. complete:()=>{
  68. this.Loading=false;
  69. }
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style>
  76. .submitRemin {
  77. color: #fff !important;
  78. background-color: #D9332E !important;
  79. height: 70upx;
  80. text-align: center;
  81. line-height: 70upx;
  82. margin-top: 25upx;
  83. width: 100%;
  84. }
  85. </style>