feat(frontend): upgrade report dialog experience

Replace manual report links with automatic target association, improve validation and evidence uploads, and remove retired report UI code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-30 23:56:59 +08:00
1 parent 59ddf677b6
commit 80aecab586
10 files changed
+1121 -462

No files matched your search

+6 -41
View File
@@ -286,41 +286,6 @@ body.aksrt-modal-runtime-open {
transition: opacity 0.15s ease;
}
/* ---- 举报弹窗(参考主题报告弹窗几何 1:1)----
宽度对齐参考主题 Bootstrap 默认模态(>=768px 600px),圆角/底色走
--main-radius / --main-bg-color;移动端仍由 --bottom 底部抽屉接管。 */
.aksrt-report-modal:not(.aksrt-modal-runtime--bottom) .aksrt-modal-runtime__dialog {
width: min(600px, calc(100vw - 32px));
border-radius: var(--main-radius, 8px);
background: var(--main-bg-color, #fff);
}
/* edit-header:参考主题弹窗头(关闭钮靠右,红色警示徽标 + 标题居左)。 */
.aksrt-report-modal .edit-header {
position: relative;
padding-right: 32px;
}
.aksrt-report-modal .edit-header .close {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
float: none;
font-size: 20px;
line-height: 1;
cursor: pointer;
background: none;
border: 0;
padding: 2px 6px;
}
/* 原因徽章行:与参考主题一致,徽章可换行且间距走 mr6/mb6 工具类。 */
.aksrt-report-modal .form-but-radio .badg {
cursor: pointer;
user-select: none;
}
/* ---- 禁封用户弹窗(参考主题 set_user_ban 模态框几何 1:1)----
参考主题 zib_get_edit_user_ban_link 未传 data-class → 走 Bootstrap 默认
.modal-dialog(>=768px 宽 600px);data-height=360 → .modal-content 初始
@@ -562,14 +527,14 @@ body.aksrt-modal-runtime-open {
color: var(--color-ink, #111);
}
:is(.order-comment-from, .aksrt-report-modal) .form-upload .preview {
.order-comment-from .form-upload .preview {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
:is(.order-comment-from, .aksrt-report-modal) .form-upload .preview .add,
:is(.order-comment-from, .aksrt-report-modal) .form-upload .preview .preview-item {
.order-comment-from .form-upload .preview .add,
.order-comment-from .form-upload .preview .preview-item {
width: 80px;
height: 80px;
border-radius: 10px;
@@ -585,14 +550,14 @@ body.aksrt-modal-runtime-open {
此前这里的 left/top:50% + translate 版本与该规则叠加导致过约束,
加号被推到 75%/75% 只剩“L”形,故整体删除、统一走主样式包。 */
:is(.order-comment-from, .aksrt-report-modal) .form-upload .preview .preview-item img {
.order-comment-from .form-upload .preview .preview-item img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
:is(.order-comment-from, .aksrt-report-modal) .form-upload .preview .preview-item .remove {
.order-comment-from .form-upload .preview .preview-item .remove {
position: absolute;
top: 2px;
right: 2px;
@@ -607,7 +572,7 @@ body.aksrt-modal-runtime-open {
cursor: pointer;
}
:is(.order-comment-from, .aksrt-report-modal) .form-upload .hide {
.order-comment-from .form-upload .hide {
display: none !important;
}
+328
View File
@@ -0,0 +1,328 @@
/**
* Report form inside the shared modal runtime.
* @package AKSRT
*/
.aksrt-report-modal .aksrt-modal-runtime__dialog {
display: flex;
flex-direction: column;
overflow: hidden;
max-height: min(90vh, 820px);
max-height: min(90dvh, 820px);
background: var(--modal-surface);
color: var(--modal-ink);
}
.aksrt-report-modal:not(.aksrt-modal-runtime--bottom) .aksrt-modal-runtime__dialog {
width: min(600px, calc(100vw - 32px));
border-radius: var(--main-radius, 8px);
}
.aksrt-report-modal .aksrt-modal-runtime__header {
position: relative;
flex: none;
padding: 24px 64px 18px 24px;
border-bottom: 1px solid var(--modal-line-soft);
}
.aksrt-report-modal .aksrt-modal-runtime__title {
font-size: 20px;
font-weight: 600;
line-height: 1.4;
}
.aksrt-report-modal .aksrt-modal-runtime__close {
top: 14px;
right: 14px;
width: 44px;
height: 44px;
font-size: 26px;
color: var(--modal-muted);
}
.aksrt-report-modal .aksrt-modal-runtime__content {
display: flex;
min-height: 0;
padding: 0;
}
.aksrt-report-form {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
min-height: 0;
margin: 0;
text-align: left;
font-size: 14px;
line-height: 1.6;
}
.aksrt-report-body {
min-height: 0;
overflow-y: auto;
overscroll-behavior: contain;
padding: 22px 24px 24px;
}
.aksrt-report-target {
display: flex;
align-items: flex-start;
gap: 12px;
padding: 14px;
margin-bottom: 24px;
border-radius: 8px;
background: var(--modal-surface-3);
}
.aksrt-report-target > div { min-width: 0; }
.aksrt-report-target__icon {
display: grid;
flex: none;
place-items: center;
width: 36px;
height: 36px;
border: 1px solid var(--modal-line);
border-radius: 8px;
background: var(--modal-surface);
color: var(--modal-ink-2);
}
.aksrt-report-target__name {
display: block;
margin: 2px 0 4px;
font-size: 15px;
font-weight: 600;
overflow-wrap: anywhere;
}
.aksrt-report-hint,
.aksrt-report-count {
color: var(--modal-muted);
font-size: 12px;
font-weight: 400;
}
.aksrt-report-form p { margin: 6px 0 0; }
.aksrt-report-target p { margin: 0; }
.aksrt-report-count { font-variant-numeric: tabular-nums; }
.aksrt-report-reasons {
min-width: 0;
padding: 0;
margin: 0 0 22px;
border: 0;
}
.aksrt-report-reasons legend {
width: auto;
padding: 0;
margin: 0 0 10px;
border: 0;
color: inherit;
font-size: 14px;
font-weight: 600;
line-height: inherit;
}
.aksrt-report-label .aksrt-report-hint,
.aksrt-report-reasons legend .aksrt-report-hint { margin-left: 8px; }
.aksrt-report-reasons__options {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.aksrt-report-reason {
display: flex;
align-items: center;
gap: 9px;
min-height: 44px;
padding: 10px 12px;
margin: 0;
border: 1px solid var(--modal-line);
border-radius: 8px;
background: var(--modal-surface);
font-weight: 400;
cursor: pointer;
overflow-wrap: anywhere;
}
.aksrt-report-reason input[type="radio"] {
position: static;
display: block;
flex: none;
width: 16px;
height: 16px;
margin: 0;
opacity: 1;
appearance: auto;
accent-color: var(--modal-primary);
}
.aksrt-report-reason:has(input:checked) {
border-color: var(--modal-primary);
background: color-mix(in srgb, var(--modal-primary) 6%, var(--modal-surface));
}
.aksrt-report-reason input:checked + span { font-weight: 600; }
.aksrt-report-other { margin-top: 12px; }
.aksrt-report-field + .aksrt-report-field { margin-top: 22px; }
.aksrt-report-label-row {
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
margin-bottom: 8px;
}
.aksrt-report-label {
display: inline-block;
margin: 0;
font-weight: 600;
}
.aksrt-report-form textarea {
display: block;
width: 100%;
min-height: 80px;
max-height: 240px;
padding: 11px 12px;
border: 1px solid var(--modal-line);
border-radius: 8px;
background: var(--modal-surface);
color: var(--modal-ink);
font: inherit;
line-height: 1.65;
resize: vertical;
}
.aksrt-report-form textarea::placeholder { color: var(--modal-muted); }
.aksrt-report-other textarea { margin-top: 8px; }
.aksrt-report-form [aria-invalid="true"] { border-color: var(--modal-danger); }
.aksrt-report-images,
.aksrt-report-images__list {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.aksrt-report-images__list:empty { display: none; }
.aksrt-report-add,
.aksrt-report-image {
position: relative;
width: 90px;
height: 90px;
flex: none;
border: 1px solid var(--modal-line);
border-radius: 8px;
background: var(--modal-surface-3);
}
.aksrt-report-add {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
border-style: dashed;
color: var(--modal-ink-2);
font: inherit;
font-size: 12px;
cursor: pointer;
}
.aksrt-report-add i { font-size: 18px; }
.aksrt-report-image img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.aksrt-report-image__state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
height: 100%;
padding: 8px;
color: var(--modal-muted);
font-size: 12px;
}
.aksrt-report-image[data-upload-state="ready"] .aksrt-report-image__state { display: none; }
.aksrt-report-image[data-upload-state="error"] { border-color: var(--modal-danger); }
.aksrt-report-image [data-aksrt-report-retry] { min-width: 44px; min-height: 28px; border: 0; background: transparent; color: var(--modal-primary); text-decoration: underline; cursor: pointer; }
.aksrt-report-image__remove {
position: absolute;
top: -8px;
right: -8px;
display: grid;
place-items: center;
width: 30px;
height: 30px;
padding: 0;
border: 1px solid var(--modal-line);
border-radius: 50%;
background: var(--modal-surface);
color: var(--modal-ink-2);
font-size: 22px;
line-height: 1;
cursor: pointer;
}
.aksrt-report-notice {
margin-top: 22px;
padding-top: 16px;
border-top: 1px solid var(--modal-line-soft);
color: var(--modal-ink-2);
font-size: 12px;
overflow-wrap: anywhere;
}
.aksrt-report-notice > :first-child { margin-top: 0; }
.aksrt-report-notice > :last-child { margin-bottom: 0; }
.aksrt-report-footer {
flex: none;
padding: 0 24px max(20px, env(safe-area-inset-bottom));
border-top: 1px solid var(--modal-line-soft);
background: var(--modal-surface);
}
.aksrt-report-form .aksrt-report-error { margin: 12px 0 0; color: var(--modal-danger); font-size: 13px; }
.aksrt-report-form .aksrt-report-status { color: var(--modal-muted); font-size: 12px; }
.aksrt-report-form .aksrt-report-status:empty { display: none; }
.aksrt-report-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; }
.aksrt-report-actions button {
min-width: 96px;
min-height: 44px;
padding: 10px 20px;
border: 1px solid var(--modal-line);
border-radius: 8px;
font: inherit;
font-weight: 600;
cursor: pointer;
}
.aksrt-report-cancel { color: var(--modal-ink-2); background: var(--modal-surface); }
.aksrt-report-actions .aksrt-report-submit { color: var(--modal-on-primary); background: var(--modal-primary); border-color: transparent; }
.aksrt-report-form button:disabled { opacity: 0.55; cursor: not-allowed; }
.aksrt-report-form textarea:disabled { opacity: 0.65; }
.aksrt-report-modal :is(button, input, textarea, a):focus-visible { outline: 2px solid var(--modal-primary); outline-offset: 3px; }
.aksrt-report-modal [hidden] { display: none !important; }
@media (max-width: 768px) {
.aksrt-report-modal .aksrt-modal-runtime__header { padding: 20px 64px 16px 20px; }
.aksrt-report-body { padding: 18px 20px 22px; }
.aksrt-report-footer { padding-right: 20px; padding-left: 20px; }
.aksrt-report-actions button { flex: 1; min-width: 0; }
}
@media (max-width: 360px) {
.aksrt-report-reasons__options { grid-template-columns: 1fr; }
}