国外MOSE官网
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.

238 lines
5.2 KiB

6 days 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 v-if="activeTab === 'income'" class="income-list">
  25. <view
  26. v-for="(item, index) in incomeList"
  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.time }}</text>
  35. </view>
  36. </view>
  37. <view class="item-right">
  38. <text class="points-text income">+{{ item.points }}积分</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 expenseList"
  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.time }}</text>
  54. </view>
  55. </view>
  56. <view class="item-right">
  57. <text class="points-text expense">-{{ item.points }}积分</text>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </template>
  64. <script>
  65. export default {
  66. name: 'PointsDetail',
  67. data() {
  68. return {
  69. activeTab: 'income', // 当前激活的tab
  70. incomeList: [
  71. {
  72. title: '野广告清理活动(公益活动)',
  73. time: '2020-12-29 12:54:54',
  74. points: '20'
  75. },
  76. {
  77. title: '关爱自闭症儿童活(公益活动)',
  78. time: '2020-12-29 12:54:54',
  79. points: '30'
  80. },
  81. {
  82. title: '美的公司活动(品牌项目)',
  83. time: '2020-12-29 12:54:54',
  84. points: '10'
  85. },
  86. {
  87. title: '关爱自闭症儿童活(公益活动)',
  88. time: '2020-12-29 12:54:54',
  89. points: '15'
  90. },
  91. {
  92. title: '关爱自闭症儿童培训(培训活动)',
  93. time: '2020-12-29 12:54:54',
  94. points: '10'
  95. }
  96. ],
  97. expenseList: [
  98. {
  99. title: '兑换商品',
  100. time: '2020-12-29 12:54:54',
  101. points: '20'
  102. },
  103. {
  104. title: '兑换商品',
  105. time: '2020-12-29 12:54:54',
  106. points: '30'
  107. },
  108. {
  109. title: '兑换商品',
  110. time: '2020-12-29 12:54:54',
  111. points: '10'
  112. },
  113. {
  114. title: '兑换商品',
  115. time: '2020-12-29 12:54:54',
  116. points: '15'
  117. },
  118. {
  119. title: '兑换商品',
  120. time: '2020-12-29 12:54:54',
  121. points: '10'
  122. }
  123. ]
  124. }
  125. },
  126. methods: {
  127. switchTab(tab) {
  128. this.activeTab = tab;
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. .points-detail {
  135. background: #f8f8f8;
  136. min-height: 100vh;
  137. }
  138. .tab-container {
  139. display: flex;
  140. background: #ffffff;
  141. margin: 20rpx;
  142. border-radius: 50rpx;
  143. padding: 8rpx;
  144. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  145. .tab-item {
  146. flex: 1;
  147. height: 80rpx;
  148. display: flex;
  149. align-items: center;
  150. justify-content: center;
  151. border-radius: 40rpx;
  152. transition: all 0.3s ease;
  153. &.active {
  154. background: #1488DB;
  155. .tab-text {
  156. color: #ffffff;
  157. font-weight: bold;
  158. }
  159. }
  160. .tab-text {
  161. font-size: 28rpx;
  162. color: #666666;
  163. transition: all 0.3s ease;
  164. }
  165. }
  166. }
  167. .list-container {
  168. padding: 0 20rpx;
  169. }
  170. .list-item {
  171. background: #ffffff;
  172. margin-bottom: 20rpx;
  173. padding: 30rpx;
  174. border-radius: 15rpx;
  175. display: flex;
  176. align-items: center;
  177. justify-content: space-between;
  178. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  179. .item-left {
  180. display: flex;
  181. align-items: center;
  182. flex: 1;
  183. .item-icon {
  184. width: 60rpx;
  185. height: 60rpx;
  186. margin-right: 20rpx;
  187. border-radius: 50%;
  188. }
  189. .item-info {
  190. flex: 1;
  191. .item-title {
  192. font-size: 28rpx;
  193. color: #333333;
  194. display: block;
  195. margin-bottom: 10rpx;
  196. line-height: 1.4;
  197. }
  198. .item-time {
  199. font-size: 24rpx;
  200. color: #999999;
  201. display: block;
  202. }
  203. }
  204. }
  205. .item-right {
  206. .points-text {
  207. font-size: 28rpx;
  208. font-weight: bold;
  209. &.income {
  210. color: #1488DB;
  211. }
  212. &.expense {
  213. color: #ff4757;
  214. }
  215. }
  216. }
  217. }
  218. </style>