统一暗色模式页面/顶栏/Handsontable 选中色,调整下单到仓方式文案与提示,CustomLeftMenu 卡片统一 60px;补充揽收单、问题件处理与 H5 相关页面。 Co-authored-by: Cursor <cursoragent@cursor.com>
1657 lines
42 KiB
Vue
1657 lines
42 KiB
Vue
<template>
|
||
<div class="h5-orders-page" :class="{ 'is-selection-mode': selectionMode }">
|
||
<button
|
||
v-if="todoCount > 0 && !selectionMode"
|
||
type="button"
|
||
class="h5-orders-todo h5-enter"
|
||
@click="activeGroup = actionCount > 0 ? 'actionNeeded' : 'issue'"
|
||
>
|
||
<span class="h5-orders-todo__dot" />
|
||
<span class="h5-orders-todo__body">
|
||
<strong>{{ t('h5.orders.todo') }}</strong>
|
||
<span>
|
||
<template v-if="actionCount > 0">
|
||
{{ t('h5.orders.group.actionNeeded') }} {{ actionCount }}
|
||
</template>
|
||
<template v-if="actionCount > 0 && issueCount > 0"> · </template>
|
||
<template v-if="issueCount > 0">
|
||
{{ t('h5.orders.group.issue') }} {{ issueCount }}
|
||
</template>
|
||
</span>
|
||
</span>
|
||
<span class="h5-orders-todo__go">{{ t('h5.me.todoGo') }}</span>
|
||
</button>
|
||
|
||
<section v-if="selectionMode" class="h5-pickup-hero h5-enter">
|
||
<div class="h5-pickup-hero__top">
|
||
<button type="button" class="h5-pickup-hero__cancel" @click="exitSelectionMode">
|
||
<icon-left />
|
||
{{ t('h5.orders.mergePickup.cancel') }}
|
||
</button>
|
||
<div class="h5-pickup-hero__steps" aria-hidden="true">
|
||
<template v-if="selectionKind === 'create'">
|
||
<span class="is-active">{{ t('h5.orders.mergePickup.stepSelect') }}</span>
|
||
<i />
|
||
<span>{{ t('h5.orders.mergePickup.stepForm') }}</span>
|
||
</template>
|
||
<template v-else>
|
||
<span class="is-active">{{ t('h5.pickup.rebind.stepAdd') }}</span>
|
||
</template>
|
||
</div>
|
||
</div>
|
||
<div class="h5-pickup-hero__body">
|
||
<img :src="iconOrderPickup" alt="" class="h5-pickup-hero__icon" draggable="false" />
|
||
<div class="h5-pickup-hero__text">
|
||
<h2>
|
||
{{
|
||
selectionKind === 'rebind'
|
||
? t('h5.pickup.rebind.heroTitle')
|
||
: t('h5.orders.mergePickup.heroTitle')
|
||
}}
|
||
</h2>
|
||
<p>
|
||
{{
|
||
selectionKind === 'rebind'
|
||
? t('h5.pickup.rebind.hint', { warehouse: rebindWarehouseName || '-' })
|
||
: t('h5.orders.mergePickup.hint')
|
||
}}
|
||
</p>
|
||
</div>
|
||
</div>
|
||
<div class="h5-pickup-hero__stats">
|
||
<span class="h5-pickup-hero__chip">
|
||
{{ t('h5.orders.mergePickup.selectableCount', { count: selectableCountOnPage }) }}
|
||
</span>
|
||
<span v-if="selectedCount > 0" class="h5-pickup-hero__chip is-primary">
|
||
{{ t('h5.orders.mergePickup.selected', { count: selectedCount }) }}
|
||
</span>
|
||
</div>
|
||
</section>
|
||
|
||
<div class="h5-orders-search" :class="{ 'is-pickup-mode': selectionMode }">
|
||
<icon-search class="h5-orders-search__icon" />
|
||
<input
|
||
v-model="keyword"
|
||
class="h5-orders-search__input"
|
||
type="search"
|
||
enterkeyhint="search"
|
||
:placeholder="t('h5.orders.searchPlaceholder')"
|
||
@keyup.enter="reload"
|
||
/>
|
||
<button
|
||
v-if="keyword"
|
||
type="button"
|
||
class="h5-orders-search__clear"
|
||
aria-label="clear"
|
||
@click="keyword = ''; reload()"
|
||
>
|
||
×
|
||
</button>
|
||
</div>
|
||
|
||
<div v-if="!selectionMode" class="h5-orders-tabs">
|
||
<button
|
||
v-for="group in groups"
|
||
:key="group.key"
|
||
type="button"
|
||
class="h5-orders-tab"
|
||
:class="{ 'is-active': activeGroup === group.key }"
|
||
@click="activeGroup = group.key"
|
||
>
|
||
{{ t(group.labelKey) }}
|
||
<em v-if="groupCount(group) > 0">{{ groupCount(group) }}</em>
|
||
</button>
|
||
</div>
|
||
|
||
<div v-if="loading && !orders.length" class="h5-skel">
|
||
<div v-for="n in 3" :key="n" class="h5-skel-card" />
|
||
</div>
|
||
|
||
<a-spin :loading="loading && orders.length > 0" class="h5-orders-spin">
|
||
<H5EmptyState
|
||
v-if="!loading && !orders.length"
|
||
:icon="IconList"
|
||
:text="selectionMode ? t('h5.orders.mergePickup.emptyPredeclared') : t('h5.orders.empty')"
|
||
>
|
||
<a-button v-if="!selectionMode" type="outline" size="small" @click="h5Navigate(router, '/h5/price')">
|
||
{{ t('h5.orders.emptyGoPrice') }}
|
||
</a-button>
|
||
<a-button v-else type="outline" size="small" @click="exitSelectionMode">
|
||
{{ t('h5.orders.mergePickup.cancel') }}
|
||
</a-button>
|
||
</H5EmptyState>
|
||
|
||
<template v-for="(row, index) in orders" :key="selectionMode ? `pick-${row.id || row.waybillNo}` : (row.id || row.waybillNo)">
|
||
<article
|
||
v-if="selectionMode"
|
||
class="h5-pickup-card h5-enter"
|
||
:class="{
|
||
'is-selected': isRowSelected(row),
|
||
'is-disabled': !pickupSelectable(row).ok,
|
||
}"
|
||
:style="{ animationDelay: `${Math.min(index, 6) * 40}ms` }"
|
||
@click="onCardClick(row)"
|
||
>
|
||
<span
|
||
class="h5-pickup-card__check"
|
||
:class="{
|
||
'is-checked': isRowSelected(row),
|
||
'is-disabled': !pickupSelectable(row).ok,
|
||
}"
|
||
>
|
||
<icon-check v-if="isRowSelected(row)" />
|
||
</span>
|
||
<div class="h5-pickup-card__main">
|
||
<div class="h5-pickup-card__row">
|
||
<strong>{{ row.waybillNo || row.customerOrderNo || '-' }}</strong>
|
||
<span class="h5-pickup-card__status" :style="statusStyle(row)">{{ statusLabel(row) }}</span>
|
||
</div>
|
||
<p v-if="pickupSelectable(row).ok" class="h5-pickup-card__meta">
|
||
{{ warehouseLabel(row) }}
|
||
<i aria-hidden="true">→</i>
|
||
{{ countryLabel(row) || countryCode(row) || '-' }}
|
||
</p>
|
||
<p v-else class="h5-pickup-card__reason">{{ pickupReasonLabel(row) }}</p>
|
||
</div>
|
||
</article>
|
||
|
||
<article
|
||
v-else
|
||
class="h5-order-card h5-enter"
|
||
:class="{ 'is-pay': isPendingPay(row) }"
|
||
:style="{ animationDelay: `${Math.min(index, 6) * 40}ms` }"
|
||
@click="onCardClick(row)"
|
||
>
|
||
<!-- 顶栏:状态 + 单号(右上) -->
|
||
<div class="h5-order-top">
|
||
<span class="h5-order-status" :style="statusStyle(row)">{{ statusLabel(row) }}</span>
|
||
<button
|
||
type="button"
|
||
class="h5-order-no"
|
||
@click.stop="copyText(row.waybillNo || row.customerOrderNo)"
|
||
>
|
||
<span>{{ row.waybillNo || row.customerOrderNo || row.trackingNo || '-' }}</span>
|
||
<icon-copy />
|
||
</button>
|
||
</div>
|
||
|
||
<!-- 主视觉:发货仓 → 目的国(顺丰/菜鸟式线路) -->
|
||
<div class="h5-order-route">
|
||
<div class="h5-order-route__end">
|
||
<strong>{{ warehouseLabel(row) }}</strong>
|
||
<em>{{ t('h5.price.origin') }}</em>
|
||
</div>
|
||
<div class="h5-order-route__mid" aria-hidden="true">
|
||
<span class="h5-order-route__line" />
|
||
<img :src="iconRoute" alt="" class="h5-order-route__icon" draggable="false" />
|
||
<span class="h5-order-route__line" />
|
||
</div>
|
||
<div class="h5-order-route__end h5-order-route__end--dest">
|
||
<strong>{{ countryLabel(row) || countryCode(row) || '-' }}</strong>
|
||
<em>
|
||
{{
|
||
countryLabel(row) && countryCode(row)
|
||
? countryCode(row)
|
||
: t('h5.orders.detail.country')
|
||
}}
|
||
</em>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 底栏:渠道 + 金额/主操作 -->
|
||
<div class="h5-order-foot">
|
||
<p v-if="channelLabel(row) || row.cargoAttributeLabel" class="h5-order-sub">
|
||
<span v-if="channelLabel(row)">{{ channelLabel(row) }}</span>
|
||
<template v-if="channelLabel(row) && row.cargoAttributeLabel"> · </template>
|
||
<span v-if="row.cargoAttributeLabel">{{ row.cargoAttributeLabel }}</span>
|
||
</p>
|
||
<span v-else class="h5-order-sub h5-order-sub--spacer" />
|
||
<div class="h5-order-foot__action" @click.stop>
|
||
<span v-if="isPendingPay(row)" class="h5-order-amount">
|
||
<small>{{ t('h5.orders.payable') }}</small>
|
||
<em>¥{{ formatMoney(row.receivableAmount) }}</em>
|
||
</span>
|
||
<span v-else-if="row.isPaid" class="h5-order-amount is-paid">
|
||
{{ t('h5.orders.paid') }}
|
||
</span>
|
||
<button
|
||
v-if="isPendingPay(row)"
|
||
type="button"
|
||
class="primary-btn primary-btn--danger"
|
||
@click="openPay(row)"
|
||
>
|
||
{{ t('h5.orders.pay') }}
|
||
</button>
|
||
<button
|
||
v-else-if="isShipping(row)"
|
||
type="button"
|
||
class="primary-btn"
|
||
@click="goDetail(row, 'track')"
|
||
>
|
||
{{ t('h5.orders.track') }}
|
||
</button>
|
||
<button
|
||
v-else-if="isIssue(row)"
|
||
type="button"
|
||
class="primary-btn primary-btn--warn"
|
||
@click="askAdvisor(row)"
|
||
>
|
||
{{ t('h5.orders.askAdvisor') }}
|
||
</button>
|
||
</div>
|
||
</div>
|
||
</article>
|
||
</template>
|
||
|
||
<a-button
|
||
v-if="hasMore"
|
||
long
|
||
class="h5-orders-more"
|
||
:loading="loadingMore"
|
||
@click="loadMore"
|
||
>
|
||
{{ t('h5.orders.loadMore') }}
|
||
</a-button>
|
||
</a-spin>
|
||
|
||
<H5OrderPaySheet
|
||
v-model:visible="payVisible"
|
||
:orders="payOrders"
|
||
@success="onPaySuccess"
|
||
@fail="onPayFail"
|
||
/>
|
||
|
||
<H5OrderDetailSheet
|
||
v-model:visible="detailVisible"
|
||
:order-id="detailOrderId"
|
||
:initial-tab="detailTab"
|
||
@paid="onPaySuccess"
|
||
/>
|
||
|
||
<div v-if="selectionMode" class="h5-orders-pickup-bar">
|
||
<div class="h5-orders-pickup-bar__summary">
|
||
<span class="h5-orders-pickup-bar__count">{{ selectedCount }}</span>
|
||
<div class="h5-orders-pickup-bar__text">
|
||
<strong>
|
||
{{
|
||
selectedWarehouseLabel
|
||
? t('h5.orders.mergePickup.selectedWithWarehouse', {
|
||
count: selectedCount,
|
||
warehouse: selectedWarehouseLabel,
|
||
})
|
||
: t('h5.orders.mergePickup.selected', { count: selectedCount })
|
||
}}
|
||
</strong>
|
||
<em>
|
||
{{
|
||
selectionKind === 'rebind'
|
||
? t('h5.pickup.rebind.stepAdd')
|
||
: t('h5.orders.mergePickup.stepForm')
|
||
}}
|
||
</em>
|
||
</div>
|
||
</div>
|
||
<button
|
||
type="button"
|
||
class="h5-orders-pickup-bar__btn"
|
||
:disabled="selectedCount === 0 || rebindSubmitting"
|
||
@click="selectionKind === 'rebind' ? submitRebindAdd() : openCreatePickup()"
|
||
>
|
||
{{
|
||
selectionKind === 'rebind'
|
||
? rebindSubmitting
|
||
? t('h5.pickup.loading')
|
||
: t('h5.pickup.rebind.confirmAdd')
|
||
: t('h5.orders.mergePickup.next')
|
||
}}
|
||
</button>
|
||
</div>
|
||
|
||
<H5CreatePickupFromOrdersSheet ref="createPickupSheetRef" @success="onCreatePickupSuccess" />
|
||
<H5PickupOrderDetailSheet ref="pickupDetailRef" @paid="reload" @changed="reload" />
|
||
</div>
|
||
</template>
|
||
|
||
<script lang="ts" setup>
|
||
import { computed, ref, watch } from 'vue';
|
||
import { useRoute, useRouter } from 'vue-router';
|
||
import { useI18n } from 'vue-i18n';
|
||
import { Message, Modal } from '@arco-design/web-vue';
|
||
import { IconCheck, IconCopy, IconLeft, IconList, IconSearch } from '@arco-design/web-vue/es/icon';
|
||
import { h5Navigate } from '@/utils/device';
|
||
import iconRoute from '@/assets/icons/h5/route-plane.svg?url';
|
||
import iconOrderPickup from '@/assets/icons/h5/order-pickup.svg?url';
|
||
import H5EmptyState from '../components/H5EmptyState.vue';
|
||
import {
|
||
getOrderStatusCounts,
|
||
postOrderList,
|
||
} from '@/api/order';
|
||
import {
|
||
getOrderStatusMeta,
|
||
getOrderStatusTagStyle,
|
||
resolveOrderStatusCode,
|
||
type OrderStatusCode,
|
||
} from '@/constants/orderStatus';
|
||
import {
|
||
H5_ORDER_GROUPS,
|
||
sumStatusCounts,
|
||
type H5OrderGroup,
|
||
type H5OrderGroupKey,
|
||
} from '@/constants/h5OrderStatus';
|
||
import {
|
||
buildAskAdvisorQuery,
|
||
buildWaybillContextFromRow,
|
||
} from '@/composables/useAskAdvisor';
|
||
import H5OrderPaySheet from '../components/H5OrderPaySheet.vue';
|
||
import H5OrderDetailSheet from '../components/H5OrderDetailSheet.vue';
|
||
import H5CreatePickupFromOrdersSheet from '../components/H5CreatePickupFromOrdersSheet.vue';
|
||
import H5PickupOrderDetailSheet from '../components/H5PickupOrderDetailSheet.vue';
|
||
import { addPickupOrderOrders, getPickupOrderDetail } from '@/api/order/pickupOrder';
|
||
|
||
const PICKUP_SELECTABLE_STATUS = 'predeclared' as const;
|
||
type PickupRejectReason = 'notPredeclared' | 'alreadyBound' | 'noWarehouse' | 'differentWarehouse';
|
||
type PickupSelectionKind = 'create' | 'rebind';
|
||
|
||
defineOptions({ name: 'H5Orders' });
|
||
|
||
const { t } = useI18n();
|
||
const route = useRoute();
|
||
const router = useRouter();
|
||
|
||
const groups = H5_ORDER_GROUPS;
|
||
|
||
function resolveInitialGroup(): H5OrderGroupKey {
|
||
const raw = String(route.query.group || '');
|
||
if (groups.some((g) => g.key === raw)) return raw as H5OrderGroupKey;
|
||
return 'all';
|
||
}
|
||
|
||
const activeGroup = ref<H5OrderGroupKey>(resolveInitialGroup());
|
||
const keyword = ref('');
|
||
const loading = ref(false);
|
||
const loadingMore = ref(false);
|
||
const page = ref(1);
|
||
const pageSize = 20;
|
||
const total = ref(0);
|
||
const orders = ref<any[]>([]);
|
||
const statusCounts = ref<Record<string, number>>({});
|
||
|
||
const payVisible = ref(false);
|
||
const payOrders = ref<{ id: number | string; waybillNo?: string }[]>([]);
|
||
const detailVisible = ref(false);
|
||
const detailOrderId = ref<number | string>('');
|
||
const detailTab = ref<'overview' | 'track' | 'fee'>('overview');
|
||
|
||
const selectionMode = ref(false);
|
||
const selectionKind = ref<PickupSelectionKind>('create');
|
||
const selectedOrderIds = ref<Array<number | string>>([]);
|
||
const rebindPickupId = ref<number | string>('');
|
||
const rebindWarehouseId = ref(0);
|
||
const rebindWarehouseName = ref('');
|
||
const rebindSubmitting = ref(false);
|
||
const createPickupSheetRef = ref<InstanceType<typeof H5CreatePickupFromOrdersSheet> | null>(null);
|
||
const pickupDetailRef = ref<InstanceType<typeof H5PickupOrderDetailSheet> | null>(null);
|
||
|
||
const selectedCount = computed(() => selectedOrderIds.value.length);
|
||
const selectedWarehouseId = computed(() => {
|
||
if (!selectedOrderIds.value.length) return 0;
|
||
const first = orders.value.find((row) => isRowSelected(row));
|
||
return getRowWarehouseId(first);
|
||
});
|
||
const selectedWarehouseLabel = computed(() => {
|
||
if (!selectedWarehouseId.value) return '';
|
||
const first = orders.value.find((row) => isRowSelected(row));
|
||
return warehouseLabel(first);
|
||
});
|
||
const selectableCountOnPage = computed(() =>
|
||
orders.value.filter((row) => pickupSelectable(row).ok).length,
|
||
);
|
||
|
||
const actionCount = computed(() =>
|
||
sumStatusCounts(statusCounts.value, ['pendingPayment']),
|
||
);
|
||
const issueCount = computed(() =>
|
||
sumStatusCounts(statusCounts.value, ['deliveryFailed', 'problematic', 'claimed']),
|
||
);
|
||
const todoCount = computed(() => actionCount.value + issueCount.value);
|
||
const hasMore = computed(() => orders.value.length < total.value);
|
||
|
||
function pick(raw: Record<string, any> | undefined, ...keys: string[]) {
|
||
if (!raw) return undefined;
|
||
for (const k of keys) {
|
||
const v = raw[k];
|
||
if (v !== undefined && v !== null && v !== '') return v;
|
||
}
|
||
return undefined;
|
||
}
|
||
|
||
function cargoLabel(raw: any) {
|
||
const value = String(pick(raw, 'cargoAttribute', 'CargoAttribute') ?? '').trim();
|
||
if (!value) return '';
|
||
const map: Record<string, string> = {
|
||
general: 'order.myOrders.drawer.cargoAttribute.general',
|
||
electronics: 'order.myOrders.drawer.cargoAttribute.electronics',
|
||
'3c': 'order.myOrders.drawer.cargoAttribute.electronics',
|
||
sensitive: 'order.myOrders.drawer.cargoAttribute.sensitive',
|
||
};
|
||
const key = map[value.toLowerCase()];
|
||
if (key) {
|
||
const label = t(key);
|
||
if (label && label !== key) return label;
|
||
}
|
||
return value;
|
||
}
|
||
|
||
function normalizeOrderRow(raw: any) {
|
||
const r = raw?.receiver || raw?.Receiver || {};
|
||
const serviceNo = pick(raw, 'serviceNo', 'ServiceNo', 'waybillNo', 'WaybillNo');
|
||
const clientNo = pick(raw, 'clientNo', 'ClientNo', 'customerOrderNo', 'CustomerOrderNo');
|
||
const trackNo = pick(raw, 'trackNo', 'TrackNo', 'trackingNo', 'TrackingNo');
|
||
const isPaidRaw = pick(raw, 'isPaid', 'IsPaid');
|
||
const warehouse = String(
|
||
pick(raw, 'warehouse', 'Warehouse', 'warehouseName', 'WarehouseName') ?? '',
|
||
).trim();
|
||
return {
|
||
...raw,
|
||
id: pick(raw, 'id', 'Id'),
|
||
waybillNo: serviceNo ?? '',
|
||
customerOrderNo: clientNo ?? '',
|
||
trackingNo: trackNo ?? '',
|
||
productName: pick(raw, 'productName', 'ProductName', 'productCode', 'ProductCode') ?? '',
|
||
channelName: pick(raw, 'channelName', 'ChannelName', 'channelCode', 'ChannelCode') ?? '',
|
||
isPaid: isPaidRaw === true || isPaidRaw === 1 || isPaidRaw === '1',
|
||
consigneeCountry: pick(raw, 'consigneeCountry', 'ConsigneeCountry') ?? pick(r, 'country', 'Country') ?? '',
|
||
consigneeCountryName:
|
||
pick(raw, 'consigneeCountryName', 'ConsigneeCountryName', 'chineseName', 'ChineseName') ??
|
||
pick(r, 'countryName', 'CountryName', 'chineseName', 'ChineseName') ??
|
||
'',
|
||
receivableAmount: pick(raw, 'receivableAmount', 'ReceivableAmount') ?? '',
|
||
status: resolveOrderStatusCode(raw),
|
||
createTime: pick(raw, 'createTime', 'CreateTime') ?? '',
|
||
warehouse,
|
||
warehouseId: Number(pick(raw, 'warehouseId', 'WarehouseId') || 0) || undefined,
|
||
pickupOrderId: pick(raw, 'pickupOrderId', 'PickupOrderId'),
|
||
cargoAttributeLabel: cargoLabel(raw),
|
||
};
|
||
}
|
||
|
||
function currentGroup(): H5OrderGroup {
|
||
return groups.find((g) => g.key === activeGroup.value) || groups[0];
|
||
}
|
||
|
||
function groupCount(group: H5OrderGroup) {
|
||
if (group.key === 'all') {
|
||
return Object.values(statusCounts.value).reduce((s, n) => s + (Number(n) || 0), 0);
|
||
}
|
||
return sumStatusCounts(statusCounts.value, group.statuses);
|
||
}
|
||
|
||
function statusLabel(row: any) {
|
||
const code = resolveOrderStatusCode(row);
|
||
const meta = getOrderStatusMeta(code);
|
||
if (!meta) return code || '-';
|
||
return t(meta.labelKey);
|
||
}
|
||
|
||
function statusStyle(row: any) {
|
||
return getOrderStatusTagStyle(getOrderStatusMeta(resolveOrderStatusCode(row)));
|
||
}
|
||
|
||
function channelLabel(row: any) {
|
||
return String(row.channelName || row.productName || '').trim();
|
||
}
|
||
|
||
function getRowWarehouseId(row: any) {
|
||
return Number(row?.warehouseId || pick(row, 'warehouseId', 'WarehouseId') || 0);
|
||
}
|
||
|
||
function getRowPickupOrderId(row: any) {
|
||
const v = row?.pickupOrderId ?? pick(row, 'pickupOrderId', 'PickupOrderId');
|
||
const id = Number(v);
|
||
return Number.isFinite(id) && id > 0 ? id : 0;
|
||
}
|
||
|
||
function pickupSelectable(row: any): { ok: boolean; reason?: PickupRejectReason } {
|
||
const status = resolveOrderStatusCode(row);
|
||
if (status !== PICKUP_SELECTABLE_STATUS) {
|
||
return { ok: false, reason: 'notPredeclared' };
|
||
}
|
||
if (getRowPickupOrderId(row)) {
|
||
return { ok: false, reason: 'alreadyBound' };
|
||
}
|
||
const whId = getRowWarehouseId(row);
|
||
if (!whId) {
|
||
return { ok: false, reason: 'noWarehouse' };
|
||
}
|
||
const lockWarehouseId =
|
||
selectionKind.value === 'rebind'
|
||
? rebindWarehouseId.value
|
||
: selectedWarehouseId.value;
|
||
if (lockWarehouseId > 0 && whId !== lockWarehouseId) {
|
||
return { ok: false, reason: 'differentWarehouse' };
|
||
}
|
||
return { ok: true };
|
||
}
|
||
|
||
function pickupReasonLabel(row: any) {
|
||
const reason = pickupSelectable(row).reason;
|
||
if (!reason) return '';
|
||
return t(`h5.orders.mergePickup.reason.${reason}`);
|
||
}
|
||
|
||
function isRowSelected(row: any) {
|
||
const id = row?.id;
|
||
return id != null && selectedOrderIds.value.some((x) => String(x) === String(id));
|
||
}
|
||
|
||
function resolvePickupSelectFromQuery() {
|
||
const raw = route.query.pickupSelect;
|
||
const value = Array.isArray(raw) ? raw[0] : raw;
|
||
return value === '1' || value === 'true';
|
||
}
|
||
|
||
function resolvePickupRebindFromQuery() {
|
||
const raw = route.query.pickupRebind;
|
||
const value = Array.isArray(raw) ? raw[0] : raw;
|
||
return value === '1' || value === 'true';
|
||
}
|
||
|
||
function resolveRebindPickupIdFromQuery() {
|
||
const raw = route.query.pickupId;
|
||
const value = Array.isArray(raw) ? raw[0] : raw;
|
||
const id = Number(value);
|
||
return Number.isFinite(id) && id > 0 ? id : 0;
|
||
}
|
||
|
||
async function loadRebindPickupContext(pickupId: number | string) {
|
||
try {
|
||
const raw = await getPickupOrderDetail(pickupId);
|
||
rebindWarehouseId.value = Number(raw?.warehouseId ?? raw?.WarehouseId) || 0;
|
||
rebindWarehouseName.value = String(raw?.warehouseName ?? raw?.WarehouseName ?? '');
|
||
} catch {
|
||
rebindWarehouseId.value = 0;
|
||
rebindWarehouseName.value = '';
|
||
}
|
||
}
|
||
|
||
async function syncSelectionModeFromQuery() {
|
||
if (resolvePickupSelectFromQuery()) {
|
||
selectionKind.value = 'create';
|
||
rebindPickupId.value = '';
|
||
rebindWarehouseId.value = 0;
|
||
rebindWarehouseName.value = '';
|
||
if (!selectionMode.value) {
|
||
selectionMode.value = true;
|
||
selectedOrderIds.value = [];
|
||
activeGroup.value = 'warehouse';
|
||
}
|
||
return;
|
||
}
|
||
if (resolvePickupRebindFromQuery()) {
|
||
const pickupId = resolveRebindPickupIdFromQuery();
|
||
if (!pickupId) return;
|
||
selectionKind.value = 'rebind';
|
||
rebindPickupId.value = pickupId;
|
||
if (!selectionMode.value) {
|
||
selectionMode.value = true;
|
||
selectedOrderIds.value = [];
|
||
activeGroup.value = 'warehouse';
|
||
}
|
||
await loadRebindPickupContext(pickupId);
|
||
return;
|
||
}
|
||
if (selectionMode.value) {
|
||
selectionMode.value = false;
|
||
selectedOrderIds.value = [];
|
||
selectionKind.value = 'create';
|
||
rebindPickupId.value = '';
|
||
rebindWarehouseId.value = 0;
|
||
rebindWarehouseName.value = '';
|
||
}
|
||
}
|
||
|
||
function exitSelectionMode() {
|
||
selectionMode.value = false;
|
||
selectedOrderIds.value = [];
|
||
selectionKind.value = 'create';
|
||
rebindPickupId.value = '';
|
||
rebindWarehouseId.value = 0;
|
||
rebindWarehouseName.value = '';
|
||
const nextQuery = { ...route.query } as Record<string, unknown>;
|
||
let changed = false;
|
||
if (resolvePickupSelectFromQuery()) {
|
||
delete nextQuery.pickupSelect;
|
||
changed = true;
|
||
}
|
||
if (resolvePickupRebindFromQuery()) {
|
||
delete nextQuery.pickupRebind;
|
||
delete nextQuery.pickupId;
|
||
changed = true;
|
||
}
|
||
if (changed) {
|
||
void router.replace({ query: nextQuery });
|
||
}
|
||
void reload();
|
||
}
|
||
|
||
function onCreatePickupSuccess(payload?: { pickupNo?: string; id?: number | string }) {
|
||
exitSelectionMode();
|
||
if (payload?.id != null) {
|
||
pickupDetailRef.value?.open(payload.id);
|
||
}
|
||
}
|
||
|
||
function toggleSelect(row: any) {
|
||
const check = pickupSelectable(row);
|
||
if (!check.ok) {
|
||
Message.warning(pickupReasonLabel(row));
|
||
return;
|
||
}
|
||
const id = row?.id;
|
||
if (id == null) return;
|
||
const key = String(id);
|
||
if (isRowSelected(row)) {
|
||
selectedOrderIds.value = selectedOrderIds.value.filter((x) => String(x) !== key);
|
||
} else {
|
||
selectedOrderIds.value = [...selectedOrderIds.value, id];
|
||
}
|
||
}
|
||
|
||
function onCardClick(row: any) {
|
||
if (selectionMode.value) {
|
||
toggleSelect(row);
|
||
return;
|
||
}
|
||
goDetail(row);
|
||
}
|
||
|
||
function openCreatePickup() {
|
||
const rows = orders.value.filter((row) => isRowSelected(row));
|
||
if (!rows.length) {
|
||
Message.warning(t('h5.orders.mergePickup.needSelect'));
|
||
return;
|
||
}
|
||
const invalid = rows.find((row) => !pickupSelectable(row).ok);
|
||
if (invalid) {
|
||
Message.warning(pickupReasonLabel(invalid));
|
||
return;
|
||
}
|
||
createPickupSheetRef.value?.open(
|
||
rows.map((row) => ({
|
||
id: row.id,
|
||
serviceNo: row.waybillNo || row.customerOrderNo,
|
||
warehouseId: getRowWarehouseId(row),
|
||
})),
|
||
);
|
||
}
|
||
|
||
async function submitRebindAdd() {
|
||
if (!rebindPickupId.value) return;
|
||
if (!selectedOrderIds.value.length) {
|
||
Message.warning(t('h5.orders.mergePickup.needSelect'));
|
||
return;
|
||
}
|
||
const invalid = orders.value
|
||
.filter((row) => isRowSelected(row))
|
||
.find((row) => !pickupSelectable(row).ok);
|
||
if (invalid) {
|
||
Message.warning(pickupReasonLabel(invalid));
|
||
return;
|
||
}
|
||
rebindSubmitting.value = true;
|
||
try {
|
||
await addPickupOrderOrders({
|
||
id: rebindPickupId.value,
|
||
orderIds: selectedOrderIds.value,
|
||
});
|
||
Message.success(t('order.pickupOrder.message.rebindOk'));
|
||
const pickupId = rebindPickupId.value;
|
||
exitSelectionMode();
|
||
pickupDetailRef.value?.open(pickupId);
|
||
} catch (e: any) {
|
||
Message.error(e?.message || t('order.pickupOrder.message.actionFailed'));
|
||
} finally {
|
||
rebindSubmitting.value = false;
|
||
}
|
||
}
|
||
|
||
function warehouseLabel(row: any) {
|
||
return String(row.warehouse || '').trim() || t('h5.price.originAny');
|
||
}
|
||
|
||
function countryLabel(row: any) {
|
||
return String(row.consigneeCountryName || '').trim();
|
||
}
|
||
|
||
function countryCode(row: any) {
|
||
return String(row.consigneeCountry || '').trim().toUpperCase();
|
||
}
|
||
|
||
function isPendingPay(row: any) {
|
||
return resolveOrderStatusCode(row) === 'pendingPayment';
|
||
}
|
||
|
||
function isShipping(row: any) {
|
||
return resolveOrderStatusCode(row) === 'shipping';
|
||
}
|
||
|
||
function isIssue(row: any) {
|
||
const code = resolveOrderStatusCode(row) as OrderStatusCode;
|
||
return ['deliveryFailed', 'problematic', 'claimed'].includes(code);
|
||
}
|
||
|
||
function formatMoney(val: unknown) {
|
||
const n = Number(val);
|
||
if (!Number.isFinite(n)) return String(val ?? '-');
|
||
return n.toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||
}
|
||
|
||
async function copyText(text?: string) {
|
||
if (!text) return;
|
||
try {
|
||
await navigator.clipboard.writeText(text);
|
||
Message.success(t('h5.orders.copySuccess'));
|
||
} catch {
|
||
Message.error(t('h5.orders.copyFailed'));
|
||
}
|
||
}
|
||
|
||
async function fetchCounts() {
|
||
try {
|
||
const res = await getOrderStatusCounts();
|
||
statusCounts.value = res.counts || {};
|
||
} catch {
|
||
statusCounts.value = {};
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 多状态分组:优先用单状态接口;多状态时拉 all 后在前端过滤(一期可行,量大再改后端 in 查询)
|
||
*/
|
||
async function fetchPage(pageNo: number, append: boolean) {
|
||
const group = currentGroup();
|
||
let singleStatus: string;
|
||
if (selectionMode.value) {
|
||
singleStatus = PICKUP_SELECTABLE_STATUS;
|
||
} else if (group.statuses.length === 1) {
|
||
singleStatus = group.statuses[0];
|
||
} else {
|
||
singleStatus = 'all';
|
||
}
|
||
|
||
const res = await postOrderList({
|
||
page: pageNo,
|
||
pageSize: selectionMode.value || group.statuses.length > 1 ? Math.max(pageSize, 50) : pageSize,
|
||
status: singleStatus,
|
||
keyword: keyword.value.trim(),
|
||
});
|
||
|
||
let items = (res.items || []).map(normalizeOrderRow);
|
||
if (!selectionMode.value && group.statuses.length > 1) {
|
||
const set = new Set(group.statuses);
|
||
items = items.filter((row) => set.has(resolveOrderStatusCode(row) as OrderStatusCode));
|
||
}
|
||
|
||
if (append) {
|
||
orders.value = [...orders.value, ...items];
|
||
} else {
|
||
orders.value = items;
|
||
if (selectionMode.value) {
|
||
const visible = new Set(items.map((row) => String(row.id)));
|
||
selectedOrderIds.value = selectedOrderIds.value.filter((id) => visible.has(String(id)));
|
||
}
|
||
}
|
||
total.value =
|
||
selectionMode.value
|
||
? res.total || items.length
|
||
: group.statuses.length > 1
|
||
? groupCount(group) || items.length
|
||
: res.total || items.length;
|
||
page.value = pageNo;
|
||
}
|
||
|
||
async function reload() {
|
||
loading.value = true;
|
||
try {
|
||
await Promise.all([fetchCounts(), fetchPage(1, false)]);
|
||
} catch (e: any) {
|
||
Message.error(e?.message || t('h5.orders.empty'));
|
||
orders.value = [];
|
||
} finally {
|
||
loading.value = false;
|
||
}
|
||
}
|
||
|
||
async function loadMore() {
|
||
if (!hasMore.value || loadingMore.value) return;
|
||
loadingMore.value = true;
|
||
try {
|
||
await fetchPage(page.value + 1, true);
|
||
} finally {
|
||
loadingMore.value = false;
|
||
}
|
||
}
|
||
|
||
function goDetail(row: any, tab?: string) {
|
||
detailOrderId.value = row.id;
|
||
detailTab.value =
|
||
tab === 'track' || tab === 'fee' || tab === 'overview' ? tab : 'overview';
|
||
detailVisible.value = true;
|
||
}
|
||
|
||
function openPay(row: any) {
|
||
payOrders.value = [{ id: row.id, waybillNo: row.waybillNo }];
|
||
payVisible.value = true;
|
||
}
|
||
|
||
function onPaySuccess() {
|
||
void reload();
|
||
}
|
||
|
||
function isBalanceLowError(error: unknown) {
|
||
const msg = String((error as any)?.message || (error as any)?.Message || error || '');
|
||
return /余额不足|balance|insufficient/i.test(msg);
|
||
}
|
||
|
||
function onPayFail(error: unknown) {
|
||
if (!isBalanceLowError(error)) return;
|
||
Modal.confirm({
|
||
title: t('h5.pay.balanceLowTitle'),
|
||
content: t('h5.pay.balanceLow'),
|
||
okText: t('h5.pay.goRecharge'),
|
||
cancelText: t('h5.pay.later'),
|
||
onOk: () => {
|
||
h5Navigate(router, '/h5/recharge');
|
||
},
|
||
});
|
||
}
|
||
|
||
function askAdvisor(row: any) {
|
||
const ctx = buildWaybillContextFromRow(row, 'h5Orders');
|
||
h5Navigate(router, {
|
||
path: '/h5/assistant',
|
||
query: buildAskAdvisorQuery(ctx),
|
||
});
|
||
}
|
||
|
||
watch(
|
||
() => [route.query.pickupSelect, route.query.pickupRebind, route.query.pickupId],
|
||
async () => {
|
||
const prev = selectionMode.value;
|
||
await syncSelectionModeFromQuery();
|
||
if (
|
||
selectionMode.value !== prev ||
|
||
resolvePickupSelectFromQuery() ||
|
||
resolvePickupRebindFromQuery()
|
||
) {
|
||
void reload();
|
||
}
|
||
},
|
||
);
|
||
|
||
watch(
|
||
() => route.query.group,
|
||
(g) => {
|
||
const raw = String(g || '');
|
||
if (groups.some((item) => item.key === raw)) {
|
||
activeGroup.value = raw as H5OrderGroupKey;
|
||
}
|
||
},
|
||
);
|
||
|
||
watch(activeGroup, () => {
|
||
if (selectionMode.value) return;
|
||
void reload();
|
||
});
|
||
|
||
async function tryOpenOrderFromQuery() {
|
||
const rawId = route.query.orderId;
|
||
const idStr = Array.isArray(rawId) ? rawId[0] : rawId;
|
||
const id = Number(idStr);
|
||
if (!Number.isFinite(id) || id <= 0) return;
|
||
goDetail({ id });
|
||
const nextQuery = { ...route.query } as Record<string, any>;
|
||
delete nextQuery.orderId;
|
||
await router.replace({ query: nextQuery });
|
||
}
|
||
|
||
watch(
|
||
() => route.query.orderId,
|
||
(orderId) => {
|
||
if (!orderId) return;
|
||
void tryOpenOrderFromQuery();
|
||
},
|
||
);
|
||
|
||
syncSelectionModeFromQuery().then(() => reload()).then(() => tryOpenOrderFromQuery());
|
||
</script>
|
||
|
||
<style lang="less" scoped>
|
||
.h5-orders-page {
|
||
padding: 12px 16px 24px;
|
||
background: #f5f6f8;
|
||
min-height: 100%;
|
||
box-sizing: border-box;
|
||
|
||
&.is-selection-mode {
|
||
padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
|
||
background: linear-gradient(180deg, #eef6f6 0%, #f5f6f8 220px);
|
||
}
|
||
}
|
||
|
||
.h5-pickup-hero {
|
||
margin-bottom: 12px;
|
||
padding: 14px;
|
||
border-radius: 16px;
|
||
background: linear-gradient(135deg, #fff 0%, var(--h5-primary-softer, #f3faf9) 100%);
|
||
box-shadow: var(--h5-shadow, 0 4px 16px rgba(15, 23, 42, 0.05));
|
||
border: 1px solid color-mix(in srgb, var(--app-primary-color) 12%, #fff);
|
||
}
|
||
|
||
.h5-pickup-hero__top {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 12px;
|
||
margin-bottom: 12px;
|
||
}
|
||
|
||
.h5-pickup-hero__cancel {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 2px;
|
||
border: none;
|
||
background: transparent;
|
||
padding: 0;
|
||
font-size: 14px;
|
||
color: var(--h5-text-2, #4e5969);
|
||
cursor: pointer;
|
||
|
||
:deep(.arco-icon) {
|
||
font-size: 14px;
|
||
}
|
||
}
|
||
|
||
.h5-pickup-hero__steps {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 4px 10px;
|
||
border-radius: 999px;
|
||
background: #f2f3f5;
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
color: var(--h5-text-3, #86909c);
|
||
|
||
i {
|
||
width: 16px;
|
||
height: 1px;
|
||
background: #c9cdd4;
|
||
}
|
||
|
||
.is-active {
|
||
color: var(--app-primary-color);
|
||
}
|
||
}
|
||
|
||
.h5-pickup-hero__body {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 12px;
|
||
}
|
||
|
||
.h5-pickup-hero__icon {
|
||
width: 44px;
|
||
height: 44px;
|
||
flex-shrink: 0;
|
||
object-fit: contain;
|
||
}
|
||
|
||
.h5-pickup-hero__text {
|
||
min-width: 0;
|
||
|
||
h2 {
|
||
margin: 0 0 4px;
|
||
font-size: 16px;
|
||
font-weight: 700;
|
||
color: var(--h5-text, #1d2129);
|
||
line-height: 1.35;
|
||
}
|
||
|
||
p {
|
||
margin: 0;
|
||
font-size: 12px;
|
||
line-height: 1.5;
|
||
color: var(--h5-text-3, #86909c);
|
||
}
|
||
}
|
||
|
||
.h5-pickup-hero__stats {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 8px;
|
||
margin-top: 12px;
|
||
}
|
||
|
||
.h5-pickup-hero__chip {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
height: 26px;
|
||
padding: 0 10px;
|
||
border-radius: 999px;
|
||
background: #f2f3f5;
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
color: var(--h5-text-2, #4e5969);
|
||
|
||
&.is-primary {
|
||
background: var(--h5-primary-soft, #e6f4f4);
|
||
color: var(--app-primary-color);
|
||
}
|
||
}
|
||
|
||
.h5-orders-search.is-pickup-mode {
|
||
margin-bottom: 10px;
|
||
}
|
||
|
||
.h5-pickup-card {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 12px;
|
||
margin-bottom: 10px;
|
||
padding: 14px;
|
||
border-radius: 14px;
|
||
background: #fff;
|
||
border: 1.5px solid transparent;
|
||
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
|
||
cursor: pointer;
|
||
text-align: left;
|
||
transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
|
||
|
||
&.is-selected {
|
||
border-color: var(--app-primary-color);
|
||
box-shadow: 0 4px 14px color-mix(in srgb, var(--app-primary-color) 18%, transparent);
|
||
}
|
||
|
||
&.is-disabled {
|
||
opacity: 0.58;
|
||
cursor: not-allowed;
|
||
}
|
||
|
||
&:active:not(.is-disabled) {
|
||
transform: scale(0.992);
|
||
}
|
||
}
|
||
|
||
.h5-pickup-card__check {
|
||
flex-shrink: 0;
|
||
width: 22px;
|
||
height: 22px;
|
||
margin-top: 2px;
|
||
border-radius: 50%;
|
||
border: 1.5px solid #c9cdd4;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
color: #fff;
|
||
background: #fff;
|
||
|
||
&.is-checked {
|
||
border-color: var(--app-primary-color);
|
||
background: var(--app-primary-color);
|
||
|
||
:deep(.arco-icon) {
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
&.is-disabled {
|
||
border-color: #e5e6eb;
|
||
background: #f7f8fa;
|
||
}
|
||
}
|
||
|
||
.h5-pickup-card__main {
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.h5-pickup-card__row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
margin-bottom: 6px;
|
||
|
||
strong {
|
||
font-size: 14px;
|
||
font-weight: 700;
|
||
color: #1d2129;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
}
|
||
|
||
.h5-pickup-card__status {
|
||
flex-shrink: 0;
|
||
font-size: 11px;
|
||
padding: 2px 7px;
|
||
border-radius: 6px;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.h5-pickup-card__meta {
|
||
margin: 0;
|
||
font-size: 12px;
|
||
color: #86909c;
|
||
line-height: 1.4;
|
||
|
||
i {
|
||
font-style: normal;
|
||
margin: 0 4px;
|
||
color: #c9cdd4;
|
||
}
|
||
}
|
||
|
||
.h5-pickup-card__reason {
|
||
margin: 0;
|
||
font-size: 12px;
|
||
color: #ff7d00;
|
||
line-height: 1.4;
|
||
}
|
||
|
||
.h5-orders-pickup-bar {
|
||
position: fixed;
|
||
left: 0;
|
||
right: 0;
|
||
bottom: calc(56px + env(safe-area-inset-bottom, 0px));
|
||
z-index: 90;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
padding: 12px 16px;
|
||
background: rgba(255, 255, 255, 0.98);
|
||
border-top: 1px solid var(--h5-border-soft, #f2f3f5);
|
||
box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
|
||
backdrop-filter: blur(10px);
|
||
}
|
||
|
||
.h5-orders-pickup-bar__summary {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.h5-orders-pickup-bar__count {
|
||
flex-shrink: 0;
|
||
width: 36px;
|
||
height: 36px;
|
||
border-radius: 12px;
|
||
background: var(--h5-primary-soft, #e6f4f4);
|
||
color: var(--app-primary-color);
|
||
font-size: 16px;
|
||
font-weight: 700;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
|
||
.h5-orders-pickup-bar__text {
|
||
min-width: 0;
|
||
|
||
strong {
|
||
display: block;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
color: var(--h5-text, #1d2129);
|
||
line-height: 1.35;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
em {
|
||
display: block;
|
||
margin-top: 2px;
|
||
font-style: normal;
|
||
font-size: 11px;
|
||
color: var(--h5-text-3, #86909c);
|
||
}
|
||
}
|
||
|
||
.h5-orders-pickup-bar__btn {
|
||
flex-shrink: 0;
|
||
border: none;
|
||
min-width: 96px;
|
||
height: 44px;
|
||
padding: 0 20px;
|
||
border-radius: 22px;
|
||
background: var(--app-primary-color);
|
||
color: #fff;
|
||
font-size: 15px;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
box-shadow: 0 6px 16px color-mix(in srgb, var(--app-primary-color) 28%, transparent);
|
||
|
||
&:disabled {
|
||
opacity: 0.45;
|
||
box-shadow: none;
|
||
cursor: not-allowed;
|
||
}
|
||
}
|
||
|
||
.h5-orders-todo {
|
||
width: 100%;
|
||
margin-bottom: 12px;
|
||
padding: 12px 14px;
|
||
border: none;
|
||
border-radius: 14px;
|
||
background:
|
||
linear-gradient(135deg, rgba(255, 247, 232, 0.95), rgba(255, 255, 255, 0.88));
|
||
color: #ff7d00;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
text-align: left;
|
||
cursor: pointer;
|
||
box-shadow:
|
||
inset 0 1px 0 rgba(255, 255, 255, 0.85),
|
||
0 6px 16px rgba(255, 125, 0, 0.1);
|
||
}
|
||
|
||
.h5-orders-todo__dot {
|
||
width: 8px;
|
||
height: 8px;
|
||
border-radius: 50%;
|
||
background: currentColor;
|
||
flex-shrink: 0;
|
||
animation: h5-todo-pulse 1.8s ease-out infinite;
|
||
}
|
||
|
||
@keyframes h5-todo-pulse {
|
||
0% {
|
||
box-shadow: 0 0 0 0 rgba(255, 125, 0, 0.45);
|
||
}
|
||
70% {
|
||
box-shadow: 0 0 0 8px rgba(255, 125, 0, 0);
|
||
}
|
||
100% {
|
||
box-shadow: 0 0 0 0 rgba(255, 125, 0, 0);
|
||
}
|
||
}
|
||
|
||
.h5-orders-todo__body {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 2px;
|
||
font-size: 13px;
|
||
|
||
strong {
|
||
font-size: 12px;
|
||
opacity: 0.9;
|
||
}
|
||
}
|
||
|
||
.h5-orders-todo__go {
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.h5-orders-search {
|
||
position: relative;
|
||
display: flex;
|
||
align-items: center;
|
||
margin-bottom: 8px;
|
||
height: 40px;
|
||
padding: 0 12px 0 36px;
|
||
border-radius: 12px;
|
||
background: rgba(255, 255, 255, 0.92);
|
||
box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
|
||
}
|
||
|
||
.h5-orders-search__icon {
|
||
position: absolute;
|
||
left: 12px;
|
||
color: #c9cdd4;
|
||
font-size: 16px;
|
||
}
|
||
|
||
.h5-orders-search__input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
height: 100%;
|
||
border: none;
|
||
outline: none;
|
||
background: transparent;
|
||
font-size: 14px;
|
||
color: #1d2129;
|
||
|
||
&::placeholder {
|
||
color: #c9cdd4;
|
||
}
|
||
}
|
||
|
||
.h5-orders-search__clear {
|
||
border: none;
|
||
background: transparent;
|
||
color: #c9cdd4;
|
||
font-size: 20px;
|
||
line-height: 1;
|
||
padding: 0 2px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
.h5-orders-tabs {
|
||
display: flex;
|
||
gap: 2px;
|
||
overflow-x: auto;
|
||
padding: 2px 0 10px;
|
||
margin-bottom: 2px;
|
||
-webkit-overflow-scrolling: touch;
|
||
|
||
&::-webkit-scrollbar {
|
||
display: none;
|
||
}
|
||
}
|
||
|
||
.h5-orders-tab {
|
||
flex: 0 0 auto;
|
||
height: 28px;
|
||
padding: 0 10px;
|
||
border: none;
|
||
border-radius: 6px;
|
||
background: transparent;
|
||
font-size: 13px;
|
||
font-weight: 500;
|
||
color: #86909c;
|
||
white-space: nowrap;
|
||
cursor: pointer;
|
||
|
||
em {
|
||
margin-left: 3px;
|
||
font-style: normal;
|
||
font-size: 11px;
|
||
font-weight: 600;
|
||
opacity: 0.75;
|
||
}
|
||
|
||
&.is-active {
|
||
color: #4e5969;
|
||
background: rgba(15, 23, 42, 0.05);
|
||
font-weight: 600;
|
||
}
|
||
}
|
||
|
||
.h5-orders-spin {
|
||
width: 100%;
|
||
display: block;
|
||
}
|
||
|
||
.h5-skel {
|
||
display: grid;
|
||
gap: 10px;
|
||
}
|
||
|
||
.h5-skel-card {
|
||
height: 108px;
|
||
border-radius: 16px;
|
||
background: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 37%, #eef0f3 63%);
|
||
background-size: 400% 100%;
|
||
animation: h5-skel 1.2s ease infinite;
|
||
}
|
||
|
||
@keyframes h5-skel {
|
||
0% {
|
||
background-position: 100% 0;
|
||
}
|
||
100% {
|
||
background-position: 0 0;
|
||
}
|
||
}
|
||
|
||
.h5-orders-spin :deep(.h5-empty) {
|
||
p {
|
||
margin-bottom: 14px;
|
||
}
|
||
}
|
||
|
||
.h5-order-card {
|
||
margin-bottom: 12px;
|
||
padding: 14px;
|
||
border-radius: 14px;
|
||
border: none;
|
||
background: #fff;
|
||
box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
|
||
cursor: pointer;
|
||
text-align: left;
|
||
transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
|
||
|
||
&.is-pay {
|
||
box-shadow:
|
||
0 0 0 1px color-mix(in srgb, #f53f3f 18%, transparent),
|
||
0 1px 2px rgba(15, 23, 42, 0.04);
|
||
}
|
||
|
||
&:active {
|
||
transform: scale(0.992);
|
||
}
|
||
}
|
||
|
||
/* 顶栏:状态 + 单号(右上) */
|
||
.h5-order-top {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 10px;
|
||
margin-bottom: 14px;
|
||
}
|
||
|
||
.h5-order-status {
|
||
flex-shrink: 0;
|
||
font-size: 12px;
|
||
padding: 3px 8px;
|
||
border-radius: 6px;
|
||
font-weight: 600;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
.h5-order-no {
|
||
min-width: 0;
|
||
max-width: 62%;
|
||
margin: 0;
|
||
border: none;
|
||
background: transparent;
|
||
padding: 0;
|
||
font-size: 12px;
|
||
font-weight: 500;
|
||
color: #86909c;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: flex-end;
|
||
gap: 4px;
|
||
cursor: pointer;
|
||
text-align: right;
|
||
|
||
span {
|
||
min-width: 0;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
:deep(.arco-icon) {
|
||
flex-shrink: 0;
|
||
color: #c9cdd4;
|
||
font-size: 12px;
|
||
}
|
||
}
|
||
|
||
.h5-order-amount {
|
||
display: inline-flex;
|
||
align-items: baseline;
|
||
gap: 4px;
|
||
color: #f53f3f;
|
||
line-height: 1.15;
|
||
white-space: nowrap;
|
||
|
||
small {
|
||
font-size: 11px;
|
||
font-weight: 500;
|
||
opacity: 0.85;
|
||
}
|
||
|
||
em {
|
||
font-style: normal;
|
||
font-size: 15px;
|
||
font-weight: 700;
|
||
font-variant-numeric: tabular-nums;
|
||
}
|
||
|
||
&.is-paid {
|
||
font-size: 12px;
|
||
font-weight: 600;
|
||
color: #00b42a;
|
||
}
|
||
}
|
||
|
||
/* 主视觉:仓 → 国 */
|
||
.h5-order-route {
|
||
display: grid;
|
||
grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
|
||
align-items: center;
|
||
gap: 6px;
|
||
margin-bottom: 14px;
|
||
padding: 12px 10px;
|
||
border-radius: 12px;
|
||
background: #f7f8fa;
|
||
}
|
||
|
||
.h5-order-route__end {
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 3px;
|
||
|
||
strong {
|
||
font-size: 16px;
|
||
font-weight: 700;
|
||
color: #1d2129;
|
||
line-height: 1.25;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
em {
|
||
font-style: normal;
|
||
font-size: 11px;
|
||
color: #86909c;
|
||
line-height: 1.2;
|
||
}
|
||
|
||
&--dest {
|
||
text-align: right;
|
||
|
||
strong {
|
||
color: var(--app-primary-color);
|
||
}
|
||
}
|
||
}
|
||
|
||
.h5-order-route__mid {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 4px;
|
||
padding: 0 2px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.h5-order-route__line {
|
||
width: 16px;
|
||
height: 1px;
|
||
background: color-mix(in srgb, var(--app-primary-color) 35%, #e5e6eb);
|
||
}
|
||
|
||
.h5-order-route__icon {
|
||
width: 22px;
|
||
height: 22px;
|
||
display: block;
|
||
object-fit: contain;
|
||
pointer-events: none;
|
||
-webkit-user-drag: none;
|
||
}
|
||
|
||
/* 底栏:渠道 + 金额/操作 */
|
||
.h5-order-foot {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
min-width: 0;
|
||
}
|
||
|
||
.h5-order-sub {
|
||
flex: 1;
|
||
min-width: 0;
|
||
margin: 0;
|
||
font-size: 12px;
|
||
color: #86909c;
|
||
line-height: 1.35;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
white-space: nowrap;
|
||
|
||
&--spacer {
|
||
visibility: hidden;
|
||
}
|
||
}
|
||
|
||
.h5-order-foot__action {
|
||
flex-shrink: 0;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
|
||
.primary-btn {
|
||
border: none;
|
||
height: 32px;
|
||
padding: 0 14px;
|
||
border-radius: 16px;
|
||
background: var(--app-primary-color);
|
||
color: #fff;
|
||
font-size: 13px;
|
||
font-weight: 600;
|
||
cursor: pointer;
|
||
white-space: nowrap;
|
||
box-shadow: 0 4px 12px color-mix(in srgb, var(--app-primary-color) 28%, transparent);
|
||
|
||
&--danger {
|
||
background: #f53f3f;
|
||
box-shadow: 0 4px 12px rgba(245, 63, 63, 0.28);
|
||
}
|
||
|
||
&--warn {
|
||
background: #ff7d00;
|
||
box-shadow: 0 4px 12px rgba(255, 125, 0, 0.28);
|
||
}
|
||
}
|
||
|
||
.h5-orders-more {
|
||
margin-top: 8px;
|
||
}
|
||
|
||
@media (prefers-reduced-motion: reduce) {
|
||
.h5-orders-todo__dot,
|
||
.h5-skel-card,
|
||
.h5-enter {
|
||
animation: none;
|
||
}
|
||
}
|
||
</style>
|