10.10综合交易所原始源码_移动端
1
admin
2026-01-10 b719b3b66ec4893057df275e3871a6bd0029ac3c
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
<template>
  <div class="detail-popup">
    <div class="popup-header">
      <div class="header-title">{{ t('详情') }}</div>
      <van-icon name="cross" class="close-icon" @click="$emit('close')" />
    </div>
    <div class="popup-content">
      <div class="detail-item" v-for="(item, index) in detailList" :key="index">
        <div class="detail-label">{{ item.label }}</div>
        <div class="detail-value" :class="item.class">{{ item.value }}</div>
      </div>
    </div>
  </div>
</template>
 
<script setup>
import { computed, reactive } from 'vue'
import { useI18n } from 'vue-i18n'
 
const props = defineProps({
  detailData: {
    type: Object,
    default: () => ({})
  }
})
 
const emit = defineEmits(['close'])
 
const { t } = useI18n()
 
const getTime = (time) => {
  return time?.split(' ')[0] || '--'
}
 
const symbolType = reactive({
  'forex': '外汇',
  'indices': '指数',
  'commodities': '大宗商品',
  'cryptos': '虚拟货币',
  'US-stocks': 'UsStocks',
  'HK-stocks': 'HkStocks',
  'TW-stocks': '台股',
  'A-stocks': 'A股',
  'JP-stocks': '日股',
  'global': 'GlobalETFs',
  'gold': 'GoldEFs',
  'ai': 'ArtificialIntelligenceETFs',
  'energy': 'EnergyETFs',
})
 
const detailList = computed(() => {
  const data = props.detailData
  return [
    {
      label: t('名称/代码'),
      value: `${data.symbolName || '--'} / ${data.symbolCode || '--'}`
    },
    {
      label: t('现价/成本'),
      value: `${data.closePrice || '--'} / ${data.subPrice || '--'}`
    },
    {
      label: t('持有/市场'),
      value: `${data.winningNumber || '--'}${data.symbolType && symbolType[data.symbolType] ? ' / ' + t(symbolType[data.symbolType]) : ''}`
    },
    {
      label: t('数量'),
      value: data.winningNumber || '--'
    },
    {
      label: t('损益'),
      value: data.inventoryGainsLosses || '--',
      class: data.inventoryGainsLosses > 0 ? 'red' : data.inventoryGainsLosses < 0 ? 'green' : ''
    },
    {
      label: t('中签应认缴'),
      value: data.requiredNumber || '--'
    },
    {
      label: t('已认缴金额'),
      value: data.subscribedAmount || '--'
    },
    {
      label: t('需补缴金额'),
      value: ((data.requiredNumber || 0) - (data.subscribedAmount || 0)).toFixed(2)
    },
    {
      label: t('卖出价'),
      value: data.closePrice || '--'
    },
    {
      label: t('收益金额'),
      value: data.inventoryGainsLosses || '--',
      class: data.inventoryGainsLosses > 0 ? 'red' : data.inventoryGainsLosses < 0 ? 'green' : ''
    },
    {
      label: t('收益比例'),
      value: data.inventoryGainsLossesValue ? `${data.inventoryGainsLossesValue}%` : '--',
    },
    {
      label: t('卖出状态'),
      value: data.sell === 1 ? t('已卖出') : t('未卖出'),
      class: data.sell === 1 ? 'red' : ''
    },
    {
      label: t('时间'),
      value: getTime(data.createTime)
    },
  ]
})
</script>
 
<style lang="scss">
.detail-popup {
  width: 100%;
  max-height: 80vh;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
 
  .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid $border_color;
    position: sticky;
    top: 0;
    z-index: 1;
 
    .header-title {
      font-size: 16px;
      font-weight: 600;
      color: $text_color;
    }
 
    .close-icon {
      font-size: 20px;
      color: $text_color;
      cursor: pointer;
    }
  }
 
  .popup-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
 
    .detail-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 0;
      border-bottom: 1px solid $border_color;
      font-size: 14px;
 
      &:last-child {
        border-bottom: none;
      }
 
      .detail-label {
        color: $ipo_normal_text;
        flex-shrink: 0;
      }
 
      .detail-value {
        color: $text_color;
        text-align: right;
        flex: 1;
        margin-left: 20px;
        word-break: break-all;
 
        &.red {
          color: #F33368;
        }
 
        &.green {
          color: #4CAF50;
        }
      }
    }
  }
}
</style>