Przeglądaj źródła

重排营业执照影像区并突出上传按钮

sy 7 godzin temu
rodzic
commit
6adc316c3b

+ 26 - 9
web-scaffold/src/pages/CustomerWorkspacePage.tsx

@@ -717,16 +717,33 @@ export function CustomerWorkspacePage() {
     </section>
 
     <section className="ops-record-card customer-workspace-panel" id="customer-panel-materials" role="tabpanel" aria-labelledby="customer-tab-materials" hidden={tab !== "materials"}>
-      <div className="customer-panel"><h3>登记材料 · 营业执照影像</h3>
+      <div className="customer-panel customer-license-panel">
+        <h3>登记材料 · 营业执照影像</h3>
         <div className="customer-license-row">
-          {!licenseApplicable ? <p className="ops-muted">不适用(个人与个体工商户不采集证件影像)</p>
-            : license?.status === "viewable" ? <div className="customer-file-list"><div><span className="customer-file-thumb"><FileText size={16} /></span><div><strong>{license.file_name ?? MISSING}</strong><p>可查看(签名短时效,仅本次页面有效)</p></div>
-              <Button variant="ghost" onClick={() => window.open(license.view_url ?? "", "_blank", "noopener,noreferrer")}>查看</Button>
-              <Button variant="ghost" onClick={() => { const a = document.createElement("a"); a.href = license.view_url ?? ""; a.download = license.file_name ?? ""; a.target = "_blank"; a.rel = "noopener noreferrer"; document.body.appendChild(a); a.click(); a.remove(); }}>下载</Button></div></div>
-            : license?.status === "expired" ? <p className="ops-muted">已超期(影像留存期限已过,不再提供查看与下载)</p>
-            : <div className="customer-file-list"><div><span className="customer-file-thumb"><FileText size={16} /></span><div><strong>{license ? "未登记影像" : MISSING}</strong><p>{license ? "营业执照影像未登记(选填,可在本面板补传)" : "后端未下发 license 摘要(/customer/get@v1 旧版本)"}</p></div></div></div>}
+          <div className="customer-license-document">
+            <span className="customer-file-thumb" aria-hidden="true"><FileText size={20} /></span>
+            <div className="customer-license-description">
+              {!licenseApplicable ? <>
+                <strong>不适用</strong>
+                <p>个人和个体工商户无需登记营业执照影像。</p>
+              </> : license?.status === "viewable" ? <>
+                <div className="customer-license-filename"><strong>{license.file_name ?? "营业执照影像"}</strong><OpsStatus tone="success">已登记</OpsStatus></div>
+                <p>{license.view_url ? "查看链接短期有效,失效后请刷新页面。" : "查看链接暂不可用,请刷新页面。"}</p>
+                {license.view_url && <div className="customer-license-links">
+                  <a href={license.view_url} target="_blank" rel="noopener noreferrer">查看影像</a>
+                  <a href={license.view_url} download={license.file_name ?? ""} target="_blank" rel="noopener noreferrer">下载</a>
+                </div>}
+              </> : license?.status === "expired" ? <>
+                <strong>已超期</strong>
+                <p>影像留存期已满,无法查看或下载。</p>
+              </> : <>
+                <strong>{license ? "未登记影像" : MISSING}</strong>
+                <p>{license ? "营业执照影像为选填材料,可在此补传。" : "暂未获取影像登记状态。"}</p>
+              </>}
+            </div>
+          </div>
           {licenseApplicable && license?.status !== "expired" && <div className="customer-license-upload">
-            <label className="customer-upload-button" title="选择后立即直传平台对象存储(字节流不经过本系统)">
+            <label className="customer-upload-button customer-license-button">
               <Upload size={15} aria-hidden="true" />
               {licenseBusy ? "正在上传…" : license?.status === "viewable" ? "替换影像" : "上传影像"}
               <input
@@ -741,7 +758,7 @@ export function CustomerWorkspacePage() {
                 }}
               />
             </label>
-            <small id="customer-license-upload-note">格式与大小上限随平台桶策略;重新上传不重置留存期限(起算点=建档日)。</small>
+            <small id="customer-license-upload-note">格式和大小以平台限制为准。替换影像后,留存期限仍从建档日起算。</small>
           </div>}
         </div>
         {licenseError && <p className="ops-form-error" role="alert">{licenseError}</p>}

+ 85 - 5
web-scaffold/src/styles/record-detail.css

@@ -229,24 +229,102 @@
   margin-top: 12px;
 }
 
+.record-detail .customer-license-panel {
+  background: var(--card);
+}
+
 .customer-license-row {
   display: flex;
   flex-wrap: wrap;
-  align-items: center;
-  gap: 12px 16px;
+  gap: 12px;
 }
 
-.customer-license-row > .customer-file-list {
+.customer-license-document {
+  display: flex;
+  align-items: center;
   flex: 1 1 min(100%, 320px);
   min-width: 0;
+  gap: 12px;
+  padding: 14px;
+  border: 1px solid var(--border);
+  border-radius: var(--radius-control);
+  background: var(--surface-subtle);
+}
+
+.customer-license-document .customer-file-thumb {
+  flex: none;
+  width: 42px;
+  height: 42px;
+  color: var(--primary-soft-foreground);
+}
+
+.customer-license-description {
+  min-width: 0;
+  overflow-wrap: anywhere;
+  font-size: var(--type-body);
+}
+
+.customer-license-description p {
+  margin: 3px 0 0;
+  color: var(--text-secondary);
+  font-size: var(--type-support);
+  line-height: 1.5;
+}
+
+.customer-license-filename,
+.customer-license-links {
+  display: flex;
+  align-items: center;
+  flex-wrap: wrap;
+  gap: 4px 10px;
+}
+
+.customer-license-links {
+  margin-top: 6px;
+  font-size: var(--type-support);
+}
+
+.customer-license-links a {
+  color: var(--primary-soft-foreground);
+  font-weight: 600;
+  text-decoration: underline;
+  text-underline-offset: 3px;
 }
 
 .customer-license-upload {
   display: grid;
   flex: 0 1 17rem;
+  align-content: center;
   justify-items: start;
-  gap: 5px;
+  gap: 7px;
   min-width: 0;
+  padding: 12px 14px;
+  border-radius: var(--radius-control);
+  background: var(--primary-soft);
+}
+
+.customer-license-upload .customer-license-button {
+  min-height: 36px;
+  padding-inline: 12px;
+  border-color: transparent;
+  background: var(--primary);
+  color: var(--primary-foreground);
+  font-weight: 600;
+  transition: background-color .15s, box-shadow .15s;
+}
+
+.customer-license-button:hover:not(:has(input:disabled)) {
+  background: var(--primary-hover);
+}
+
+.customer-license-button:has(input:disabled),
+.customer-license-button input:disabled {
+  cursor: not-allowed;
+}
+
+.customer-license-button:has(input:disabled) {
+  background: var(--secondary);
+  color: var(--text-secondary);
 }
 
 .customer-license-upload small {
@@ -301,11 +379,13 @@
 }
 
 @media (max-width: 600px) {
+  .customer-license-upload { flex-basis: 100%; }
   .customer-record-metrics > div { padding-inline: 12px; }
   .record-detail .customer-workspace-panel > .ops-record-summary,
   .record-detail .customer-panel-grid { grid-template-columns: minmax(0, 1fr); }
 }
 
 @media (prefers-reduced-motion: reduce) {
-  .record-tabs button { transition: none; }
+  .record-tabs button,
+  .customer-license-upload .customer-license-button { transition: none; }
 }