refundOrderDetail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698
  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. </view>
  179. </view>
  180. </view>
  181. </template>
  182. <script>
  183. import {
  184. getStoreAfterSalesById,
  185. revoke
  186. } from '@/api/order.js'
  187. export default {
  188. data() {
  189. return {
  190. modalTitle: "请输入快递单号",
  191. sales: {},
  192. items: [],
  193. order: null,
  194. id: null,
  195. // 状态栏的高度
  196. statusBarHeight: uni.getStorageSync('menuInfo').statusBarHeight,
  197. };
  198. },
  199. onLoad(option) {
  200. console.log("option是", option)
  201. this.id = option.id
  202. },
  203. onShow() {
  204. this.getStoreAfterSalesById()
  205. },
  206. computed: {
  207. formattedCreateTime() {
  208. if (!this.sales.createTime) return '';
  209. // 如果是时间戳格式
  210. if (typeof this.sales.createTime === 'number') {
  211. const date = new Date(this.sales.createTime);
  212. return this.formatDate(date);
  213. }
  214. // 如果是字符串格式,尝试解析
  215. const date = new Date(this.sales.createTime);
  216. if (!isNaN(date.getTime())) {
  217. return this.formatDate(date);
  218. }
  219. // 如果无法解析,返回原值
  220. return this.sales.createTime;
  221. },
  222. },
  223. methods: { // 日期格式化方法
  224. formatDate(date) {
  225. const year = date.getFullYear();
  226. const month = String(date.getMonth() + 1).padStart(2, '0');
  227. const day = String(date.getDate()).padStart(2, '0');
  228. const hours = String(date.getHours()).padStart(2, '0');
  229. const minutes = String(date.getMinutes()).padStart(2, '0');
  230. const seconds = String(date.getSeconds()).padStart(2, '0');
  231. return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
  232. },
  233. addDeliverySn() {
  234. uni.navigateTo({
  235. url: './refundOrderDelivery?id=' + this.id
  236. })
  237. },
  238. revoke() {
  239. var data = {
  240. id: this.id
  241. };
  242. revoke(data).then(res => {
  243. if (res.code == 200) {
  244. uni.showToast({
  245. icon: 'success',
  246. title: '操作成功'
  247. });
  248. setTimeout(function() {
  249. uni.$emit('refreshAfterSales');
  250. uni.navigateBack({
  251. delta: 1
  252. })
  253. }, 500);
  254. } else {
  255. uni.showToast({
  256. icon: 'none',
  257. title: res.msg
  258. });
  259. }
  260. });
  261. },
  262. getStoreAfterSalesById() {
  263. //联网加载数据
  264. getStoreAfterSalesById(this.id).then(res => {
  265. if (res.code == 200) {
  266. //设置列表数据
  267. this.sales = res.sales;
  268. this.items = res.items;
  269. this.order = res.order;
  270. } else {
  271. uni.showToast({
  272. icon: 'none',
  273. title: res.msg
  274. });
  275. }
  276. });
  277. },
  278. // 返回上一页
  279. back() {
  280. uni.navigateBack()
  281. },
  282. }
  283. }
  284. </script>
  285. <style lang="scss">
  286. .fixed-top-box {
  287. width: 100%;
  288. background: linear-gradient(135deg, #2BC7B9 0%, #60CDC3 100%);
  289. position: fixed;
  290. top: 0;
  291. left: 0;
  292. z-index: 1000;
  293. }
  294. .top-cont {
  295. width: 100%;
  296. height: 500upx;
  297. position: relative;
  298. .bg {
  299. width: 100%;
  300. height: 100%;
  301. position: absolute;
  302. top: 0;
  303. left: 0;
  304. z-index: 1;
  305. }
  306. .top-inner {
  307. width: 100%;
  308. height: 100%;
  309. position: absolute;
  310. top: 0;
  311. left: 0;
  312. z-index: 2;
  313. .back-box {
  314. height: 88upx;
  315. padding-left: 22upx;
  316. display: flex;
  317. align-items: center;
  318. justify-content: space-between;
  319. padding: 0 20upx;
  320. image {
  321. width: 40upx;
  322. height: 40upx;
  323. }
  324. .title {
  325. font-size: 36upx;
  326. font-family: PingFang SC;
  327. font-weight: 500;
  328. color: #FFFFFF;
  329. }
  330. }
  331. .order-status {
  332. margin-top: 60upx;
  333. display: flex;
  334. align-items: center;
  335. justify-content: space-between;
  336. padding: 0 30upx;
  337. .inner {
  338. display: flex;
  339. align-items: center;
  340. .img-box {
  341. width: 96upx;
  342. height: 96upx;
  343. margin-right: 30upx;
  344. image {
  345. width: 100%;
  346. height: 100%;
  347. }
  348. }
  349. .status-box {
  350. height: 96upx;
  351. display: flex;
  352. flex-direction: column;
  353. justify-content: center;
  354. .status {
  355. font-size: 40upx;
  356. font-family: PingFang SC;
  357. font-weight: bold;
  358. color: #FFFFFF;
  359. line-height: 1;
  360. }
  361. .desc {
  362. font-size: 26upx;
  363. font-family: PingFang SC;
  364. font-weight: 500;
  365. color: #FFFFFF;
  366. line-height: 1;
  367. margin-top: 30upx;
  368. }
  369. .det-box {
  370. display: flex;
  371. align-items: center;
  372. image {
  373. width: 14upx;
  374. height: 24upx;
  375. margin-left: 12upx;
  376. margin-top: 30upx;
  377. }
  378. }
  379. }
  380. }
  381. }
  382. .refund-info {
  383. margin-top: 50upx;
  384. padding: 0 20upx;
  385. .inner {
  386. background: #FFFFFF;
  387. border-radius: 16upx;
  388. padding: 0 30upx 15upx 30upx;
  389. .title-box {
  390. height: 88upx;
  391. border-bottom: 1px solid #F0F0F0;
  392. display: flex;
  393. align-items: center;
  394. justify-content: space-between;
  395. .left {
  396. display: flex;
  397. align-items: center;
  398. .title {
  399. font-size: 30upx;
  400. font-family: PingFang SC;
  401. font-weight: bold;
  402. color: #333333;
  403. line-height: 1;
  404. margin-right: 20upx;
  405. }
  406. .price-box {
  407. display: flex;
  408. align-items: flex-end;
  409. .unit {
  410. font-size: 24upx;
  411. font-family: PingFang SC;
  412. font-weight: 500;
  413. color: #FF6633;
  414. line-height: 1.2;
  415. margin-right: 4upx;
  416. }
  417. .num {
  418. font-size: 32upx;
  419. font-family: PingFang SC;
  420. font-weight: bold;
  421. color: #FF6633;
  422. line-height: 1;
  423. }
  424. }
  425. }
  426. .right {
  427. display: flex;
  428. align-items: center;
  429. .text {
  430. font-size: 24upx;
  431. font-family: PingFang SC;
  432. font-weight: 500;
  433. color: #999999;
  434. line-height: 1;
  435. margin-right: 10upx;
  436. }
  437. image {
  438. width: 12upx;
  439. height: 22upx;
  440. }
  441. }
  442. }
  443. .refund-item {
  444. margin-top: 40upx;
  445. .text {
  446. margin-bottom: 10upx;
  447. font-size: 26upx;
  448. font-family: PingFang SC;
  449. font-weight: 500;
  450. color: #666666;
  451. line-height: 1;
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. .content {
  459. padding: 0 20upx 20upx;
  460. .return-info {
  461. margin-top: 30upx;
  462. background: #FFFFFF;
  463. border-radius: 16upx;
  464. .title-box {
  465. height: 88upx;
  466. padding: 0 30upx;
  467. display: flex;
  468. align-items: center;
  469. justify-content: space-between;
  470. .label {
  471. font-size: 30upx;
  472. font-family: PingFang SC;
  473. font-weight: bold;
  474. color: #333333;
  475. }
  476. .ret-num {
  477. font-size: 26upx;
  478. font-family: PingFang SC;
  479. font-weight: 500;
  480. color: #999999;
  481. }
  482. }
  483. .goods-list {
  484. padding: 0 30upx;
  485. background-color: #FFFFFF;
  486. border-radius: 16upx;
  487. .item {
  488. padding: 30upx 0;
  489. border-bottom: 1px solid #EDEEEF;
  490. display: flex;
  491. align-items: center;
  492. .img-box {
  493. width: 160upx;
  494. height: 160upx;
  495. margin-right: 30upx;
  496. image {
  497. width: 100%;
  498. height: 100%;
  499. }
  500. }
  501. .info-box {
  502. width: calc(100% - 190upx);
  503. height: 160upx;
  504. display: flex;
  505. flex-direction: column;
  506. justify-content: space-between;
  507. .title {
  508. font-size: 28upx;
  509. font-family: PingFang SC;
  510. font-weight: 500;
  511. color: #333333;
  512. line-height: 36upx;
  513. .tag {
  514. display: inline-block;
  515. padding: 0 6upx;
  516. height: 30upx;
  517. background: linear-gradient(90deg, #2BC7B9 0%, #2BC7A4 100%);
  518. border-radius: 4upx;
  519. margin-right: 10upx;
  520. font-size: 22upx;
  521. font-family: PingFang SC;
  522. font-weight: bold;
  523. color: #FFFFFF;
  524. line-height: 30upx;
  525. float: left;
  526. margin-top: 7upx;
  527. }
  528. }
  529. .spec {
  530. margin-top: 18upx;
  531. font-size: 24upx;
  532. font-family: PingFang SC;
  533. font-weight: 500;
  534. color: #999999;
  535. line-height: 1;
  536. }
  537. .price-num {
  538. display: flex;
  539. align-items: center;
  540. justify-content: space-between;
  541. .price {
  542. display: flex;
  543. align-items: flex-end;
  544. .unit {
  545. font-size: 24upx;
  546. font-family: PingFang SC;
  547. font-weight: 500;
  548. color: #111111;
  549. line-height: 1.2;
  550. margin-right: 4upx;
  551. }
  552. .num {
  553. font-size: 32upx;
  554. font-family: PingFang SC;
  555. font-weight: 500;
  556. color: #111111;
  557. line-height: 1;
  558. }
  559. }
  560. .num {
  561. font-size: 24upx;
  562. font-family: PingFang SC;
  563. font-weight: 500;
  564. color: #999999;
  565. line-height: 1;
  566. }
  567. }
  568. }
  569. }
  570. .refund-det-info {
  571. padding-bottom: 30upx;
  572. .det-item {
  573. margin-top: 40upx;
  574. display: flex;
  575. align-items: center;
  576. justify-content: space-between;
  577. .label {
  578. font-size: 26upx;
  579. font-family: PingFang SC;
  580. font-weight: 500;
  581. color: #666666;
  582. line-height: 1;
  583. }
  584. .text {
  585. font-size: 26upx;
  586. font-family: PingFang SC;
  587. font-weight: 500;
  588. color: #222222;
  589. line-height: 1;
  590. }
  591. }
  592. }
  593. }
  594. }
  595. }
  596. .btn-box {
  597. margin-top: 15upx;
  598. box-sizing: border-box;
  599. display: flex;
  600. align-items: center;
  601. justify-content: flex-end;
  602. .btn {
  603. width: 155upx;
  604. height: 64upx;
  605. line-height: 64upx;
  606. font-size: 26upx;
  607. font-family: PingFang SC;
  608. font-weight: 500;
  609. text-align: center;
  610. border-radius: 32upx;
  611. margin-left: 15upx;
  612. &:first-child {
  613. margin-left: 0;
  614. }
  615. &.cancel {
  616. border: 1px solid #DDDDDD;
  617. color: #666666;
  618. }
  619. }
  620. }
  621. </style>