order-dialog.vue 805 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <u-modal v-model="show" :show-cancel-button ="true" :content="getTipsText" @confirm="onConfirm" confirm-color="#ff2c3c"></u-modal>
  3. </template>
  4. <script>
  5. export default {
  6. props: {
  7. type: Number,
  8. orderId: [Number, String]
  9. },
  10. data() {
  11. return {
  12. show: false
  13. };
  14. },
  15. methods: {
  16. open() {
  17. this.show = true
  18. },
  19. close() {
  20. this.show = false
  21. },
  22. async onConfirm() {
  23. const {
  24. type,
  25. orderId
  26. } = this;
  27. let res = null;
  28. this.$emit("confirm")
  29. },
  30. },
  31. computed: {
  32. getTipsText() {
  33. const {
  34. type
  35. } = this
  36. switch (type) {
  37. case 0:
  38. return "确认取消订单吗?"
  39. case 1:
  40. return "确认删除订单吗?"
  41. case 2:
  42. return "确认收货吗?"
  43. }
  44. }
  45. }
  46. }
  47. </script>
  48. <style>
  49. </style>