The old 售后 flow was an order-refund appendage: tickets were hard-bound to an order number, users could only file them from 「我的订单」against a paid order, and the admin action bottomed out at 「标记订单已退款」. It could not carry account questions or feature requests that have nothing to do with an order. Replace it with a general ticket system modelled on 魔方财务云's idcsmart_ticket: title + department + description are required, linking an order is optional (user's own paid orders only). Add departments, custom statuses, preset replies and internal admin notes as four configuration surfaces. Conversation history moves off the ticket row's JSON log into dedicated ticket_reply rows, which unlocks quoted replies. Front end gets a 工单中心 panel under 我的服务; back end moves from 支付中心 → 售后服务 to users.php → 工单管理. Per CLAUDE.md's rewrite-over-compatibility rule: drop the old table, build new ones, delete the old code. No dual paths, no data migration. The upstream plugin's upstream/downstream delivery and internal-ticket conversion are deliberately left out — both are multi-provider platform concerns with no meaning on a single WordPress site. Data: order_aftersale becomes six aksrt_ticket* tables (ticket, ticket_reply, ticket_status, ticket_type, ticket_prereply, ticket_note). SCHEMA_VERSION 2.6.0 -> 3.0.0. Status and department seeds are idempotent; the default status 「待接单」is flagged as non-editable. Domain: new src/Ticket/ (13 files, all under 460 lines). Attachments reuse UserController::rest_upload_comment_image with a ticket-specific permission callback, mirroring the existing /report/upload-image route rather than growing a second upload path. Notifications go through AKSRT\Messages\Message::send() and deep-link to the right surface; email/SMS stay out of scope since the theme's mail and SMS stacks are separate implementations. Refund gate opens up: marking an order refunded no longer requires an in-flight ticket, only that the order is paid. Also generalise a hardcoded special case in tools/audit-admin-contracts.php — schema domain inference now reads the parent directory instead of matching "PostList" by name, so new leaf schema files need no per-name exception. Verification: php tools/audit-admin-contracts.php exit 0, errors=0 node --test (widget-system + admin) 664 pass / 0 fail php -l over all new/changed files clean node --check over all JS clean npm run build + build:public clean Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
178 lines
6.6 KiB
CSS
178 lines
6.6 KiB
CSS
/* User center ticket (工单) center */
|
|
.aksrt-tickets-page {
|
|
--tickets-ink: var(--color-ink, #1d2738);
|
|
--tickets-muted: var(--color-ink-3, #758096);
|
|
--tickets-line: color-mix(in srgb, var(--color-line, #e1e6ef) 88%, transparent);
|
|
padding: 0;
|
|
color: var(--tickets-ink);
|
|
}
|
|
|
|
.uc-tickets-panel__head {
|
|
display: grid;
|
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
gap: 20px;
|
|
align-items: end;
|
|
padding: 4px 0 22px;
|
|
border-bottom: 1px solid var(--tickets-line);
|
|
}
|
|
|
|
.aksrt-tickets-page__eyebrow {
|
|
margin: 0 0 7px;
|
|
color: var(--color-primary, #3b82f6);
|
|
font-size: 11px;
|
|
font-weight: 750;
|
|
letter-spacing: .14em;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.uc-tickets-panel__title { display: flex; align-items: center; gap: 9px; font-size: 21px; }
|
|
.uc-tickets-panel__title-icon { color: var(--color-primary, #3b82f6); font-size: 17px; }
|
|
.uc-tickets-panel__title-wrap > p:last-child { margin-bottom: 0; }
|
|
|
|
.aksrt-tickets-page__stats {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
|
|
margin: 18px 0;
|
|
border: 1px solid var(--tickets-line);
|
|
border-radius: 14px;
|
|
background: var(--surface-1, #fff);
|
|
overflow: hidden;
|
|
}
|
|
.aksrt-tickets-page__stat { display: grid; gap: 5px; padding: 12px 15px; border-right: 1px solid var(--tickets-line); }
|
|
.aksrt-tickets-page__stat:last-child { border-right: 0; }
|
|
.aksrt-tickets-page__stat span { color: var(--tickets-muted); font-size: 12px; }
|
|
.aksrt-tickets-page__stat strong { font-size: 19px; font-variant-numeric: tabular-nums; }
|
|
|
|
.aksrt-tickets-page__search {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
align-items: center;
|
|
margin-bottom: 16px;
|
|
}
|
|
.aksrt-tickets-page__search input,
|
|
.aksrt-tickets-page__search select {
|
|
padding: 7px 11px;
|
|
border: 1px solid var(--tickets-line);
|
|
border-radius: 9px;
|
|
background: var(--surface-1, #fff);
|
|
color: inherit;
|
|
font-size: 13px;
|
|
}
|
|
.aksrt-tickets-page__search input { flex: 1 1 190px; }
|
|
|
|
.aksrt-tickets-page__list { display: grid; gap: 12px; }
|
|
|
|
.aksrt-tickets-page__card {
|
|
display: grid;
|
|
gap: 8px;
|
|
padding: 15px 17px;
|
|
border: 1px solid var(--tickets-line);
|
|
border-radius: 13px;
|
|
background: var(--surface-1, #fff);
|
|
}
|
|
.aksrt-tickets-page__card-head { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
|
|
.aksrt-tickets-page__card-num { color: var(--tickets-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
|
|
.aksrt-tickets-page__card-title { margin: 0; font-size: 15px; line-height: 1.5; }
|
|
.aksrt-tickets-page__card-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--tickets-muted); font-size: 12px; }
|
|
.aksrt-tickets-page__card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
|
|
.aksrt-ticket-badge {
|
|
display: inline-block;
|
|
padding: 2px 11px;
|
|
border-radius: 999px;
|
|
background: color-mix(in srgb, var(--aksrt-ticket-color, #6b7280) 13%, transparent);
|
|
color: var(--aksrt-ticket-color, #6b7280);
|
|
font-size: 12px;
|
|
font-weight: 650;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.aksrt-tickets-page__empty { display: grid; gap: 7px; justify-items: center; padding: 46px 16px; text-align: center; }
|
|
.aksrt-tickets-page__empty > i { color: var(--tickets-muted); font-size: 30px; }
|
|
.aksrt-tickets-page__empty h3 { margin: 0; font-size: 16px; }
|
|
.aksrt-tickets-page__empty p { margin: 0; color: var(--tickets-muted); font-size: 13px; }
|
|
|
|
.aksrt-tickets-page__pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 18px; }
|
|
.aksrt-tickets-page__page-chip {
|
|
min-width: 32px;
|
|
padding: 5px 10px;
|
|
border: 1px solid var(--tickets-line);
|
|
border-radius: 8px;
|
|
background: var(--surface-1, #fff);
|
|
color: inherit;
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
}
|
|
.aksrt-tickets-page__page-chip.is-active {
|
|
border-color: transparent;
|
|
background: var(--color-primary, #3b82f6);
|
|
color: #fff;
|
|
}
|
|
|
|
/* 详情 / 新建弹窗 */
|
|
.aksrt-ticket-detail { display: grid; gap: 12px; text-align: left; }
|
|
.aksrt-ticket-detail__head { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
|
|
.aksrt-ticket-detail__type { color: var(--tickets-muted); font-size: 12px; }
|
|
.aksrt-ticket-detail__title { margin: 0; font-size: 15px; line-height: 1.5; }
|
|
.aksrt-ticket-detail__order { margin: 0; color: var(--tickets-muted); font-size: 12px; }
|
|
.aksrt-ticket-detail__content,
|
|
.aksrt-ticket-detail__reply-body { color: var(--tickets-ink); font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
|
|
|
|
.aksrt-ticket-detail__replies { display: grid; gap: 9px; }
|
|
.aksrt-ticket-detail__reply { display: grid; gap: 5px; padding: 10px 12px; border-left: 3px solid var(--tickets-line); border-radius: 4px; background: var(--surface-2, #f6f7f9); }
|
|
.aksrt-ticket-detail__reply.is-admin { border-left-color: var(--color-primary, #3b82f6); }
|
|
.aksrt-ticket-detail__reply-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; font-size: 12px; }
|
|
.aksrt-ticket-detail__reply-head time { color: var(--tickets-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
|
|
|
|
.aksrt-ticket-quote {
|
|
margin: 0;
|
|
padding: 6px 10px;
|
|
border-left: 3px solid var(--tickets-line);
|
|
background: var(--surface-1, #fff);
|
|
color: var(--tickets-muted);
|
|
font-size: 12px;
|
|
}
|
|
.aksrt-ticket-detail__closed { margin: 0; color: var(--tickets-muted); font-size: 12px; }
|
|
|
|
.aksrt-ticket-attachments { display: flex; flex-wrap: wrap; gap: 7px; }
|
|
.aksrt-ticket-attachment { display: block; width: 68px; height: 68px; border: 1px solid var(--tickets-line); border-radius: 8px; overflow: hidden; }
|
|
.aksrt-ticket-attachment img { width: 100%; height: 100%; object-fit: cover; }
|
|
|
|
.aksrt-ticket-reply-form,
|
|
.aksrt-ticket-create-form { display: grid; gap: 11px; text-align: left; }
|
|
.aksrt-ticket-reply-form textarea,
|
|
.aksrt-ticket-create-form textarea,
|
|
.aksrt-ticket-create-form input,
|
|
.aksrt-ticket-create-form select {
|
|
width: 100%;
|
|
padding: 8px 11px;
|
|
border: 1px solid var(--tickets-line);
|
|
border-radius: 9px;
|
|
background: var(--surface-1, #fff);
|
|
color: inherit;
|
|
font-size: 13px;
|
|
font-family: inherit;
|
|
}
|
|
.aksrt-ticket-reply-form__actions { display: flex; flex-wrap: wrap; gap: 7px; }
|
|
|
|
.aksrt-ticket-field { display: grid; gap: 5px; }
|
|
.aksrt-ticket-field > span { color: var(--tickets-muted); font-size: 12px; }
|
|
.aksrt-ticket-images { display: flex; flex-wrap: wrap; gap: 7px; }
|
|
.aksrt-ticket-image { position: relative; width: 66px; height: 66px; border: 1px solid var(--tickets-line); border-radius: 8px; overflow: hidden; }
|
|
.aksrt-ticket-image img { width: 100%; height: 100%; object-fit: cover; }
|
|
.aksrt-ticket-image__remove {
|
|
position: absolute;
|
|
top: 1px;
|
|
right: 1px;
|
|
width: 17px;
|
|
height: 17px;
|
|
border: 0;
|
|
border-radius: 50%;
|
|
background: rgb(0 0 0 / 55%);
|
|
color: #fff;
|
|
font-size: 12px;
|
|
line-height: 17px;
|
|
cursor: pointer;
|
|
}
|