<template>
|
<div class="item-card-box">
|
<div class="total-assets">
|
<div class="left">
|
<div class="total-name">
|
{{ activeObj.assname }} ({{ activeObj.symbolCode }})
|
</div>
|
<div class="total-data">{{ activeObj.totalMoney || "0.0000" }}</div>
|
<!-- <div class="total-data-huansuan" v-if="activeObj.symbolCode !== $USD">
|
≈ {{ $USD }} {{ activeObj.totalMoneyUSD || "0.0000" }}
|
</div> -->
|
</div>
|
<!-- <div class="right" @click="closeAll">{{ $t("全部平仓") }}</div> -->
|
</div>
|
|
<div class="item-card-itembox">
|
<div class="item">
|
<div class="itembox-data">{{ activeObj.profitAndLoss }}</div>
|
<!-- <div v-if="activeObj.symbolCode !== $USD" class="number-text">
|
≈ {{ $USD }} {{ activeObj.profitAndLossUSD || "0.0000" }}
|
</div> -->
|
<div class="itembox-name">
|
{{ $t("浮動盈虧") }} ({{ activeObj.symbolCode }})
|
</div>
|
</div>
|
<div class="item">
|
<div class="itembox-data">{{ activeObj.availableBalance }}</div>
|
<!-- <div v-if="activeObj.symbolCode !== $USD" class="number-text">
|
≈ {{ $USD }}
|
{{ activeObj.availableBalanceUSD || "0.0000" }}
|
</div> -->
|
<div class="itembox-name">
|
{{ $t("可用資產") }} ({{ activeObj.symbolCode }})
|
</div>
|
</div>
|
<div class="item">
|
<div class="itembox-data">{{ activeObj.cumulativeProfitAndLoss }}</div>
|
<!-- <div v-if="activeObj.symbolCode !== $USD" class="number-text">
|
≈ {{ $USD }}
|
{{ activeObj.cumulativeProfitAndLossUSD || "0.0000" }}
|
</div> -->
|
<div class="itembox-name">
|
{{ $t("累計盈虧") }} ({{ activeObj.symbolCode }})
|
</div>
|
</div>
|
<div class="item">
|
<div class="itembox-data">{{ activeObj.freezeMoney }}</div>
|
<!-- <div v-if="activeObj.symbolCode !== $USD" class="number-text">
|
≈ {{ $USD }} {{ activeObj.freezeMoneyUSD || "0.0000" }}
|
</div> -->
|
<div class="itembox-name">
|
{{ $t("凍結資產") }} ({{ activeObj.symbolCode }})
|
</div>
|
</div>
|
<div class="item">
|
<div class="itembox-data">{{ activeObj.handlingCharge }}</div>
|
<!-- <div v-if="activeObj.symbolCode !== $USD" class="number-text">
|
≈ {{ $USD }} {{ activeObj.handlingChargeUSD || "0.0000" }}
|
</div> -->
|
<div class="itembox-name">
|
{{ $t("總手續費") }} ({{ activeObj.symbolCode }})
|
</div>
|
</div>
|
</div>
|
<Dialog ref="closeAllDialog" :title="$t('一鍵平倉')" :confirm="confirm">
|
<template v-slot:center>
|
<div>{{ $t("您確定一鍵平倉所有訂單嗎?") }}</div>
|
</template>
|
</Dialog>
|
</div>
|
</template>
|
|
<script>
|
import Dialog from "@/components/Dialog";
|
import { allsell } from "../../../axios/api";
|
|
export default {
|
components: { Dialog },
|
props: {
|
activeObj: {
|
type: Object,
|
default: {},
|
},
|
itemClick: {
|
type: Function,
|
default: () => {},
|
},
|
},
|
|
methods: {
|
async confirm() {
|
console.log(this.activeObj.laber);
|
const res = await allsell({ stockType: this.activeObj.laber });
|
if (res.status === 0) {
|
this.itemClick();
|
this.$refs.closeAllDialog.show = false;
|
}
|
},
|
|
closeAll() {
|
this.$refs.closeAllDialog.show = true;
|
},
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
.item-card-box {
|
width: 100%;
|
min-height: 3.52rem;
|
margin: 0 auto;
|
box-shadow: 0 0.16rem 0.32rem #00b57429;
|
border-radius: 0.26667rem;
|
margin-top: 0.42667rem;
|
padding: 0.32rem 0.4rem;
|
box-sizing: border-box;
|
background-color: #ff5b96;
|
color: #fff;
|
.total-assets {
|
display: flex;
|
justify-content: space-between;
|
.left {
|
.total-name {
|
font-style: normal;
|
font-weight: 400;
|
font-size: 0.37333rem;
|
opacity: 0.8;
|
}
|
.total-data {
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.64rem;
|
margin-top: 0.05333rem;
|
}
|
.total-data-huansuan {
|
font-family: PingFang SC;
|
font-size: 0.32rem;
|
font-style: normal;
|
font-weight: 400;
|
line-height: normal;
|
word-break: break-all;
|
}
|
}
|
.right {
|
border-radius: 0.53333rem;
|
background: linear-gradient(130deg, #fff 0%, #f4f4f4 100%);
|
box-shadow: 0 0.16rem 0.24rem #0035641a;
|
color: #cd3a30;
|
text-align: center;
|
font-family: PingFang SC;
|
font-size: 0.37333rem;
|
font-style: normal;
|
font-weight: 500;
|
min-width: 2.50667rem;
|
height: 0.90667rem;
|
flex-shrink: 0;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
line-height: 0.4rem;
|
}
|
}
|
}
|
|
.item-card-itembox {
|
display: flex;
|
flex-wrap: wrap; /* 自动换行 */
|
.item {
|
width: 33%;
|
// height: 20px;
|
min-width: 33%;
|
max-width: 33%;
|
// background-color: #fff;
|
.itembox-data {
|
font-style: normal;
|
font-weight: 500;
|
font-size: 0.37333rem;
|
color: #fff;
|
margin-top: 0.45333rem;
|
word-break: break-all;
|
}
|
.itembox-name {
|
font-style: normal;
|
font-weight: 400;
|
font-size: 0.32rem;
|
color: #fff;
|
opacity: 0.8;
|
margin-top: 0.13333rem;
|
}
|
.number-text {
|
color: #fff;
|
font-family: PingFang SC;
|
font-size: 0.32rem;
|
font-style: normal;
|
font-weight: 400;
|
line-height: normal;
|
word-break: break-all;
|
}
|
}
|
}
|
</style>
|