consume-val.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view>
  3. <navbar :config="config" backColor="#999999">
  4. <template v-slot:right>
  5. <view class="" @click.stop="lookExplain()" style="font-size: 28rpx;margin-right: 30rpx;color: #fff;">
  6. <text class="iconfont3">&#xe64c;</text>
  7. <text style="margin-left: 6rpx;">收益说明</text>
  8. </view>
  9. </template>
  10. </navbar>
  11. <view class="consume-top">
  12. <view class="consume-content">
  13. <text class="consume-nuns">{{ $addDecimals(commission_able , 2) }}</text>
  14. <text class="consume-text">贡献值</text>
  15. <text class="consume-text">累计贡献值:{{ $addDecimals(commission_settled , 2) }}</text>
  16. </view>
  17. <view class="look-integral" @click.stop="goIntegrateBalance">
  18. 查看积分
  19. </view>
  20. </view>
  21. <consume-list title="贡献值明细" :status="status" :list="pointsList" :keys="{title: 'remark',
  22. time: 'format_create_time_millis',
  23. val: 'entry_value',
  24. type: 'bill_type'}"></consume-list>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. userbillInfo
  30. } from "@/api/personal-center.js"
  31. import {
  32. getAccountInfo
  33. } from "@/api/login.js"
  34. export default {
  35. data() {
  36. return {
  37. commission_able: 0,
  38. commission_settled: 0,
  39. config: {
  40. back: true, //false是tolbar页面 是则不写
  41. title: '贡献值明细',
  42. color: '#1A1A1A',
  43. // autoBack:true,
  44. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  45. backgroundColor: [1, "#fff"],
  46. statusBarFontColor: '#1A1A1A',
  47. rightSlot: true,
  48. },
  49. params: {
  50. page: 1,
  51. limit: 10
  52. },
  53. pointsList: [],
  54. status: 'loading', //more|loading|noMore
  55. };
  56. },
  57. onShow() {
  58. this.getUserInfo()
  59. this.params.page = 1;
  60. this.pointsList = [];
  61. this.getList();
  62. },
  63. onReachBottom() {
  64. if (this.status !== 'loading' && this.status !== 'noMore') {
  65. this.params.page++
  66. this.getList()
  67. }
  68. },
  69. onPullDownRefresh() {
  70. this.params.page = 1
  71. this.pointsList = []
  72. this.getList()
  73. },
  74. methods: {
  75. lookExplain(){
  76. uni.navigateTo({
  77. url: '/pages/protocol/index?code=income_statement'
  78. })
  79. },
  80. getList() {
  81. this.status = 'loading';
  82. this.$http.get(userbillInfo, this.params).then((res) => {
  83. if (res && res.code == 200) {
  84. uni.stopPullDownRefresh()
  85. this.pointsList = this.pointsList.concat(res.page.list);
  86. if (res.page.totalPage <= res.page.currPage) {
  87. this.status = 'noMore'
  88. } else {
  89. this.status = 'more'
  90. }
  91. }
  92. });
  93. },
  94. //获取个人信息
  95. getUserInfo() {
  96. this.$http.get(getAccountInfo).then(res => {
  97. if (res && res.code == 200) {
  98. this.commission_able = res.data.commission_able;
  99. this.commission_settled = res.data.commission_settled;
  100. uni.setStorageSync("personal", res.data)
  101. }
  102. })
  103. },
  104. // 积分余额
  105. goIntegrateBalance() {
  106. uni.navigateTo({
  107. url: "/pages/user/integrateBalance"
  108. })
  109. },
  110. }
  111. }
  112. </script>
  113. <style lang="scss" scoped>
  114. .consume-top {
  115. width: 100%;
  116. min-height: 365rpx;
  117. background-color: #FA6138;
  118. display: flex;
  119. justify-content: space-between;
  120. align-items: center;
  121. padding: 50rpx 60rpx 173rpx;
  122. .consume-content {
  123. width: 1px;
  124. flex: 1;
  125. display: flex;
  126. flex-direction: column;
  127. .consume-nuns {
  128. font-size: 50rpx;
  129. font-family: PingFang SC, PingFang SC-Regular;
  130. font-weight: 400;
  131. color: #ffffff;
  132. padding-bottom: 15rpx;
  133. }
  134. .consume-text {
  135. font-size: 28rpx;
  136. font-family: PingFang SC, PingFang SC-Regular;
  137. font-weight: 400;
  138. color: #ffffff;
  139. }
  140. }
  141. .look-integral {
  142. flex-shrink: 0;
  143. width: 200rpx;
  144. height: 60rpx;
  145. background: #ffffff;
  146. border-radius: 30rpx;
  147. text-align: center;
  148. line-height: 60rpx;
  149. font-size: 26rpx;
  150. font-family: PingFang SC, PingFang SC-Regular;
  151. font-weight: 400;
  152. color: #FA6138;
  153. }
  154. }
  155. </style>