<template>
|
<div class="trade-page">
|
<!-- 主标签 -->
|
<div class="main-tabs">
|
<span class="tab-item">闪兑</span>
|
<span class="tab-item active">合约</span>
|
<span class="tab-item">股票</span>
|
<span class="tab-item red-dot">股票</span>
|
<div class="tab-right">
|
<Icon icon="solar:question-circle-bold" class="tab-icon" />
|
<Icon icon="solar:hamburger-menu-bold" class="tab-icon" />
|
</div>
|
</div>
|
|
<!-- 子标签 -->
|
<div class="sub-tabs">
|
<span class="sub-tab-item">市价</span>
|
<span class="sub-tab-item active">跨链</span>
|
<span class="sub-tab-item">限价</span>
|
</div>
|
|
<!-- 交易区域 -->
|
<div class="trade-area">
|
<!-- 上方输入 -->
|
<div class="trade-input top">
|
<div class="input-left">
|
<div class="input-value">0</div>
|
<div class="input-fiat">$0.00</div>
|
</div>
|
<div class="input-right">
|
<div class="token-select">
|
<div class="token-icon">S</div>
|
<span class="token-name">BGB</span>
|
<span class="dropdown">▼</span>
|
</div>
|
<div class="token-balance">0.00 BGB</div>
|
<button class="add-btn">+</button>
|
</div>
|
</div>
|
|
<!-- 互换按钮 -->
|
<Icon icon="solar:swap-bold" class="swap-icon" />
|
|
<!-- 下方输入 -->
|
<div class="trade-input bottom">
|
<div class="input-left">
|
<div class="input-value">0</div>
|
<div class="input-fiat">$0.00 价格影响%</div>
|
</div>
|
<div class="input-right">
|
<div class="token-select">
|
<div class="token-icon usdt">T</div>
|
<span class="token-name">USDT</span>
|
<span class="dropdown">▼</span>
|
</div>
|
<div class="token-balance">0.00 USDT</div>
|
</div>
|
</div>
|
</div>
|
|
<!-- 交易按钮 -->
|
<div class="trade-button-wrapper">
|
<AppButton variant="primary" size="large" full-width class="trade-button">交易</AppButton>
|
</div>
|
|
<!-- 底部信息 -->
|
<div class="bottom-info">
|
<span>USDT</span>
|
<span>1 +0.00% ^</span>
|
</div>
|
|
<!-- 底部导航 -->
|
<BottomNav />
|
</div>
|
</template>
|
|
<script setup lang="ts">
|
import { Icon } from '@iconify/vue'
|
import BottomNav from '@/components/BottomNav.vue'
|
import Card from '@/components/Card.vue'
|
import AppButton from '@/components/Button.vue'
|
</script>
|
|
<style lang="scss" scoped>
|
@import '@/styles/variables.scss';
|
|
.trade-page {
|
background: $bg-primary;
|
padding-bottom: 60px;
|
min-height: 100vh;
|
}
|
|
.main-tabs {
|
display: flex;
|
align-items: center;
|
padding: $spacing-md $spacing-lg;
|
gap: $spacing-xxl;
|
margin-bottom: $spacing-lg;
|
background: $bg-tertiary;
|
|
.tab-item {
|
font-size: $font-md;
|
color: $text-secondary;
|
position: relative;
|
|
&.active {
|
color: $text-primary;
|
font-weight: 500;
|
}
|
|
&.red-dot::after {
|
content: '';
|
position: absolute;
|
top: -4px;
|
right: -8px;
|
width: 6px;
|
height: 6px;
|
background: $error;
|
border-radius: 50%;
|
}
|
}
|
|
.tab-right {
|
margin-left: auto;
|
display: flex;
|
gap: 16px;
|
|
.tab-icon {
|
width: 24px;
|
height: 24px;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
color: $text-secondary;
|
}
|
}
|
}
|
|
.sub-tabs {
|
display: flex;
|
padding: $spacing-md $spacing-lg;
|
gap: $spacing-xxl;
|
margin-bottom: $spacing-lg;
|
background: $bg-tertiary;
|
|
.sub-tab-item {
|
font-size: $font-md;
|
color: $text-secondary;
|
padding: $spacing-xs $spacing-md;
|
border-radius: $radius-pill;
|
transition: all $transition-base;
|
|
&.active {
|
color: $primary;
|
font-weight: 600;
|
background: $primary-light;
|
}
|
}
|
}
|
|
.trade-area {
|
padding: $spacing-xxl $spacing-lg;
|
|
.trade-input {
|
background: $bg-card;
|
border-radius: $radius-lg;
|
padding: $spacing-xl;
|
margin-bottom: $spacing-lg;
|
box-shadow: $card-shadow;
|
|
&.top {
|
margin-bottom: 8px;
|
}
|
|
&.bottom {
|
margin-top: 8px;
|
}
|
|
.input-left {
|
margin-bottom: 16px;
|
|
.input-value {
|
font-size: 32px;
|
font-weight: 500;
|
margin-bottom: 4px;
|
}
|
|
.input-fiat {
|
font-size: $font-sm;
|
color: $text-secondary;
|
}
|
}
|
|
.input-right {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
|
.token-select {
|
display: flex;
|
align-items: center;
|
gap: 8px;
|
|
.token-icon {
|
width: 32px;
|
height: 32px;
|
border-radius: 50%;
|
background: $primary;
|
color: white;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-weight: bold;
|
|
&.usdt {
|
background: $success;
|
}
|
}
|
|
.token-name {
|
font-size: $font-lg;
|
font-weight: 500;
|
}
|
|
.dropdown {
|
font-size: $font-xs;
|
color: $text-tertiary;
|
}
|
}
|
|
.token-balance {
|
font-size: $font-sm;
|
color: $text-secondary;
|
}
|
|
.add-btn {
|
width: 24px;
|
height: 24px;
|
border-radius: 50%;
|
background: $primary;
|
color: white;
|
border: none;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-size: 18px;
|
cursor: pointer;
|
}
|
}
|
}
|
|
.swap-icon {
|
width: 48px;
|
height: 48px;
|
border-radius: $radius-round;
|
background: $primary;
|
color: white;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin: -24px auto;
|
position: relative;
|
z-index: 1;
|
cursor: pointer;
|
box-shadow: $button-shadow;
|
|
svg {
|
width: 24px;
|
height: 24px;
|
}
|
}
|
}
|
|
.trade-button-wrapper {
|
padding: 0 $spacing-lg $spacing-lg;
|
}
|
|
.bottom-info {
|
display: flex;
|
justify-content: space-between;
|
padding: $spacing-md $spacing-lg;
|
font-size: $font-sm;
|
color: $text-secondary;
|
background: $bg-tertiary;
|
margin-top: $spacing-lg;
|
}
|
</style>
|