2026-07-30 17:59:42 +08:00
|
|
|
|
<script setup lang="ts">
|
2026-09-18 16:48:35 +08:00
|
|
|
|
import { computed } from 'vue'
|
|
|
|
|
|
import { ArrowRight, PanelsTopLeft, RefreshCcw, Ship, ShoppingCart, Tags, Truck } from '@lucide/vue'
|
2026-08-03 18:52:30 +08:00
|
|
|
|
import { useAuthStore } from '@/modules/auth/public'
|
2026-09-18 16:48:35 +08:00
|
|
|
|
import { FirstLegOrdersView } from '@/modules/first-leg/public'
|
2026-07-30 17:59:42 +08:00
|
|
|
|
|
|
|
|
|
|
const auth = useAuthStore()
|
2026-08-04 15:31:08 +08:00
|
|
|
|
|
2026-09-18 16:48:35 +08:00
|
|
|
|
const primaryActions = computed(() => [
|
|
|
|
|
|
{ title: '头程下单', description: '国内提货 · 海运订舱 · 清关派送', icon: Ship, route: '/orders/first-leg/create', permission: 'order:first-leg:create', tone: 'blue' },
|
|
|
|
|
|
{ title: '退货换标', description: '退件接收 · 标签更换 · 重新入仓', icon: RefreshCcw, route: '/overseas-warehouse/return-relabel/create', permission: 'merchant:overseas-warehouse:return-order:create', tone: 'purple' },
|
|
|
|
|
|
{ title: '美国本土卡', description: '港口提柜 · 仓到仓 · 仓到门', icon: Truck, route: '/cross-border/domestic-trucking/create', permission: 'merchant:cross-border:domestic-trucking:create', tone: 'green' },
|
|
|
|
|
|
{ title: '美本土散板', description: '拼车拼载 · 打盘服务 · 灵活派送', icon: PanelsTopLeft, route: '/cross-border/pallet-shipping/create', permission: 'merchant:cross-border:pallet-shipping:create', tone: 'cyan' },
|
|
|
|
|
|
{ title: '海外采购', description: '采购代购 · 验货质检 · 集中发货', icon: ShoppingCart, route: '/cross-border/procurement/create', permission: 'merchant:cross-border:procurement:create', tone: 'orange' },
|
|
|
|
|
|
{ title: '贴标申请', description: '产品建档 · 标签上传 · 批量贴标', icon: Tags, route: '/overseas-warehouse/labeling/create', permission: 'merchant:overseas-warehouse:relabel:create', tone: 'rose' },
|
|
|
|
|
|
].filter((action) => auth.hasPermission(action.permission)))
|
2026-08-04 15:31:08 +08:00
|
|
|
|
|
2026-07-30 17:59:42 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
2026-09-18 16:48:35 +08:00
|
|
|
|
<div class="client-dashboard">
|
|
|
|
|
|
<header class="business-intro">
|
|
|
|
|
|
<h1>选择业务,快速下单</h1>
|
|
|
|
|
|
<p>请选择您需要的业务类型,填写信息后提交订单,我们将尽快为您安排。</p>
|
|
|
|
|
|
</header>
|
2026-08-04 15:31:08 +08:00
|
|
|
|
|
2026-09-18 16:48:35 +08:00
|
|
|
|
<section class="quick-actions" aria-label="业务选择">
|
|
|
|
|
|
<RouterLink v-for="(action, index) in primaryActions" :key="action.route" :to="action.route" class="quick-action" :class="`quick-action--${action.tone}`" :style="{ '--entry-index': index }">
|
|
|
|
|
|
<span class="action-icon"><component :is="action.icon" :size="23" :stroke-width="2.1" aria-hidden="true" /></span>
|
|
|
|
|
|
<span class="action-copy"><strong>{{ action.title }}</strong><small>{{ action.description }}</small></span>
|
|
|
|
|
|
<span class="action-enter">开始下单<ArrowRight :size="15" aria-hidden="true" /></span>
|
|
|
|
|
|
</RouterLink>
|
|
|
|
|
|
<p v-if="!primaryActions.length" class="no-actions">当前账号暂无常用业务权限,请通过已授权菜单办理业务,或联系企业管理员。</p>
|
|
|
|
|
|
</section>
|
2026-08-04 15:31:08 +08:00
|
|
|
|
|
2026-09-18 16:48:35 +08:00
|
|
|
|
<FirstLegOrdersView v-if="auth.hasPermission('order:first-leg:list')" :show-create-action="false" class="dashboard-order-list" />
|
|
|
|
|
|
<section v-else class="orders-permission-empty">
|
|
|
|
|
|
<strong>暂无头程订单查看权限</strong>
|
|
|
|
|
|
<span>需要查看企业订单时,请联系企业管理员开通。</span>
|
|
|
|
|
|
</section>
|
2026-07-30 17:59:42 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
2026-08-01 12:17:33 +08:00
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2026-09-18 16:48:35 +08:00
|
|
|
|
.client-dashboard { display: flex; min-width: 0; container-name: dashboard-content; container-type: inline-size; flex-direction: column; gap: 14px; padding: 0 8px 18px; color: var(--navy); animation: dashboard-enter .3s ease-out both; }
|
|
|
|
|
|
.business-intro { padding-top: 0; }
|
|
|
|
|
|
.business-intro h1 { margin: 0; color: #172033; font-size: 27px; font-weight: 750; letter-spacing: -.5px; line-height: 1.3; }
|
|
|
|
|
|
.business-intro p { margin: 5px 0 0; color: #7a8495; font-size: 13px; line-height: 1.55; }
|
|
|
|
|
|
.quick-actions { display: grid; grid-template-columns: repeat(6, minmax(188px, 1fr)); gap: 10px; overflow-x: auto; padding: 0 0 6px; scroll-snap-type: x proximity; scrollbar-color: #bdc9dc transparent; scrollbar-width: thin; }
|
|
|
|
|
|
.quick-actions::-webkit-scrollbar { height: 7px; }
|
|
|
|
|
|
.quick-actions::-webkit-scrollbar-thumb { border-radius: 999px; background: #bdc9dc; }
|
|
|
|
|
|
.quick-actions::-webkit-scrollbar-track { background: transparent; }
|
|
|
|
|
|
.quick-action { scroll-snap-align: start; }
|
|
|
|
|
|
.quick-action { --action-a: #2563eb; --action-b: #3730a3; --action-soft: rgba(37, 99, 235, .18); position: relative; display: flex; min-width: 0; min-height: 154px; overflow: hidden; align-items: center; flex-direction: column; padding: 15px 9px 13px; border: 1px solid rgba(148, 163, 184, .22); border-radius: 14px; background: linear-gradient(155deg, #fff 8%, rgba(248, 250, 252, .96) 100%); color: inherit; text-align: center; text-decoration: none; box-shadow: 0 8px 22px rgba(15, 23, 42, .055); animation: action-enter .4s cubic-bezier(.22, 1, .36, 1) both; animation-delay: calc(var(--entry-index) * 55ms); transition: border-color .35s ease, box-shadow .35s ease, transform .35s cubic-bezier(.22, 1, .36, 1); }
|
|
|
|
|
|
.quick-action::before { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, var(--action-soft), transparent 70%); content: ''; right: -62px; top: -66px; transition: transform .4s ease; }
|
|
|
|
|
|
.quick-action::after { position: absolute; right: 20%; bottom: 0; left: 20%; height: 3px; border-radius: 99px 99px 0 0; background: linear-gradient(90deg, var(--action-a), var(--action-b)); content: ''; opacity: .55; transform: scaleX(.35); transition: all .35s ease; }
|
|
|
|
|
|
.quick-action--blue { --action-a: #2563eb; --action-b: #3730a3; --action-soft: rgba(37, 99, 235, .18); }
|
|
|
|
|
|
.quick-action--purple { --action-a: #8b5cf6; --action-b: #c026d3; --action-soft: rgba(139, 92, 246, .18); }
|
|
|
|
|
|
.quick-action--green { --action-a: #059669; --action-b: #0f766e; --action-soft: rgba(5, 150, 105, .18); }
|
|
|
|
|
|
.quick-action--cyan { --action-a: #0891b2; --action-b: #0e7490; --action-soft: rgba(8, 145, 178, .18); }
|
|
|
|
|
|
.quick-action--orange { --action-a: #f59e0b; --action-b: #dc6b12; --action-soft: rgba(245, 158, 11, .2); }
|
|
|
|
|
|
.quick-action--rose { --action-a: #e11d48; --action-b: #be185d; --action-soft: rgba(225, 29, 72, .17); }
|
|
|
|
|
|
.quick-action:hover { border-color: color-mix(in srgb, var(--action-a) 35%, transparent); box-shadow: 0 16px 34px rgba(15, 23, 42, .12); transform: translateY(-5px); }
|
|
|
|
|
|
.quick-action:hover::before { transform: scale(1.25); }
|
|
|
|
|
|
.quick-action:hover::after { right: 12%; left: 12%; opacity: 1; transform: scaleX(1); }
|
|
|
|
|
|
.action-icon { position: relative; display: grid; width: 48px; height: 48px; flex: 0 0 auto; place-items: center; margin-bottom: 11px; border-radius: 14px; background: linear-gradient(135deg, var(--action-a), var(--action-b)); color: #fff; box-shadow: 0 8px 17px color-mix(in srgb, var(--action-a) 24%, transparent); transition: transform .35s ease; }
|
|
|
|
|
|
.action-icon::after { position: absolute; border: 1px solid color-mix(in srgb, var(--action-a) 20%, transparent); border-radius: 18px; content: ''; inset: -4px; }
|
|
|
|
|
|
.quick-action:hover .action-icon { transform: translateY(-3px) scale(1.06) rotate(-3deg); }
|
|
|
|
|
|
.action-copy { position: relative; display: flex; min-width: 0; width: 100%; align-items: center; flex-direction: column; }
|
|
|
|
|
|
.action-copy strong { color: #172033; font-size: 15px; font-weight: 750; line-height: 1.35; white-space: nowrap; }
|
|
|
|
|
|
.action-copy small { overflow: hidden; width: 100%; margin-top: 4px; color: #718096; font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
|
|
.action-enter { position: relative; display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 7px; color: var(--action-a); font-size: 10px; font-weight: 700; }
|
|
|
|
|
|
.action-enter svg { transition: transform .25s ease; }
|
|
|
|
|
|
.quick-action:hover .action-enter svg { transform: translateX(4px); }
|
|
|
|
|
|
.no-actions { margin: 0; padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #667085; font-size: 14px; }
|
|
|
|
|
|
.dashboard-order-list { min-width: 0; }
|
|
|
|
|
|
.orders-permission-empty { display: flex; min-height: 180px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: #7b8494; }
|
|
|
|
|
|
.orders-permission-empty strong { color: #475467; font-size: 15px; }
|
|
|
|
|
|
.orders-permission-empty span { font-size: 12px; }
|
|
|
|
|
|
.client-dashboard a:focus-visible { border-radius: 6px; outline: 2px solid var(--primary); outline-offset: 4px; }
|
|
|
|
|
|
@keyframes dashboard-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
|
|
|
|
|
|
@keyframes action-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
|
|
|
|
|
|
@container dashboard-content (max-width: 1180px) { .quick-actions { grid-template-columns: repeat(6, minmax(178px, 1fr)); } }
|
|
|
|
|
|
@media (max-width: 720px) { .client-dashboard { padding: 0; gap: 16px; } .business-intro h1 { font-size: 25px; } .quick-actions { grid-template-columns: repeat(2, minmax(150px, 1fr)); } }
|
|
|
|
|
|
@media (max-width: 420px) { .quick-actions { grid-template-columns: repeat(6, minmax(168px, 1fr)); } }
|
|
|
|
|
|
@media (prefers-reduced-motion: reduce) { .client-dashboard, .quick-action { animation: none; } .quick-action, .quick-action::before, .quick-action::after, .action-icon, .action-enter svg { transition: none; } }
|
2026-08-01 12:17:33 +08:00
|
|
|
|
</style>
|