添加温馨提示页面
This commit is contained in:
90
src/pages/UI81/UI81.tsx
Normal file
90
src/pages/UI81/UI81.tsx
Normal file
@@ -0,0 +1,90 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "./UI81.css";
|
||||
import "../../assets/css/basic.css";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import ConfirmButton from "../../components/ConfirmButton";
|
||||
import DecorLine from "../../components/DecorLine";
|
||||
import { getPackagItemDetail } from "../../api/hisApi";
|
||||
import errorIcon from "../../assets/error.png";
|
||||
|
||||
const UI81: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleBack = () => {
|
||||
navigate(-1);
|
||||
};
|
||||
|
||||
const handleConfirm = () => {
|
||||
navigate("/UI9");
|
||||
};
|
||||
|
||||
const [ListData, setListData] = useState<any[]>([]);
|
||||
const [PackageInfo, setPackageInfo] = useState<any>({});
|
||||
useEffect(() => {
|
||||
getListData();
|
||||
}, []);
|
||||
|
||||
|
||||
const getListData = async () => {
|
||||
const id_no = localStorage.getItem("lastIdCardNo");
|
||||
if (!id_no) {
|
||||
alert("请先输入身份证号");
|
||||
return;
|
||||
}
|
||||
const res = await getPackagItemDetail(id_no as string);
|
||||
if (res.Status === 200) {
|
||||
// 处理数据:将 project_id 和 project_name 字符串分离为数组
|
||||
const processedData = res.Data.listPackDetail.map((item: any) => {
|
||||
// 将 project_id 字符串按中文顿号分割为数组
|
||||
const project_ids = item.project_id
|
||||
? item.project_id.split("、").map((id: string) => id.trim()).filter((id: string) => id)
|
||||
: [];
|
||||
|
||||
// 将 project_name 字符串按中文顿号分割为数组
|
||||
const project_names = item.project_name
|
||||
? item.project_name.split("、").map((name: string) => name.trim()).filter((name: string) => name)
|
||||
: [];
|
||||
|
||||
return {
|
||||
...item,
|
||||
project_ids,
|
||||
project_names,
|
||||
};
|
||||
});
|
||||
|
||||
setListData(processedData);
|
||||
setPackageInfo(res.Data.packagItemInfo);
|
||||
} else {
|
||||
alert(`获取列表数据失败: ${res.Message}`);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div className="basic-root">
|
||||
<div className="basic-white-block">
|
||||
<div className="basic-content">
|
||||
<div className="ui81-error-container">
|
||||
<img src={errorIcon} alt="error" />
|
||||
<span className="basic-title">温馨提示</span>
|
||||
</div>
|
||||
<DecorLine />
|
||||
|
||||
<span className="ui81-paragraph">
|
||||
<h4>尊敬的 {localStorage.getItem("name")} 先生/女士,体检过程中请您特别留意:</h4>
|
||||
<p>1、若您已怀孕或正在备孕,请务必提前告知工作人员,我们将为您避免放射类检查。</p>
|
||||
<p>2、若您有糖尿病史或易发低血糖,请提前告知工作人员,我们将在完成空腹项目后优先安排用餐。</p>
|
||||
<p>3、若您有长期服用任何药物、或体检过程中感到头晕、心慌等不适,请随时告知工作人员。</p>
|
||||
</span>
|
||||
|
||||
|
||||
<div className="ui81-confirm-section">
|
||||
<ConfirmButton text="我知道了" onClick={handleConfirm} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default UI81;
|
||||
Reference in New Issue
Block a user