aftersaleDetail.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <template>
  2. <view class="container">
  3. <van-cell-group title="退款明细">
  4. <van-cell :value="statusColumns[aftersale.status]" title="售后状态" required />
  5. <van-cell :value="aftersale.addTime" title="申请时间" required />
  6. <van-cell :value="aftersale.aftersaleSn" title="服务编号" required />
  7. <van-cell :value="aftersale.typeName" title="退款类型" required />
  8. <van-cell :value="aftersale.reason" title="退款原因" required />
  9. <van-cell title="退款金额" :value="'¥' + aftersale.amount + '元'" label="即订单实付- 运费" required />
  10. <van-field label="退款说明" :value="aftersale.comment" type="textarea" autosize disabled />
  11. <van-cell title="上传凭证">
  12. <van-uploader :file-list="fileList" disabled :deletable="false" :max-count="0" preview-size="50px" />
  13. </van-cell>
  14. </van-cell-group>
  15. <view class="order-goods">
  16. <view class="h">退款商品</view>
  17. <view class="goods">
  18. <view class="item" v-for="(item, index) in orderGoods" :key="index">
  19. <view class="img">
  20. <image :src="item.picUrl"></image>
  21. </view>
  22. <view class="info">
  23. <view class="t">
  24. <text class="name">{{ item.goodsName }}</text>
  25. <text class="number">x{{ item.number }}</text>
  26. </view>
  27. <view class="attr">{{ item.specifications }}</view>
  28. <view class="price">¥{{ item.price }}</view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <van-cell-group title="订单明细">
  34. <van-cell title="商品总价" :value="' ¥' + order.goodsPrice + '元'" />
  35. <van-cell title=" 运费" :value="' ¥' + order.freightPrice + '元'" />
  36. <van-cell title=" 优惠" :value="'-¥' + order.couponPrice + '元'" />
  37. <van-cell title="订单实付" :value="' ¥' + order.actualPrice + '元'" />
  38. </van-cell-group>
  39. </view>
  40. </template>
  41. <script>
  42. var util = require('../../../utils/util.js');
  43. var api = require('../../../config/api.js');
  44. export default {
  45. data() {
  46. return {
  47. orderId: 0,
  48. order: {
  49. goodsPrice: '',
  50. freightPrice: '',
  51. couponPrice: '',
  52. actualPrice: ''
  53. },
  54. orderGoods: [],
  55. aftersale: {
  56. status: '',
  57. addTime: '',
  58. aftersaleSn: '',
  59. typeName: '',
  60. reason: '',
  61. amount: '',
  62. comment: ''
  63. },
  64. statusColumns: ['未申请', '已申请,待审核', '审核通过,待退款', '退款成功', '审核不通过,已拒绝'],
  65. typeColumns: ['未收货退款', '不退货退款', '退货退款'],
  66. fileList: []
  67. };
  68. },
  69. onLoad: function (options) {
  70. // 页面初始化 options为页面跳转所带来的参数
  71. this.setData({
  72. orderId: options.id
  73. });
  74. this.getAftersaleDetail();
  75. },
  76. onReady: function () {
  77. // 页面渲染完成
  78. },
  79. onShow: function () {
  80. // 页面显示
  81. },
  82. onHide: function () {
  83. // 页面隐藏
  84. },
  85. onUnload: function () {
  86. // 页面关闭
  87. },
  88. methods: {
  89. getAftersaleDetail: function () {
  90. uni.showLoading({
  91. title: '加载中'
  92. });
  93. setTimeout(function () {
  94. uni.hideLoading();
  95. }, 2000);
  96. let that = this;
  97. util.request(api.AftersaleDetail, {
  98. orderId: that.orderId
  99. }).then(function (res) {
  100. if (res.errno === 0) {
  101. let _fileList = [];
  102. res.data.aftersale.pictures.forEach(function (v) {
  103. _fileList.push({
  104. url: v
  105. });
  106. });
  107. that.setData({
  108. order: res.data.order,
  109. orderGoods: res.data.orderGoods,
  110. aftersale: res.data.aftersale,
  111. fileList: _fileList
  112. });
  113. }
  114. uni.hideLoading();
  115. });
  116. }
  117. }
  118. };
  119. </script>
  120. <style>
  121. page {
  122. height: 100%;
  123. width: 100%;
  124. background: #f4f4f4;
  125. }
  126. .order-goods {
  127. margin-top: 20rpx;
  128. background: #fff;
  129. }
  130. .order-goods .h {
  131. height: 93.75rpx;
  132. line-height: 93.75rpx;
  133. margin-left: 31.25rpx;
  134. border-bottom: 1px solid #f4f4f4;
  135. padding-right: 31.25rpx;
  136. }
  137. .order-goods .h .label {
  138. float: left;
  139. font-size: 30rpx;
  140. color: #333;
  141. }
  142. .order-goods .h .status {
  143. float: right;
  144. font-size: 30rpx;
  145. color: #b4282d;
  146. }
  147. .order-goods .item {
  148. display: flex;
  149. align-items: center;
  150. height: 192rpx;
  151. margin-left: 31.25rpx;
  152. padding-right: 31.25rpx;
  153. border-bottom: 1px solid #f4f4f4;
  154. }
  155. .order-goods .item:last-child {
  156. border-bottom: none;
  157. }
  158. .order-goods .item .img {
  159. height: 145.83rpx;
  160. width: 145.83rpx;
  161. background: #f4f4f4;
  162. }
  163. .order-goods .item .img image {
  164. height: 145.83rpx;
  165. width: 145.83rpx;
  166. }
  167. .order-goods .item .info {
  168. flex: 1;
  169. height: 145.83rpx;
  170. margin-left: 20rpx;
  171. }
  172. .order-goods .item .t {
  173. margin-top: 8rpx;
  174. height: 33rpx;
  175. line-height: 33rpx;
  176. margin-bottom: 10.5rpx;
  177. }
  178. .order-goods .item .t .name {
  179. display: block;
  180. float: left;
  181. height: 33rpx;
  182. line-height: 33rpx;
  183. color: #333;
  184. font-size: 30rpx;
  185. }
  186. .order-goods .item .t .number {
  187. display: block;
  188. float: right;
  189. height: 33rpx;
  190. text-align: right;
  191. line-height: 33rpx;
  192. color: #333;
  193. font-size: 30rpx;
  194. }
  195. .order-goods .item .attr {
  196. height: 29rpx;
  197. line-height: 29rpx;
  198. color: #666;
  199. margin-bottom: 25rpx;
  200. font-size: 25rpx;
  201. }
  202. .order-goods .item .price {
  203. display: block;
  204. float: left;
  205. height: 30rpx;
  206. line-height: 30rpx;
  207. color: #333;
  208. font-size: 30rpx;
  209. }
  210. .fb-body {
  211. width: 100%;
  212. background: #fff;
  213. height: 300rpx;
  214. padding: 30rpx;
  215. }
  216. .fb-body .content {
  217. width: 100%;
  218. height: 200rpx;
  219. color: #333;
  220. }
  221. .weui-uploader__files {
  222. width: 100%;
  223. }
  224. .weui-uploader__file {
  225. float: left;
  226. margin-right: 9px;
  227. margin-bottom: 9px;
  228. }
  229. .weui-uploader__img {
  230. display: block;
  231. width: 30px;
  232. height: 30px;
  233. }
  234. .weui-uploader__input-box {
  235. float: left;
  236. position: relative;
  237. margin-right: 9px;
  238. margin-bottom: 9px;
  239. width: 30px;
  240. height: 30px;
  241. border: 1px solid #d9d9d9;
  242. }
  243. .weui-uploader__input-box:after,
  244. .weui-uploader__input-box:before {
  245. content: ' ';
  246. position: absolute;
  247. top: 50%;
  248. left: 50%;
  249. -webkit-transform: translate(-50%, -50%);
  250. transform: translate(-50%, -50%);
  251. background-color: #d9d9d9;
  252. }
  253. .weui-uploader__input-box:before {
  254. width: 2px;
  255. height: 30px;
  256. }
  257. .weui-uploader__input-box:after {
  258. width: 30px;
  259. height: 2px;
  260. }
  261. .weui-uploader__input-box:active {
  262. border-color: #999;
  263. }
  264. .weui-uploader__input-box:active:after,
  265. .weui-uploader__input-box:active:before {
  266. background-color: #999;
  267. }
  268. .weui-uploader__input {
  269. position: absolute;
  270. z-index: 1;
  271. top: 0;
  272. left: 0;
  273. width: 100%;
  274. height: 100%;
  275. opacity: 0;
  276. }
  277. .fb-body .text-count {
  278. float: right;
  279. color: #666;
  280. font-size: 24rpx;
  281. line-height: 30rpx;
  282. }
  283. </style>