<template>
|
<div class="account">
|
<div class="tui-userInfo flex-between">
|
<div class="userinfo-box flex-center">
|
<img src="@/assets/img/avatar_.png" alt="" />
|
<div>{{ userInfo.phone }}</div>
|
</div>
|
<div class="tui-rightsetting flex-center">
|
<img
|
src="@/assets/img/services.png"
|
alt=""
|
@click="$store.dispatch('CustomerService')"
|
/>
|
<img
|
src="@/assets/img/setting.png"
|
alt=""
|
@click="$router.push('/setting')"
|
/>
|
</div>
|
</div>
|
|
<div class="tui-money">
|
<div class="normal flex-between">
|
<div>
|
<div class="text-xs">{{ $t("hometips") }}</div>
|
<div class="price">
|
{{ moneyData.symbol }} {{ moneyData.totalMoney }}
|
</div>
|
</div>
|
</div>
|
<div class="normal flex-between">
|
<div>
|
<div class="text-xs">{{ $t("每週盈利") }}</div>
|
<div class="price" style="font-size: .6rem;">
|
{{ moneyData.symbol }} {{ weeklyProfit }}
|
</div>
|
</div>
|
</div>
|
<div class="normal flex-between">
|
<div>
|
<div class="text-xs">{{ $t("hj48") }}</div>
|
<div class="price" style="font-size: .3rem;">
|
{{ moneyData.symbol }} {{ moneyData.availableBalance }}
|
</div>
|
</div>
|
</div>
|
<div class="normal flex-between">
|
<div>
|
<div class="text-xs">{{ $t("平仓盈亏") }}</div>
|
<div class="price" style="font-size: .3rem;">
|
{{ moneyData.symbol }} {{ moneyData.cumulativeProfitAndLoss }}
|
</div>
|
</div>
|
</div>
|
<!-- <div class="all-assets flex-center">
|
<div class="assets-item flex-center">
|
<div class="all-size">{{ $t("hj48") }}</div>
|
<div class="big-size">{{ moneyData.availableBalance }}</div>
|
</div>
|
<div class="assets-item flex-center" style="align-items: end;">
|
<div class="all-size">{{ $t("平仓盈亏") }}</div>
|
<div class="big-size">{{ moneyData.cumulativeProfitAndLoss }}</div>
|
</div>
|
</div> -->
|
</div>
|
|
<div class="tui-spendMoney flex-between-start">
|
<div class="tui-rightItem flex-center" @click="czts">
|
<img src="@/assets/img/account_1.png" />
|
<div class="text">{{ this.$t("hj172") }}</div>
|
</div>
|
<div
|
class="tui-rightItem flex-center"
|
v-for="i in tabs"
|
:key="i.name"
|
@click="toPage(i.path)"
|
>
|
<img :src="i.img" />
|
<div class="text">{{ i.name }}</div>
|
</div>
|
</div>
|
|
<!-- <my-order :Operation="true"></my-order> -->
|
</div>
|
</template>
|
|
<script>
|
import { Toast } from "vant";
|
import tabHead from "@/components/tabHead.vue";
|
import myOrder from "@/page/user/myOrder.vue";
|
import * as api from "@/axios/api";
|
export default {
|
name: "account",
|
components: {
|
tabHead,
|
myOrder
|
},
|
data() {
|
return {
|
userInfo: {}, // 用户信息
|
moneyData: {}, // 账户金额
|
positionData: {}, // 账户持仓数据
|
weeklyProfit: 0, // 每周盈利数据
|
tabs: [
|
{
|
name: this.$t("hj177"),
|
img: require("@/assets/img/account_2.png"),
|
path: "/RechargeSure"
|
},
|
{
|
name: this.$t("hj168"),
|
img: require("@/assets/img/account_3.png"),
|
path: "/rechargelist"
|
},
|
{
|
name: this.$t("hj162"),
|
img: require("@/assets/img/account_4.png"),
|
path: "/cashlist"
|
},
|
{
|
name: this.$t("hj247"),
|
img: require("@/assets/img/account_5.png"),
|
path: "/banklist"
|
}
|
]
|
};
|
},
|
methods: {
|
// 获取账户金额
|
async getMoney() {
|
let data = await api.getMoney();
|
if (data.status === 0) {
|
this.moneyData = data.data[0];
|
}
|
},
|
// 获取账户每周盈利
|
async getWeeklyProfit() {
|
let data = await api.getWeeklyProfit();
|
if (data.status === 0) {
|
this.weeklyProfit = data.data;
|
}
|
},
|
// 获取账户持仓数据
|
async getMyPositionProfitAndLose() {
|
let data = await api.getMyPositionProfitAndLose();
|
if (data.status === 0) {
|
this.positionData = data.data;
|
}
|
},
|
// 获取用户信息
|
async getUserInfo() {
|
let data = await api.getUserInfodata();
|
if (data.status === 0) {
|
// 判断是否登录
|
this.$store.commit("dialogVisible", false);
|
this.$store.state.userInfo = data.data;
|
this.userInfo = data.data;
|
} else {
|
this.$store.commit("dialogVisible", true);
|
}
|
},
|
// 跳转
|
toPage(url) {
|
if (!url) return;
|
this.$router.push(url);
|
},
|
// 充值提示
|
czts() {
|
Toast(this.$t("充值提示"));
|
}
|
},
|
created() {
|
this.getUserInfo();
|
this.getMoney();
|
this.getWeeklyProfit();
|
// this.getMyPositionProfitAndLose();
|
}
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.account {
|
width: 100%;
|
min-height: 100vh;
|
padding: 0 0.475rem;
|
.tui-spendMoney {
|
font-size: 0.375rem;
|
margin-top: 0.3rem;
|
.tui-rightItem {
|
padding: 0.4rem 0;
|
width: 20%;
|
border-radius: 0.325rem;
|
flex-direction: column;
|
.text {
|
width: 100%;
|
font-size: 0.3rem;
|
font-weight: 500;
|
padding-top: 0.15rem;
|
text-align: center;
|
color: #b1b2b3;
|
}
|
img {
|
width: 0.825rem;
|
height: 0.825rem;
|
}
|
}
|
}
|
.tui-money {
|
margin-top: 0.65rem;
|
background: linear-gradient(90deg, #585fb4, #48529e);
|
border-radius: 0.175rem;
|
.all-assets {
|
width: 100%;
|
padding: 0.225rem 0 0.35rem;
|
justify-content: space-evenly;
|
.assets-item {
|
width: 50%;
|
flex-shrink: 0;
|
flex-direction: column;
|
align-items: start;
|
padding: 0 0.3rem;
|
.big-size {
|
font-size: 0.4rem;
|
color: #fff;
|
padding-top: 0.15rem;
|
}
|
.all-size {
|
font-size: 0.35rem;
|
color: #c4c7e4;
|
}
|
}
|
}
|
.normal {
|
padding: 0.375rem 0;
|
margin: 0 0.375rem;
|
position: relative;
|
.price {
|
font-size: 0.825rem;
|
// line-height: 0.825rem;
|
font-weight: 500;
|
padding-top: 0.3rem;
|
color: #fff;
|
}
|
.text-xs {
|
font-size: 0.3rem;
|
color: #c7c9e6;
|
}
|
}
|
}
|
.tui-userInfo {
|
box-sizing: border-box;
|
padding-top: 0.95rem;
|
height: 2.1rem;
|
.tui-rightsetting {
|
img {
|
display: block;
|
width: 0.675rem;
|
height: 0.675rem;
|
margin: 0 0.175rem;
|
}
|
}
|
.userinfo-box {
|
font-size: 0.65rem;
|
font-weight: 700;
|
color: #fff;
|
img {
|
width: 1.2rem;
|
height: 1.2rem;
|
margin-right: 0.35rem;
|
}
|
}
|
}
|
}
|
</style>
|