afterSalesManage.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view>
  3. <view class="top-tab">
  4. <view
  5. :class="{ commodity: follow == '' }"
  6. class="tab"
  7. @click="tabSwitch('')"
  8. >
  9. 全部
  10. </view>
  11. <view
  12. :class="{ commodity: follow == '0' }"
  13. class="tab"
  14. @click="tabSwitch('0')"
  15. >
  16. 待退款
  17. </view>
  18. <view
  19. :class="{ commodity: follow == 3 }"
  20. class="tab"
  21. @click="tabSwitch(3)"
  22. >
  23. 平台介入
  24. </view>
  25. <view
  26. :class="{ commodity: follow == 1 }"
  27. class="tab"
  28. @click="tabSwitch(1)"
  29. >
  30. 已退款
  31. </view>
  32. </view>
  33. <view class="center">
  34. <view v-for="item in orderList" :key="item.id">
  35. <DetailCard
  36. :itemInfo="item"
  37. @toDetail="toDetail"
  38. @agreeRefund="agreeRefund"
  39. @refuseRefund="refuseRefund"
  40. @platformIntervene="platformIntervene"
  41. />
  42. </view>
  43. </view>
  44. <AgreePop :show="show" @close="close" @refund="refund" />
  45. <RefusePopup :show="refuseShow" @close="close" @refund="refund" />
  46. </view>
  47. </template>
  48. <script>
  49. import DetailCard from "./component/detailCard.vue";
  50. import AgreePop from "./component/agreePop.vue";
  51. import RefusePopup from "../afterSalesDetail/component/refusePopup";
  52. export default {
  53. components: {
  54. DetailCard,
  55. AgreePop,
  56. RefusePopup,
  57. },
  58. data() {
  59. return {
  60. follow: "",
  61. orderList: [],
  62. show: false,
  63. needRdfundOrder: {},
  64. refuseShow: false,
  65. page: 1,
  66. total: 0,
  67. };
  68. },
  69. methods: {
  70. tabSwitch(num) {
  71. this.follow = num;
  72. this.getOrderList();
  73. },
  74. toDetail(item) {
  75. uni.navigateTo({
  76. url: "/pageD/afterSalesDetail/afterSalesDetail?id=" + item.id,
  77. });
  78. },
  79. //获取售后订单
  80. getOrderList() {
  81. uni.$u.http
  82. .get(
  83. `/api/order/refund_order?status=${this.follow}&page=${this.page}&limit=10`
  84. )
  85. .then((res) => {
  86. this.orderList = res.data;
  87. this.total = res.total;
  88. });
  89. },
  90. //平台介入
  91. platformIntervene(item) {
  92. uni.$u.http
  93. .post(`/api/order_refund/platform_intervention`, {
  94. order_refund_id: item.id,
  95. })
  96. .then((res) => {
  97. uni.showToast({
  98. title: "已申请平台介入",
  99. icon: "none",
  100. });
  101. this.getOrderList();
  102. });
  103. },
  104. //关闭退款确认框
  105. close() {
  106. this.show = false;
  107. this.refuseShow = false;
  108. },
  109. //确认退款 or 拒绝退款
  110. refund(status, value) {
  111. uni.$u.http
  112. .post(`/api/order_refund/examine`, {
  113. status,
  114. order_refund_id: this.needRdfundOrder.id,
  115. reason: value,
  116. })
  117. .then((res) => {
  118. this.show = false;
  119. this.refuseShow = false;
  120. uni.showToast({
  121. title: status == 1 ? "已同意退款" : "已拒绝退款",
  122. icon: "none",
  123. });
  124. this.getOrderList();
  125. });
  126. },
  127. refuseRefund(item) {
  128. this.refuseShow = true;
  129. this.needRdfundOrder = item;
  130. },
  131. //打开同意退款确认框
  132. agreeRefund(item) {
  133. this.show = true;
  134. this.needRdfundOrder = item;
  135. },
  136. },
  137. mounted() {
  138. this.getOrderList();
  139. uni.setNavigationBarTitle({
  140. title: "售后订单",
  141. });
  142. },
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. .top-tab {
  147. display: flex;
  148. justify-content: space-around;
  149. overflow-y: auto;
  150. padding-bottom: 10rpx;
  151. // flex-shrink: 1;
  152. // width: 100vw;
  153. background-color: #fff;
  154. .tab {
  155. margin-right: 40rpx;
  156. font-size: 26rpx;
  157. color: rgba(34, 34, 34, 0.8);
  158. flex-shrink: 0;
  159. height: 44rpx;
  160. display: flex;
  161. align-items: flex-end;
  162. }
  163. .commodity {
  164. position: relative;
  165. font-weight: 600;
  166. font-size: 32rpx;
  167. }
  168. .commodity::before {
  169. content: "";
  170. display: block;
  171. height: 8rpx;
  172. width: 100%;
  173. background: linear-gradient(to right, #f83224, #fff);
  174. position: absolute;
  175. bottom: 5rpx;
  176. opacity: 0.8;
  177. }
  178. }
  179. .center {
  180. padding: 20rpx 24rpx;
  181. }
  182. </style>