1
李凌
2026-01-21 e01cee0f0c5c5c2eb2d8595eadb3c7a9df2a37fc
src/views/ICO/icoRecord.vue
@@ -2,7 +2,7 @@
    <div class="icoRecord">
        <fx-header>
            <template v-slot:title>
                <div>{{$t('申购记录')}}</div>
                <div>{{ $t('申购记录') }}</div>
            </template>
        </fx-header>
@@ -16,7 +16,7 @@
        </van-tabs>
        <div class="icoRecord_list">
            <div class="icoRecord_item mb-5" v-for="(item,index) in recordLIst" :key="index">
            <div class="icoRecord_item mb-5" v-for="(item, index) in recordLIst" :key="index">
                <div class="item_1">
                    {{ item.symbol }} ({{ item.name }})
                </div>
@@ -32,6 +32,38 @@
                    <div>{{ $t('中签数量') }}</div>
                    <div>{{ item.ballotNumber }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('中签时间') }}</div>
                    <div>{{ item.endTime }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('发行价') }}</div>
                    <div>{{ item.issuePrice }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('现价') }}</div>
                    <div>{{ item.currentPrice }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('利润') }}</div>
                    <div>{{ item.profit }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('申购总额') }}</div>
                    <div>{{ item.subscriptionTotalAmount }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('现价总额') }}</div>
                    <div>{{ item.currentTotalPrice }}</div>
                </div>
                <div class="item_2 flex justify-between">
                    <div>{{ $t('利润百分比') }}</div>
                    <div>{{ item.profitPercent ? (item.profitPercent + '%') : '0' }}</div>
                </div>
                <div class="item_3" v-if="item.status == 5">
                    <van-button type="primary" block round @click="goToSell(item)">{{ $t('卖出') }}</van-button>
                </div>
            </div>
        </div>
    </div>
@@ -42,7 +74,10 @@
import { showToast } from 'vant'
import { _icoRecordList } from "@/service/ico.api.js";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
import { setStorage } from "@/utils/index.js";
const { t } = useI18n()
const router = useRouter()
// tab切换
const active = ref('0');
@@ -56,6 +91,7 @@
    let opt = {
        status: active.value
    }
    if (opt.status == '0') delete opt.status
    _icoRecordList(opt).then((res) => {
        console.log(res);
        recordLIst.value = res.records
@@ -87,38 +123,57 @@
    }
    return str
}
// 跳转到卖出页面
const goToSell = (item) => {
    // 将卖出参数存储到 localStorage,供交易页面读取
    setStorage('tradeSellParams', {
        volume: item.ballotNumber || '0',
        mode: 'close' // 卖出模式
    })
    if (item.symbol) {
        router.push(`/cryptos/trade/${item.symbol}`)
    } else {
        showToast(t('交易对信息错误'))
    }
}
</script>
<style lang="scss" scoped>
.icoRecord{
.icoRecord {
    padding: 0rem 1.2rem 2rem 1.2rem;
    font-size: 1.5rem;
    .icoRecord_list{
    .icoRecord_list {
        padding: 1rem 0rem;
        .icoRecord_item{
            background-color: #eee;
            padding:.5rem 1rem;
        .icoRecord_item {
            background-color: #333;
            padding: .5rem 1rem;
            border: #aaa solid 1px;
            border-radius: 1rem;
            .item_1{
            .item_1 {
                padding: 1rem .5rem;
                border-bottom: #ccc solid 1px;
                font-size: 2rem;
                font-weight: 700;
            }
            .item_2{
            .item_2 {
                padding: 1rem .5rem;
                border-bottom: #ccc solid 1px;
                font-size: 1.6rem;
                font-weight: 500;
                &>div:last-child{
                &>div:last-child {
                    color: #999;
                }
            }
            .item_3{
                padding: .5rem;
            .item_3 {
                padding: 1rem .5rem;
                margin-top: 1rem;
            }
        }
    }