123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <template>
- <view class="content">
- <view class="content-money flex">
- <view class="money-box">
- <view class="margin-b-20">{{$t('money.a2')}}</view>
- <view class="money">{{userWallet}}</view>
- </view>
- <!-- 数据代办 -->
- <view class="box">
- <view class="moneybtn-box">
- <view class="money-btn"></view>
- <view class="money-btn" @click="navto('/pages/user/money/recharge')">{{$t('money.a3')}}</view>
- </view>
- <view class="moneybtn-box margin-t-10">
- <view class="money-btn"></view>
- <view class="money-btn" @click="navto('/pages/user/money/withdrawal')">{{$t('money.a4')}}</view>
- </view>
- </view>
- </view>
- <view class="info-box flex">
- <view class="info-item">
- <view class="info-font">{{$t('money.a7')}}</view>
- <view class="info-num">{{userInfo.brokerage || '0'}}</view>
- </view>
- <view class="shu"></view>
- <view class="info-item">
- <view class="info-font">{{$t('money.a8')}}</view>
- <view class="info-num">{{userInfo.extract || '0'}}</view>
- </view>
- </view>
- <scroll-view :style="{height:height}" scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
- <!-- 空白页 -->
- <empty v-if="loaded === true &&list.length === 0"></empty>
- <!-- 订单列表 -->
- <view class="list flex" v-for="(item, index) in list" :key="index">
- <view class="">
- <view class="tit" v-if="item.title === '充值'">{{$t('user.a7')}}</view>
- <view class="tit" v-else>{{$t('user.a6')}}</view>
- <view class="tim">{{item.time}}</view>
- </view>
- <view class="boxT">
- <view class="mon">{{item.money}}</view>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- import {
- qianBao
- } from "@/api/wallet.js"
- import {
- gameWallet,
- } from "@/api/game.js";
- import {
- getUserInfo,
- } from '@/api/user.js';
- import {
- getMoneyStyle
- } from '@/utils/rocessor.js';
- import empty from '@/components/empty';
- import {
- spreadCommission,
- } from '@/api/wallet.js';
- export default {
- filters: {
- getMoneyStyle
- },
- components: {
- empty,
- },
- data() {
- return {
- userInfo: {},
- userWallet: '', //余额
- height: '',
- loaded: false,
- list: [],
- money: ''
- };
- },
- onLoad(options) {},
- onReady(res) {
- var _this = this;
- uni.getSystemInfo({
- success: resu => {
- const query = uni.createSelectorQuery();
- query.select('.list-scroll-content').boundingClientRect();
- query.exec(function(res) {
- _this.height = resu.windowHeight - res[0].top + 'px';
- });
- },
- fail: res => {}
- });
- },
- onShow() {
- this.getUserInfo();
- // this.loadData();
- this.getUserWallet();
- this.qianBao()
- },
- methods: {
- // 钱包
- async qianBao() {
- const res = await qianBao()
- console.log('qian', res);
- },
- // 获取用户余额信息
- getUserWallet() {
- gameWallet().then((res) => {
- this.userWallet = +res.data.back.USDT.money.money
- })
- },
- getUserInfo() {
- getUserInfo({}).then(({
- data
- }) => {
- this.userInfo = data
- });
- },
- toBack() {
- uni.switchTab({
- url: '/pages/index/user'
- });
- },
- // 页面跳转
- navto(e) {
- uni.navigateTo({
- url: e
- });
- },
- //获取收入支出信息
- async loadData(source) {
- let obj = this;
- //这里是将订单挂载到tab列表下
- let index = this.tabCurrentIndex;
- let navItem = this.navList[index];
- let state = navItem.state;
- if (source === 'tabChange' && navItem.loaded === true) {
- //tab切换只有第一次需要加载数据
- return;
- }
- if (navItem.loadingType === 'loading') {
- //防止重复加载
- return;
- }
- // 修改当前对象状态为加载中
- navItem.loadingType = 'loading';
- spreadCommission({}, state)
- .then(({
- data
- }) => {
- if (data.length > 0) {
- data.forEach(e => {
- navItem.orderList = navItem.orderList.concat(e.list);
- })
- console.log(navItem.orderList);
- navItem.page++;
- }
- //判断是否还有数据, 有改为more, 没有改为noMore
- if (navItem.limit == data.length) {
- navItem.loadingType = 'more';
- return;
- } else {
- navItem.loadingType = 'noMore';
- }
- uni.hideLoading();
- this.$set(navItem, 'loaded', true);
- })
- .catch(e => {
- console.log(e);
- });
- },
- //顶部tab点击
- tabClick(index) {
- this.tabCurrentIndex = index;
- },
- }
- };
- </script>
- <style lang="scss">
- .content{
- line-height: 1;
- }
- .content-money {
- position: relative;
- padding: 60rpx 30rpx;
- .box {
- position: absolute;
- right: 0;
- top: 50rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #ffffff;
- .moneybtn-box {
- padding: 14rpx 40rpx;
- border: 2px solid #FFFFFF;
- border-bottom-left-radius: 100rpx;
- border-top-left-radius: 100rpx;
- border-right: none;
- }
- }
- .money-box {
- position: relative;
- z-index: 2;
- color: #ffffff;
- text-align: left;
-
- .money {
- font-weight: bold;
- font-size: 72rpx;
- color: #fdb242;
- }
- }
- }
- .info-box {
- background: #1d1d22;
- border-radius: 20rpx;
- margin: 0 30rpx;
- padding: 30rpx;
- .info-item {
- width: 50%;
- display: flex;
- flex-direction: column;
- align-items: center;
- line-height: 1;
- .info-font {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #e2e2e2;
- }
- .info-num {
- margin-top: 30rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #ffffff;
- }
- }
- .shu {
- width: 2rpx;
- height: 74rpx;
- background: #ffffff;
- }
- }
-
- .content {
- height: 100%;
- .empty-content {
- background-color: #ffffff;
- }
- }
- // border-bottom: 1px solid #ffffff;
- .list {
- margin: 40rpx 31rpx;
- .tit {
- height: 26rpx;
- font-size: 28rpx;
- font-weight: 500;
- color: #FFFFFF;
- }
- .tim {
- padding-top: 30rpx;
- height: 17rpx;
- font-size: 22rpx;
- font-weight: 400;
- color: #999999;
- }
- .boxT {
- .mon {
- height: 23rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #FDB242;
- }
- }
- }
- </style>
|