2026-02-05 01:33:28 +08:00
|
|
|
|
<!--
|
2026-02-14 12:14:07 +08:00
|
|
|
|
JQueryVsStateDemo.vue - 前端开发模式对比
|
2026-02-06 03:34:50 +08:00
|
|
|
|
用"手工记账 vs 智能管家"的比喻来解释 jQuery vs Vue/React
|
2026-02-05 01:33:28 +08:00
|
|
|
|
-->
|
|
|
|
|
|
<template>
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<div class="jquery-vs-state-demo">
|
|
|
|
|
|
<!-- 标题区 -->
|
|
|
|
|
|
<div class="demo-header">
|
|
|
|
|
|
<span class="icon">🔄</span>
|
|
|
|
|
|
<span class="title">前端开发模式</span>
|
|
|
|
|
|
<span class="subtitle">手动操作DOM vs 状态管理</span>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<!-- 主内容区 -->
|
|
|
|
|
|
<div class="demo-content">
|
|
|
|
|
|
<!-- 模式选择 -->
|
|
|
|
|
|
<div class="mode-tabs">
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="tab-btn"
|
|
|
|
|
|
:class="{ active: mode === 'manual' }"
|
|
|
|
|
|
@click="mode = 'manual'"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="tab-icon">✍️</span>
|
|
|
|
|
|
<span class="tab-text">手工记账</span>
|
|
|
|
|
|
<span class="tab-sub">通俗说法: jQuery</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="tab-btn"
|
|
|
|
|
|
:class="{ active: mode === 'smart' }"
|
|
|
|
|
|
@click="mode = 'smart'"
|
|
|
|
|
|
>
|
|
|
|
|
|
<span class="tab-icon">🤖</span>
|
|
|
|
|
|
<span class="tab-text">智能管家</span>
|
|
|
|
|
|
<span class="tab-sub">通俗说法: Vue/React</span>
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<!-- 对比展示区 -->
|
|
|
|
|
|
<div class="comparison-showcase">
|
|
|
|
|
|
<!-- 左侧:场景描述 -->
|
|
|
|
|
|
<div class="scenario-panel">
|
|
|
|
|
|
<div class="scenario-header">
|
|
|
|
|
|
<span class="scenario-icon">{{ mode === 'manual' ? '👨🍳' : '🤖' }}</span>
|
|
|
|
|
|
<span class="scenario-title">{{ mode === 'manual' ? '手工记账' : '智能管家' }}</span>
|
|
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<div class="scenario-content">
|
|
|
|
|
|
<div class="step-list">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="(step, index) in currentSteps"
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
class="step-item"
|
|
|
|
|
|
:class="{ active: index === currentStep }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="step-number">{{ index + 1 }}</div>
|
|
|
|
|
|
<div class="step-text">{{ step }}</div>
|
|
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<!-- 右侧:账本展示 -->
|
|
|
|
|
|
<div class="ledger-panel">
|
|
|
|
|
|
<div class="ledger-header">
|
|
|
|
|
|
<span class="ledger-icon">📒</span>
|
|
|
|
|
|
<span class="ledger-title">今日账本</span>
|
|
|
|
|
|
<span class="ledger-status" :class="mode">{{ ledgerStatus }}</span>
|
|
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<div class="ledger-content">
|
|
|
|
|
|
<!-- 订单列表 -->
|
|
|
|
|
|
<div class="order-list">
|
|
|
|
|
|
<div
|
|
|
|
|
|
v-for="order in orders"
|
|
|
|
|
|
:key="order.id"
|
|
|
|
|
|
class="order-item"
|
|
|
|
|
|
:class="{ completed: order.completed }"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="order-info">
|
|
|
|
|
|
<span class="order-name">{{ order.name }}</span>
|
|
|
|
|
|
<span class="order-price">¥{{ order.price }}</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="order-status">
|
|
|
|
|
|
{{ order.completed ? '✓' : '○' }}
|
|
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<!-- 总计 -->
|
|
|
|
|
|
<div class="total-section">
|
|
|
|
|
|
<div class="total-row">
|
|
|
|
|
|
<span>菜品数量:</span>
|
|
|
|
|
|
<span class="total-value">{{ completedCount }}/{{ orders.length }} 份</span>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="total-row total-final">
|
|
|
|
|
|
<span>今日营收:</span>
|
|
|
|
|
|
<span class="total-amount">¥{{ totalRevenue }}</span>
|
|
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<!-- 操作按钮 -->
|
|
|
|
|
|
<div class="action-buttons">
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="btn btn-primary"
|
|
|
|
|
|
@click="processOrder"
|
|
|
|
|
|
:disabled="isProcessing || allCompleted"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ isProcessing ? '处理中...' : allCompleted ? '今日完成!' : '下一道菜' }}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
<button
|
|
|
|
|
|
class="btn btn-secondary"
|
|
|
|
|
|
@click="resetDemo"
|
|
|
|
|
|
>
|
|
|
|
|
|
重新开始
|
|
|
|
|
|
</button>
|
|
|
|
|
|
</div>
|
2026-02-06 03:34:50 +08:00
|
|
|
|
</div>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
<!-- 信息框 -->
|
|
|
|
|
|
<div class="info-box">
|
|
|
|
|
|
<span class="icon">💡</span>
|
|
|
|
|
|
<strong>核心思想:</strong>
|
|
|
|
|
|
<span v-if="mode === 'manual'">jQuery需要手动查找和修改DOM,就像手工记账,容易出错。</span>
|
|
|
|
|
|
<span v-else>Vue/React通过状态自动更新界面,就像智能管家,改数据界面自动变。</span>
|
2026-02-05 01:33:28 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
|
|
import { ref, computed } from 'vue'
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 当前模式
|
|
|
|
|
|
const mode = ref('manual')
|
|
|
|
|
|
|
|
|
|
|
|
// 处理状态
|
|
|
|
|
|
const isProcessing = ref(false)
|
|
|
|
|
|
const currentStep = ref(0)
|
|
|
|
|
|
|
|
|
|
|
|
// 订单数据
|
|
|
|
|
|
const orders = ref([
|
|
|
|
|
|
{ id: 1, name: '宫保鸡丁', price: 38, completed: false },
|
|
|
|
|
|
{ id: 2, name: '鱼香肉丝', price: 32, completed: false },
|
|
|
|
|
|
{ id: 3, name: '麻婆豆腐', price: 18, completed: false },
|
|
|
|
|
|
{ id: 4, name: '糖醋排骨', price: 48, completed: false }
|
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
// 手工记账步骤
|
|
|
|
|
|
const manualSteps = [
|
|
|
|
|
|
'翻开账本,找到对应菜品',
|
|
|
|
|
|
'手动计算价格,写到本子上',
|
|
|
|
|
|
'再算一遍总数,防止算错',
|
|
|
|
|
|
'把完成的菜标记一下'
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
// 智能管家步骤
|
|
|
|
|
|
const smartSteps = [
|
|
|
|
|
|
'告诉管家:这道菜做好了',
|
|
|
|
|
|
'管家自动更新账本',
|
|
|
|
|
|
'总数自动计算,不会出错',
|
|
|
|
|
|
'所有数据实时同步'
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
// 当前步骤列表
|
|
|
|
|
|
const currentSteps = computed(() => {
|
|
|
|
|
|
return mode.value === 'manual' ? manualSteps : smartSteps
|
2026-02-05 01:33:28 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 计算属性
|
|
|
|
|
|
const completedCount = computed(() => orders.value.filter(o => o.completed).length)
|
|
|
|
|
|
const totalRevenue = computed(() => orders.value.filter(o => o.completed).reduce((sum, o) => sum + o.price, 0))
|
|
|
|
|
|
const allCompleted = computed(() => orders.value.every(o => o.completed))
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
const ledgerStatus = computed(() => {
|
|
|
|
|
|
if (allCompleted.value) return '已完成'
|
|
|
|
|
|
return mode.value === 'manual' ? '手工计算中...' : '自动同步中...'
|
2026-02-05 01:33:28 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 处理下一道菜
|
|
|
|
|
|
const processOrder = async () => {
|
|
|
|
|
|
if (isProcessing.value || allCompleted.value) return
|
|
|
|
|
|
|
|
|
|
|
|
isProcessing.value = true
|
|
|
|
|
|
currentStep.value = 0
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 找到第一个未完成的订单
|
|
|
|
|
|
const orderIndex = orders.value.findIndex(o => !o.completed)
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 模拟步骤执行
|
|
|
|
|
|
for (let i = 0; i < currentSteps.value.length; i++) {
|
|
|
|
|
|
currentStep.value = i
|
|
|
|
|
|
await sleep(400)
|
|
|
|
|
|
}
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 完成订单
|
|
|
|
|
|
if (orderIndex !== -1) {
|
|
|
|
|
|
orders.value[orderIndex].completed = true
|
|
|
|
|
|
}
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
isProcessing.value = false
|
|
|
|
|
|
currentStep.value = 0
|
|
|
|
|
|
}
|
2026-02-05 01:33:28 +08:00
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 重置演示
|
|
|
|
|
|
const resetDemo = () => {
|
|
|
|
|
|
isProcessing.value = false
|
|
|
|
|
|
currentStep.value = 0
|
|
|
|
|
|
orders.value.forEach(o => o.completed = false)
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
// 辅助函数
|
2026-02-05 01:33:28 +08:00
|
|
|
|
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms))
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-02-14 12:14:07 +08:00
|
|
|
|
.jquery-vs-state-demo {
|
|
|
|
|
|
border: 1px solid var(--vp-c-divider);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
background: var(--vp-c-bg-soft);
|
|
|
|
|
|
padding: 1rem;
|
|
|
|
|
|
margin: 1rem 0;
|
|
|
|
|
|
max-height: 600px;
|
|
|
|
|
|
overflow-y: auto;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
/* 标题区 */
|
|
|
|
|
|
.demo-header {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-bottom: 0.75rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
.demo-header .icon {
|
|
|
|
|
|
font-size: 1.25rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
.demo-header .title {
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 1rem;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.demo-header .subtitle {
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
margin-left: 0.5rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
/* 主内容区 */
|
|
|
|
|
|
.demo-content {
|
|
|
|
|
|
margin-bottom: 0.75rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
/* 模式选项卡 */
|
|
|
|
|
|
.mode-tabs {
|
|
|
|
|
|
display: flex;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
|
margin-bottom: 1rem;
|
|
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
padding: 0.5rem;
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 2px solid var(--vp-c-divider);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.tab-btn {
|
|
|
|
|
|
flex: 1;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
align-items: center;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.25rem;
|
|
|
|
|
|
padding: 0.75rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border: none;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
border-radius: 6px;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
background: transparent;
|
|
|
|
|
|
cursor: pointer;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
transition: all 0.2s;
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.tab-btn:hover {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-bg-alt);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.tab-btn.active {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-brand);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.tab-icon {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 1.5rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.tab-text {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.85rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.tab-sub {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.75rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
opacity: 0.8;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
/* 对比展示区 */
|
|
|
|
|
|
.comparison-showcase {
|
|
|
|
|
|
display: grid;
|
|
|
|
|
|
grid-template-columns: 1fr 1fr;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 1rem;
|
|
|
|
|
|
margin-bottom: 1rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
|
.comparison-showcase {
|
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
|
}
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
/* 场景面板 */
|
|
|
|
|
|
.scenario-panel {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 2px solid var(--vp-c-divider);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
overflow: hidden;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.scenario-header {
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
border-bottom: 2px solid var(--vp-c-divider);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.scenario-icon {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 1.5rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.scenario-title {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.9rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.scenario-content {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
padding: 1rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.step-list {
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.5rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.step-item {
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
transition: all 0.2s;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.step-item.active {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-brand);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
color: white;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
transform: translateX(4px);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.step-number {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
width: 24px;
|
|
|
|
|
|
height: 24px;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
justify-content: center;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border-radius: 50%;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.75rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.step-item.active .step-number {
|
|
|
|
|
|
background: rgba(255, 255, 255, 0.2);
|
|
|
|
|
|
color: white;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.step-text {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.85rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
flex: 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
/* 账本面板 */
|
|
|
|
|
|
.ledger-panel {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
|
border: 2px solid var(--vp-c-divider);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
overflow: hidden;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.ledger-header {
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.75rem;
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
border-bottom: 2px solid var(--vp-c-divider);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.ledger-icon {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 1.5rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.ledger-title {
|
|
|
|
|
|
flex: 1;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.9rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.ledger-status {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
|
padding: 0.25rem 0.75rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border-radius: 12px;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-bg);
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.ledger-status.manual {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-warning);
|
|
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.ledger-status.smart {
|
|
|
|
|
|
background: var(--vp-c-success);
|
|
|
|
|
|
color: white;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.ledger-content {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
padding: 1rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-list {
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.5rem;
|
|
|
|
|
|
margin-bottom: 1rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-item {
|
2026-02-05 01:33:28 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
align-items: center;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
justify-content: space-between;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
transition: all 0.2s;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-item.completed {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-success);
|
|
|
|
|
|
border-left: 4px solid var(--vp-c-brand);
|
|
|
|
|
|
opacity: 0.3;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-info {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
flex-direction: column;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.25rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-name {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.85rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-price {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.75rem;
|
|
|
|
|
|
color: var(--vp-c-brand);
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.order-status {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 1rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.total-section {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
border-top: 2px dashed var(--vp-c-divider);
|
|
|
|
|
|
padding-top: 0.75rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.total-row {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
padding: 0.5rem 0;
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.total-row.total-final {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
font-size: 0.9rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
color: var(--vp-c-text-1);
|
|
|
|
|
|
border-top: 2px solid var(--vp-c-divider);
|
|
|
|
|
|
margin-top: 0.5rem;
|
|
|
|
|
|
padding-top: 0.75rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.total-amount {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
color: var(--vp-c-success);
|
|
|
|
|
|
font-size: 1.1rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
/* 操作按钮 */
|
|
|
|
|
|
.action-buttons {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: center;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
gap: 0.75rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.btn {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
padding: 0.5rem 1rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
border: none;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
font-size: 0.85rem;
|
2026-02-06 03:34:50 +08:00
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
cursor: pointer;
|
2026-02-14 12:14:07 +08:00
|
|
|
|
transition: all 0.2s;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.btn:hover:not(:disabled) {
|
|
|
|
|
|
transform: translateY(-2px);
|
|
|
|
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.btn:disabled {
|
|
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
cursor: not-allowed;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.btn-primary {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-brand);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
color: white;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-06 03:34:50 +08:00
|
|
|
|
.btn-secondary {
|
2026-02-14 12:14:07 +08:00
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
/* 信息框 */
|
|
|
|
|
|
.info-box {
|
|
|
|
|
|
background: var(--vp-c-bg-alt);
|
|
|
|
|
|
padding: 0.75rem;
|
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
|
font-size: 0.85rem;
|
|
|
|
|
|
color: var(--vp-c-text-2);
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
gap: 0.25rem;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
.info-box .icon {
|
|
|
|
|
|
flex-shrink: 0;
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-14 12:14:07 +08:00
|
|
|
|
.info-box strong {
|
|
|
|
|
|
color: var(--vp-c-text-1);
|
2026-02-05 01:33:28 +08:00
|
|
|
|
}
|
|
|
|
|
|
</style>
|