木邻有你前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

194 lines
4.2 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="points-detail">
  3. <!-- 顶部导航栏 -->
  4. <!-- Tab切换栏 -->
  5. <view class="tab-container">
  6. <view
  7. class="tab-item"
  8. :class="{ active: activeTab === 'income' }"
  9. @click="switchTab('income')"
  10. >
  11. <text class="tab-text">收入明细</text>
  12. </view>
  13. <view
  14. class="tab-item"
  15. :class="{ active: activeTab === 'expense' }"
  16. @click="switchTab('expense')"
  17. >
  18. <text class="tab-text">支出明细</text>
  19. </view>
  20. </view>
  21. <!-- 列表内容 -->
  22. <view class="list-container">
  23. <!-- 收入明细列表 -->
  24. <view >
  25. <view
  26. v-for="(item, index) in list"
  27. :key="index"
  28. class="list-item"
  29. >
  30. <view class="item-left">
  31. <image src="/subPages/static/商品_积分@2x.png" class="item-icon"></image>
  32. <view class="item-info">
  33. <text class="item-title">{{ item.title }}</text>
  34. <text class="item-time">{{ item.createTime }}</text>
  35. </view>
  36. </view>
  37. <view class="item-right">
  38. <text class="points-text " :class="{'income': item.type === '0', 'expense': item.type === '1'}">+{{ item.score }}积分</text>
  39. </view>
  40. </view>
  41. </view>
  42. <!-- 支出明细列表 -->
  43. <!-- <view v-if="activeTab === 'expense'" class="expense-list">
  44. <view
  45. v-for="(item, index) in list"
  46. :key="index"
  47. class="list-item"
  48. >
  49. <view class="item-left">
  50. <image src="/subPages/static/商品_积分@2x.png" class="item-icon"></image>
  51. <view class="item-info">
  52. <text class="item-title">{{ item.title }}</text>
  53. <text class="item-time">{{ item.createTime }}</text>
  54. </view>
  55. </view>
  56. <view class="item-right">
  57. <text class="points-text expense">-{{ item.score }}积分</text>
  58. </view>
  59. </view>
  60. </view> -->
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. import MixinList from '@/mixins/list.js'
  66. export default {
  67. mixins: [MixinList],
  68. name: 'PointsDetail',
  69. data() {
  70. return {
  71. activeTab: 'income', // 当前激活的tab
  72. mixinListApi: 'score.queryScoreList',
  73. }
  74. },
  75. methods: {
  76. switchTab(tab) {
  77. this.activeTab = tab;
  78. this.initPage()
  79. this.getList(true)
  80. },
  81. mixinSetParams() {
  82. return {
  83. type: this.activeTab === 'income' ? 0 : 1
  84. }
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss" scoped>
  90. .points-detail {
  91. background: #f8f8f8;
  92. min-height: 100vh;
  93. }
  94. .tab-container {
  95. display: flex;
  96. background: #ffffff;
  97. margin: 20rpx;
  98. border-radius: 50rpx;
  99. padding: 8rpx;
  100. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  101. .tab-item {
  102. flex: 1;
  103. height: 80rpx;
  104. display: flex;
  105. align-items: center;
  106. justify-content: center;
  107. border-radius: 40rpx;
  108. transition: all 0.3s ease;
  109. &.active {
  110. background: #1488DB;
  111. .tab-text {
  112. color: #ffffff;
  113. font-weight: bold;
  114. }
  115. }
  116. .tab-text {
  117. font-size: 28rpx;
  118. color: #666666;
  119. transition: all 0.3s ease;
  120. }
  121. }
  122. }
  123. .list-container {
  124. padding: 0 20rpx;
  125. }
  126. .list-item {
  127. background: #ffffff;
  128. margin-bottom: 20rpx;
  129. padding: 30rpx;
  130. border-radius: 15rpx;
  131. display: flex;
  132. align-items: center;
  133. justify-content: space-between;
  134. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  135. .item-left {
  136. display: flex;
  137. align-items: center;
  138. flex: 1;
  139. .item-icon {
  140. width: 60rpx;
  141. height: 60rpx;
  142. margin-right: 20rpx;
  143. border-radius: 50%;
  144. }
  145. .item-info {
  146. flex: 1;
  147. .item-title {
  148. font-size: 28rpx;
  149. color: #333333;
  150. display: block;
  151. margin-bottom: 10rpx;
  152. line-height: 1.4;
  153. }
  154. .item-time {
  155. font-size: 24rpx;
  156. color: #999999;
  157. display: block;
  158. }
  159. }
  160. }
  161. .item-right {
  162. .points-text {
  163. font-size: 28rpx;
  164. font-weight: bold;
  165. &.income {
  166. color: #1488DB;
  167. }
  168. &.expense {
  169. color: #ff4757;
  170. }
  171. }
  172. }
  173. }
  174. </style>