refund_detail.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. <template>
  2. <view class="audit">
  3. <view class="refund_num" v-if="refundInfo.length > 0">退货次数:{{ refundInfo.length }}次</view>
  4. <view class="audit_con" v-for="item in refundInfo" :key="item.id">
  5. <view class="goods_info">
  6. <view class="title">退货信息</view>
  7. <view v-for="temp in item.goods" :key="temp.id" class="goods_con">
  8. <view class="flexS">
  9. <image :src="temp.img" class="goods_img"></image>
  10. <view>
  11. <text class="goods_name">{{ temp.name }}</text>
  12. <view class="one_year" style="width: 200rpx;">3条装</view>
  13. </view>
  14. </view>
  15. <view class="goods_size">
  16. <view class="size_box flexB" v-for="sku in temp.sku" :key="sku.id">
  17. <text>{{ sku.type }}</text>
  18. <text>{{ sku.size }}</text>
  19. <text>{{ sku.price }}</text>
  20. <text>X{{ sku.num }}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="flexE" style="margin-top:20rpx;">
  25. <text class="gray" v-if="item.goods">共{{ item.goods | totalNum }}件</text>
  26. <text class="gray">合计:</text>
  27. <text class="total">
  28. <text>¥</text>
  29. <text class="price" v-if="item.goods">{{ item.goods | totalPrice }}</text>
  30. </text>
  31. </view>
  32. </view>
  33. <view class="audit_order">
  34. <view class="order_top">
  35. <view class="label flexS">
  36. <view>
  37. <text>订单号:</text>
  38. <text style="font-size:24rpx;">{{ item.order_no }}</text>
  39. </view>
  40. <view class="copy_new_btn" @click="copy(item.order_no)">复制</view>
  41. </view>
  42. <view class="label flexS">
  43. <view>
  44. <text>退货单号:</text>
  45. <text style="font-size:24rpx;">{{ item.refund_no }}</text>
  46. </view>
  47. <view class="copy_new_btn" @click="copy(item.refund_no)">复制</view>
  48. </view>
  49. <view class="label">
  50. <text>退货状态:</text>
  51. <text style="color:#f00;">{{ item.status | getStatus }}</text>
  52. </view>
  53. <view class="label">
  54. <text>申请时间:</text>
  55. <text>{{ item.created_at }}</text>
  56. </view>
  57. <view class="label">
  58. <text>退货原因:</text>
  59. <text>{{ item.reason }}</text>
  60. </view>
  61. </view>
  62. <view class="order_bottom" v-if="item.reason_all">
  63. <view class="label">
  64. <text>补充说明:</text>
  65. <text style="color:#F76454">{{ item.reason_all }}</text>
  66. </view>
  67. <view class="img_box flexS" v-if="item.img">
  68. <view v-for="(curImg, index) in item.img" :key="index">
  69. <image :src="curImg" @click="previewImg(curImg,item.img)"></image>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="sub_btn" @click="cancelApply(item.id)" v-if="item.status == 0 && item.op_type == 2">取消退货</view>
  75. </view>
  76. <view class="noData" v-if="refundInfo.length == 0">
  77. <image src="../../static/imgs/default/no_order.png" mode=""></image>
  78. <view>--暂无数据--</view>
  79. </view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. handleClipboard
  85. } from '../../common/util/utils.js';
  86. import {
  87. getRefund,
  88. cancelRefund
  89. } from '../../apis/shop.js';
  90. export default {
  91. data() {
  92. return {
  93. refundInfo: [], //退货详情
  94. imgs: [],
  95. order_no: ''
  96. };
  97. },
  98. onLoad(ops) {
  99. this.order_no = ops.order_no;
  100. this.getDetail(ops.order_no);
  101. },
  102. filters: {
  103. getStatus(val) {
  104. switch (val) {
  105. case 0:
  106. return '审核中';
  107. break;
  108. case 1:
  109. return '已同意';
  110. break;
  111. case 2:
  112. return '已驳回';
  113. break;
  114. case 3:
  115. return '已完成';
  116. break;
  117. default:
  118. return '暂无';
  119. }
  120. }
  121. },
  122. methods: {
  123. //点击预览图片
  124. previewImg(img, imgs) {
  125. uni.previewImage({
  126. urls: imgs,
  127. current: img
  128. })
  129. },
  130. //取消退货申请
  131. cancelApply(refund_id) {
  132. uni.showModal({
  133. content: '你确定要取消此次退货吗?',
  134. success: res => {
  135. if (res.confirm) {
  136. cancelRefund({
  137. refund_id
  138. }).then(res => {
  139. if (res.code == 200) {
  140. this.getDetail(this.order_no);
  141. uni.showToast({
  142. title: '取消退货成功'
  143. });
  144. } else {
  145. uni.showModal({
  146. content: res.data || '取消失败',
  147. showCancel: false
  148. });
  149. }
  150. });
  151. }
  152. }
  153. });
  154. },
  155. /*获取退货订单详情*/
  156. getDetail(order_no) {
  157. getRefund({
  158. order_no
  159. }).then(res => {
  160. if (res.code == 200) {
  161. let refund = res.data;
  162. refund.map(i => {
  163. i.img = i.img ? JSON.parse(i.img) : "";
  164. })
  165. this.refundInfo = refund;
  166. } else {
  167. uni.showModal({
  168. content: res.data || '获取详情失败',
  169. showCancel: false
  170. });
  171. }
  172. });
  173. },
  174. /*复制订单号*/
  175. copy(data) {
  176. uni.setClipboardData({
  177. data,
  178. success: res => {
  179. uni.showToast({
  180. title: '复制成功'
  181. });
  182. },
  183. fail() {
  184. uni.showToast({
  185. title: '复制失败',
  186. icon: 'none',
  187. });
  188. }
  189. })
  190. },
  191. }
  192. };
  193. </script>
  194. <style>
  195. page {
  196. min-height: 100%;
  197. width: 100%;
  198. background: #f7f7f7;
  199. }
  200. </style>
  201. <style lang="scss" scoped>
  202. .audit {
  203. padding-bottom: 150rpx;
  204. .refund_num {
  205. width: 690rpx;
  206. background: #fff;
  207. margin: 30rpx auto;
  208. border-radius: 8rpx;
  209. padding: 15rpx;
  210. font-size: 32rpx;
  211. font-weight: bold;
  212. box-sizing: border-box;
  213. }
  214. .audit_con {
  215. width: 690rpx;
  216. margin: 0 auto 30rpx;
  217. background: #fff;
  218. border-radius: 24rpx;
  219. padding-bottom: 30rpx;
  220. .sub_btn {
  221. margin: 20rpx auto;
  222. }
  223. .audit_money {
  224. padding: 10rpx 30rpx;
  225. }
  226. .refund {
  227. height: 110rpx;
  228. }
  229. .goods_info {
  230. padding: 30rpx 30rpx;
  231. .title {
  232. font-size: 32rpx;
  233. font-weight: bold;
  234. padding: 0 0 20rpx 0;
  235. }
  236. .goods_con {
  237. padding-bottom: 20rpx;
  238. .goods_img {
  239. width: 180rpx;
  240. height: 144rpx;
  241. border-radius: 8rpx;
  242. margin-right: 20rpx;
  243. }
  244. .goods_name {
  245. font-size: 32rpx;
  246. font-weight: bold;
  247. }
  248. }
  249. .size_box {
  250. width: 100%;
  251. background: #f9f9f9;
  252. // padding: 15rpx;
  253. padding: 15rpx 0;
  254. margin-top: 15rpx;
  255. border-radius: 8rpx;
  256. text {
  257. width: 20%;
  258. text-align: center;
  259. }
  260. }
  261. }
  262. .label {
  263. padding: 10rpx 0;
  264. text:first-child {
  265. font-size: 30rpx;
  266. color: #999;
  267. }
  268. text:last-child {
  269. font-size: 28rpx;
  270. color: #333;
  271. }
  272. }
  273. .audit_order {
  274. padding: 10rpx 30rpx;
  275. margin-bottom: 15rpx;
  276. .order_bottom {
  277. border-top: 2rpx solid #eeeeee;
  278. .img_box {
  279. image {
  280. width: 140rpx;
  281. height: 140rpx;
  282. border-radius: 8rpx;
  283. margin-right: 10rpx;
  284. }
  285. }
  286. }
  287. }
  288. .reject_box {
  289. padding: 15rpx 30rpx;
  290. }
  291. }
  292. }
  293. </style>