123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405 |
- <template>
- <view class="container">
- <view class="top">
- <view class="my">{{$t('home.d4')}}</view>
- <view class="userinfo flex">
- <view class="flex" @click="navTo('/pages/user/set/userinfo')">
- <image class="image margin-r-10" :src="userInfo.avatar || '/static/error/missing-face.png'"
- mode="scaleToFill">
- </image>
- <view class="info">
- <view class="infor margin-b-20">{{ userInfo.nickname || '游客' }}</view>
- <view class="uservip flex-start" v-if="userInfo.vip">
- <text>
- {{ userInfo.vip_name}}
- </text>
- <image class="vipIcon" :src="userInfo.vip_icon" mode="scaleToFill"></image>
- </view>
- </view>
- </view>
- <image @click="showY" class="inf" src="../../static/shouye/userinfo.png" mode="scaleToFill"></image>
- </view>
- </view>
- <!-- 余额 -->
- <view class="body">
- <template v-if="hasLogin">
- <view v-if="show" class="yue margin-b-30">
- <view class="te">
- {{$t('user.c1')}}
- </view>
- <view class="tex">
- {{userWallet}}U
- </view>
- <view class="btn flex">
- <button @click="navTo('/pages/user/money/recharge')" class="btn1"> <text>{{$t('user.a7')}}</text>
- </button>
- <button @click="navTo('/pages/user/money/withdrawal')" class="btn1"> <text>{{$t('user.a6')}}</text>
- </button>
- </view>
- </view>
- <view v-else class="yue1 margin-b-30">
- <view class="tj">{{$t('user.a1')}}</view>
- <view class="tj-item flex ">
- <view class="lj">{{$t('user.a4')}}{{$t('user.a7')}}</view>
- <view class="ljsu">{{userInfo.sum_recharge || 0}}</view>
- </view>
- <view class="tj-item flex">
- <view class="lj">{{$t('user.a4')}}{{$t('user.a6')}}</view>
- <view class="ljsu">{{userInfo.sum_extract || 0}}</view>
- </view>
- <view class="tj-item flex">
- <view class="lj">{{$t('user.a8')}}</view>
- <view class="ljsu">{{sum_win || 0}}</view>
- </view>
- <view class="tj-item flex">
- <view class="lj">{{$t('user.a9')}}</view>
- <view class="ljsu">{{sum_bet || 0}}</view>
- </view>
- <view class="tj-item flex">
- <view class="lj">{{$t('user.a10')}}</view>
- <view class="ljsu">{{group_sum_bet || 0}}</view>
- </view>
- </view>
- </template>
- <!-- 列表 -->
- <view class="gj">
- {{$t('user.b1')}}
- </view>
- <view class="user-list flex" @click="navTo('/pages/user/money/team')">
- <image src="../../static/shouye/yue.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b2')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view>
-
- <!-- 额外添加 -->
- <view class="user-list flex" @click="navTo('/pages/user/shareQrCode')">
- <image src="../../static/shouye/money.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b3')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view>
- <!-- 额外添加 -->
- <view class="user-list flex" @click="navTo('/pages/user/vip/tabulation')">
- <image src="../../static/shouye/liebiao.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b4')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view>
- <view class="user-list flex" @click="navTo('/pages/user/favorites')">
- <image src="../../static/shouye/liebiao.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b5')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view>
- <!-- <view class="user-list flex" @click="openKf()">
- <image src="../../static/shouye/liuyan.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b6')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view> -->
- <!-- <view class="user-list flex" @click="navTo('/pages/user/set/transaction')">
- <image src="../../static/shouye/jiaoyi.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b7')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view> -->
- <!-- <view class="user-list flex" @click="navTo('/pages/public/login')">
- <image src="../../static/shouye/tuichu.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b8')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view> -->
-
- <!-- 跳转到联系客服 -->
- <view class="user-list flex" @click="nav()">
- <image src="../../static/shouye/yue.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.a2')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view>
- <!-- todo -->
- <view class="user-list flex" @click="navTo('/pages/user/set/set')">
- <image src="../../static/shouye/shezhi.png" mode="scaleToFill" class="left-img"></image>
- <view class="item-name">
- {{$t('user.b9')}}
- </view>
- <image src="../../static/icon/back.png" mode="scaleToFill" class="right-img"></image>
- </view>
-
- </view>
- <taber tab='user'></taber>
- </view>
- </template>
- <script>
- import {
- getIndex,
- } from "@/api/index.js";
-
- import {
- gameWallet,
- } from "@/api/game.js";
- import taber from "@/components/footer/footer.vue";
- import {
- mapState,
- mapMutations
- } from 'vuex';
- import {
- getUserInfo,
- getUser
- } from '@/api/user.js';
- import {
- saveUrl,
- interceptor
- } from '@/utils/loginUtils.js';
- export default {
- components: {
- taber
- },
- data() {
- return {
- current: 2,
- show: true,
- userWallet: 0, //余额
- extractTotalPrice: '', //累计体现
- sum_win: '', //累计收益
- sum_bet: '', //个人交易量
- group_sum_bet: '', // 团队交易量
- user:{},
- service: ""
- };
- },
- onShow() {
- // 判断是否已经登录
- if (this.hasLogin) {
- this.getUserWallet();
- this.getUser();
- }
- this.loadBaseData();
- this.getIndex()
- },
- computed: {
- ...mapState('user', [ 'hasLogin','userInfo'])
- },
- methods: {
- ...mapMutations('user', ['setUserInfo']),
- showY() {
- this.show = !this.show
- },
- async getIndex() {
- const res = await getIndex()
- this.service = res.data.service
- },
- // 统计表
- async getUser() {
- const res = await getUser();
- this.user = res.data;
- this.recharge = res.data.recharge;
- this.extractTotalPrice = res.data.extractTotalPrice;
- this.sum_win = res.data.sum_win.toFixed(2);
- this.sum_bet = res.data.sum_bet
- this.group_sum_bet = res.data.group_sum_bet
- },
- // 跳转到联系客服
- nav() {
- window.location.href = this.service
- },
- // 获取用户余额信息
- getUserWallet() {
- gameWallet().then((res) => {
- const balance = Number(res.data.back.USDT.money.money);
- this.userWallet = +balance.toFixed(2);
- // this.userWallet = +res.data.back.USDT.money.money
- })
- },
- // 加载初始数据
- loadBaseData() {
- const obj = this
- getUserInfo({})
- .then(({
- data
- }) => {
- obj.setUserInfo(data);
- })
- .catch(e => {
- console.log(e);
- });
- },
- /**
- * 统一跳转接口,拦截未登录路由
- * navigator标签现在默认没有转场动画,所以用view
- */
- navTo(url) {
- if (!this.hasLogin) {
- // 保存地址
- saveUrl();
- // 登录拦截
- interceptor();
- } else {
- uni.navigateTo({
- url
- });
- }
- },
- }
- };
- </script>
- <style lang="scss">
- .container {
- height: 100%;
- line-height: 1;
- }
- .top {
- height: 327rpx;
- background-color: #000000;
- padding: 0 45rpx;
- .my {
- padding-top: 40rpx;
- font-size: 48rpx;
- font-weight: 500;
- color: #FFFFFF;
- }
- .userinfo {
- padding-top: 40rpx;
- .image {
- border-radius: 100rpx;
- overflow: hidden;
- width: 125rpx;
- height: 125rpx;
- }
- .info {
- .infor {
- font-size: 30rpx;
- font-weight: 500;
- color: #FFFFFF;
- }
- .vipIcon{
- width: 40rpx;
- height: 40rpx;
- margin-left: 10rpx;
- }
- .uservip {
- font-size: 20rpx;
- font-weight: 500;
- color: #93794B;
- }
- }
- }
- }
- .inf {
- margin-top: 25rpx;
- width: 48rpx;
- height: 48rpx;
- }
- // body
- .body {
- background-color: #191a1f;
- padding: 30rpx;
- border-top-right-radius: 60rpx;
- border-top-left-radius: 60rpx;
- color: #FFFFFF;
- .yue {
- border-radius: 60rpx;
- background-color: #000000;
- text-align: center;
- padding-top: 40rpx;
- padding-bottom: 35rpx;
- .te {
- font-size: 26rpx;
- font-weight: 500;
- padding-bottom: 30rpx;
- }
- .tex {
- font-size: 48rpx;
- font-weight: bold;
- padding-bottom: 50rpx;
- }
- .btn {
- padding: 0 50rpx;
- .btn1 {
- min-width: 270rpx;
- background: #FDB242;
- border-radius: 10rpx;
- font-size: $font-base;
- }
- }
- }
- .yue1 {
- background-color: #000000;
- padding: 30rpx;
- color: #FFFFFF;
- border-radius: 60rpx;
- .tj {
- font-size: 30rpx;
- font-weight: bold;
- text-align: center;
- }
- .tj-item {
- padding-top: 26rpx;
- font-size: 24rpx;
- opacity: 0.65;
- }
- }
- }
- .gj {
- margin-left: 20rpx;
- padding-top: 10rpx;
- font-size: 36rpx;
- font-weight: bold;
- color: #FFFFFF;
- padding-bottom: 10rpx;
- }
- .user-list {
- background: #191a1f;
- box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
- margin: 0 auto;
- padding: 30rpx 25rpx;
- border-bottom: 1px solid rgba(240, 240, 240, 0.2);
- .left-img {
- width: 40rpx;
- height: 40rpx;
- margin-right: 20rpx;
- }
- .item-name {
- flex-grow: 1;
- font-size: 29rpx;
- font-weight: bold;
- color: #FFF;
- }
- .right-img {
- width: 18rpx;
- height: 27rpx;
- }
- }
- </style>
|