aftersaleDetail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <template>
  2. <view class="container">
  3. <view class="order-goods">
  4. <view class="h">退款商品</view>
  5. <view class="goods">
  6. <view class="item" v-for="(item, index) in orderGoods" :key="index">
  7. <view class="img">
  8. <image :src="item.picUrl"></image>
  9. </view>
  10. <view class="info">
  11. <view class="t">
  12. <text class="name">{{ item.goodsName }}</text>
  13. <text class="number">x{{ item.number }}</text>
  14. </view>
  15. <view class="attr">{{ item.specifications }}</view>
  16. <!-- <view class="price">服务次数:{{item.serviceTimes}}</view> -->
  17. <view class="price">单价:¥{{ item.price }}</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="card">
  23. <view class="module-title">订单明细</view>
  24. <view class="tt-cell">
  25. <view>商品总价</view>
  26. <view>¥{{ order.goodsPrice }}元</view>
  27. </view>
  28. <!-- <view class="tt-cell">
  29. <view> 运费</view>
  30. <view>¥{{order.freightPrice}}元</view>
  31. </view> -->
  32. <view class="tt-cell">
  33. <view>优惠</view>
  34. <view>-¥{{ order.couponPrice }}元</view>
  35. </view>
  36. <view class="tt-cell">
  37. <view>订单实付</view>
  38. <view>¥{{ order.actualPrice }}元</view>
  39. </view>
  40. </view>
  41. <view class="card">
  42. <view class="module-title">退款明细</view>
  43. <view class="tt-cell">
  44. <view>售后状态</view>
  45. <view>{{ statusColumns[aftersale.status] }}</view>
  46. </view>
  47. <view class="tt-cell">
  48. <view>申请时间</view>
  49. <view>{{ aftersale.addTime }}</view>
  50. </view>
  51. <view class="tt-cell">
  52. <view>服务编号</view>
  53. <view>{{ aftersale.aftersaleSn }}</view>
  54. </view>
  55. <view class="tt-cell">
  56. <view>退款类型</view>
  57. <view>{{ typeColumns[aftersale.type] }}</view>
  58. </view>
  59. <view class="tt-cell">
  60. <view>退款原因</view>
  61. <view>{{ aftersale.reason }}</view>
  62. </view>
  63. <view class="tt-cell">
  64. <view>退款说明</view>
  65. <view>{{ aftersale.comment }}</view>
  66. </view>
  67. <view class="comment-wrapper">
  68. <view class="tt-cell comment-cell">
  69. <view>退款金额</view>
  70. <view>¥{{ aftersale.amount }}元</view>
  71. </view>
  72. <view class="comment-tips">不可更改,即订单实付</view>
  73. </view>
  74. <view class="upload-text">上传凭证</view>
  75. <view class="upload-wrapper" v-if="fileList.length > 0">
  76. <view class="img-item" v-for="(item, index) in fileList" :key="index">
  77. <image mode="aspectFill" :src="item" class="user-upload" @tap="previewImg" :data-img="item"></image>
  78. </view>
  79. </view>
  80. </view>
  81. <!--
  82. <van-cell-group title="订单明细">
  83. <van-cell title="商品总价" value=" ¥{{order.goodsPrice}}元" />
  84. <van-cell title=" 运费" value=" ¥{{order.freightPrice}}元" />
  85. <van-cell title=" 优惠" value="-¥{{order.couponPrice}}元" />
  86. <van-cell title="订单实付" value=" ¥{{order.actualPrice}}元" />
  87. </van-cell-group> -->
  88. </view>
  89. </template>
  90. <script>
  91. var util = require('../../../utils/util.js');
  92. var api = require('../../../config/api.js');
  93. export default {
  94. data() {
  95. return {
  96. orderId: 0,
  97. order: {
  98. goodsPrice: '',
  99. couponPrice: '',
  100. actualPrice: ''
  101. },
  102. orderGoods: [],
  103. aftersale: {
  104. status: '',
  105. addTime: '',
  106. aftersaleSn: '',
  107. type: '',
  108. reason: '',
  109. comment: '',
  110. amount: ''
  111. },
  112. statusColumns: ['未申请', '已申请,待审核', '审核通过,待退款', '退款成功', '审核不通过,已拒绝', '审核不通过,已取消', '审核通过,退款中'],
  113. typeColumns: ['未收货退款', '不退货退款', '退货退款'],
  114. fileList: []
  115. };
  116. },
  117. onLoad: function (options) {
  118. // 页面初始化 options为页面跳转所带来的参数
  119. this.setData({
  120. orderId: options.id
  121. });
  122. this.getAftersaleDetail();
  123. },
  124. onReady: function () {
  125. // 页面渲染完成
  126. },
  127. onShow: function () {
  128. // 页面显示
  129. },
  130. onHide: function () {
  131. // 页面隐藏
  132. },
  133. onUnload: function () {
  134. // 页面关闭
  135. },
  136. methods: {
  137. getAftersaleDetail: function () {
  138. uni.showLoading({
  139. title: '加载中'
  140. });
  141. setTimeout(function () {
  142. uni.hideLoading();
  143. }, 2000);
  144. let that = this;
  145. util.request(api.AftersaleDetail, {
  146. orderId: that.orderId
  147. }).then(function (res) {
  148. if (res.errno === 0) {
  149. // let _fileList = [];
  150. // res.data.aftersale.pictures.forEach(function (v) {
  151. // _fileList.push({
  152. // v
  153. // });
  154. // });
  155. that.setData({
  156. order: res.data.order,
  157. orderGoods: res.data.orderGoods,
  158. aftersale: res.data.aftersale,
  159. fileList: res.data.aftersale.pictures
  160. });
  161. }
  162. uni.hideLoading();
  163. });
  164. },
  165. previewImg(e) {
  166. let img = e.currentTarget.dataset.img;
  167. let imgs = this.fileList;
  168. uni.previewImage({
  169. current: img,
  170. // 当前显示图片的http链接
  171. urls: imgs // 需要预览的图片http链接列表
  172. });
  173. }
  174. }
  175. };
  176. </script>
  177. <style>
  178. page {
  179. /* height: 100%; */
  180. width: 100%;
  181. background: #f4f4f4;
  182. padding: 0 0 80rpx;
  183. }
  184. .container {
  185. padding: 0 30rpx;
  186. }
  187. .order-goods {
  188. margin-top: 30rpx;
  189. background: #fff;
  190. border-radius: 10rpx;
  191. width: 690rpx;
  192. padding: 30rpx 20rpx;
  193. }
  194. .order-goods .h {
  195. height: 30rpx;
  196. line-height: 30rpx;
  197. margin-bottom: 30rpx;
  198. font-size: 30rpx;
  199. color: #333;
  200. }
  201. .order-goods .h .label {
  202. float: left;
  203. font-size: 30rpx;
  204. color: #333;
  205. }
  206. .order-goods .h .status {
  207. float: right;
  208. font-size: 30rpx;
  209. color: #b4282d;
  210. }
  211. .order-goods .item {
  212. display: flex;
  213. align-items: center;
  214. height: 190rpx;
  215. }
  216. .order-goods .item:last-child {
  217. border-bottom: none;
  218. }
  219. .order-goods .item .img {
  220. height: 190rpx;
  221. width: 190rpx;
  222. background: #f4f4f4;
  223. margin-right: 20rpx;
  224. border-radius: 10rpx;
  225. }
  226. .order-goods .item .img image {
  227. height: 190rpx;
  228. border-radius: 10rpx;
  229. width: 190rpx;
  230. }
  231. .order-goods .item .info {
  232. flex: 1;
  233. height: 190rpx;
  234. }
  235. .order-goods .item .t {
  236. margin-top: 10rpx;
  237. /* height: 33rpx; */
  238. line-height: 34rpx;
  239. margin-bottom: 30rpx;
  240. display: flex;
  241. justify-content: space-between;
  242. }
  243. .order-goods .item .t .name {
  244. max-height: 68rpx;
  245. line-height: 34rpx;
  246. color: #333;
  247. font-size: 30rpx;
  248. width: 360rpx;
  249. margin-right: 40rpx;
  250. /* text-overflow: ellipsis;
  251. white-space: nowrap;*/
  252. overflow: hidden;
  253. }
  254. .order-goods .item .t .number {
  255. line-height: 36rpx;
  256. color: #666;
  257. font-size: 26rpx;
  258. }
  259. .order-goods .item .attr {
  260. height: 26rpx;
  261. line-height: 26rpx;
  262. color: #666;
  263. font-size: 26rpx;
  264. }
  265. .order-goods .item .price {
  266. height: 26rpx;
  267. line-height: 26rpx;
  268. color: #666;
  269. font-size: 26rpx;
  270. margin-top: 16rpx;
  271. }
  272. .fb-body {
  273. width: 100%;
  274. background: #fff;
  275. height: 300rpx;
  276. padding: 30rpx;
  277. }
  278. .fb-body .content {
  279. width: 100%;
  280. height: 200rpx;
  281. color: #333;
  282. }
  283. .weui-uploader__files {
  284. width: 100%;
  285. }
  286. .weui-uploader__file {
  287. float: left;
  288. margin-right: 9px;
  289. margin-bottom: 9px;
  290. }
  291. .weui-uploader__img {
  292. display: block;
  293. width: 30px;
  294. height: 30px;
  295. }
  296. .weui-uploader__input-box {
  297. float: left;
  298. position: relative;
  299. margin-right: 9px;
  300. margin-bottom: 9px;
  301. width: 30px;
  302. height: 30px;
  303. border: 1px solid #d9d9d9;
  304. }
  305. .weui-uploader__input-box:after,
  306. .weui-uploader__input-box:before {
  307. content: ' ';
  308. position: absolute;
  309. top: 50%;
  310. left: 50%;
  311. -webkit-transform: translate(-50%, -50%);
  312. transform: translate(-50%, -50%);
  313. background-color: #d9d9d9;
  314. }
  315. .weui-uploader__input-box:before {
  316. width: 2px;
  317. height: 30px;
  318. }
  319. .weui-uploader__input-box:after {
  320. width: 30px;
  321. height: 2px;
  322. }
  323. .weui-uploader__input-box:active {
  324. border-color: #999;
  325. }
  326. .weui-uploader__input-box:active:after,
  327. .weui-uploader__input-box:active:before {
  328. background-color: #999;
  329. }
  330. .weui-uploader__input {
  331. position: absolute;
  332. z-index: 1;
  333. top: 0;
  334. left: 0;
  335. width: 100%;
  336. height: 100%;
  337. opacity: 0;
  338. }
  339. .fb-body .text-count {
  340. float: right;
  341. color: #666;
  342. font-size: 24rpx;
  343. line-height: 30rpx;
  344. }
  345. .module-title {
  346. height: 80rpx;
  347. padding: 0 8rpx;
  348. line-height: 80rpx;
  349. font-size: 30rpx;
  350. color: #333;
  351. border-bottom: 1rpx solid #efefef;
  352. }
  353. .tt-cell {
  354. display: flex;
  355. padding: 0 4rpx 0 8rpx;
  356. align-items: center;
  357. justify-content: space-between;
  358. background: #fff;
  359. height: 68rpx;
  360. /* border-bottom:2rpx solid #ebedf0; */
  361. }
  362. .tt-cell view {
  363. font-size: 30rpx;
  364. color: #333;
  365. }
  366. .tt-cell view:last-child {
  367. color: #666;
  368. }
  369. .tt-cell input {
  370. text-align: right;
  371. }
  372. .need {
  373. color: red;
  374. }
  375. .comment-wrapper {
  376. /* border-bottom:2rpx solid #ebedf0; */
  377. }
  378. .tt-cell.comment-cell {
  379. border: none;
  380. }
  381. .tt-cell.comment-cell view {
  382. /* padding-left:14rpx; */
  383. }
  384. .comment-tips {
  385. padding-left: 8rpx;
  386. height: 50rpx;
  387. line-height: 30rpx;
  388. color: #777;
  389. font-size: 20rpx;
  390. background: #fff;
  391. }
  392. .upload-wrapper {
  393. /* margin:18rpx -20rpx 56rpx 0; */
  394. display: flex;
  395. flex-wrap: wrap;
  396. background: #fff;
  397. padding: 0 24rpx 40rpx;
  398. }
  399. .upload {
  400. width: 160rpx;
  401. height: 160rpx;
  402. background: #fafafa;
  403. border-radius: 2rpx;
  404. border: 1rpx solid #d9d9d9;
  405. display: flex;
  406. align-items: center;
  407. flex-direction: column;
  408. justify-content: center;
  409. margin-right: 16rpx;
  410. box-sizing: border-box;
  411. }
  412. .upload image {
  413. width: 38rpx;
  414. height: 38rpx;
  415. margin-bottom: 22rpx;
  416. }
  417. .upload view {
  418. font-weight: 400;
  419. color: #c5c3c3;
  420. line-height: 48rpx;
  421. font-size: 26rpx;
  422. }
  423. .img-item {
  424. width: 160rpx;
  425. height: 160rpx;
  426. background: #fff;
  427. border-radius: 2rpx;
  428. border: 1rpx solid #d9d9d9;
  429. margin: 0 20rpx 24rpx 0;
  430. padding: 8rpx;
  431. position: relative;
  432. box-sizing: border-box;
  433. }
  434. .img-item .user-upload {
  435. width: 144rpx;
  436. height: 144rpx;
  437. }
  438. .img-item .close-img {
  439. width: 28rpx;
  440. height: 28rpx;
  441. position: absolute;
  442. top: 0;
  443. right: 0;
  444. }
  445. .upload-text {
  446. height: 88rpx;
  447. line-height: 88rpx;
  448. padding-left: 8rpx;
  449. background: #fff;
  450. }
  451. .card {
  452. background: #fff;
  453. border-radius: 10rpx;
  454. margin-top: 20rpx;
  455. padding: 0 20rpx 20rpx;
  456. }
  457. </style>