refundOrderDetail.vue 17 KB

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