wallet.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view>
  3. <view class="w100 bg-blue plr-36 ptb-40">
  4. <view class="flex">
  5. <view class="white">
  6. <view class="size-28">
  7. 账户余额(元)
  8. </view>
  9. <view class="size-28 mt-20">
  10. ¥{{userInfo.money}}
  11. </view>
  12. <view class="size-28 mt-20">
  13. 可提金额:¥{{money}}
  14. </view>
  15. </view>
  16. <view class="cash text-center blue bg-white" @click="goCash" v-if="userInfo.ts_status==1">
  17. 提现
  18. </view>
  19. </view>
  20. </view>
  21. <view class="">
  22. <view class="plr-36 blue flex size-26" style="background:#f3f0ff;height: 60rpx;">
  23. 平台将收取30%服务费
  24. </view>
  25. <view class="ml-36 size-32 bold mt-40">
  26. 余额明细
  27. </view>
  28. <empty v-if="list.length==0" top="150" text="暂无记录"></empty>
  29. <view class="flex ml-36 mt-30 pr-36 pb-30 bb" v-for="(item,i) in list" :key="i">
  30. <view class="">
  31. <view class="size-32">
  32. {{item.msg}}
  33. </view>
  34. <!-- <view class="size-28 mt-10">
  35. 招银大厦--翰林国际城
  36. </view> -->
  37. <view class="size-26 mt-10 gray-2">
  38. {{item.createtime}}
  39. </view>
  40. </view>
  41. <view class="size-32" style="color: #08ab90;" v-if="item.fluctuate_type==1">
  42. +{{item.amount}}
  43. </view>
  44. <view class="size-32" style="color: #d64b62;" v-if="item.fluctuate_type==2">
  45. -{{item.amount}}
  46. </view>
  47. </view>
  48. </view>
  49. <u-loadmore v-if="list.length>9" :status="status" icon-type="flower" bg-color="#fff" :load-text="loadText" margin-top="30" margin-bottom="30"/>
  50. </view>
  51. </template>
  52. <script>
  53. import {mapState} from 'vuex'
  54. export default {
  55. data() {
  56. return {
  57. money:'',//可提现金额
  58. list:[],
  59. page:1,
  60. status: 'nomore',
  61. loadText: {
  62. loadmore: '上拉加载更多',
  63. loading: '努力加载中',
  64. nomore: '实在没有了'
  65. },
  66. }
  67. },
  68. computed:{
  69. ...mapState(['userInfo'])
  70. },
  71. onLoad() {
  72. this.$store.dispatch('updateUserInfo')
  73. },
  74. onShow() {
  75. this.page = 1
  76. this.list = []
  77. this.getmoney()
  78. this.init()
  79. },
  80. onReachBottom() {
  81. //避免多次触发
  82. if (this.status == 'loading' || this.status == 'nomore') {
  83. return;
  84. }
  85. this.init()
  86. },
  87. methods: {
  88. goCash(){
  89. uni.navigateTo({
  90. url:'/pages/my/cash?money=' + this.money
  91. })
  92. },
  93. // 我的收入
  94. getmoney() {
  95. this.$http('/addons/ddrive/user/userIncome', "POST").then(data => {
  96. console.log(data);
  97. this.money = data.withdraw_money
  98. })
  99. },
  100. // 账单
  101. init(){
  102. this.status = "loading";
  103. this.$http('/addons/ddrive/user/assets',"POST").then(data=>{
  104. console.log(data);
  105. if(data.data.length < 10){
  106. this.status = "nomore"
  107. }else{
  108. this.page = this.page + 1
  109. this.status = "loadmore"
  110. }
  111. this.list = this.list.concat(data.data)
  112. })
  113. }
  114. }
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .cash{
  119. width: 144rpx;
  120. height: 70rpx;
  121. line-height: 70rpx;
  122. }
  123. </style>