杂务:整理文档并收口 YumiNail 修复

This commit is contained in:
xiaowang
2026-05-21 18:43:59 +08:00
parent 3797938616
commit 9227ec6175
362 changed files with 8358 additions and 19928 deletions
+48 -22
View File
@@ -5,7 +5,8 @@
<LeftOutlined :style="{ fontSize: '20px' }" />
</a-button>
<h1>美甲师订单</h1>
<a-button type="link" @click="router.push('/artist-calendar')">日历</a-button>
<a-button v-if="showCalendarEntry" type="link" @click="router.push('/artist-calendar')">日历</a-button>
<div v-else class="placeholder" />
</header>
<main class="content">
@@ -46,7 +47,7 @@
<a-card
v-for="order in filteredOrders"
:key="order.id"
:ref="el => setOrderRef(order.id, el)"
:ref="(el: any) => setOrderRef(order.id, el)"
class="order-card"
:class="{ 'is-target': isTargetOrder(order.id) }"
>
@@ -97,6 +98,7 @@ import { computed, nextTick, onMounted, reactive, ref } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { LeftOutlined } from '@ant-design/icons-vue'
import { message, Modal } from 'ant-design-vue'
import { userApi } from '@/api/user'
import { fileApi } from '../api/index'
import { orderApi } from '../api/order'
import type { IdType } from '@/utils/id'
@@ -107,6 +109,7 @@ const route = useRoute()
const orders = ref<any[]>([])
const imageIdCache = ref<Record<string, string>>({})
const orderRefs = ref<Record<string, any>>({})
const showCalendarEntry = ref(false)
const filters = reactive({
keyword: '',
source: 'all',
@@ -217,6 +220,24 @@ const loadOrders = async () => {
}
}
/** loadCalendarAccess is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const loadCalendarAccess = async () => {
showCalendarEntry.value = false
try {
const currentUser = await userApi.getUserInfo()
if (currentUser.type === 3) {
showCalendarEntry.value = true
return
}
if (currentUser.type === 2) {
const artistInfo = await userApi.getNailArtistInfo(currentUser.id).catch(() => null)
showCalendarEntry.value = Number(artistInfo?.participateProduction) === 1
}
} catch {
showCalendarEntry.value = false
}
}
/** handleRefreshClick is an async page action. Trigger it from the template or lifecycle hook, then await the result. */
const handleRefreshClick = async () => {
await runWithGlobalLoading(() => loadOrders())
@@ -241,40 +262,45 @@ const completeOrder = (orderId: IdType) => {
})
}
onMounted(loadOrders)
onMounted(async () => {
await Promise.all([loadCalendarAccess(), loadOrders()])
})
</script>
<style scoped>
.page { min-height: 100vh; padding-top: 60px; background: #f5f5f5; }
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; background: #fff; border-bottom: 1px solid #f0f0f0; }
.header h1 { margin: 0; font-size: 18px; }
.page { min-height: 100vh; padding-top: 60px; background: linear-gradient(rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.92)), var(--theme-background-image), var(--theme-page-bg); background-size: cover, cover, auto; background-position: center top; color: var(--text-primary); }
.header { position: fixed; top: 0; left: 0; right: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 60px; padding: 10px 15px; background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--theme-border); backdrop-filter: blur(14px); }
.header h1 { margin: 0; font-size: 18px; color: var(--text-primary); }
.placeholder { width: 40px; height: 40px; }
.content { padding: 15px; }
.filter-panel { display: grid; gap: 10px; margin-bottom: 12px; padding: 12px; border-radius: 8px; background: #fff; }
.filter-panel { display: grid; gap: 10px; margin-bottom: 12px; padding: 12px; border-radius: 14px; background: var(--theme-card-bg); border: 1px solid var(--theme-border); box-shadow: 0 14px 34px rgba(122, 67, 88, 0.08); }
.filter-row { display: flex; gap: 8px; align-items: center; }
.filter-select, .filter-date, .filter-number { flex: 1; min-width: 0; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; color: #888; font-size: 12px; }
.order-card { margin-bottom: 12px; border-radius: 12px; }
.order-card.is-target { border-color: #d9955d; box-shadow: 0 0 0 2px rgba(217, 149, 93, .22); }
.filter-actions { display: flex; align-items: center; justify-content: space-between; color: var(--text-secondary); font-size: 12px; }
.order-card { margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--theme-border); background: var(--theme-card-bg); box-shadow: 0 14px 34px rgba(122, 67, 88, 0.08); }
.order-card.is-target { border-color: var(--theme-primary); box-shadow: 0 0 0 2px rgba(198, 89, 125, .16); }
.order-head, .footer { display: flex; align-items: center; justify-content: space-between; }
.order-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }
.order-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--theme-border); }
.order-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.source-tag { padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.source-service { background: #e6f4ff; color: #1677ff; }
.source-self { background: #f9f0ff; color: #722ed1; }
.source-both { background: #fff7e6; color: #d46b08; }
.customer-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; color: #666; font-size: 13px; }
.source-service { background: var(--theme-primary-soft); color: var(--theme-primary); }
.source-self { background: var(--theme-primary-soft); color: var(--theme-accent); }
.source-both { background: var(--theme-primary-soft); color: var(--theme-primary); }
.customer-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; color: var(--text-secondary); font-size: 13px; }
.status { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pending { background: #fff7e6; color: #fa8c16; }
.completed { background: #f6ffed; color: #52c41a; }
.cancelled { background: #fff1f0; color: #ff4d4f; }
.pending { background: var(--theme-primary-soft); color: var(--theme-primary); }
.completed { background: var(--theme-primary-soft); color: var(--theme-primary); }
.cancelled { background: var(--theme-primary-soft); color: var(--theme-accent); }
.item { display: flex; gap: 12px; margin-bottom: 12px; }
.thumb { width: 60px; height: 60px; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #eef3ff; }
.thumb { width: 60px; height: 60px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--theme-primary-soft); color: var(--theme-primary); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.main { flex: 1; }
.title { font-weight: 600; }
.line { margin-top: 4px; color: #666; font-size: 13px; }
.appointment { color: #1890ff; }
.title { font-weight: 600; color: var(--text-primary); }
.line { margin-top: 4px; color: var(--text-secondary); font-size: 13px; }
.appointment { color: var(--theme-primary); }
:deep(.ant-btn-primary) { background: var(--theme-primary); border-color: var(--theme-primary); }
:deep(.ant-btn-link) { color: var(--theme-primary); }
@media (min-width: 992px) {
.content {