reminder.vue 1.4 KB

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