afterSalesManage.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. @openPop="openPop"
  42. />
  43. </view>
  44. </view>
  45. <AgreePop :title="title" :show="show" @close="close" @refund="refund" />
  46. <RefusePopup :show="refuseShow" @close="close" @refund="refund" />
  47. </view>
  48. </template>
  49. <script>
  50. import DetailCard from "./component/detailCard.vue";
  51. import AgreePop from "./component/agreePop.vue";
  52. import RefusePopup from "../afterSalesDetail/component/refusePopup";
  53. export default {
  54. components: {
  55. DetailCard,
  56. AgreePop,
  57. RefusePopup,
  58. },
  59. data() {
  60. return {
  61. follow: "",
  62. orderList: [],
  63. show: false,
  64. needRdfundOrder: {},
  65. refuseShow: false,
  66. page: 1,
  67. total: 0,
  68. title: "",
  69. };
  70. },
  71. methods: {
  72. tabSwitch(num) {
  73. this.follow = num;
  74. this.getOrderList();
  75. },
  76. toDetail(item) {
  77. uni.navigateTo({
  78. url: "/pageD/afterSalesDetail/afterSalesDetail?id=" + item.id,
  79. });
  80. },
  81. //获取售后订单
  82. getOrderList() {
  83. uni.$u.http
  84. .get(
  85. `/api/order/refund_order?status=${this.follow}&page=${this.page}&limit=10`
  86. )
  87. .then((res) => {
  88. this.orderList = res.data;
  89. this.total = res.total;
  90. });
  91. },
  92. //平台介入
  93. platformIntervene(item) {
  94. uni.$u.http
  95. .post(`/api/order_refund/platform_intervention`, {
  96. order_refund_id: item.id,
  97. })
  98. .then((res) => {
  99. uni.showToast({
  100. title: "已申请平台介入",
  101. icon: "none",
  102. });
  103. this.getOrderList();
  104. });
  105. },
  106. //关闭退款确认框
  107. close() {
  108. this.show = false;
  109. this.refuseShow = false;
  110. this.title = "";
  111. },
  112. //打开删除确认框
  113. openPop(value) {
  114. this.title = "是否确认删除售后记录";
  115. this.show = true;
  116. this.needDeleteGoods = value;
  117. },
  118. //确认退款 or 拒绝退款 or 删除记录
  119. refund(status, value) {
  120. if (this.title == "是否确认退款") {
  121. //处理退款
  122. uni.$u.http
  123. .post(`/api/order_refund/examine`, {
  124. status,
  125. order_refund_id: this.needRdfundOrder.id,
  126. reason: value,
  127. actual_refund_price: value,
  128. })
  129. .then((res) => {
  130. this.show = false;
  131. this.refuseShow = false;
  132. uni.showToast({
  133. title: status == 1 ? "已同意退款" : "已拒绝退款",
  134. icon: "none",
  135. });
  136. this.getOrderList();
  137. });
  138. } else {
  139. //订单删除
  140. uni.$u.http
  141. .post(`api/order/refund_order_del`, {
  142. order_refund_id: this.needDeleteGoods.id,
  143. })
  144. .then((res) => {
  145. uni.showToast({
  146. title: "商品已删除",
  147. icon: "none",
  148. });
  149. this.show = false;
  150. this.getOrderList();
  151. });
  152. }
  153. },
  154. //打开拒绝退款
  155. refuseRefund(item) {
  156. this.refuseShow = true;
  157. this.needRdfundOrder = item;
  158. this.title = "是否确认退款";
  159. },
  160. //打开同意退款确认框
  161. agreeRefund(item) {
  162. this.title = "是否确认退款";
  163. this.show = true;
  164. this.needRdfundOrder = item;
  165. },
  166. },
  167. mounted() {
  168. this.getOrderList();
  169. uni.setNavigationBarTitle({
  170. title: "售后订单",
  171. });
  172. },
  173. };
  174. </script>
  175. <style lang="scss" scoped>
  176. .top-tab {
  177. display: flex;
  178. justify-content: space-around;
  179. overflow-y: auto;
  180. padding-bottom: 10rpx;
  181. // flex-shrink: 1;
  182. // width: 100vw;
  183. background-color: #fff;
  184. .tab {
  185. margin-right: 40rpx;
  186. font-size: 26rpx;
  187. color: rgba(34, 34, 34, 0.8);
  188. flex-shrink: 0;
  189. height: 44rpx;
  190. display: flex;
  191. align-items: flex-end;
  192. }
  193. .commodity {
  194. position: relative;
  195. font-weight: 600;
  196. font-size: 32rpx;
  197. }
  198. .commodity::before {
  199. content: "";
  200. display: block;
  201. height: 8rpx;
  202. width: 100%;
  203. background: linear-gradient(to right, #f83224, #fff);
  204. position: absolute;
  205. bottom: 5rpx;
  206. opacity: 0.8;
  207. }
  208. }
  209. .center {
  210. padding: 20rpx 24rpx;
  211. }
  212. </style>