1
PC-20250623MANY\Administrator
2025-07-22 9ec3bd6e8d7357927533d8966f882cb5d28b3e0f
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
<template>
  <div class="position">
    <div class="position-padding" v-for="item in listData" :key="item.order_no">
      <div class="position-tag ">
        <div class="position-tag-style" :class="item.direction === 'buy' ? 'green' : 'red'">
          {{ item.direction === 'buy' ? $t('开多') : $t('开空') }}</div>
        <div class="position-tag-title textColor">{{ item.name }} {{ $t('交割') }}</div>
        <div class="position-tag-title2">{{ $t('全仓') }}</div>
        <img class="position-tag-img" src="../../assets/image/deliveryContract/Group1042.png" />
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('数量') }}</span>
        <span class="position-text2 textColor">{{ item.volume }}</span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('方向') }}</span>
        <span class="position-text2" :class="item.direction === 'buy' ? 'color-green' : 'color-red'">
          {{ item.direction === 'buy' ? $t('开多') : $t('开空') }}</span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('交割时间') }}</span>
        <span class="position-text2 textColor">{{ item.time_num + item.time_unit }}</span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('购买价') }}(USDT)</span>
        <span class="position-text2 textColor">{{ item.open_price }}</span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('结算价') }}(USDT)</span>
        <span class="position-text2 textColor">{{ item.close_price }}</span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('盈亏') }}</span>
        <span class="position-text2" :class="item.profit > 0 ? 'color-green' : 'color-red'">
          {{ item.profit > 0 ? '+' + item.profit : item.profit }}
        </span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('到期时间') }}</span>
        <span class="position-text2 textColor">{{ item.close_time }}</span>
      </div>
      <div class="position-div1">
        <span class="position-text1">{{ $t('操作') }}</span>
        <span class="position-text2 colorMain" @click="onDetail(item)">{{ $t('详情') }}</span>
      </div>
      <div style="margin-top: 33px;width: 100%;height: 1px;float: left;" class="bgDark"></div>
    </div>
    <div class="text-grey text-center py-300" v-if="!listData.length && $route.name == 'perpetualContract'">{{
      $t('您目前没有持仓') }}</div>
    <van-popup v-model="show">
      <popup-delivery showBtns :detailData="detailData" :key="detailData.order_no" @close="show = false"
        :disabled="true" />
    </van-popup>
  </div>
</template>
<script>
import { Tab, Tabs, Popup } from 'vant';
import PopupDelivery from '@/components/popup-delivery'
export default {
  data() {
    return {
      active: 2,
      show: false,
      detailData: {}
    }
  },
  props: {
    listData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  components: {
    [Tab.name]: Tab,
    [Tabs.name]: Tabs,
    [Popup.name]: Popup,
    PopupDelivery
  },
  methods: {
    onDetail(item) { // 详细界面
      this.show = true
      this.detailData = item
    }
  }
}
</script>
<style lang="scss" scoped>
.position {
  width: 100%;
  overflow: auto;
 
  .position-tab-flex {
    width: 100%;
    display: flex;
 
    .position-tab {
      flex: 1;
    }
 
    .position-tab-icon {
      width: 38px;
      height: 38px;
      margin-right: 30px;
      margin-top: 22px;
    }
  }
 
  .position-padding {
    //border-bottom: 1px solid #F2F4F9;
    padding: 42px 0 0 0;
    box-sizing: border-box;
    width: 100%;
    overflow: auto;
 
    .position-tag {
      display: flex;
      align-items: center;
 
      .position-tag-style {
        padding: 11px 28px;
        margin-right: 22px;
        font-style: normal;
        font-weight: 400;
        font-size: 26.4981px;
        color: #FFFFFF;
      }
 
      .position-tag-title {
        font-style: normal;
        font-weight: 600;
        font-size: 30.9145px;
        margin-right: 13px;
      }
 
      .position-tag-title2 {
        font-style: normal;
        font-weight: 400;
        font-size: 30.9145px;
        color: #848E9C;
      }
 
      .position-tag-img {
        margin-left: 11px;
        width: 40px;
        height: 31px;
      }
    }
 
    .red {
      background: #F6465D;
      border-radius: 6.6266px;
    }
 
    .green {
      background: #5EBA89;
      border-radius: 6.62453px;
    }
 
    .position-div1 {
      margin-top: 33px;
      width: 100%;
      float: left;
 
      .position-text1 {
        float: left;
        font-style: normal;
        font-weight: 400;
        font-size: 30px;
        color: #848E9C;
      }
 
      .position-text2 {
        float: right;
        font-style: normal;
        font-weight: 400;
        font-size: 30px;
      }
 
      .position-text3 {
        font-style: normal;
        font-weight: 400;
        font-size: 30px;
      }
    }
  }
 
  .color-red {
    color: #F6465D !important;
  }
 
  .color-green {
    color: #5EBA89 !important;
  }
 
  .color-blue {
    color: #1D91FF !important;
  }
}
 
.textColor {
  @include themify() {
    color: themed("text_color");
  }
}
 
.border-b-color {
  @include themify() {
    border-bottom: 1px solid themed("border_color");
  }
}
 
.bgDark {
  @include themify() {
    background: themed("border_color");
  }
}
</style>