refundDetail.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <view class="page">
  3. <RefundSuccessful
  4. v-if="refundDetail.goods[0].refund.status == 1"
  5. @checkMoney="checkMoney"
  6. :refundDetail="refundDetail"
  7. />
  8. <RefundInProgress
  9. v-if="refundDetail.goods[0].refund.status == 0"
  10. :refundDetail="refundDetail"
  11. />
  12. <RefusalToRefund
  13. v-if="
  14. refundDetail.goods[0].refund.status == 2 ||
  15. refundDetail.goods[0].refund.status == 3
  16. "
  17. :refundDetail="refundDetail"
  18. />
  19. <RefundInformation
  20. :goodsDetail="refundDetail.goods[0]"
  21. :refundDetail="refundDetail"
  22. />
  23. <MoneyDestination
  24. :show="show"
  25. @close="close"
  26. :refundDetail="refundDetail"
  27. />
  28. <view class="footer" v-if="refundDetail.goods[0].refund.status != 1">
  29. <button class="btn" @click="platformIntervene">
  30. {{ i18n.platformIntervention }}
  31. </button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import RefundSuccessful from "./component/refundSuccessful.vue";
  37. import RefundInProgress from "./component/refundInProgress.vue";
  38. import RefusalToRefund from "./component/refusalToRefund.vue";
  39. import RefundInformation from "./component/refundInformation.vue";
  40. import MoneyDestination from "./component/moneyDestination.vue";
  41. export default {
  42. components: {
  43. RefundInformation,
  44. MoneyDestination,
  45. RefundSuccessful,
  46. RefundInProgress,
  47. RefusalToRefund,
  48. },
  49. data() {
  50. return {
  51. show: false,
  52. status: 1,
  53. orderRefundId: "",
  54. refundDetail: {},
  55. };
  56. },
  57. onLoad(options) {
  58. console.log(options);
  59. this.orderRefundId = options.orderId;
  60. this.getDetail();
  61. },
  62. computed: {
  63. i18n() {
  64. return this.$t("index");
  65. },
  66. },
  67. methods: {
  68. checkMoney() {
  69. this.show = true;
  70. },
  71. close() {
  72. this.show = false;
  73. },
  74. //申请平台介入
  75. platformIntervene() {
  76. if (this.refundDetail.goods[0].refund.status != 3) {
  77. uni.$u.http
  78. .post(`/api/order_refund/platform_intervention`, {
  79. order_refund_id: this.refundDetail.goods[0].refund.id,
  80. })
  81. .then((res) => {
  82. uni.showToast({
  83. title: this.i18n.appliedIntervene,
  84. icon: "none",
  85. });
  86. });
  87. } else {
  88. uni.showToast({
  89. title: this.i18n.hasIntervened,
  90. icon: "none",
  91. });
  92. }
  93. },
  94. //获取售后订单详情
  95. getDetail() {
  96. uni.$u.http
  97. .post(`/api/order/refund_read`, { order_refund_id: this.orderRefundId })
  98. .then((res) => {
  99. this.refundDetail = res;
  100. console.log(this.refundDetail);
  101. });
  102. },
  103. },
  104. created() {
  105. uni.setNavigationBarTitle({
  106. title: this.i18n.refundDetails,
  107. });
  108. },
  109. };
  110. </script>
  111. <style lang="scss" scoped>
  112. .page {
  113. padding: 20rpx 24rpx;
  114. position: relative;
  115. .footer {
  116. position: fixed;
  117. bottom: 0;
  118. padding: 20rpx 24rpx 60rpx;
  119. background-color: #fff;
  120. left: 0;
  121. width: 94%;
  122. display: flex;
  123. justify-content: flex-end;
  124. .btn {
  125. margin: 0;
  126. padding: 0;
  127. background-color: #fff;
  128. border: 2rpx solid #979797;
  129. color: #222222;
  130. border-radius: 44rpx;
  131. width: 188rpx;
  132. height: 78rpx;
  133. line-height: 78rpx;
  134. font-size: 28rpx;
  135. }
  136. }
  137. }
  138. </style>