R7E 真机二次反馈移动修复
引用 R7E-16C BIZ8-12B
这个提交包含在:
@@ -1,3 +1,4 @@
|
||||
import { useEffect } from "react";
|
||||
import { Link, useLocation, useNavigate } from "react-router-dom";
|
||||
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { toast } from "sonner";
|
||||
@@ -204,6 +205,20 @@ export function MobilePortalPage() {
|
||||
queryFn: () => fetchPortalHome(),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (location.hash !== "#finance" || !canUseFinance) {
|
||||
return;
|
||||
}
|
||||
|
||||
const frameId = window.requestAnimationFrame(() => {
|
||||
const financeSection = document.getElementById("finance");
|
||||
financeSection?.scrollIntoView({ block: "start", behavior: "smooth" });
|
||||
financeSection?.focus({ preventScroll: true });
|
||||
});
|
||||
|
||||
return () => window.cancelAnimationFrame(frameId);
|
||||
}, [canUseFinance, location.hash, portalHomeQuery.isError, portalHomeQuery.isLoading]);
|
||||
|
||||
const markHomeNotificationReadMutation = useMutation({
|
||||
mutationFn: (notificationId: string) => markNotificationRead(notificationId),
|
||||
onSuccess: async () => {
|
||||
@@ -379,7 +394,7 @@ export function MobilePortalPage() {
|
||||
) : null}
|
||||
|
||||
{canUseFinance ? (
|
||||
<section id="finance" className="mobile-card mobile-page-stack" data-testid="mobile-finance-summary">
|
||||
<section id="finance" tabIndex={-1} className="mobile-card mobile-page-stack" data-testid="mobile-finance-summary">
|
||||
<div className="mobile-section-header">
|
||||
<div className="mobile-section-title">财务</div>
|
||||
<span className="badge-neutral">{paymentBatchEnabled ? "复核与付款" : "审批与台账"}</span>
|
||||
|
||||
在新工单中引用
屏蔽一个用户