IncomeItem.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="invite-item" @tap="handleItemClick">
  3. <view class="income-header-menu-item">
  4. <view class="income-header-menu-icon">
  5. <image :src="getImageUrl(`@img/income/${iconImages[type]}.png`)" mode="aspectFit" />
  6. <view class="income-header-menu-text">
  7. <view v-if="[5, 6, 7].includes(data.commissionType)" class="income-header-menu-text-nickname">
  8. <template v-if="data.commissionType === 5">
  9. 拉新奖励
  10. </template>
  11. <template v-if="data.commissionType === 6">
  12. 分享奖励
  13. </template>
  14. <template v-else>
  15. 提现到银行卡
  16. </template>
  17. </view>
  18. <view v-else class="income-header-menu-text-nickname">
  19. {{ data.receiveUserName }}
  20. </view>
  21. <view v-if="![5, 6, 7].includes(data.commissionType)">
  22. {{ data.couponName }}
  23. <template v-if="data.status === 2">
  24. <text class="text-red ml-10rpx">(退款)</text>
  25. </template>
  26. </view>
  27. <view>
  28. <!-- <view v-if="[7].includes(data.commissionType)"> -->
  29. {{ data.bankName }}招商银行
  30. </view>
  31. </view>
  32. </view>
  33. <view class="income-header-menu-left">
  34. <view class="income-header-menu-left-amount">
  35. <view class="center" v-if="![5, 6, 7].includes(data.commissionType)">
  36. <template v-if="data.status === 2">
  37. <up-icon name="minus" size="12" color="#333333" />
  38. </template>
  39. <!-- <template v-else>
  40. <up-icon name="plus" size="12" color="#333333" />
  41. </template> -->
  42. </view>
  43. <up-text mode="price" :style="{ flex: '0' }" :text="data.changeAmount" align="right"
  44. color="#222222" font-size="30rpx" />
  45. </view>
  46. <view class="income-header-menu-left-time">
  47. {{ type === 2 ? data.createTime : type === 1 ? data.settleTime : '预估' }}
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script setup lang="ts">
  54. import { getImageUrl } from '@/utils/imageUtil'
  55. const props = defineProps({
  56. data: {
  57. type: Object,
  58. default: () => ({}),
  59. },
  60. type: {
  61. type: Number,
  62. default: 0,
  63. },
  64. itemClick: {
  65. type: Function,
  66. default: () => { },
  67. },
  68. })
  69. const iconImages = [
  70. 'djs', // type 0: 待结算
  71. 'hb', // type 1: 已结算
  72. 'card', // type 2: 已提现
  73. ]
  74. const emit = defineEmits(['itemClick'])
  75. const handleItemClick = () => {
  76. if ([5, 6].includes(props.data.commissionType)) {
  77. emit('itemClick', props.data)
  78. }
  79. }
  80. </script>
  81. <style lang="scss" scoped>
  82. .invite-item {
  83. background: #ffffff;
  84. border-radius: 10rpx;
  85. .income-header-menu-item {
  86. height: 88rpx;
  87. display: flex;
  88. justify-content: space-between;
  89. align-items: center;
  90. border-bottom: 1px solid #eeeeee;
  91. padding: 32rpx 0 29rpx;
  92. margin: 0 20rpx;
  93. &:last-child {
  94. border-bottom: none;
  95. }
  96. .income-header-menu-icon {
  97. display: flex;
  98. justify-content: center;
  99. align-items: center;
  100. gap: 19rpx;
  101. image {
  102. width: 60rpx;
  103. height: 60rpx;
  104. }
  105. .income-header-menu-text {
  106. font-weight: 400;
  107. font-size: 24rpx;
  108. color: #888888;
  109. .income-header-menu-text-nickname {
  110. font-size: 28rpx;
  111. color: #222222;
  112. margin-bottom: 18rpx;
  113. }
  114. }
  115. }
  116. .income-header-menu-left {
  117. font-weight: 400;
  118. font-size: 24rpx;
  119. color: #888888;
  120. .income-header-menu-left-amount {
  121. font-size: 28rpx;
  122. color: #222222;
  123. margin-bottom: 18rpx;
  124. text-align: right;
  125. display: flex;
  126. flex-direction: row;
  127. justify-content: flex-end;
  128. }
  129. .income-header-menu-left-time {
  130. text-align: right;
  131. }
  132. }
  133. }
  134. }
  135. </style>