team.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <view class="content">
  3. <view class="content-money flex">
  4. <view class="money-box">
  5. <view class="margin-b-20">{{$t('money.a2')}}</view>
  6. <view class="money">{{userWallet}}</view>
  7. </view>
  8. <!-- 数据代办 -->
  9. <view class="box">
  10. <view class="moneybtn-box">
  11. <view class="money-btn"></view>
  12. <view class="money-btn" @click="navto('/pages/user/money/recharge')">{{$t('money.a3')}}</view>
  13. </view>
  14. <view class="moneybtn-box margin-t-10">
  15. <view class="money-btn"></view>
  16. <view class="money-btn" @click="navto('/pages/user/money/withdrawal')">{{$t('money.a4')}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="info-box flex">
  21. <view class="info-item">
  22. <view class="info-font">{{$t('money.a7')}}</view>
  23. <view class="info-num">{{userInfo.brokerage || '0'}}</view>
  24. </view>
  25. <view class="shu"></view>
  26. <view class="info-item">
  27. <view class="info-font">{{$t('money.a8')}}</view>
  28. <view class="info-num">{{userInfo.extract || '0'}}</view>
  29. </view>
  30. </view>
  31. <scroll-view :style="{height:height}" scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
  32. <!-- 空白页 -->
  33. <empty v-if="loaded === true &&list.length === 0"></empty>
  34. <!-- 订单列表 -->
  35. <view class="list flex" v-for="(item, index) in list" :key="index">
  36. <view class="">
  37. <view class="tit" v-if="item.title === '充值'">{{$t('user.a7')}}</view>
  38. <view class="tit" v-else>{{$t('user.a6')}}</view>
  39. <view class="tim">{{item.time}}</view>
  40. </view>
  41. <view class="boxT">
  42. <view class="mon">{{item.money}}</view>
  43. </view>
  44. </view>
  45. </scroll-view>
  46. </view>
  47. </template>
  48. <script>
  49. import {
  50. qianBao
  51. } from "@/api/wallet.js"
  52. import {
  53. gameWallet,
  54. } from "@/api/game.js";
  55. import {
  56. getUserInfo,
  57. } from '@/api/user.js';
  58. import {
  59. getMoneyStyle
  60. } from '@/utils/rocessor.js';
  61. import empty from '@/components/empty';
  62. import {
  63. spreadCommission,
  64. } from '@/api/wallet.js';
  65. export default {
  66. filters: {
  67. getMoneyStyle
  68. },
  69. components: {
  70. empty,
  71. },
  72. data() {
  73. return {
  74. userInfo: {},
  75. userWallet: '', //余额
  76. height: '',
  77. loaded: false,
  78. list: [],
  79. money: ''
  80. };
  81. },
  82. onLoad(options) {},
  83. onReady(res) {
  84. var _this = this;
  85. uni.getSystemInfo({
  86. success: resu => {
  87. const query = uni.createSelectorQuery();
  88. query.select('.list-scroll-content').boundingClientRect();
  89. query.exec(function(res) {
  90. _this.height = resu.windowHeight - res[0].top + 'px';
  91. });
  92. },
  93. fail: res => {}
  94. });
  95. },
  96. onShow() {
  97. this.getUserInfo();
  98. // this.loadData();
  99. this.getUserWallet();
  100. this.qianBao()
  101. },
  102. methods: {
  103. // 钱包
  104. async qianBao() {
  105. const res = await qianBao()
  106. console.log('qian', res);
  107. },
  108. // 获取用户余额信息
  109. getUserWallet() {
  110. gameWallet().then((res) => {
  111. this.userWallet = +res.data.back.USDT.money.money
  112. })
  113. },
  114. getUserInfo() {
  115. getUserInfo({}).then(({
  116. data
  117. }) => {
  118. this.userInfo = data
  119. });
  120. },
  121. toBack() {
  122. uni.switchTab({
  123. url: '/pages/index/user'
  124. });
  125. },
  126. // 页面跳转
  127. navto(e) {
  128. uni.navigateTo({
  129. url: e
  130. });
  131. },
  132. //获取收入支出信息
  133. async loadData(source) {
  134. let obj = this;
  135. //这里是将订单挂载到tab列表下
  136. let index = this.tabCurrentIndex;
  137. let navItem = this.navList[index];
  138. let state = navItem.state;
  139. if (source === 'tabChange' && navItem.loaded === true) {
  140. //tab切换只有第一次需要加载数据
  141. return;
  142. }
  143. if (navItem.loadingType === 'loading') {
  144. //防止重复加载
  145. return;
  146. }
  147. // 修改当前对象状态为加载中
  148. navItem.loadingType = 'loading';
  149. spreadCommission({}, state)
  150. .then(({
  151. data
  152. }) => {
  153. if (data.length > 0) {
  154. data.forEach(e => {
  155. navItem.orderList = navItem.orderList.concat(e.list);
  156. })
  157. console.log(navItem.orderList);
  158. navItem.page++;
  159. }
  160. //判断是否还有数据, 有改为more, 没有改为noMore
  161. if (navItem.limit == data.length) {
  162. navItem.loadingType = 'more';
  163. return;
  164. } else {
  165. navItem.loadingType = 'noMore';
  166. }
  167. uni.hideLoading();
  168. this.$set(navItem, 'loaded', true);
  169. })
  170. .catch(e => {
  171. console.log(e);
  172. });
  173. },
  174. //顶部tab点击
  175. tabClick(index) {
  176. this.tabCurrentIndex = index;
  177. },
  178. }
  179. };
  180. </script>
  181. <style lang="scss">
  182. .content{
  183. line-height: 1;
  184. }
  185. .content-money {
  186. position: relative;
  187. padding: 60rpx 30rpx;
  188. .box {
  189. position: absolute;
  190. right: 0;
  191. top: 50rpx;
  192. font-size: 30rpx;
  193. font-weight: bold;
  194. color: #ffffff;
  195. .moneybtn-box {
  196. padding: 14rpx 40rpx;
  197. border: 2px solid #FFFFFF;
  198. border-bottom-left-radius: 100rpx;
  199. border-top-left-radius: 100rpx;
  200. border-right: none;
  201. }
  202. }
  203. .money-box {
  204. position: relative;
  205. z-index: 2;
  206. color: #ffffff;
  207. text-align: left;
  208. .money {
  209. font-weight: bold;
  210. font-size: 72rpx;
  211. color: #fdb242;
  212. }
  213. }
  214. }
  215. .info-box {
  216. background: #1d1d22;
  217. border-radius: 20rpx;
  218. margin: 0 30rpx;
  219. padding: 30rpx;
  220. .info-item {
  221. width: 50%;
  222. display: flex;
  223. flex-direction: column;
  224. align-items: center;
  225. line-height: 1;
  226. .info-font {
  227. font-size: 30rpx;
  228. font-family: PingFang SC;
  229. font-weight: bold;
  230. color: #e2e2e2;
  231. }
  232. .info-num {
  233. margin-top: 30rpx;
  234. font-size: 30rpx;
  235. font-family: PingFang SC;
  236. font-weight: bold;
  237. color: #ffffff;
  238. }
  239. }
  240. .shu {
  241. width: 2rpx;
  242. height: 74rpx;
  243. background: #ffffff;
  244. }
  245. }
  246. .content {
  247. height: 100%;
  248. .empty-content {
  249. background-color: #ffffff;
  250. }
  251. }
  252. // border-bottom: 1px solid #ffffff;
  253. .list {
  254. margin: 40rpx 31rpx;
  255. .tit {
  256. height: 26rpx;
  257. font-size: 28rpx;
  258. font-weight: 500;
  259. color: #FFFFFF;
  260. }
  261. .tim {
  262. padding-top: 30rpx;
  263. height: 17rpx;
  264. font-size: 22rpx;
  265. font-weight: 400;
  266. color: #999999;
  267. }
  268. .boxT {
  269. .mon {
  270. height: 23rpx;
  271. font-size: 30rpx;
  272. font-weight: bold;
  273. color: #FDB242;
  274. }
  275. }
  276. }
  277. </style>