From 6bf742b19037b59da70f2bc4119c9c0c68430870 Mon Sep 17 00:00:00 2001
From: PC-20250623MANY\Administrator <344137771@qq.com>
Date: Sat, 19 Jul 2025 18:22:38 +0800
Subject: [PATCH] 1

---
 src/page/trading/TradeNew.vue |   76 +++++++++++++++++++++++++++++++------
 1 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/src/page/trading/TradeNew.vue b/src/page/trading/TradeNew.vue
index b56beb8..bff737b 100644
--- a/src/page/trading/TradeNew.vue
+++ b/src/page/trading/TradeNew.vue
@@ -2,6 +2,16 @@
   <div class="trade_new">
     <tab-head></tab-head>
 
+    <div class="order_tabs">
+      <van-tabs v-model="active" swipe-threshold="1">
+        <van-tab :title="$t('hj160')" name=""></van-tab>
+        <van-tab title="AI" name="4"></van-tab>
+        <van-tab :title="$t('hj621')" name="3"></van-tab>
+        <van-tab title="IPO" name="2"></van-tab>
+        <van-tab :title="$t('日内')" name="0"></van-tab>
+      </van-tabs>
+    </div>
+
     <van-row class="list_head">
       <van-col span="8" class="flex-start head_item">
         {{ $t("hj313") }}/{{ $t("Worth") }}
@@ -26,7 +36,7 @@
           <span class="i_hint">{{ i.stockSpell }}</span>
         </div>
         <div class="i_name">
-          {{ i.orderNum * i.now_price }}
+          {{ (i.orderNum * i.now_price).toFixed(2) }}
         </div>
       </van-col>
       <van-col span="8" class="item_n">
@@ -43,23 +53,27 @@
           <span>{{ i.now_price }}</span>
         </div>
       </van-col>
-      <!-- <van-col span="24" class="flex-start transaction_type">
-        <span>AI交易</span>
-      </van-col> -->
-      <!-- <van-col span="24" class="flex-between item_card">
+      <van-col span="24" class="flex-start transaction_type">
+        <span>{{ types[i.positionType] }}</span>
+      </van-col>
+      <van-col
+        span="24"
+        class="flex-between-start item_card"
+        v-if="i.positionType == 4"
+      >
         <div class="card_label">
-          <p>建仓成本</p>
+          <p>{{ $t("建仓成本") }}</p>
           <p>{{ i.orderTotalPrice }}</p>
         </div>
         <div class="card_label">
-          <p>平仓金额</p>
-          <p>90</p>
+          <p>{{ $t("pcje") }}</p>
+          <p>{{ i.sellOrderTotalPrice }}</p>
         </div>
         <div class="card_label">
-          <p>预期收益</p>
-          <p>-10</p>
+          <p>{{ $t("预期收益") }}</p>
+          <p>{{ i.profitAndLose }}</p>
         </div>
-      </van-col> -->
+      </van-col>
     </van-row>
 
     <!-- 无数据时显示 -->
@@ -88,13 +102,24 @@
   data() {
     return {
       pageNum: 1,
-      pageSize: 1,
+      pageSize: 15,
       total: 1,
-      list: []
+      list: [],
+      active: "",
+      types: {
+        0: this.$t("日内"),
+        2: "IPO",
+        3: this.$t("hj621"),
+        4: "AI"
+      }
     };
   },
   watch: {
     pageNum() {
+      this.getList();
+    },
+    active() {
+      this.pageNum = 1;
       this.getList();
     }
   },
@@ -106,6 +131,7 @@
     async getList() {
       let data = await api.getchicang({
         state: 0,
+        positionType: this.active,
         pageNum: this.pageNum,
         pageSize: this.pageSize
       });
@@ -131,6 +157,7 @@
 @dark_green: #07c160;
 @red: #ee0a24;
 @brown: #ff976a;
+@green: #c4d600;
 
 .trade_new {
   width: 100%;
@@ -138,6 +165,29 @@
   background: #fff;
   font-size: 10vw;
   padding-bottom: 1.3rem;
+  // padding-top: 1.4em;
+  /deep/ .van-tabs--line .van-tabs__wrap {
+    height: 1.2em;
+  }
+  /deep/ .van-tab__text--ellipsis {
+    overflow: visible;
+  }
+  /deep/ .van-tab {
+    font-size: 0.4em;
+  }
+  /deep/ .van-tabs__line {
+    background-color: @green;
+    height: 0.1em;
+    width: 1em;
+  }
+
+  .order_tabs {
+    width: 100%;
+    // position: fixed;
+    // top: 1.4em;
+    // left: 0;
+    // z-index: 999;
+  }
 
   .list_head {
     background-color: @green2;

--
Gitblit v1.9.3