refund-detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <template>
  2. <app-layout>
  3. <view v-if="is_show" class="refund-detail-box">
  4. <app-order-banner :title='refundDetail.status_text' :hint="refundDetail.hint_text"></app-order-banner>
  5. <view v-if='refundDetail.is_confirm == 1 && refundDetail.type == 2' class='express-box'>
  6. <view class='express-label t-medium'>换货物流</view>
  7. <template v-if="refundDetail.merchant_express && refundDetail.merchant_express_no">
  8. <app-order-express :pageUrl="`/pages/order/express-detail/express-detail?id=${refundDetail.order_id}&express=${refundDetail.merchant_express}&express_no=${refundDetail.merchant_express_no}&cover_pic=${refundDetail.detail[0].goods_info.pic_url}&customer_name=${refundDetail.customer_name}`" :express='refundDetail.merchant_express' :express_no='refundDetail.merchant_express_no'>
  9. </app-order-express>
  10. </template>
  11. <template v-else>
  12. <view v-if='refundDetail.send_type == 1'>
  13. 物流信息:到店自提
  14. </view>
  15. <view v-else-if='refundDetail.send_type == 2'>
  16. 物流信息:同城配送
  17. </view>
  18. <view v-else>
  19. 物流信息: 其它方式({{refundDetail.merchant_express_content}})
  20. </view>
  21. </template>
  22. </view>
  23. <view v-if='refundDetail.send_type != 1 && refundDetail.send_type != 2 && refundDetail.is_send == 1 && refundDetail.type != 3' class='express-box'>
  24. <view class='express-label'>退货物流</view>
  25. <app-order-express :pageUrl="`/pages/order/express-detail/express-detail?id=${refundDetail.order_id}&express=${refundDetail.express}&express_no=${refundDetail.express_no}&cover_pic=${refundDetail.goods_info.pic_url}&customer_name=${refundDetail.customer_name}`" :express='refundDetail.express' :express_no='refundDetail.express_no'>
  26. </app-order-express>
  27. </view>
  28. <view v-if='refundDetail.status == 2 && refundDetail.is_send == 0' class='refund-address-box dif-top'>
  29. <view class='t-extra-small-color'>收件人信息</view>
  30. <view class='dir-left-nowrap'>
  31. <view class='box-grow-1 dir-top-nowrap'>
  32. <view class='dir-left-nowrap express'>
  33. <view class='box-grow-1'>{{refundDetail.refund_name}}</view>
  34. <view class='box-grow-0'>{{refundDetail.refund_mobile}}</view>
  35. </view>
  36. <view>{{refundDetail.refund_address}}</view>
  37. </view>
  38. <view class='box-grow-0 cross-center'>
  39. <view @click='copyText' class='box-grow-0 detail-btn'>复制</view>
  40. </view>
  41. </view>
  42. <view class='t-extra-small-color t-small remark'>
  43. {{refundDetail.refund_remark}}
  44. </view>
  45. </view>
  46. <form class='form-box'>
  47. <view v-if='refundDetail.status == 2 && refundDetail.is_send == 0' class='dir-top-nowrap refund-express-box'>
  48. <view class='dir-left-nowrap'>
  49. <view class='label box-grow-0 cross-center'>快递公司:</view>
  50. <view class="select-box">
  51. <picker @change="expressListChange" :value="expressIndex" range-key="name" :range="expressList">
  52. <view>
  53. <span :class="{'select-label-active': express}" class="select-label">{{express ? expressList[expressIndex].name : '请选择'}}</span>
  54. <image class="arrow-right" src="/static/image/icon/arrow-right.png"></image>
  55. </view>
  56. </picker>
  57. </view>
  58. </view>
  59. <view class='dir-left-nowrap express_no'>
  60. <view class='label box-grow-0 cross-center'>快递单号:</view>
  61. <input placeholder-style="color:#999999;font-size:31rpx" v-model="express_no" class='box-grow-1' placeholder='请填写快递单号' />
  62. </view>
  63. </view>
  64. <view class="platform">{{refundDetail.platform}}</view>
  65. <view class='goods-box'>
  66. <app-jump-button :url="refundDetail.goods_info.page_url">
  67. <app-order-goods-info style="width:100%;" :is-last-one="false" :goods='refundDetail.goods_info'></app-order-goods-info>
  68. </app-jump-button>
  69. </view>
  70. <view class='preferential-box dir-top-nowrap'>
  71. <view class='dir-left-nowrap item cross-center'>
  72. <view class='label box-grow-0'>售后类型:</view>
  73. <view class='t-small-color box-grow-1'>{{refundDetail.refund_type_text}}</view>
  74. </view>
  75. <view v-if="refundDetail.refund_data.goods_status" class='dir-left-nowrap item cross-center'>
  76. <view class='label box-grow-0'>货物状态:</view>
  77. <view class='t-small-color box-grow-1'>{{refundDetail.refund_data.goods_status}}</view>
  78. </view>
  79. <view v-if="refundDetail.refund_data.cause" class='dir-left-nowrap item cross-center'>
  80. <view class='label box-grow-0'>{{refundDetail.type == 2 ? '换货原因' : '退款原因'}}:</view>
  81. <view class='t-small-color box-grow-1 common-text'>{{refundDetail.refund_data.cause}}</view>
  82. </view>
  83. <template v-if='refundDetail.type == 1 || refundDetail.type == 3'>
  84. <view class='dir-left-nowrap item cross-center'>
  85. <view class='label'>申请退款:</view>
  86. <view class='refund-price'>¥{{refundDetail.refund_price}}</view>
  87. </view>
  88. <view v-if="refundDetail.is_refund == 1" class='dir-left-nowrap item cross-center'>
  89. <view class='label'>实际退款:</view>
  90. <view class='refund-price'>¥{{refundDetail.reality_refund_price}}</view>
  91. </view>
  92. </template>
  93. <view class='dir-left-nowrap item cross-center'>
  94. <view class='label box-grow-0'>备注信息:</view>
  95. <view class='t-small-color box-grow-1 common-text'>{{refundDetail.remark}}</view>
  96. </view>
  97. <view v-if="refundDetail.mobile" class='dir-left-nowrap item cross-center'>
  98. <view class='label box-grow-0'>联系方式:</view>
  99. <view class='t-small-color box-grow-1 common-text'>{{refundDetail.mobile}}</view>
  100. </view>
  101. <view v-if='refundDetail.merchant_remark' class='dir-left-nowrap item cross-center'>
  102. <view class='label'>商家留言:</view>
  103. <view class='merchant-remark common-text'>{{refundDetail.merchant_remark}}</view>
  104. </view>
  105. <view v-if='refundDetail.pic_list.length > 0' class='dir-top-nowrap'>
  106. <view class='image-label'>图片凭证:</view>
  107. <view class="flex-wrap">
  108. <image @click="previewImage(index)" mode='aspectFill' class="picture" v-for="(item, index) in refundDetail.pic_list" :key="index" :src="item"></image>
  109. </view>
  110. </view>
  111. </view>
  112. <template v-if="refundDetail.status == 1 || (refundDetail.status == 2 && refundDetail.is_send == 0)">
  113. <view style="height: 120rpx; width: 100%"></view>
  114. <view class="main-center btn-box">
  115. <!--商家未进行同意或拒绝操作时 用户可主动撤销申请-->
  116. <view v-if='refundDetail.status == 2 && refundDetail.is_send == 0' @click="formSubmit" class="btn main-center cross-center">确认发货
  117. </view>
  118. <view v-if="refundDetail.status == 1" @click="cancel" class="btn main-center cross-center">
  119. 撤销申请
  120. </view>
  121. </view>
  122. </template>
  123. </form>
  124. </view>
  125. </app-layout>
  126. </template>
  127. <script>
  128. import appOrderBanner from '../../../components/page-component/app-order-banner/app-order-banner.vue';
  129. import appOrderGoodsInfo from '../../../components/page-component/app-order-goods-info/app-order-goods-info.vue';
  130. import appOrderExpress from '../../../components/page-component/app-order-express/app-order-express.vue';
  131. import order from "../order.js";
  132. export default {
  133. components: {
  134. 'app-order-banner': appOrderBanner,
  135. 'app-order-goods-info': appOrderGoodsInfo,
  136. 'app-order-express': appOrderExpress,
  137. },
  138. data() {
  139. return {
  140. id: null,
  141. refundDetail: {},
  142. expressList: [],
  143. expressIndex: 0,
  144. express: '',
  145. express_no: '',
  146. customer_name: '',
  147. index: 0,
  148. is_show: false,
  149. value: [0],
  150. }
  151. },
  152. methods: {
  153. getRefundDetail() {
  154. let self = this;
  155. self.$showLoading();
  156. self.$request({
  157. url: self.$api.order.refund_detail,
  158. data: {
  159. id: self.id
  160. }
  161. }).then(response => {
  162. self.$hideLoading();
  163. self.is_show = true;
  164. if (response.code === 0) {
  165. self.refundDetail = response.data.detail;
  166. self.expressList = response.data.express_list;
  167. }
  168. }).catch(() => {
  169. self.$hideLoading();
  170. });
  171. },
  172. async formSubmit() {
  173. let self = this;
  174. if (!this.express) {
  175. uni.showToast({
  176. title: '请选择快递公司',
  177. icon: 'none',
  178. });
  179. return;
  180. }
  181. if (!this.express_no) {
  182. uni.showToast({
  183. title: '请填写快递单号',
  184. icon: 'none',
  185. });
  186. return;
  187. }
  188. this.$subscribe(this.refundDetail.template_message_list).then(response => {
  189. self.submitAction();
  190. }).catch(res => {
  191. self.submitAction();
  192. });
  193. },
  194. submitAction() {
  195. let self = this;
  196. try {
  197. this.$showLoading({ title: '提交中' });
  198. this.$request({
  199. url: this.$api.order.refund_send,
  200. method: 'post',
  201. data: {
  202. id: this.id,
  203. express: this.express,
  204. customer_name: this.customer_name,
  205. express_no: this.express_no
  206. }
  207. }).then(response => {
  208. this.$hideLoading();
  209. if (response.code === 0) {
  210. this.getRefundDetail();
  211. } else {
  212. uni.showModal({
  213. title: '',
  214. content: response.msg,
  215. showCancel: false,
  216. });
  217. }
  218. });
  219. } catch (e) {
  220. this.$hideLoading();
  221. }
  222. },
  223. copyText() {
  224. let { refund_name, refund_mobile, refund_address } = this.refundDetail;
  225. order.copyText(`${refund_name}\xa0${refund_mobile}\xa0${refund_address}`)
  226. },
  227. // 用户撤销申请
  228. cancel() {
  229. let self = this;
  230. uni.showModal({
  231. title: '提示',
  232. content: '是否撤销申请?',
  233. success: function(res) {
  234. if (res.confirm) {
  235. uni.showLoading({ title: '撤销中' });
  236. self.$request({
  237. url: self.$api.order.cancel_refund,
  238. data: {
  239. refund_id: self.refundDetail.id
  240. },
  241. method: 'post'
  242. }).then(response => {
  243. uni.hideLoading();
  244. let { code, data, msg } = response;
  245. uni.showModal({
  246. title: '',
  247. content: msg,
  248. showCancel: false,
  249. success: function() {
  250. let pages = getCurrentPages();
  251. uni.navigateBack({
  252. delta: pages.length > 3 ? 3 : 1
  253. });
  254. }
  255. });
  256. });
  257. }
  258. }
  259. });
  260. },
  261. expressListChange(e) {
  262. this.expressIndex = e.target.value;
  263. this.express = this.expressList[this.expressIndex].name;
  264. },
  265. // 图片预览
  266. previewImage(index) {
  267. let imageList = this.refundDetail.pic_list;
  268. uni.previewImage({
  269. current: imageList[index],
  270. urls: imageList
  271. })
  272. },
  273. },
  274. onLoad(options) { this.$commonLoad.onload(options);
  275. this.id = options.id;
  276. this.getRefundDetail();
  277. }
  278. }
  279. </script>
  280. <style lang="scss" scoped>
  281. .refund-detail-box {
  282. position: absolute;
  283. width: 100%;
  284. height: 100%;
  285. .form-box {
  286. .platform {
  287. background: #fff;
  288. border-bottom: 1#{rpx} solid #e2e2e2;
  289. padding: 20#{rpx} 20#{rpx};
  290. margin-top: 20#{rpx};
  291. }
  292. .select-box {
  293. text-align: right;
  294. width: 100%;
  295. .select-label {
  296. font-size: 31#{rpx};
  297. color: #999999;
  298. }
  299. .select-label-active {
  300. color: #353535;
  301. }
  302. .arrow-right {
  303. width: 12#{rpx};
  304. height: 22#{rpx};
  305. margin-left: 16#{rpx};
  306. }
  307. }
  308. }
  309. .btn-box {
  310. position: fixed;
  311. bottom: 0;
  312. width: 100%;
  313. background: #f7f7f7;
  314. padding: 20#{rpx};
  315. .btn {
  316. border-radius: 40#{rpx};
  317. height: 80#{rpx};
  318. width: 100%;
  319. background-color: $uni-important-color-red;
  320. padding: 24#{rpx} 0;
  321. color: #ffffff;
  322. font-size: 32#{rpx};
  323. }
  324. }
  325. }
  326. .express-box {
  327. background: #fff;
  328. padding: 32#{rpx} 24#{rpx};
  329. margin-top: 20#{rpx};
  330. }
  331. .express-label {
  332. margin-bottom: 10#{rpx};
  333. color: #999999;
  334. font-size: $uni-font-size-general-one;
  335. }
  336. .goods-box {
  337. background: #fff;
  338. padding: 32#{rpx} 24#{rpx};
  339. }
  340. .preferential-box {
  341. background: #fff;
  342. padding: 32#{rpx} 24#{rpx};
  343. margin-top: 20#{rpx};
  344. .picture {
  345. width: #{160rpx};
  346. height: #{160rpx};
  347. margin-right: #{14rpx};
  348. margin-bottom: #{14rpx};
  349. }
  350. }
  351. .preferential-box {
  352. .item {
  353. margin: 12#{rpx} 15#{rpx} 12#{rpx} 0;
  354. align-items: flex-start;
  355. }
  356. .image-label {
  357. margin: 12#{rpx} 0 24#{rpx};
  358. }
  359. .common-text {
  360. word-break: break-all;
  361. }
  362. }
  363. .preferential-box .label {
  364. margin-right: 15#{rpx};
  365. }
  366. .preferential-box .merchant-remark {
  367. color: $uni-important-color-red;
  368. }
  369. .refund-address-box {
  370. background-color: #fff;
  371. padding: 32#{rpx} 24#{rpx};
  372. margin-top: 20#{rpx};
  373. }
  374. .refund-address-box .express {
  375. margin: 15#{rpx} 0 5#{rpx};
  376. }
  377. .refund-address-box .remark {
  378. margin-top: 10#{rpx};
  379. padding-top: 5#{rpx};
  380. border-top: 1#{rpx} solid $uni-weak-color-one;
  381. }
  382. .refund-express-box {
  383. background-color: #fff;
  384. padding: 32#{rpx} 24#{rpx};
  385. margin-top: 20#{rpx};
  386. }
  387. .refund-express-box .label {
  388. margin-right: 25#{rpx};
  389. }
  390. .refund-express-box .express_no {
  391. border-top: 1#{rpx} solid $uni-weak-color-one;
  392. margin-top: 15#{rpx};
  393. padding-top: 15#{rpx};
  394. }
  395. .refund-express-box .right-icon {
  396. width: 12#{rpx};
  397. height: 22#{rpx};
  398. margin-right: 25#{rpx};
  399. }
  400. .refund-price {
  401. color: $uni-important-color-red;
  402. }
  403. .detail-btn {
  404. border: 1#{px} solid #bbbbbb;
  405. border-radius: 30#{rpx};
  406. padding: 10#{rpx} 30#{rpx};
  407. margin-left: 15#{rpx};
  408. }
  409. .dialog {
  410. position: fixed;
  411. height: 100%;
  412. width: 100%;
  413. bottom: #{96rpx};
  414. left: 0;
  415. z-index: 10;
  416. background-color: rgba(0, 0, 0, .3);
  417. }
  418. .picker-list {
  419. background-color: #fff;
  420. padding-top: #{20rpx};
  421. position: fixed;
  422. bottom: 0;
  423. left: 0;
  424. width: 100%;
  425. }
  426. .picker-header {
  427. padding: 0 #{24rpx};
  428. color: #446dfd;
  429. font-size: #{32rpx};
  430. }
  431. .get {
  432. width: #{160rpx};
  433. height: #{48rpx};
  434. line-height: #{48rpx};
  435. text-align: center;
  436. border: #{1rpx} solid #446dfd;
  437. border-radius: #{24rpx};
  438. position: absolute;
  439. top: #{20rpx};
  440. right: #{24rpx};
  441. display: block;
  442. color: #446dfd;
  443. }
  444. .pick {
  445. width: 100%;
  446. height: #{440rpx}
  447. }
  448. .pick-view {
  449. line-height: #{72rpx};
  450. text-align: center;
  451. color: #446dfd;
  452. font-size: #{32rpx};
  453. }
  454. </style>