awards.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view>
  3. <view class="bg-img" style="background-image: url('https://upload-file-data.obs.cn-south-1.myhuaweicloud.com/5f263a5a6e7c4f2493e0325f28ab659a-bgimg.png');height: 310upx;"></view>
  4. <view class="container" style="margin: -80upx 30upx 30upx 30upx;">
  5. <view class="padding">
  6. <text class="text-bold text-black padding-right-sm">账户热力值</text>
  7. <text class="text-bold" style="color: #f87a3a;">可兑换到账{{data.totalWithDraw}}元</text>
  8. </view>
  9. <view class="padding-lr flex justify-between align-center">
  10. <view>
  11. <text
  12. style="font-size: 60upx;font-family: PingFang SC;font-weight: 800;color: #F3484E;">{{data.usableHotValue}}</text>
  13. <text class="padding-left-xs"
  14. style="font-size: 24upx;font-family: PingFang SC;font-weight: 800;color: #878787;">热力值</text>
  15. </view>
  16. <button @click="doAwards" class="cu-btn round text-white" style="background-color: #f75757;width: 140upx;">提现</button>
  17. </view>
  18. <view style="margin: 10upx 20upx;">
  19. <u-line color="#e0e0e0"></u-line>
  20. </view>
  21. <view style="padding: 20upx 0upx 0upx 30upx;">
  22. <text class="title">已提现:</text>
  23. <text class="number">{{data.withdrawed}}</text>
  24. <text class="title padding-left-xs">元</text>
  25. </view>
  26. <view style="padding: 10upx 0upx 20upx 30upx;">
  27. <text class="title">可提现:</text>
  28. <text class="number">{{data.usableWithdraw}}</text>
  29. <text class="title padding-left-xs">元</text>
  30. </view>
  31. </view>
  32. <view class="container margin-lr">
  33. <view class="padding flex align-center">
  34. <view class="cuIcon-text text-bold padding-right-xs" style="font-size: 38upx;"></view>
  35. <view class="title">提现明细</view>
  36. </view>
  37. <view v-for="(item, index) in list" :key="index" class="flex align-center justify-between padding-sm">
  38. <view class="padding-lr">
  39. <view class="title">{{item.note}}</view>
  40. <view class="padding-top-sm" style="font-size: 24upx;font-family: PingFang SC;font-weight: bold;color: #686868;">
  41. {{item.createTime}}</view>
  42. </view>
  43. <view class="padding-right">
  44. <text style="font-size: 36upx;font-family: PingFang SC;font-weight: bold;color: #F3484E;">+{{ +item.cashValue}}</text>
  45. <text class="text-bold padding-left-xs">元</text>
  46. </view>
  47. </view>
  48. <view class="padding-top-sm">
  49. </view>
  50. <u-loadmore :status="status" v-if="list.length>8"/>
  51. <view style="padding: 20upx;">
  52. <u-line color="#e0e0e0"></u-line>
  53. </view>
  54. </view>
  55. <view style="height: 30upx;"></view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. userId: '',
  63. data: {},
  64. list:[],
  65. status: 'loadmore',
  66. current:1
  67. }
  68. },
  69. onLoad() {
  70. this.userId = uni.getStorageSync("userId");
  71. if (!this.userId) {
  72. this.$u.toast('用户未登录')
  73. return
  74. }
  75. this.getBonus()
  76. this.fetchData()
  77. },
  78. onReachBottom() {
  79. if(this.list.length<this.current*10){
  80. this.status = 'nomore';
  81. return
  82. }else{
  83. this.status = 'loading';
  84. this.current = ++ this.current;
  85. this.fetchData()
  86. }
  87. },
  88. methods: {
  89. getBonus() {
  90. this.$u.api.user.getBonus({
  91. userId: this.userId
  92. }).then(res => {
  93. this.data = res
  94. })
  95. },
  96. fetchData() {
  97. let params={
  98. size:10,
  99. userId: this.userId,
  100. current:this.current
  101. }
  102. this.$u.api.user.withdrawrecords(params).then(res => {
  103. this.list = [...this.list,...res.records]
  104. })
  105. },
  106. doAwards(){
  107. uni.navigateTo({
  108. url:"doAwards?userId="+this.userId
  109. })
  110. }
  111. }
  112. }
  113. </script>
  114. <style>
  115. .container {
  116. background-color: #FFFFFF;
  117. border-radius: 16upx;
  118. box-shadow: 0px 3px 79px 0px rgba(132, 132, 132, 0.22);
  119. }
  120. .title {
  121. font-size: 28upx;
  122. font-family: PingFang SC;
  123. font-weight: 800;
  124. color: #000000;
  125. }
  126. .number {
  127. font-size: 30upx;
  128. font-family: PingFang SC;
  129. font-weight: 800;
  130. color: #F3484E;
  131. }
  132. </style>