refundOrderDetail.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. <template>
  2. <view>
  3. <view class="top-cont">
  4. <!-- 背景图片 -->
  5. <image class="bg" src="../../static/images/order_top_bg.png" mode=""></image>
  6. <view class="top-inner">
  7. <!-- 这里是状态栏 -->
  8. <view class="fixed-top-box">
  9. <view class="status_bar" :style="{height: statusBarHeight}"></view>
  10. <view class="back-box" @click="back">
  11. <image src="../../static/images/back_white.png" mode=""></image>
  12. <text class="title">售后详情</text>
  13. <text></text>
  14. </view>
  15. </view>
  16. <!-- 顶部固定后站位元素 -->
  17. <view style="padding-bottom: 88upx;">
  18. <view :style="{height: statusBarHeight}"></view>
  19. </view>
  20. <!-- 订单状态 -->
  21. <view class="order-status">
  22. <!-- 处理中 -->
  23. <view v-if="sales.salesStatus == 0" class="inner">
  24. <view class="img-box">
  25. <image src="../../static/images/deal96.png" mode=""></image>
  26. </view>
  27. <view class="status-box">
  28. <text class="status">售后中</text>
  29. <text class="desc">请等待客服处理...</text>
  30. </view>
  31. </view>
  32. <view v-if="sales.salesStatus == 1" class="inner">
  33. <view class="img-box">
  34. <image src="../../static/images/close_trade.png" mode=""></image>
  35. </view>
  36. <view class="status-box">
  37. <text class="status">售后取消</text>
  38. <text class="desc">用户已取消售后</text>
  39. </view>
  40. </view>
  41. <view v-if="sales.salesStatus == 2" class="inner">
  42. <view class="img-box">
  43. <image src="../../static/images/close_trade.png" mode=""></image>
  44. </view>
  45. <view class="status-box">
  46. <text class="status">售后取消</text>
  47. <text class="desc">商家已拒绝...</text>
  48. </view>
  49. </view>
  50. <!-- 退款成功 -->
  51. <view v-if="sales.salesStatus == 3" class="inner">
  52. <view class="img-box">
  53. <image src="../../static/images/compel96.png" mode=""></image>
  54. </view>
  55. <view class="status-box">
  56. <text class="status">退款成功</text>
  57. <text class="desc">已退款,退款金额将按原支付退回</text>
  58. </view>
  59. </view>
  60. </view>
  61. <!-- 退款信息 -->
  62. <view class="refund-info">
  63. <view class="inner">
  64. <view class="title-box">
  65. <view class="left">
  66. <text class="title">退款金额</text>
  67. <view class="price-box">
  68. <text class="unit">¥</text>
  69. <text class="num"
  70. v-if="sales.refundAmount!=null">{{sales.refundAmount.toFixed(2)}}</text>
  71. </view>
  72. </view>
  73. <view class="right">
  74. <text class="text" v-if="sales.salesStatus==0">
  75. <text
  76. class="text success">{{utils.getDictLabelName("storeAfterSalesStatus",sales.status)}}</text>
  77. </text>
  78. </view>
  79. </view>
  80. <view class="refund-item" v-if="sales.status>=1&&sales.serviceType==1">
  81. <view class="text">收件人:{{sales.consignee}} </view>
  82. <view class="text">电话:{{sales.address}} </view>
  83. <view class="text">收件地址:{{sales.phoneNumber}}</view>
  84. </view>
  85. <view class="btn-box" v-if="sales.salesStatus==0">
  86. <view v-if="sales.status==1" class="btn cancel" @click="addDeliverySn()">填写物流</view>
  87. <view v-if="sales.status==0" class="btn cancel" @click="revoke()">撤销申请
  88. </view>
  89. <!-- <view class="btn cancel" @click="showLogs()" >查看进度</view> -->
  90. </view>
  91. <view class="refund-item" v-if="sales.status==0">
  92. <view class="text">已提交等待平台审核 </view>
  93. </view>
  94. <view class="refund-item" v-if="sales.status==1">
  95. <view class="text">平台已审核,等待用户发货 </view>
  96. </view>
  97. <view class="refund-item" v-if="sales.status==2">
  98. <view class="text">用户已发货,等待仓库审核 </view>
  99. </view>
  100. <view class="refund-item" v-if="sales.status==3">
  101. <view class="text">财务审核 </view>
  102. </view>
  103. <view class="refund-item" v-if="sales.status==4">
  104. <view class="text">已完成 </view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="content">
  109. <!-- 退货信息 -->
  110. <view class="return-info">
  111. <!-- <view class="title-box">
  112. <text class="label">退货信息</text>
  113. <text class="ret-num">共2件</text>
  114. </view> -->
  115. <!-- 退货列表 -->
  116. <view class="goods-list">
  117. <view v-if="sales!=null&&sales.isPackage!=1" v-for="(item,index) in items" :key="index"
  118. class="item">
  119. <view class="img-box">
  120. <image :src="JSON.parse(item.jsonInfo).image" mode="aspectFill"></image>
  121. </view>
  122. <view class="info-box">
  123. <view>
  124. <view class="title ellipsis2">{{JSON.parse(item.jsonInfo).productName}}</view>
  125. <view class="spec">规格:{{JSON.parse(item.jsonInfo).sku}}</view>
  126. </view>
  127. <view class="price-num">
  128. <view class="price">
  129. <text class="unit">¥</text>
  130. <text class="num">{{JSON.parse(item.jsonInfo).price.toFixed(2)}}</text>
  131. </view>
  132. <view class="num">x{{JSON.parse(item.jsonInfo).num}}</view>
  133. </view>
  134. </view>
  135. </view>
  136. <view v-if="sales!=null&&sales.isPackage==1" class="item">
  137. <view class="img-box">
  138. <image :src="JSON.parse(sales.packageJson).imgUrl" mode="aspectFill"></image>
  139. </view>
  140. <view class="info-box">
  141. <view>
  142. <view class="title ellipsis2">
  143. <!-- <view class="tag">处方药</view> -->
  144. <view class="tag">套餐</view>{{JSON.parse(sales.packageJson).title}}
  145. </view>
  146. <view class="spec">{{JSON.parse(sales.packageJson).descs}}</view>
  147. </view>
  148. </view>
  149. </view>
  150. <!-- 详细信息 -->
  151. <view class="refund-det-info">
  152. <view class="det-item">
  153. <text class="label">退货原因</text>
  154. <text class="text">{{sales.reasons}}</text>
  155. </view>
  156. <view class="det-item">
  157. <text class="label">退货说明</text>
  158. <text class="text">{{sales.explains}}</text>
  159. </view>
  160. <view class="det-item">
  161. <text class="label">退款金额</text>
  162. <text class="text"
  163. v-if="sales.refundAmount!=null">¥{{sales.refundAmount.toFixed(2)}}</text>
  164. </view>
  165. <view class="det-item">
  166. <text class="label">订单编号</text>
  167. <text class="text">{{order.orderCode}}</text>
  168. </view>
  169. <view class="det-item">
  170. <text class="label">申请时间</text>
  171. <!-- {{sales.createTime}} -->
  172. <text class="text">{{formattedCreateTime}} </text>
  173. </view>
  174. </view>
  175. </view>
  176. </view>
  177. </view>
  178. <!-- 按钮 -->
  179. <view class="btn-box">
  180. <button class="btn cancel contact-btn" open-type="contact">
  181. <text>售后客服</text>
  182. </button>
  183. </view>
  184. </view>
  185. </view>
  186. </view>
  187. </template>
  188. <script>
  189. import {
  190. getDicts
  191. } from '@/api/index.js'
  192. import {
  193. getStoreAfterSalesById,
  194. revoke
  195. } from '@/api/order.js'
  196. export default {
  197. data() {
  198. return {
  199. modalTitle: "请输入快递单号",
  200. sales: {},
  201. items: [],
  202. order: null,
  203. id: null,
  204. // 状态栏的高度
  205. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  206. };
  207. },
  208. onLoad(option) {
  209. console.log("option是", option)
  210. this.id = option.id
  211. this.getDicts()
  212. },
  213. onShow() {
  214. this.getStoreAfterSalesById()
  215. },
  216. computed: {
  217. formattedCreateTime() {
  218. if (!this.sales.createTime) return '';
  219. // 如果是时间戳格式
  220. if (typeof this.sales.createTime === 'number') {
  221. const date = new Date(this.sales.createTime);
  222. return this.formatDate(date);
  223. }
  224. // 如果是字符串格式,尝试解析
  225. const date = new Date(this.sales.createTime);
  226. if (!isNaN(date.getTime())) {
  227. return this.formatDate(date);
  228. }
  229. // 如果无法解析,返回原值
  230. return this.sales.createTime;
  231. },
  232. },
  233. methods: {
  234. getDicts: function() {
  235. getDicts().then(
  236. res => {
  237. if (res.code == 200) {
  238. uni.setStorageSync('dicts', JSON.stringify(res));
  239. }
  240. },
  241. rej => {}
  242. );
  243. },
  244. // 日期格式化方法
  245. formatDate(date) {
  246. const year = date.getFullYear();
  247. const month = String(date.getMonth() + 1).padStart(2, '0');
  248. const day = String(date.getDate()).padStart(2, '0');
  249. const hours = String(date.getHours()).padStart(2, '0');
  250. const minutes = String(date.getMinutes()).padStart(2, '0');
  251. const seconds = String(date.getSeconds()).padStart(2, '0');
  252. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  253. },
  254. addDeliverySn() {
  255. uni.navigateTo({
  256. url: './refundOrderDelivery?id=' + this.id
  257. })
  258. },
  259. revoke() {
  260. var data = {
  261. id: this.id
  262. };
  263. revoke(data).then(res => {
  264. if (res.code == 200) {
  265. uni.showToast({
  266. icon: 'success',
  267. title: '操作成功'
  268. });
  269. setTimeout(function() {
  270. uni.$emit('refreshAfterSales');
  271. uni.navigateBack({
  272. delta: 1
  273. })
  274. }, 500);
  275. } else {
  276. uni.showToast({
  277. icon: 'none',
  278. title: res.msg
  279. });
  280. }
  281. });
  282. },
  283. getStoreAfterSalesById() {
  284. //联网加载数据
  285. getStoreAfterSalesById(this.id).then(res => {
  286. if (res.code == 200) {
  287. //设置列表数据
  288. this.sales = res.sales;
  289. this.items = res.items;
  290. this.order = res.order;
  291. } else {
  292. uni.showToast({
  293. icon: 'none',
  294. title: res.msg
  295. });
  296. }
  297. });
  298. },
  299. // 返回上一页
  300. back() {
  301. uni.navigateBack()
  302. },
  303. }
  304. }
  305. </script>
  306. <style lang="scss">
  307. .fixed-top-box {
  308. width: 100%;
  309. background: linear-gradient(135deg, #2BC7B9 0%, #60CDC3 100%);
  310. position: fixed;
  311. top: 0;
  312. left: 0;
  313. z-index: 1000;
  314. }
  315. .top-cont {
  316. width: 100%;
  317. height: 500upx;
  318. position: relative;
  319. .bg {
  320. width: 100%;
  321. height: 100%;
  322. position: absolute;
  323. top: 0;
  324. left: 0;
  325. z-index: 1;
  326. }
  327. .top-inner {
  328. width: 100%;
  329. height: 100%;
  330. position: absolute;
  331. top: 0;
  332. left: 0;
  333. z-index: 2;
  334. .back-box {
  335. height: 88upx;
  336. padding-left: 22upx;
  337. display: flex;
  338. align-items: center;
  339. justify-content: space-between;
  340. padding: 0 20upx;
  341. image {
  342. width: 40upx;
  343. height: 40upx;
  344. }
  345. .title {
  346. font-size: 36upx;
  347. font-family: PingFang SC;
  348. font-weight: 500;
  349. color: #FFFFFF;
  350. }
  351. }
  352. .order-status {
  353. margin-top: 60upx;
  354. display: flex;
  355. align-items: center;
  356. justify-content: space-between;
  357. padding: 0 30upx;
  358. .inner {
  359. display: flex;
  360. align-items: center;
  361. .img-box {
  362. width: 96upx;
  363. height: 96upx;
  364. margin-right: 30upx;
  365. image {
  366. width: 100%;
  367. height: 100%;
  368. }
  369. }
  370. .status-box {
  371. height: 96upx;
  372. display: flex;
  373. flex-direction: column;
  374. justify-content: center;
  375. .status {
  376. font-size: 40upx;
  377. font-family: PingFang SC;
  378. font-weight: bold;
  379. color: #FFFFFF;
  380. line-height: 1;
  381. }
  382. .desc {
  383. font-size: 26upx;
  384. font-family: PingFang SC;
  385. font-weight: 500;
  386. color: #FFFFFF;
  387. line-height: 1;
  388. margin-top: 30upx;
  389. }
  390. .det-box {
  391. display: flex;
  392. align-items: center;
  393. image {
  394. width: 14upx;
  395. height: 24upx;
  396. margin-left: 12upx;
  397. margin-top: 30upx;
  398. }
  399. }
  400. }
  401. }
  402. }
  403. .refund-info {
  404. margin-top: 50upx;
  405. padding: 0 20upx;
  406. .inner {
  407. background: #FFFFFF;
  408. border-radius: 16upx;
  409. padding: 0 30upx 15upx 30upx;
  410. .title-box {
  411. height: 88upx;
  412. border-bottom: 1px solid #F0F0F0;
  413. display: flex;
  414. align-items: center;
  415. justify-content: space-between;
  416. .left {
  417. display: flex;
  418. align-items: center;
  419. .title {
  420. font-size: 30upx;
  421. font-family: PingFang SC;
  422. font-weight: bold;
  423. color: #333333;
  424. line-height: 1;
  425. margin-right: 20upx;
  426. }
  427. .price-box {
  428. display: flex;
  429. align-items: flex-end;
  430. .unit {
  431. font-size: 24upx;
  432. font-family: PingFang SC;
  433. font-weight: 500;
  434. color: #FF6633;
  435. line-height: 1.2;
  436. margin-right: 4upx;
  437. }
  438. .num {
  439. font-size: 32upx;
  440. font-family: PingFang SC;
  441. font-weight: bold;
  442. color: #FF6633;
  443. line-height: 1;
  444. }
  445. }
  446. }
  447. .right {
  448. display: flex;
  449. align-items: center;
  450. .text {
  451. font-size: 24upx;
  452. font-family: PingFang SC;
  453. font-weight: 500;
  454. color: #999999;
  455. line-height: 1;
  456. margin-right: 10upx;
  457. }
  458. image {
  459. width: 12upx;
  460. height: 22upx;
  461. }
  462. }
  463. }
  464. .refund-item {
  465. margin-top: 40upx;
  466. .text {
  467. margin-bottom: 10upx;
  468. font-size: 26upx;
  469. font-family: PingFang SC;
  470. font-weight: 500;
  471. color: #666666;
  472. line-height: 1;
  473. }
  474. }
  475. }
  476. }
  477. }
  478. }
  479. .content {
  480. padding: 0 20upx 20upx;
  481. .return-info {
  482. margin-top: 30upx;
  483. background: #FFFFFF;
  484. border-radius: 16upx;
  485. .title-box {
  486. height: 88upx;
  487. padding: 0 30upx;
  488. display: flex;
  489. align-items: center;
  490. justify-content: space-between;
  491. .label {
  492. font-size: 30upx;
  493. font-family: PingFang SC;
  494. font-weight: bold;
  495. color: #333333;
  496. }
  497. .ret-num {
  498. font-size: 26upx;
  499. font-family: PingFang SC;
  500. font-weight: 500;
  501. color: #999999;
  502. }
  503. }
  504. .goods-list {
  505. padding: 0 30upx;
  506. background-color: #FFFFFF;
  507. border-radius: 16upx;
  508. .item {
  509. padding: 30upx 0;
  510. border-bottom: 1px solid #EDEEEF;
  511. display: flex;
  512. align-items: center;
  513. .img-box {
  514. width: 160upx;
  515. height: 160upx;
  516. margin-right: 30upx;
  517. image {
  518. width: 100%;
  519. height: 100%;
  520. }
  521. }
  522. .info-box {
  523. width: calc(100% - 190upx);
  524. height: 160upx;
  525. display: flex;
  526. flex-direction: column;
  527. justify-content: space-between;
  528. .title {
  529. font-size: 28upx;
  530. font-family: PingFang SC;
  531. font-weight: 500;
  532. color: #333333;
  533. line-height: 36upx;
  534. .tag {
  535. display: inline-block;
  536. padding: 0 6upx;
  537. height: 30upx;
  538. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  539. border-radius: 4upx;
  540. margin-right: 10upx;
  541. font-size: 22upx;
  542. font-family: PingFang SC;
  543. font-weight: bold;
  544. color: #FFFFFF;
  545. line-height: 30upx;
  546. float: left;
  547. margin-top: 7upx;
  548. }
  549. }
  550. .spec {
  551. margin-top: 18upx;
  552. font-size: 24upx;
  553. font-family: PingFang SC;
  554. font-weight: 500;
  555. color: #999999;
  556. line-height: 1;
  557. }
  558. .price-num {
  559. display: flex;
  560. align-items: center;
  561. justify-content: space-between;
  562. .price {
  563. display: flex;
  564. align-items: flex-end;
  565. .unit {
  566. font-size: 24upx;
  567. font-family: PingFang SC;
  568. font-weight: 500;
  569. color: #111111;
  570. line-height: 1.2;
  571. margin-right: 4upx;
  572. }
  573. .num {
  574. font-size: 32upx;
  575. font-family: PingFang SC;
  576. font-weight: 500;
  577. color: #111111;
  578. line-height: 1;
  579. }
  580. }
  581. .num {
  582. font-size: 24upx;
  583. font-family: PingFang SC;
  584. font-weight: 500;
  585. color: #999999;
  586. line-height: 1;
  587. }
  588. }
  589. }
  590. }
  591. .refund-det-info {
  592. padding-bottom: 30upx;
  593. .det-item {
  594. margin-top: 40upx;
  595. display: flex;
  596. align-items: center;
  597. justify-content: space-between;
  598. .label {
  599. font-size: 26upx;
  600. font-family: PingFang SC;
  601. font-weight: 500;
  602. color: #666666;
  603. line-height: 1;
  604. }
  605. .text {
  606. font-size: 26upx;
  607. font-family: PingFang SC;
  608. font-weight: 500;
  609. color: #222222;
  610. line-height: 1;
  611. }
  612. }
  613. }
  614. }
  615. }
  616. }
  617. .btn-box {
  618. z-index: 999;
  619. bottom: 0;
  620. width: 100%;
  621. position: fixed;
  622. height: 120upx;
  623. box-sizing: border-box;
  624. background: #FFFFFF;
  625. padding: 0 30upx;
  626. display: flex;
  627. align-items: center;
  628. justify-content: flex-end;
  629. .btn {
  630. width: 155upx;
  631. height: 64upx;
  632. line-height: 64upx;
  633. font-size: 26upx;
  634. font-family: PingFang SC;
  635. font-weight: 500;
  636. text-align: center;
  637. border-radius: 32upx;
  638. margin-left: 15upx;
  639. &.cancel {
  640. border: 1px solid #DDDDDD;
  641. color: #666666;
  642. }
  643. &.pay {
  644. background: #2BC7B9;
  645. color: #FFFFFF;
  646. }
  647. &.contact-btn{
  648. background: transparent;
  649. border: 1px solid #DDDDDD;
  650. color: #666666;
  651. padding: 0;
  652. margin: 0 15upx 0 0;
  653. text-align: center;
  654. line-height: 64upx;
  655. }
  656. &.contact-btn::after{
  657. display: none;
  658. }
  659. }
  660. }
  661. </style>