myDetail.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="container">
  3. <navBar :show-title="true" :title="$t('user.收支明细')" url="/pages/index/index"></navBar>
  4. <!-- <view class="topBox">
  5. <image :src="`../../static/img/userIcon${type=='USDT'?1:2}.png`" class="logo" mode="scaleToFill"></image>
  6. <view class="money">{{money}}</view>
  7. </view> -->
  8. <view class="listBox">
  9. <!-- <view class="listName flex">
  10. <text>
  11. 交易記錄
  12. </text>
  13. <navigator :url="'./transfer?type='+type">
  14. <view class="targetText">
  15. 轉賬
  16. </view>
  17. </navigator>
  18. </view> -->
  19. <view class="listTpl flex" v-for="item,index in list" :key="index">
  20. <view class="tplInfo flex_item">
  21. <image src="/static/img/moneyIcon.png" style="width: 39rpx;height: 43rpx;" mode="widthFix"></image>
  22. <view class="tpl">{{item.title}}<text>{{item.createtime|dateFormat}}</text></view>
  23. </view>
  24. <view class="tip" :class="{'text-linear-gradient':item.pm == 1}">
  25. {{ item.pm == 1?'+':'-'}}
  26. {{item.money*1}}
  27. </view>
  28. </view>
  29. </view>
  30. <u-loadmore :status="loadingType" line :loadmoreText="$t('base.加载更多')" :loadingText="$t('base.正在加载')"
  31. :nomoreText="$t('base.没有更多了')" />
  32. </view>
  33. </template>
  34. <script>
  35. import {
  36. moneyLog,
  37. } from '@/api/index.js';
  38. import {
  39. getUserInfo
  40. } from '@/api/user.js';
  41. import dayjs from '@/libs/dayjs/dayjs.min.js';
  42. import navBar from "@/components/nav/nav.vue"
  43. export default {
  44. data() {
  45. return {
  46. money: 0,
  47. page: 1,
  48. limit:10,
  49. loadingType: "more",
  50. list: [],
  51. type: '',
  52. };
  53. },
  54. components: {
  55. navBar
  56. },
  57. filters: {
  58. dateFormat: function(value) {
  59. return dayjs(value * 1000).format('YYYY/MM/DD hh:mm:ss');
  60. }
  61. },
  62. onLoad(opt) {
  63. this.type = opt.type;
  64. this.loadData();
  65. this.getUserInfo();
  66. uni.setNavigationBarTitle({
  67. title: this.type
  68. })
  69. },
  70. onShow() {},
  71. onReachBottom() {
  72. this.loadData()
  73. },
  74. methods: {
  75. getUserInfo() {
  76. const that = this;
  77. getUserInfo().then((res) => {
  78. that.money = res.data[that.type] * 1;
  79. console.log(that.money)
  80. })
  81. },
  82. loadData() {
  83. let obj = this;
  84. if (obj.loadingType == "nomore" ||
  85. obj.loadingType == "loading") {
  86. return;
  87. }
  88. obj.loadingType = "loading";
  89. moneyLog({
  90. page: obj.page,
  91. limit: obj.limit,
  92. token: obj.type
  93. }).then(res => {
  94. let ar = res.data.list.map((re) => {
  95. return re;
  96. })
  97. console.log(ar)
  98. if (ar.length > 0) {
  99. obj.list = obj.list.concat(ar);
  100. obj.page++;
  101. console.log(obj.limit,ar.length)
  102. console.log(obj.limit == ar.length)
  103. if (obj.limit == ar.length) {
  104. obj.loadingType = "more";
  105. } else {
  106. obj.loadingType = "nomore";
  107. }
  108. } else {
  109. obj.loadingType = "nomore";
  110. }
  111. });
  112. },
  113. },
  114. };
  115. </script>
  116. <style lang="scss" scoped>
  117. .targetText {
  118. background: linear-gradient(90deg, #7D32FF, #3EE0FF);
  119. border-top-left-radius: 100rpx;
  120. border-bottom-left-radius: 100rpx;
  121. padding: 10rpx 30rpx;
  122. padding-left: 50rpx;
  123. }
  124. .container {
  125. line-height: 1;
  126. background-color: rgb(12, 8, 21);
  127. min-height: 100vh;
  128. }
  129. .logo {
  130. width: 120rpx;
  131. height: 120rpx;
  132. border-radius: 100%;
  133. background-color: #e3e3e3;
  134. }
  135. .topBox {
  136. text-align: center;
  137. padding-top: 25rpx;
  138. .money {
  139. font-family: Kozuka Gothic Pr6N;
  140. font-weight: normal;
  141. font-size: 26rpx;
  142. color: #FFFFFF;
  143. line-height: 55rpx;
  144. }
  145. }
  146. .listBox {
  147. color: #FFFFFF;
  148. padding: 25rpx 25rpx;
  149. .listName {
  150. font-weight: 500;
  151. font-size: 30rpx;
  152. padding-bottom: 30rpx;
  153. }
  154. .listTpl {
  155. background: rgba(255, 255, 255, .09);
  156. border-radius: 10rpx;
  157. padding: 40rpx 40rpx;
  158. margin-bottom: 20rpx;
  159. font-weight: 400;
  160. .tplInfo {
  161. .tpl {
  162. padding-left: 25rpx;
  163. font-size: 30rpx;
  164. text {
  165. font-size: 24rpx;
  166. color: #999999;
  167. padding-left: 15rpx;
  168. }
  169. }
  170. }
  171. .tip {
  172. font-size: 36rpx;
  173. }
  174. }
  175. }
  176. </style>