afterSalesDetail.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="page">
  3. <view
  4. class="top"
  5. v-if="
  6. orderInformation.goods[0].refund.status == '0' ||
  7. orderInformation.goods[0].refund.status == '3'
  8. "
  9. >
  10. <view class="top-title"> 请处理退款申请 </view>
  11. <view class="top-detail"> 如果您同意,请点击“同意退款” </view>
  12. </view>
  13. <view
  14. class="top"
  15. v-else-if="orderInformation.goods[0].refund.status == '2'"
  16. >
  17. <view class="top-title"> 您拒绝了退款申请 </view>
  18. <view class="top-detail">
  19. 商家:{{ orderInformation.goods[0].refund.reason || "" }}
  20. </view>
  21. </view>
  22. <view class="top" v-else>
  23. <view class="top-title"> 您同意了退款申请 </view>
  24. </view>
  25. <!-- 地址信息 -->
  26. <view class="address">
  27. <view class="name-phone">
  28. <view style="margin-right: 20rpx; font-size: 32rpx">{{
  29. orderInformation.address_name
  30. }}</view>
  31. <text class="phone">{{ orderInformation.address_mobile }}</text>
  32. </view>
  33. <view class="address-detail">
  34. {{ orderInformation.full_address }}
  35. </view>
  36. </view>
  37. <CommodityDetail
  38. :orderInformation="orderInformation"
  39. v-if="orderInformation.goods"
  40. />
  41. <ApplicationInformation
  42. :orderInformation="orderInformation"
  43. v-if="orderInformation.goods"
  44. :refuseImg="refuseImg"
  45. />
  46. <RefusePopup :show="show" @refund="close" @close="close" />
  47. <AgreePopup :agreeShow="agreeShow" @close="close" title="请确认是否退款" />
  48. <view
  49. class="footer"
  50. v-if="
  51. (orderInformation.goods[0].refund.status == '0' ||
  52. orderInformation.goods[0].refund.status == '3') &&
  53. Number(orderInformation.goods[0].refund.is_send)
  54. "
  55. >
  56. <button class="btn-1" @click="refuseApplication">拒绝申请</button
  57. ><button @click="agreeShow = true" class="btn-2">同意退款</button>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import CommodityDetail from "./component/commodityDetail.vue";
  63. import ApplicationInformation from "./component/applicationInformation.vue";
  64. import RefusePopup from "./component/refusePopup.vue";
  65. import AgreePopup from "../components/agreePopup.vue";
  66. export default {
  67. components: {
  68. CommodityDetail,
  69. ApplicationInformation,
  70. RefusePopup,
  71. AgreePopup,
  72. },
  73. data() {
  74. return {
  75. show: false,
  76. agreeShow: false,
  77. orderInformation: {},
  78. orderId: "",
  79. refuseImg: [], //申请退款图片
  80. };
  81. },
  82. onLoad(options) {
  83. this.orderId = options.id;
  84. this.getOrderDetail(options.id);
  85. },
  86. methods: {
  87. refuseApplication() {
  88. this.show = true;
  89. },
  90. //关闭弹窗,确认是否退款,status有值则退款
  91. close(status, value) {
  92. this.show = false;
  93. this.agreeShow = false;
  94. if (status) {
  95. uni.$u.http
  96. .post(`/api/order_refund/examine`, {
  97. status,
  98. order_refund_id: this.orderInformation.goods[0].refund.id,
  99. reason: value,
  100. actual_refund_price: value,
  101. })
  102. .then((res) => {
  103. uni.showToast({
  104. title: status == 2 ? "已拒绝退款" : "已同意退款",
  105. icon: "none",
  106. });
  107. this.getOrderDetail(this.orderId);
  108. });
  109. }
  110. },
  111. getOrderDetail(id) {
  112. uni.$u.http
  113. .post(`/api/order/refund_read?order_refund_id=${id}`)
  114. .then((res) => {
  115. this.orderInformation = res;
  116. this.refuseImg =
  117. this.orderInformation.goods[0].refund.images.split(",");
  118. console.log(this.refuseImg);
  119. });
  120. },
  121. },
  122. };
  123. </script>
  124. <style lang="scss" scoped>
  125. .page {
  126. padding: 20rpx 24rpx;
  127. position: relative;
  128. .top {
  129. background-color: #fff;
  130. border-radius: 16rpx;
  131. padding: 28rpx 20rpx;
  132. .top-title {
  133. font-size: 36rpx;
  134. color: #333;
  135. font-weight: 600;
  136. }
  137. .top-detail {
  138. font-size: 26rpx;
  139. color: #a3a3a3;
  140. margin-top: 10rpx;
  141. }
  142. }
  143. .address {
  144. background-color: #fff;
  145. border-radius: 16rpx;
  146. padding: 34rpx 24rpx 28rpx;
  147. margin-top: 24rpx;
  148. .name-phone {
  149. display: flex;
  150. align-items: center;
  151. align-items: flex-end;
  152. .phone {
  153. font-size: 26rpx;
  154. color: #666;
  155. }
  156. }
  157. .address-detail {
  158. margin-top: 20rpx;
  159. font-size: 24rpx;
  160. color: #444;
  161. }
  162. }
  163. .footer {
  164. position: fixed;
  165. bottom: 0;
  166. left: 0;
  167. width: 100%;
  168. background-color: #fff;
  169. height: 146rpx;
  170. display: flex;
  171. justify-content: flex-end;
  172. padding: 20rpx 20rpx 0 0;
  173. .btn-1 {
  174. height: 76rpx;
  175. padding: 0;
  176. margin: 0;
  177. font-size: 28rpx;
  178. color: #f83224;
  179. min-width: 188rpx;
  180. background-color: #fff;
  181. border-radius: 38rpx;
  182. border: 2rpx solid #f83224;
  183. margin-right: 20rpx;
  184. }
  185. .btn-2 {
  186. height: 76rpx;
  187. padding: 0;
  188. margin: 0;
  189. font-size: 28rpx;
  190. color: #fff;
  191. min-width: 188rpx;
  192. background-color: #f83224;
  193. border-radius: 38rpx;
  194. margin-right: 20rpx;
  195. }
  196. }
  197. }
  198. </style>