refund-order-item.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="refund-order-item" @click="goToDetail">
  3. <!-- 订单头部:订单号和状态 -->
  4. <view class="order-header">
  5. <text class="order-no">退款编号:{{ order.refundOrderId }}</text>
  6. <text class="order-status">{{ getStatusText(order.status) }}</text>
  7. </view>
  8. <!-- 商品信息 -->
  9. <view class="goods-list">
  10. <!-- 单本书样式 -->
  11. <view class="single-book">
  12. <image :src="order.cover || defaultCover" mode="aspectFit" class="book-cover"></image>
  13. <view class="book-info">
  14. <view class="info-top">
  15. <text class="book-name u-line-2">{{ order.bookName }}</text>
  16. <view class="price-box">
  17. <text class="num">x{{ order.refundNum || 1 }}</text>
  18. </view>
  19. </view>
  20. <view class="book-sku" v-if="order.conditionType">
  21. 品相:{{ order.conditionType | conditionText }}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 价格汇总 -->
  27. <view class="order-total">
  28. <text class="ml-20">退款金额 ¥{{ order.refundMoney || '0.00' }}</text>
  29. </view>
  30. <!-- 操作按钮 -->
  31. <view class="action-box">
  32. <!-- 查看详情 -->
  33. <u-button size="mini" shape="circle" plain :custom-style="btnStyle"
  34. @click.stop="goToDetail">查看详情</u-button>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. name: 'refund-order-item',
  41. props: {
  42. order: {
  43. type: Object,
  44. required: true
  45. }
  46. },
  47. data() {
  48. return {
  49. defaultCover: 'https://uviewui.com/album/1.jpg',
  50. btnStyle: {
  51. marginLeft: '20rpx',
  52. height: '60rpx',
  53. lineHeight: '60rpx',
  54. padding: '0 24rpx',
  55. fontSize: '26rpx',
  56. },
  57. themeBtnStyle: {
  58. marginLeft: '20rpx',
  59. height: '60rpx',
  60. lineHeight: '60rpx',
  61. padding: '0 30rpx',
  62. backgroundColor: '#38C148',
  63. color: '#fff',
  64. fontSize: '26rpx',
  65. }
  66. }
  67. },
  68. methods: {
  69. goToDetail() {
  70. uni.navigateTo({
  71. url: `/pages-car/pages/refund-detail?refundOrderId=${this.order.refundOrderId}`
  72. })
  73. },
  74. getStatusText(status) {
  75. const map = {
  76. '1': '申请退款',
  77. '2': '协商中待用户确认',
  78. '3': '协商中待商家确认',
  79. '4': '审核通过',
  80. '5': '审核驳回',
  81. '6': '超时关闭',
  82. '7': '买家已发货',
  83. '8': '确认收货',
  84. '9': '退款成功',
  85. '10': '退款已撤销'
  86. }
  87. return map[status] || '未知状态'
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .refund-order-item {
  94. background-color: #fff;
  95. border-radius: 16rpx;
  96. padding: 30rpx 20rpx;
  97. margin-bottom: 20rpx;
  98. .order-header {
  99. display: flex;
  100. justify-content: space-between;
  101. margin-bottom: 20rpx;
  102. font-size: 28rpx;
  103. .order-no {
  104. color: #333;
  105. font-weight: 500;
  106. }
  107. .order-status {
  108. color: #FF000C;
  109. }
  110. }
  111. .goods-list {
  112. margin-bottom: 20rpx;
  113. .single-book {
  114. display: flex;
  115. .book-cover {
  116. width: 140rpx;
  117. height: 140rpx;
  118. margin-right: 10rpx;
  119. border-radius: 8rpx;
  120. flex-shrink: 0;
  121. }
  122. .book-info {
  123. flex: 1;
  124. display: flex;
  125. flex-direction: column;
  126. justify-content: space-between;
  127. .info-top {
  128. display: flex;
  129. justify-content: space-between;
  130. .book-name {
  131. flex: 1;
  132. font-size: 28rpx;
  133. color: #333;
  134. font-weight: bold;
  135. margin-right: 30rpx;
  136. }
  137. .price-box {
  138. text-align: right;
  139. display: flex;
  140. flex-direction: column;
  141. align-items: flex-end;
  142. .num {
  143. font-size: 24rpx;
  144. color: #999;
  145. margin-top: 6rpx;
  146. }
  147. }
  148. }
  149. .book-sku {
  150. background: rgb(56, 193, 72, 0.1);
  151. color: #333;
  152. font-size: 24rpx;
  153. padding: 4rpx 12rpx;
  154. border-radius: 4rpx;
  155. align-self: flex-start;
  156. margin-top: 10rpx;
  157. }
  158. }
  159. }
  160. }
  161. .order-total {
  162. text-align: right;
  163. font-size: 26rpx;
  164. color: #333;
  165. margin-bottom: 20rpx;
  166. .ml-20 {
  167. margin-left: 20rpx;
  168. font-weight: 500;
  169. }
  170. }
  171. .action-box {
  172. display: flex;
  173. justify-content: flex-end;
  174. align-items: center;
  175. flex-wrap: wrap; // 防止按钮过多换行问题
  176. u-button {
  177. margin-bottom: 10rpx; // 如果换行,增加间距
  178. }
  179. }
  180. }
  181. </style>