优化财务仪表盘UI与快捷时间筛选
This commit is contained in:
@@ -240,8 +240,13 @@ export async function fetchAdminMohongProduct(id: number | string) {
|
||||
return data.data
|
||||
}
|
||||
|
||||
export async function createAdminMohongProduct(payload: Partial<MohongProduct> & { title: string; price_cent: number }) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongProduct>>('/admin/crash/products', payload)
|
||||
export async function createAdminMohongProduct(
|
||||
payload: Partial<MohongProduct> & { title: string; price_cent: number }
|
||||
) {
|
||||
const { data } = await apiClient.post<ApiResponse<MohongProduct>>(
|
||||
'/admin/crash/products',
|
||||
payload
|
||||
)
|
||||
return data.data
|
||||
}
|
||||
|
||||
|
||||
@@ -87,13 +87,7 @@ async function handleCheckout() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
v-if="!mobile"
|
||||
v-model="drawerOpen"
|
||||
title="购物车"
|
||||
size="420px"
|
||||
append-to-body
|
||||
>
|
||||
<el-drawer v-if="!mobile" v-model="drawerOpen" title="购物车" size="420px" append-to-body>
|
||||
<div v-if="isEmpty" class="empty">
|
||||
<el-icon :size="36"><ShoppingCart /></el-icon>
|
||||
<p>还没有选购商品</p>
|
||||
@@ -115,7 +109,9 @@ async function handleCheckout() {
|
||||
:min="1"
|
||||
:max="line.stock > 0 ? line.stock : 99"
|
||||
size="small"
|
||||
@update:model-value="(v: number | undefined) => setQuantity(line.product_id, Number(v || 1))"
|
||||
@update:model-value="
|
||||
(v: number | undefined) => setQuantity(line.product_id, Number(v || 1))
|
||||
"
|
||||
/>
|
||||
<el-button text type="danger" :icon="Delete" @click="removeLine(line.product_id)" />
|
||||
</div>
|
||||
|
||||
@@ -206,12 +206,7 @@ async function handleSupportClick() {
|
||||
</button>
|
||||
<div class="search-wrap">
|
||||
<van-icon name="search" :size="16" />
|
||||
<input
|
||||
v-model="keyword"
|
||||
type="search"
|
||||
placeholder="搜索商品"
|
||||
@input="onSearchInput"
|
||||
/>
|
||||
<input v-model="keyword" type="search" placeholder="搜索商品" @input="onSearchInput" />
|
||||
</div>
|
||||
<button type="button" class="orders-btn" @click="openCart">
|
||||
购物车{{ cartCount > 0 ? `(${cartCount})` : '' }}
|
||||
@@ -250,7 +245,9 @@ async function handleSupportClick() {
|
||||
</aside>
|
||||
|
||||
<section ref="listPanel" class="list-panel">
|
||||
<van-loading v-if="loading" class="state-loading" size="24px" vertical>加载中...</van-loading>
|
||||
<van-loading v-if="loading" class="state-loading" size="24px" vertical
|
||||
>加载中...</van-loading
|
||||
>
|
||||
<van-empty v-else-if="products.length === 0" description="暂无商品" />
|
||||
<div v-else class="product-list">
|
||||
<button
|
||||
|
||||
@@ -37,9 +37,7 @@ const {
|
||||
paidMessage: '支付成功',
|
||||
})
|
||||
|
||||
const statusText = computed(() =>
|
||||
order.value ? mohongOrderStatusLabel(order.value.status) : ''
|
||||
)
|
||||
const statusText = computed(() => (order.value ? mohongOrderStatusLabel(order.value.status) : ''))
|
||||
|
||||
onMounted(loadOrder)
|
||||
|
||||
@@ -101,7 +99,6 @@ async function copyText() {
|
||||
showToast({ message: '复制失败', icon: 'cross' })
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -140,9 +137,7 @@ async function copyText() {
|
||||
<h3>商品明细</h3>
|
||||
<div v-for="item in order.items" :key="item.product_id" class="item-row">
|
||||
<span>{{ item.title }}</span>
|
||||
<em
|
||||
>×{{ item.quantity }} · ¥{{ item.amount || formatCent(item.amount_cent) }}</em
|
||||
>
|
||||
<em>×{{ item.quantity }} · ¥{{ item.amount || formatCent(item.amount_cent) }}</em>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -531,8 +531,6 @@ async function handleSupportClick() {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.shop-layout {
|
||||
grid-template-columns: 1fr;
|
||||
|
||||
@@ -36,9 +36,7 @@ const cashier = useOrderPaymentCashier({
|
||||
queryPayment: queryMohongPayment,
|
||||
})
|
||||
|
||||
const statusText = computed(() =>
|
||||
order.value ? mohongOrderStatusLabel(order.value.status) : ''
|
||||
)
|
||||
const statusText = computed(() => (order.value ? mohongOrderStatusLabel(order.value.status) : ''))
|
||||
|
||||
const activePayWayLabel = computed(() => {
|
||||
const map: Record<string, string> = { WXZF: '微信', ZFBZF: '支付宝' }
|
||||
@@ -123,7 +121,6 @@ async function copyText() {
|
||||
ElMessage.error('复制失败')
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -207,9 +204,7 @@ async function copyText() {
|
||||
<button v-if="order.copy_text" type="button" class="btn outline" @click="copyText">
|
||||
复制订单信息
|
||||
</button>
|
||||
<button type="button" class="btn outline" @click="router.push('/crash')">
|
||||
继续选购
|
||||
</button>
|
||||
<button type="button" class="btn outline" @click="router.push('/crash')">继续选购</button>
|
||||
</aside>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user