refund-history-popup.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <u-popup v-model="visible" mode="bottom" border-radius="24" :safe-area-inset-bottom="true" :mask-close-able="true"
  3. @close="close">
  4. <view class="history-popup">
  5. <view class="header">
  6. <text class="title">宝贝售后详情</text>
  7. <image src="/pages-sell/static/select-good/icon-close.png" class="close-icon" @click="close"></image>
  8. </view>
  9. <view class="list" v-if="list.length > 0">
  10. <view class="item" v-for="(item, index) in list" :key="index" @click="handleView(item)">
  11. <image class="cover" :src="item.cover" mode="aspectFill"></image>
  12. <view class="content">
  13. <view class="name u-line-2">{{ item.bookName }}</view>
  14. <view class="meta">
  15. <text class="meta-text">数量:{{ item.refundNum }}</text>
  16. <text class="meta-text">¥ {{ formatMoney(item.refundMoney) }}</text>
  17. </view>
  18. </view>
  19. <view class="right">
  20. <text class="link-text">查看</text>
  21. <u-icon name="arrow-right" color="#C9C9C9" size="24"></u-icon>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="empty" v-else>
  26. <u-empty text="暂无历史退款记录" mode="history"></u-empty>
  27. </view>
  28. </view>
  29. </u-popup>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. visible: false,
  36. list: []
  37. };
  38. },
  39. methods: {
  40. open(list) {
  41. this.list = Array.isArray(list) ? list : [];
  42. this.visible = true;
  43. },
  44. close() {
  45. this.visible = false;
  46. },
  47. handleView(item) {
  48. this.$emit('view', item);
  49. this.close();
  50. },
  51. formatMoney(money) {
  52. const num = Number(money || 0);
  53. if (Number.isNaN(num)) return '0.00';
  54. return num.toFixed(2);
  55. }
  56. }
  57. };
  58. </script>
  59. <style lang="scss" scoped>
  60. .history-popup {
  61. background-color: #fff;
  62. padding: 30rpx;
  63. min-height: 420rpx;
  64. max-height: 900rpx;
  65. box-sizing: border-box;
  66. display: flex;
  67. flex-direction: column;
  68. overflow: hidden;
  69. }
  70. .header {
  71. display: flex;
  72. justify-content: center;
  73. align-items: center;
  74. position: relative;
  75. margin-bottom: 20rpx;
  76. padding-bottom: 20rpx;
  77. border-bottom: 2rpx dashed #eee;
  78. flex-shrink: 0;
  79. }
  80. .title {
  81. font-size: 34rpx;
  82. font-weight: bold;
  83. color: #333;
  84. }
  85. .close-icon {
  86. position: absolute;
  87. right: 0;
  88. top: 0;
  89. width: 24rpx;
  90. height: 24rpx;
  91. padding: 10rpx;
  92. box-sizing: content-box;
  93. }
  94. .list {
  95. flex: 1;
  96. overflow: auto;
  97. }
  98. .item {
  99. display: flex;
  100. align-items: center;
  101. padding: 24rpx 0;
  102. border-bottom: 1rpx solid #F0F0F0;
  103. }
  104. .cover {
  105. width: 120rpx;
  106. height: 140rpx;
  107. border-radius: 8rpx;
  108. margin-right: 20rpx;
  109. flex-shrink: 0;
  110. background-color: #f5f5f5;
  111. }
  112. .content {
  113. flex: 1;
  114. min-width: 0;
  115. }
  116. .name {
  117. font-size: 28rpx;
  118. color: #333;
  119. line-height: 1.4;
  120. margin-bottom: 10rpx;
  121. }
  122. .meta {
  123. display: flex;
  124. align-items: center;
  125. gap: 16rpx;
  126. }
  127. .meta-text {
  128. font-size: 24rpx;
  129. color: #666;
  130. }
  131. .right {
  132. display: flex;
  133. align-items: center;
  134. margin-left: 16rpx;
  135. flex-shrink: 0;
  136. }
  137. .link-text {
  138. font-size: 26rpx;
  139. color: #38C148;
  140. margin-right: 6rpx;
  141. }
  142. .empty {
  143. flex: 1;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. }
  148. </style>