detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <template>
  2. <view class="refund-detail" :style="viewColor">
  3. <view class="head">
  4. <block v-if="type == -1">
  5. <view class="txt">退款失败</view>
  6. <view class="time">申请时间:{{detail.status_time}}</view>
  7. </block>
  8. <block v-if="type == 0">
  9. <view class="txt">审核中</view>
  10. <view class="time">申请时间:{{detail.status_time}}</view>
  11. </block>
  12. <block v-if="type == 1">
  13. <view class="txt">请退货并填写物流信息</view>
  14. <view class="time">申请时间:{{detail.status_time}}</view>
  15. </block>
  16. <block v-if="type == 2">
  17. <view class="txt">请等待商家收货并退款</view>
  18. <view class="time">还剩:
  19. <countDown :is-day="true" :tip-text="' '" :day-text="'天'" :hour-text="':'" :minute-text="':'" :second-text="' '"
  20. :datatime="datatime"></countDown>
  21. </view>
  22. </block>
  23. <block v-if="type == 3">
  24. <view class="txt">退款成功,金额 ¥{{detail.refund_price}}</view>
  25. <view class="time">申请时间:{{detail.status_time}}</view>
  26. </block>
  27. <block v-if="type == -2">
  28. <view class="txt">已取消退货申请</view>
  29. <view class="time">申请时间:{{detail.status_time}}</view>
  30. </block>
  31. </view>
  32. <!-- 拒绝 -->
  33. <view class="box" v-if="type == -1">
  34. <view class="txt">拒绝退款原因</view>
  35. <view class="des">{{detail.fail_message}}</view>
  36. </view>
  37. <!-- 待退货 -->
  38. <view class="info-box" v-if="type == 1">
  39. <view class="title">商家已同意您的退货申请,请尽早退货</view>
  40. <view class="store-info">
  41. <view class="text">收货人姓名:<text class="info">{{detail.mer_delivery_user}}</text></view>
  42. <view class="text">收货人联系方式:<text class="info">{{detail.phone}}</text></view>
  43. <view class="text">收货人地址:<text class="des">{{detail.mer_delivery_address}}</text></view>
  44. <view class="red-txt">
  45. <text class="iconfont icon-zhuyi-copy"></text>请按以上收货信息将商品退回
  46. </view>
  47. </view>
  48. </view>
  49. <!-- 待收货 -->
  50. <view class="info-box" v-if="type == 2">
  51. <view class="title">商家收货并验货无误,将操作退款给您</view>
  52. <view class="store-info">
  53. <view class="text">收货人姓名:<text class="info">{{detail.mer_delivery_user}}</text></view>
  54. <view class="text">收货人联系方式:<text class="info">{{detail.phone}}</text></view>
  55. <view class="text">收货人地址:<text class="des">{{detail.mer_delivery_address}}</text></view>
  56. </view>
  57. </view>
  58. <view class="info-box">
  59. <view class="title">退款信息</view>
  60. <view class="product-box">
  61. <view class="product-item" v-for="(item,index) in detail.refundProduct" :key="index">
  62. <image class="img-box" :src="item.product.cart_info.productAttr.image" mode="" v-if="item.product.cart_info.productAttr.image"></image>
  63. <image class="img-box" :src="item.product.cart_info.product.image" mode="" v-else></image>
  64. <view class="msg">
  65. <view class="name line1"><text v-if="item.product.cart_info.product_type === 2" class="event_name event_bg">预售</text>{{item.product.cart_info.product.store_name}}</view>
  66. <view class="des">{{item.product.cart_info.productAttr.sku}}</view>
  67. <view class="price">¥{{item.product.product_type == 3 ? item.product.cart_info.productAssistAttr.assist_price : item.product.product_type == 4 ? item.product.cart_info.activeSku.active_price : item.product.cart_info.productAttr.price}}</view>
  68. <view class="num">x {{item.refund_num}}</view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="content">
  74. <view class="item">
  75. <view class="label">订单编号:</view>
  76. <view class="txt flex">
  77. <text>{{detail.refund_order_sn}}</text>
  78. <!-- #ifdef H5 -->
  79. <text class='copy copy-data' :data-clipboard-text="detail.refund_order_sn">复制</text>
  80. <!-- #endif -->
  81. <!-- #ifdef MP -->
  82. <text class='copy' @tap='copy'>复制</text>
  83. <!-- #endif -->
  84. </view>
  85. </view>
  86. <view class="item">
  87. <view class="label">退款金额:</view>
  88. <view class="txt flex">
  89. <text>¥ {{detail.refund_price}}</text>
  90. </view>
  91. </view>
  92. <view class="item">
  93. <view class="label">申请件数:</view>
  94. <view class="txt flex">
  95. <text>{{detail.refund_num}}</text>
  96. </view>
  97. </view>
  98. <view class="item">
  99. <view class="label">申请时间:</view>
  100. <view class="txt flex">
  101. <text>{{detail.create_time}}</text>
  102. </view>
  103. </view>
  104. <view class="item">
  105. <view class="label">备注说明:</view>
  106. <view class="txt flex">
  107. <text>{{detail.mark ? detail.mark : ""}}</text>
  108. </view>
  109. </view>
  110. <view class="item" style="display: block;">
  111. <view class="label">退款凭证:</view>
  112. <view class="upload-img">
  113. <view class="img-item" v-for="(item,index) in detail.pics" :key="index">
  114. <image :src="item" mode="" @click="loookImg(item,index)"></image>
  115. </view>
  116. </view>
  117. </view>
  118. <view class="btn-wrapper">
  119. <block v-if="type==-1">
  120. <view class="btn" @click="applyAgain(detail)">再次申请</view>
  121. </block>
  122. <block v-else-if="type==1">
  123. <view class="btn gray" @click="cancelSales">取消售后</view>
  124. <view class="btn" @click="goPage">退回商品</view>
  125. </block>
  126. <block v-else-if="type==2">
  127. <view class="btn" @click="go">查看物流</view>
  128. </block>
  129. <block v-else-if="type==0">
  130. <view class="btn gray" @click="cancelSales">取消售后</view>
  131. </block>
  132. <block v-if="detail.merchant">
  133. <view v-if="detail.merchant.services_type==0" class="btn" @click="goService">联系商家</view>
  134. <view v-else-if="detail.merchant.services_type==1" class="btn" @click="call(1)">联系商家</view>
  135. <view v-else class="btn" @click="call(0)">联系商家</view>
  136. </block>
  137. </view>
  138. </view>
  139. </view>
  140. </template>
  141. <script>
  142. // +----------------------------------------------------------------------
  143. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  144. // +----------------------------------------------------------------------
  145. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  146. // +----------------------------------------------------------------------
  147. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  148. // +----------------------------------------------------------------------
  149. // | Author: CRMEB Team <admin@crmeb.com>
  150. // +----------------------------------------------------------------------
  151. import { refundDetail, refundCancelApi } from '@/api/order.js'
  152. import ClipboardJS from "@/plugin/clipboard/clipboard.js";
  153. import countDown from '@/components/countDown'
  154. import { mapGetters } from "vuex";
  155. export default{
  156. components: {
  157. countDown,
  158. },
  159. computed:{
  160. ...mapGetters(['viewColor']),
  161. },
  162. data(){
  163. return{
  164. type:0,
  165. refund_order_id:0,
  166. detail:'',
  167. datatime: 0
  168. }
  169. },
  170. onLoad(options) {
  171. uni.setNavigationBarTitle({
  172.   title:'退款详情'
  173. })
  174. this.refund_order_id = options.id
  175. this.getDetail()
  176. },
  177. onReady: function() {
  178. // #ifdef H5
  179. this.$nextTick(function() {
  180. const clipboard = new ClipboardJS(".copy-data");
  181. clipboard.on("success", () => {
  182. this.$util.Tips({
  183. title: '复制成功'
  184. });
  185. });
  186. });
  187. // #endif
  188. },
  189. methods:{
  190. //联系客服拨打电话
  191. call: function(service){
  192. let that = this;
  193. if(service){
  194. uni.showModal({
  195. title: '提示',
  196. content: '暂无在线客服,确定拨打客服电话:'+that.detail.merchant.service_phone+'吗?',
  197. success: function(res) {
  198. if (res.confirm) {
  199. uni.makePhoneCall({
  200. phoneNumber: that.detail.merchant.service_phone,
  201. });
  202. }
  203. }
  204. })
  205. }else{
  206. return that.$util.Tips({
  207. title: '暂无可用客服'
  208. })
  209. }
  210. },
  211. //查看大图
  212. loookImg(item,index){
  213. uni.previewImage({
  214. urls: this.detail.pics,
  215. current: this.detail.pics[index]
  216. });
  217. },
  218. getDetail(){
  219. refundDetail(this.refund_order_id).then(res=>{
  220. // status 0审核中 1待发货 2待收货 3已退款 -1已拒绝
  221. this.type = res.data.status
  222. this.detail = res.data
  223. this.datatime = res.data.auto_refund_time;
  224. })
  225. },
  226. goPage(){
  227. uni.navigateTo({
  228. url:'/pages/users/refund/goods/index?id='+this.detail.refund_order_id
  229. })
  230. },
  231. applyAgain(item){
  232. uni.navigateTo({
  233. url:`/pages/order_details/index?order_id=${item.refundProduct[0].product.order_id}`
  234. })
  235. },
  236. go(){
  237. uni.navigateTo({
  238. url:`/pages/users/refund/logistics?orderId=${this.detail.refund_order_id}`
  239. })
  240. },
  241. /**
  242. *
  243. * 剪切订单号
  244. */
  245. // #ifndef H5
  246. copy: function() {
  247. let that = this;
  248. uni.setClipboardData({
  249. data: this.detail.refund_order_sn
  250. });
  251. },
  252. // #endif
  253. // 客服
  254. goService(){
  255. uni.navigateTo({
  256. url:`/pages/chat/customer_list/chat?mer_id=${this.detail.mer_id}&uid=${this.detail.uid}&refund_order_id=${this.detail.refund_order_id}`
  257. })
  258. },
  259. // 取消售后
  260. cancelSales(){
  261. let that = this;
  262. uni.showModal({
  263. content: '确定要取消售后?',
  264. success: function(res) {
  265. if(res.confirm) {
  266. refundCancelApi(that.detail.refund_order_id).then(res => {
  267. if (res.status === 200) {
  268. that.$util.Tips({
  269. title: res.message
  270. });
  271. that.getDetail();
  272. }
  273. })
  274. } else if(res.cancel) {
  275. console.log('用户点击取消');
  276. }
  277. }
  278. });
  279. },
  280. }
  281. }
  282. </script>
  283. <style lang="scss">
  284. .refund-detail{
  285. .head{
  286. display: flex;
  287. flex-direction: column;
  288. justify-content: center;
  289. height: 150rpx;
  290. padding: 0 30rpx;
  291. color: #fff;
  292. background-color: #666666;
  293. font-size: 30rpx;
  294. .txt{
  295. font-weight: bold;
  296. }
  297. .time{
  298. margin-top: 10rpx;
  299. font-size: 24rpx;
  300. opacity: .8;
  301. .time{
  302. display: inline-block;
  303. width: 600rpx;
  304. /deep/ .red{
  305. color: #fff;
  306. }
  307. }
  308. }
  309. }
  310. .info-box{
  311. margin-top: 12rpx;
  312. background-color: #fff;
  313. .title{
  314. padding: 0 32rpx;
  315. line-height: 86rpx;
  316. border-bottom: 1px solid #F0F0F0;
  317. color: #282828;
  318. }
  319. .product-box{
  320. .product-item{
  321. display: flex;
  322. padding: 25rpx 30rpx;
  323. .img-box{
  324. width:130rpx;
  325. height:130rpx;
  326. border-radius:16rpx;
  327. }
  328. .msg{
  329. position: relative;
  330. display: flex;
  331. flex-direction: column;
  332. justify-content: space-between;
  333. width: 440rpx;
  334. margin-left: 26rpx;
  335. .name{
  336. font-size: 28rpx;
  337. color: #282828;
  338. }
  339. .des{
  340. font-size: 20rpx;
  341. color: #868686;
  342. }
  343. .price{
  344. font-size: 26rpx;
  345. color: var(--view-priceColor);
  346. }
  347. .num{
  348. position: absolute;
  349. right: -80rpx;
  350. top: 4rpx;
  351. color: #868686;
  352. font-size: 26rpx;
  353. }
  354. }
  355. }
  356. .event_name{
  357. display: inline-block;
  358. margin-right: 9rpx;
  359. color: #fff;
  360. font-size: 20rpx;
  361. padding: 0 8rpx;
  362. line-height: 30rpx;
  363. text-align: center;
  364. border-radius: 6rpx;
  365. }
  366. }
  367. .event_bg{
  368. background: #FF7F00;
  369. }
  370. .store-info{
  371. padding: 30rpx;
  372. .des{
  373. margin-top: 10rpx;
  374. font-size: 26rpx;
  375. color: #868686;
  376. }
  377. .red-txt{
  378. display: flex;
  379. align-items: center;
  380. margin-top: 10rpx;
  381. color: $theme-color;
  382. font-size: 24rpx;
  383. .iconfont{
  384. font-size: 30rpx;
  385. margin-right: 5rpx;
  386. margin-top: 6rpx;
  387. }
  388. }
  389. }
  390. }
  391. .content{
  392. margin-top: 12rpx;
  393. padding: 30rpx 30rpx 0;
  394. background-color: #FFFFFF;
  395. .item{
  396. display: flex;
  397. justify-content: space-between;
  398. margin-bottom: 30rpx;
  399. .txt{
  400. justify-content: flex-end;
  401. align-items: center;
  402. width: 450rpx;
  403. color: #868686;
  404. text-align: right;
  405. .copy{
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. width:80rpx;
  410. height:34rpx;
  411. margin-left: 20rpx;
  412. border:1px solid #666666;
  413. border-radius:17rpx;
  414. font-size: 20rpx;
  415. color: #333;
  416. }
  417. }
  418. &:last-child{
  419. margin-bottom: 0;
  420. }
  421. .upload-img{
  422. display: flex;
  423. flex-wrap: wrap;
  424. margin-top: 20rpx;
  425. .img-item{
  426. position: relative;
  427. width: 156rpx;
  428. height: 156rpx;
  429. margin-right: 23rpx;
  430. margin-top: 20rpx;
  431. &:nth-child(4n){
  432. margin-right: 0;
  433. }
  434. image{
  435. width: 156rpx;
  436. height: 156rpx;
  437. border-radius: 8rpx;
  438. }
  439. }
  440. }
  441. }
  442. .btn-wrapper{
  443. position: relative;
  444. display: flex;
  445. justify-content: flex-end;
  446. align-items: center;
  447. height: 100rpx;
  448. button{
  449. font-size: 28rpx;
  450. }
  451. .btn{
  452. width:176rpx;
  453. height:60rpx;
  454. display: flex;
  455. align-items: center;
  456. justify-content: center;
  457. margin-left: 20rpx;
  458. background: var(--view-theme);
  459. border-radius:30rpx;
  460. color: #fff;
  461. }
  462. .gray{
  463. background: transparent;
  464. border: 1px solid #eee;
  465. color: #AAAAAA;
  466. }
  467. &:after{
  468. content:' ';
  469. position: absolute;
  470. top: 0;
  471. left: 50%;
  472. width: 690rpx;
  473. height:1px;
  474. margin-left: -345rpx;
  475. background-color: #f0f0f0;
  476. }
  477. }
  478. }
  479. .box{
  480. margin-top: 12rpx;
  481. padding:25rpx 30rpx;
  482. background-color: #fff;
  483. font-size: 30rpx;
  484. color: #282828;
  485. .des{
  486. margin-top: 5rpx;
  487. font-size: 26rpx;
  488. color: #868686;
  489. }
  490. }
  491. }
  492. /deep/.styleAll{
  493. color: #fff;
  494. }
  495. </style>