money.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="container">
  3. <view class="topBox">
  4. <image :src="dataMoney[type]?dataMoney[type].LOGO:''" class="logo" mode="scaleToFill"></image>
  5. <view class="money">{{money}}</view>
  6. </view>
  7. <view class="listBox">
  8. <view class="listName">交易记录</view>
  9. <view class="listTpl flex" v-for="item,index in list" :key="index">
  10. <view class="tplInfo flex_item">
  11. <image src="/static/image/img33.png" style="width: 39rpx;height: 43rpx;" mode="widthFix"></image>
  12. <view class="tpl">{{item.title}}<text>{{item.add_time}}</text></view>
  13. </view>
  14. <view class="tip" :style="{color:( item.pm == 0? '#fff' :'#0C5AFA')}">
  15. {{ item.pm == 1?'+':'-'}}
  16. {{item.number}}
  17. </view>
  18. </view>
  19. </view>
  20. <uni-load-more :status="loadingType"></uni-load-more>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. moneyLog,
  26. } from '@/api/game.js';
  27. import {
  28. qianBao
  29. } from '@/api/wallet.js';
  30. export default {
  31. data() {
  32. return{
  33. money:0,
  34. page:1,
  35. loadingType: "more",
  36. list:[],
  37. type:'',
  38. dataMoney:{}
  39. };
  40. },
  41. onLoad(opt) {
  42. this.type = opt.type;
  43. this.loadData();
  44. this.qianbao();
  45. uni.setNavigationBarTitle({
  46. title:this.type
  47. })
  48. },
  49. onShow() {},
  50. onReachBottom() {
  51. // this.loadData()
  52. },
  53. methods: {
  54. qianbao() {
  55. const that = this;
  56. qianBao().then((res) => {
  57. that.dataMoney = res.data.back;
  58. that.money = that.dataMoney[that.type].money.money*1;
  59. console.log(that.dataMoney,'that.money');
  60. })
  61. },
  62. loadData(){
  63. let obj = this;
  64. if (obj.loadingType == "nomore" ||
  65. obj.loadingType == "loading"){
  66. return;
  67. }
  68. obj.loadingType = "loading";
  69. moneyLog({
  70. page:obj.page,
  71. limit:10,
  72. moneyType:obj.type
  73. },obj.status).then(res => {
  74. let ar = res.data.list.map((re)=>{
  75. re.number = +re.number
  76. return re
  77. })
  78. if (ar.length > 0) {
  79. obj.list = obj.list.concat(ar);
  80. obj.page++;
  81. if (obj.limit == ar.length) {
  82. obj.loadingType = "more";
  83. } else {
  84. obj.loadingType = "nomore";
  85. }
  86. }
  87. });
  88. },
  89. },
  90. };
  91. </script>
  92. <style lang="scss" scoped>
  93. .container{
  94. padding: 25rpx 25rpx;
  95. }
  96. .logo{
  97. width: 120rpx;
  98. height: 120rpx;
  99. border-radius: 100%;
  100. background-color: #e3e3e3;
  101. }
  102. .topBox{
  103. text-align: center;
  104. padding-top: 25rpx;
  105. .money{
  106. font-family: Kozuka Gothic Pr6N;
  107. font-weight: normal;
  108. font-size: 26rpx;
  109. color: #FFFFFF;
  110. line-height: 55rpx;
  111. }
  112. }
  113. .listBox{
  114. color: #FFFFFF;
  115. .listName{
  116. font-weight: 500;
  117. font-size: 30rpx;
  118. color: #FFFFFF;
  119. padding-bottom: 30rpx;
  120. }
  121. .listTpl{
  122. background: #1F2A4A;
  123. border-radius: 10rpx;
  124. padding: 40rpx 40rpx;
  125. margin-bottom: 20rpx;
  126. .tplInfo{
  127. .tpl{
  128. padding-left: 25rpx;
  129. font-weight: 400;
  130. font-size: 30rpx;
  131. color: #FFFFFF;
  132. text{
  133. font-weight: 400;
  134. font-size: 24rpx;
  135. color: #999999;
  136. padding-left: 15rpx;
  137. }
  138. }
  139. }
  140. .tip{
  141. font-weight: 400;
  142. font-size: 36rpx;
  143. color: #4C5D97;
  144. }
  145. }
  146. }
  147. </style>