优化了支付选择界面 ui
This commit is contained in:
@@ -3,7 +3,7 @@ import { readError } from '@/shared/utils/error'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { computed, nextTick, onMounted, ref, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { Star, StarFilled } from '@element-plus/icons-vue'
|
||||
import { ShoppingCart, Star, StarFilled } from '@element-plus/icons-vue'
|
||||
|
||||
import { fetchListing, type Listing } from '@/features/listings/api/listings'
|
||||
import { useListingCollections } from '@/features/listings/composables/useListingCollections'
|
||||
@@ -468,12 +468,21 @@ function handleToggleFavorite() {
|
||||
</section>
|
||||
|
||||
<aside class="order-panel pc-order-card">
|
||||
<h2>立即下单</h2>
|
||||
<div class="order-card-head">
|
||||
<div>
|
||||
<span class="order-eyebrow">平台担保</span>
|
||||
<h2>立即下单</h2>
|
||||
</div>
|
||||
<span class="order-state" :class="{ 'is-busy': listing.in_transaction }">
|
||||
{{ listing.in_transaction ? '交易中' : '可租' }}
|
||||
</span>
|
||||
</div>
|
||||
<p class="order-safe-text">平台托管订单与押金,按平台交接流程完成账号使用。</p>
|
||||
<el-form label-position="top">
|
||||
|
||||
<el-form label-position="top" class="order-form">
|
||||
<div class="order-total-box">
|
||||
<div class="order-total-head">
|
||||
<span>租赁价格</span>
|
||||
<span>租赁合计</span>
|
||||
<strong>¥{{ listingPrice(listing) }}</strong>
|
||||
</div>
|
||||
<div class="order-price-breakdown">
|
||||
@@ -486,8 +495,12 @@ function handleToggleFavorite() {
|
||||
<strong>¥{{ formatMoney(orderPriceBreakdown.consumable) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
<em>押金另付 ¥{{ formatCent(listing.deposit_amount_cent) }}</em>
|
||||
<div class="order-deposit-row">
|
||||
<span>押金另付</span>
|
||||
<strong>¥{{ formatCent(listing.deposit_amount_cent) }}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dl class="order-check-list">
|
||||
<div>
|
||||
<dt>账号区服</dt>
|
||||
@@ -502,23 +515,30 @@ function handleToggleFavorite() {
|
||||
<dd>{{ formatEstimatedRentalDuration(listing) }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<el-button
|
||||
type="warning"
|
||||
size="large"
|
||||
:loading="ordering || agreementsLoading"
|
||||
:disabled="listing.in_transaction"
|
||||
class="full-control"
|
||||
@click="handleCreateOrder"
|
||||
>
|
||||
{{ listing.in_transaction ? '交易中' : '立即下单' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
class="full-control favorite-order-btn"
|
||||
size="large"
|
||||
@click="handleToggleFavorite"
|
||||
>
|
||||
{{ listingFavorited ? '取消收藏' : '收藏账号' }}
|
||||
</el-button>
|
||||
|
||||
<div class="order-action-group">
|
||||
<el-button
|
||||
type="warning"
|
||||
size="large"
|
||||
:loading="ordering || agreementsLoading"
|
||||
:disabled="listing.in_transaction"
|
||||
class="full-control order-primary-btn"
|
||||
@click="handleCreateOrder"
|
||||
>
|
||||
<el-icon><ShoppingCart /></el-icon>
|
||||
{{ listing.in_transaction ? '交易中' : '立即下单' }}
|
||||
</el-button>
|
||||
<el-button
|
||||
class="full-control favorite-order-btn"
|
||||
size="large"
|
||||
@click="handleToggleFavorite"
|
||||
>
|
||||
<el-icon>
|
||||
<component :is="listingFavorited ? StarFilled : Star" />
|
||||
</el-icon>
|
||||
{{ listingFavorited ? '取消收藏' : '收藏账号' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</aside>
|
||||
</div>
|
||||
@@ -903,10 +923,78 @@ function handleToggleFavorite() {
|
||||
.pc-order-card {
|
||||
max-width: none;
|
||||
border-radius: 20px;
|
||||
padding: 24px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.order-card-head {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 18px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.order-card-head h2 {
|
||||
margin: 4px 0 0;
|
||||
color: #17233d;
|
||||
font-size: 22px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.order-eyebrow {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
min-height: 24px;
|
||||
border-radius: 999px;
|
||||
background: #f1f5f9;
|
||||
padding: 0 10px;
|
||||
color: #64748b;
|
||||
font-size: 12px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.order-state {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-width: 58px;
|
||||
min-height: 28px;
|
||||
border-radius: 999px;
|
||||
background: #ecfdf5;
|
||||
color: #16a34a;
|
||||
font-size: 12px;
|
||||
font-weight: 900;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.order-state.is-busy {
|
||||
background: #fff7ed;
|
||||
color: #ea580c;
|
||||
}
|
||||
|
||||
.order-form {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.order-safe-text {
|
||||
margin-bottom: 18px;
|
||||
color: #7a89a5;
|
||||
font-size: 15px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.order-total-box {
|
||||
margin-bottom: 14px;
|
||||
position: relative;
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
margin-bottom: 0;
|
||||
border: 1px solid rgba(245, 158, 11, 0.2);
|
||||
background:
|
||||
linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 247, 237, 0.92)),
|
||||
#fffbeb;
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
|
||||
}
|
||||
|
||||
.order-total-head {
|
||||
@@ -914,12 +1002,12 @@ function handleToggleFavorite() {
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
padding-bottom: 12px;
|
||||
padding-bottom: 14px;
|
||||
border-bottom: 1px solid rgba(217, 119, 6, 0.14);
|
||||
}
|
||||
|
||||
.order-total-head span {
|
||||
color: #92400e;
|
||||
color: #9a5a16;
|
||||
font-size: 14px;
|
||||
font-weight: 900;
|
||||
}
|
||||
@@ -927,14 +1015,15 @@ function handleToggleFavorite() {
|
||||
.order-total-head strong {
|
||||
margin: 0;
|
||||
color: #ef4444;
|
||||
font-size: 32px;
|
||||
font-size: 34px;
|
||||
line-height: 1;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.order-price-breakdown {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
padding: 12px 0;
|
||||
gap: 10px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.order-price-breakdown div {
|
||||
@@ -944,42 +1033,51 @@ function handleToggleFavorite() {
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.order-price-breakdown span {
|
||||
.order-price-breakdown span,
|
||||
.order-deposit-row span {
|
||||
color: #8a5a12;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.order-price-breakdown strong {
|
||||
.order-price-breakdown strong,
|
||||
.order-deposit-row strong {
|
||||
margin: 0;
|
||||
color: #17233d;
|
||||
font-size: 16px;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.order-total-box > em {
|
||||
padding-top: 10px;
|
||||
.order-deposit-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid rgba(217, 119, 6, 0.14);
|
||||
}
|
||||
|
||||
.order-deposit-row strong {
|
||||
color: #92400e;
|
||||
font-size: 13px;
|
||||
font-weight: 900;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.order-check-list {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
margin: 0 0 18px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.order-check-list div {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
min-height: 40px;
|
||||
padding: 0 12px;
|
||||
border-radius: 10px;
|
||||
min-height: 44px;
|
||||
border: 1px solid #eef2f7;
|
||||
border-radius: 12px;
|
||||
background: #f8fafc;
|
||||
padding: 0 14px;
|
||||
}
|
||||
|
||||
.order-check-list dt {
|
||||
@@ -994,16 +1092,57 @@ function handleToggleFavorite() {
|
||||
font-size: 14px;
|
||||
font-weight: 900;
|
||||
text-align: right;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.full-control {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.order-action-group {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.order-primary-btn {
|
||||
min-height: 48px;
|
||||
border: 0;
|
||||
background: #ff8a00;
|
||||
color: #ffffff;
|
||||
font-size: 15px;
|
||||
font-weight: 900;
|
||||
box-shadow: 0 12px 24px rgba(255, 106, 0, 0.24);
|
||||
}
|
||||
|
||||
.order-primary-btn:hover,
|
||||
.order-primary-btn:focus {
|
||||
background: #ff7a00;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.order-primary-btn.is-disabled,
|
||||
.order-primary-btn.is-disabled:hover {
|
||||
background: #f3a94a;
|
||||
color: rgba(255, 255, 255, 0.86);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.favorite-order-btn {
|
||||
margin-top: 10px;
|
||||
min-height: 46px;
|
||||
margin-left: 0;
|
||||
border-color: #ff6a00;
|
||||
background: #ffffff;
|
||||
color: #ff6a00;
|
||||
font-size: 15px;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.favorite-order-btn:hover,
|
||||
.favorite-order-btn:focus {
|
||||
border-color: #ff6a00;
|
||||
background: #fff7ed;
|
||||
color: #ea580c;
|
||||
}
|
||||
|
||||
.agreement-dialog-body {
|
||||
|
||||
Reference in New Issue
Block a user