From d37ceed2ad5b94bbfc71a8a4cbdb7b498ddf724d Mon Sep 17 00:00:00 2001
From: jhzh <1628036192@qq.com>
Date: Sat, 19 Jul 2025 14:14:18 +0800
Subject: [PATCH] 1
---
src/page/user/Warehouse/item.card.vue | 166 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 124 insertions(+), 42 deletions(-)
diff --git a/src/page/user/Warehouse/item.card.vue b/src/page/user/Warehouse/item.card.vue
index fc9362d..5b3ee92 100644
--- a/src/page/user/Warehouse/item.card.vue
+++ b/src/page/user/Warehouse/item.card.vue
@@ -1,80 +1,157 @@
<template>
<div class="item-card-box">
+ <div style="padding: 12px 24px; color: #fff;background-color: #185546;width: max-content;margin-bottom: 20px;">{{$t('日股')}}</div>
<div class="total-assets">
<div class="left">
- <div class="total-name">泰股總資產 ({{ activeObj.laber }})</div>
- <div class="total-data">0.0000</div>
- <div class="total-data-huansuan">≈ $0.0000</div>
+ <!-- <div class="total-name">
+ {{ activeObj.assname }} ()
+ </div> -->
+ <div class="total-data">
+ {{ activeObj.totalMoney }} {{ activeObj.symbolCode }}
+ </div>
</div>
- <div class="right">全部平仓</div>
</div>
<div class="item-card-itembox">
<div class="item">
- <div class="itembox-data">-23.1689</div>
- <div v-if="activeObj.laber !== 'USD'" class="number-text">
- ≈ $0.0000
+ <div class="itembox-data">
+ {{ $t("累計盈虧") }}
</div>
- <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+ <div class="itembox-name">
+ {{ activeObj.isZf === 1 ? "-" : "" }}
+ {{ activeObj.cumulativeProfitAndLoss }}
+ </div>
+
</div>
<div class="item">
- <div class="itembox-data">-23.1689</div>
- <div v-if="activeObj.laber !== 'USD'" class="number-text">
- ≈ $0.0000
+ <div class="itembox-data">
+ {{ $t("浮動盈虧") }}
</div>
- <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+ <div class="itembox-name">
+ ¥{{ activeObj.profitAndLoss }}
+ </div>
+ </div>
+
+ <!-- <div class="item">
+ <div class="itembox-data">
+ ¥{{ activeObj.availableBalance }}
+ </div>
+
+ <div class="itembox-name">
+ {{ $t("可用資產") }} ({{ activeObj.symbolCode }})
+ </div>
+ </div>
+
+ <div class="item">
+ <div class="itembox-data">
+ ¥{{ activeObj.freezeMoney }}
+ </div>
+
+ <div class="itembox-name">
+ {{ $t("凍結資產") }} ({{ activeObj.symbolCode }})
+ </div>
</div>
<div class="item">
- <div class="itembox-data">-23.1689</div>
- <div v-if="activeObj.laber !== 'USD'" class="number-text">
- ≈ $0.0000
+ <div class="itembox-data">
+ ¥{{ activeObj.handlingCharge }}
</div>
- <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+ <div class="itembox-name">
+ {{ $t("總手續費") }} ({{ activeObj.symbolCode }})
+ </div>
</div>
<div class="item">
- <div class="itembox-data">-23.1689</div>
- <div v-if="activeObj.laber !== 'USD'" class="number-text">
- ≈ $0.0000
+ <div class="itembox-data">
+ ¥{{ activeObj.amountToBeCovered }}
</div>
- <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+
+ <div class="itembox-name">
+ {{ $t("待补金额") }} ({{ activeObj.symbolCode }})
+ </div>
+ </div> -->
+ </div>
+ <div class="zj">
+ <div class="zj_box">
+ <div style="display: flex;align-items: center;color: #858093;"><img style="width: 20px;margin-right: 5px;" src="@/assets/img/xiaohao.svg"/>占用资金</div>
+ <div style="color: #185546;font-weight: bold;">{{ activeObj.freezeMoney }}</div>
</div>
- <div class="item">
- <div class="itembox-data">-23.1689</div>
- <div v-if="activeObj.laber !== 'USD'" class="number-text">
- ≈ $0.0000
- </div>
- <div class="itembox-name">浮動盈虧 ({{ activeObj.laber }})</div>
+ <div class="zj_box">
+ <div style="display: flex;align-items: center;color: #858093;"><img style="width: 20px;margin-right: 5px;" src="@/assets/img/xiaohao.svg"/>{{ $t("凍結資產") }}</div>
+ <div style="color: #185546;font-weight: bold;">0.00</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>
+ .zj_box{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ width: 48%;
+ background-color: #E8F4F0;
+ padding: 20px;
+ }
+ .zj{
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-top: 30px;
+ }
.item-card-box {
width: 100%;
min-height: 3.52rem;
margin: 0 auto;
- box-shadow: 0 0.16rem 0.32rem #00b57429;
+ // box-shadow: 0 0.16rem 0.32rem #00b57429;
border-radius: 0.26667rem;
margin-top: 0.42667rem;
- padding: 0.32rem 0.4rem;
+ // padding: 0.32rem 0.4rem;
box-sizing: border-box;
- background-color: #ff5b96;
+ // background-color: #03a7ef;
color: #fff;
.total-assets {
display: flex;
justify-content: space-between;
+ color: #1B1B1B;
.left {
.total-name {
font-style: normal;
@@ -120,28 +197,33 @@
.item-card-itembox {
display: flex;
- flex-wrap: wrap; /* 自动换行 */
+ // flex-wrap: wrap; /* 自动换行 */
+ justify-content: space-between;
.item {
- width: 33%;
+ display: flex;
+ align-items: center;
+ margin-top: 0.45333rem;
+ // width: 50%;
// height: 20px;
- min-width: 33%;
- max-width: 33%;
+ // min-width: 50%;
+ // max-width: 50%;
+ color: #1B1B1B;
// 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;
+ color: #1B1B1B;
+ // margin-top: 0.45333rem;
+ // word-break: break-all;
}
.itembox-name {
- font-style: normal;
- font-weight: 400;
- font-size: 0.32rem;
- color: #fff;
+ font-weight: bold;
+ font-size: 18px;
+ color: #1FB26B;
opacity: 0.8;
- margin-top: 0.13333rem;
+ margin-left: 20px;
+ // margin-top: 0.13333rem;
}
.number-text {
color: #fff;
@@ -154,4 +236,4 @@
}
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3