refund-order-item.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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. '11': '退款已撤销'
  87. }
  88. return map[status] || '未知状态'
  89. }
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .refund-order-item {
  95. background-color: #fff;
  96. border-radius: 16rpx;
  97. padding: 30rpx 20rpx;
  98. margin-bottom: 20rpx;
  99. .order-header {
  100. display: flex;
  101. justify-content: space-between;
  102. margin-bottom: 20rpx;
  103. font-size: 28rpx;
  104. .order-no {
  105. color: #333;
  106. font-weight: 500;
  107. }
  108. .order-status {
  109. color: #FF000C;
  110. }
  111. }
  112. .goods-list {
  113. margin-bottom: 20rpx;
  114. .single-book {
  115. display: flex;
  116. .book-cover {
  117. width: 140rpx;
  118. height: 140rpx;
  119. margin-right: 10rpx;
  120. border-radius: 8rpx;
  121. flex-shrink: 0;
  122. }
  123. .book-info {
  124. flex: 1;
  125. display: flex;
  126. flex-direction: column;
  127. justify-content: space-between;
  128. .info-top {
  129. display: flex;
  130. justify-content: space-between;
  131. .book-name {
  132. flex: 1;
  133. font-size: 28rpx;
  134. color: #333;
  135. font-weight: bold;
  136. margin-right: 30rpx;
  137. }
  138. .price-box {
  139. text-align: right;
  140. display: flex;
  141. flex-direction: column;
  142. align-items: flex-end;
  143. .num {
  144. font-size: 24rpx;
  145. color: #999;
  146. margin-top: 6rpx;
  147. }
  148. }
  149. }
  150. .book-sku {
  151. background: rgb(56, 193, 72, 0.1);
  152. color: #333;
  153. font-size: 24rpx;
  154. padding: 4rpx 12rpx;
  155. border-radius: 4rpx;
  156. align-self: flex-start;
  157. margin-top: 10rpx;
  158. }
  159. }
  160. }
  161. }
  162. .order-total {
  163. text-align: right;
  164. font-size: 26rpx;
  165. color: #333;
  166. margin-bottom: 20rpx;
  167. .ml-20 {
  168. margin-left: 20rpx;
  169. font-weight: 500;
  170. }
  171. }
  172. .action-box {
  173. display: flex;
  174. justify-content: flex-end;
  175. align-items: center;
  176. flex-wrap: wrap; // 防止按钮过多换行问题
  177. u-button {
  178. margin-bottom: 10rpx; // 如果换行,增加间距
  179. }
  180. }
  181. }
  182. </style>