1
PC-20250623MANY\Administrator
2025-07-22 3003b7486ddeffd169f2b2f564fc0ff8c2c58bb3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<template>
  <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") }}
      </van-col>
      <van-col span="8" class="flex-start head_item">
        {{ $t("sl") }}/{{ $t("Profit") }}
      </van-col>
      <van-col span="8" class="flex-end head_item">
        {{ $t("Cost") }}/{{ $t("Current") }}
      </van-col>
    </van-row>
 
    <van-row
      class="list_item"
      v-for="i in list"
      :key="i.id"
      @click="toDetails(i)"
    >
      <van-col span="8" class="item_n">
        <div class="flex-start">
          <span class="i_icon">{{ i.stockGid }}</span>
          <span class="i_hint">{{ i.stockSpell }}</span>
        </div>
        <div class="i_name">
          {{ (i.orderNum * i.now_price).toFixed(2) }}
        </div>
      </van-col>
      <van-col span="8" class="item_n">
        <p class="flex-start">{{ i.orderNum }}</p>
        <p class="flex-start i_name">
          {{ i.profitAndLose }} ({{ i.profitAndLoseParent }})
        </p>
      </van-col>
      <van-col span="8" class="item_n">
        <div class="flex-end" style="margin-bottom: .15em;">
          <span>{{ i.buyOrderPrice }}</span>
        </div>
        <div class="flex-end">
          <span>{{ i.now_price }}</span>
        </div>
      </van-col>
      <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>{{ $t("建仓成本") }}</p>
          <p>{{ i.orderTotalPrice }}</p>
        </div>
        <div class="card_label">
          <p>{{ $t("pcje") }}</p>
          <p>{{ i.sellOrderTotalPrice }}</p>
        </div>
        <div class="card_label">
          <p>{{ $t("预期收益") }}</p>
          <p>{{ i.profitAndLose }}</p>
        </div>
      </van-col>
    </van-row>
 
    <!-- 无数据时显示 -->
    <div class="no_data flex-center" v-show="!list || list.length == 0">
      <img src="@/assets/img/zhaobudao2.png" alt="" />
    </div>
 
    <n-pagination
      :pageNo.sync="pageNum"
      :pageSize="pageSize"
      :total="total"
    ></n-pagination>
  </div>
</template>
 
<script>
import tabHead from "@/components/tabHead.vue";
import * as api from "@/axios/api";
import nPagination from "@/components/nPagination.vue";
 
export default {
  components: {
    tabHead,
    nPagination
  },
  data() {
    return {
      pageNum: 1,
      pageSize: 15,
      total: 1,
      list: [],
      active: "",
      types: {
        0: this.$t("日内"),
        2: "IPO",
        3: this.$t("hj621"),
        4: "AI"
      }
    };
  },
  watch: {
    pageNum() {
      this.getList();
    },
    active() {
      this.pageNum = 1;
      this.getList();
    }
  },
  created() {
    this.getList();
  },
  methods: {
    // 获取数据
    async getList() {
      let data = await api.getchicang({
        state: 0,
        positionType: this.active,
        pageNum: this.pageNum,
        pageSize: this.pageSize
      });
 
      if (data.status === 0) {
        this.list = data.data.list;
        this.total = data.data.total;
      }
    },
    // 跳转详情
    toDetails(i) {
      if (!i.positionSn) return;
      this.$router.push({
        path: "/Stockdetail",
        query: { codes: i.positionSn }
      });
    }
  }
};
</script>
 
<style lang="less" scoped>
@green2: #f0f0f0;
@dark_green: #07c160;
@red: #ee0a24;
@brown: #ff976a;
@green: #c4d600;
 
.trade_new {
  width: 100%;
  // height: 100%;
  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;
    margin-top: 0.25em;
    height: 1em;
    padding: 0 0.25em;
 
    .head_item {
      font-size: 0.35em;
      height: 100%;
      font-weight: 500;
    }
  }
 
  .list_item {
    padding: 0.4em 0.25em 0.25em;
    border-bottom: #f5f5f5 solid 0.01em;
    position: relative;
 
    .item_card {
      background-color: @green2;
      margin-top: 0.2em;
      border-radius: 0.2em;
      padding: 0.25em;
 
      .card_label {
        width: 33.33%;
        text-align: start;
        color: #999;
        font-size: 0.35em;
 
        & > p:last-child {
          color: #333;
          margin-top: 0.15em;
        }
      }
    }
 
    .transaction_type {
      color: #fff;
      padding-top: 0.08em;
      span {
        font-size: 0.3em;
        background: @brown;
        padding: 0.2em 0.3em 0.15em;
        border-radius: 0.2em;
        font-weight: 300;
      }
    }
 
    p,
    span {
      font-size: 0.9em;
    }
 
    .item_n {
      font-size: 0.4em;
      min-height: 2em;
      font-weight: 500;
 
      .i_icon {
        border-radius: 0 26em 26em 0;
        background: @dark_green;
        color: #fff;
        padding: 0.1em 0.5em 0.1em 0.4em;
        margin-right: 0.3em;
        font-size: 0.8em;
      }
 
      .i_name {
        margin-top: 0.2em;
        // color: #777777;
        font-size: 0.9em;
      }
    }
 
    .edit {
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.8)
      );
      text-align: end;
      color: @red;
      padding-right: 0.25em;
 
      span {
        font-size: 0.55em;
      }
    }
  }
}
</style>