index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!-- #ifdef H5 -->
  2. <template >
  3. <view class="wallet_received" :style="colorStyle">
  4. <view class="tota_income">
  5. <text class="t-t"> {{ moneyObj.receiveItemAmount }}</text>
  6. <text class="t-b"> 总收益</text>
  7. </view>
  8. <view class="tota_history">
  9. <view class="h-item" v-for="(src, i) in historyList" :key="src.id">
  10. <view class="h-l">
  11. <text>{{ src.createTime }}</text>
  12. <text>{{ ["随机红包", "专属红包","收益红包"][src.type] }}</text>
  13. </view>
  14. <view class="h-r">
  15. <text class="exr">领取了</text>
  16. <text class="imp">{{ src.grabAmount }}元</text>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script> import {
  23. logListByUserId,
  24. todayStatistics
  25. } from '@/api/home.js';
  26. export default {
  27. components: {
  28. },
  29. data () {
  30. return {
  31. historyList: [],
  32. moneyObj: {
  33. lossTotalAmount: "0",
  34. receiveItemAmount: "0",
  35. receiveItemCount: 0,
  36. redEnvelopeItemCount: 0,
  37. remainItemCount: 0,
  38. totalReceivedRedEnvelopeAmount: "0",
  39. totalRedEnvelopeAmount: "0",
  40. totalRemainItemAmount: "0"
  41. },
  42. };
  43. },
  44. onPullDownRefresh () {
  45. this.logListByUserId()
  46. this.todayStatistics()
  47. },
  48. onLoad (options) {
  49. },
  50. created () {
  51. this.logListByUserId()
  52. this.todayStatistics()
  53. },
  54. methods: {
  55. todayStatistics () {
  56. todayStatistics().then(res => {
  57. this.moneyObj = res.data
  58. })
  59. },
  60. logListByUserId () {
  61. let that = this
  62. logListByUserId().then(res => {
  63. if (res.data.length > 0) {
  64. that.$set(that, "historyList", res.data)
  65. } else {
  66. that.$set(that, "historyList", [])
  67. }
  68. uni.stopPullDownRefresh();
  69. })
  70. },
  71. }
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .wallet_received {
  76. .tota_income {
  77. height: 250rpx;
  78. background: rgb(250, 250, 250);
  79. box-sizing: border-box;
  80. padding-top: 20px;
  81. padding-bottom: 20px;
  82. .t-t {
  83. display: block;
  84. text-align: center;
  85. width: 100%;
  86. font-size: 30px;
  87. }
  88. .t-b {
  89. display: block;
  90. text-align: center;
  91. font-size: 15px;
  92. font-family: PingFangSC-Regular, PingFang SC;
  93. font-weight: 400;
  94. }
  95. }
  96. .tota_history {
  97. .h-item {
  98. display: flex;
  99. padding: 10px;
  100. height: 150rpx;
  101. background: white;
  102. border-bottom: 3px solid rgb(250, 250, 250);
  103. .h-l {
  104. display: flex;
  105. flex-direction: column;
  106. text-align: left;
  107. flex: 1;
  108. &:nth-child(0) {
  109. height: 21px;
  110. font-size: 15px;
  111. font-family: PingFangSC-Medium, PingFang SC;
  112. font-weight: 500;
  113. color: #333333;
  114. line-height: 21px;
  115. }
  116. &:nth-child(1) {
  117. height: 20px;
  118. font-size: 14px;
  119. font-family: PingFangSC-Regular, PingFang SC;
  120. font-weight: 400;
  121. color: #666666;
  122. line-height: 20px;
  123. }
  124. }
  125. .h-r {
  126. display: flex;
  127. text-align: right;
  128. flex: 1;
  129. font-size: 12px;
  130. font-family: PingFangSC-Regular, PingFang SC;
  131. font-weight: 400;
  132. color: #666666;
  133. line-height: 100rpx;
  134. .exr{
  135. flex-grow: 1;
  136. }
  137. .imp {
  138. font-size: 16px;
  139. font-family: DINAlternate-Bold, DINAlternate;
  140. color: #eb4c63;
  141. }
  142. }
  143. }
  144. }
  145. }
  146. </style>
  147. <!-- #endif -->