From 0a43bba87fb734df521049e068c5926bec1ac397 Mon Sep 17 00:00:00 2001 From: xianyi Date: Wed, 7 Jan 2026 16:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=8A=A0=E9=A1=B9=E9=9D=A2?= =?UTF-8?q?=E6=9D=BFtag=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/exam/ExamAddonPanel.tsx | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/src/components/exam/ExamAddonPanel.tsx b/src/components/exam/ExamAddonPanel.tsx index 2175001..62f97b0 100644 --- a/src/components/exam/ExamAddonPanel.tsx +++ b/src/components/exam/ExamAddonPanel.tsx @@ -5,8 +5,6 @@ import { searchPhysicalExamAddItem, getAddItemCustomerInfo, getChannelCompanyLis import { Button, Input } from '../ui'; import { cls } from '../../utils/cls'; import nozImage from '../../assets/image/noz.png'; -import { setAddItemBillPdf } from '../../utils/examActions'; - interface AddonTag { title: string; type: 1 | 2 | 3 | 4; // 1: 热门(红), 2: 普通(灰), 3: 医生推荐(蓝), 4: 折扣信息 @@ -21,6 +19,7 @@ interface AddonItem { currentPrice?: string; combinationItemCode?: number | null; isEnjoyDiscount?: number | null; + discount_name?: string | null; } interface ExamAddonPanelProps { @@ -213,6 +212,7 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => { : '0.00', combinationItemCode: item.combination_item_code ?? null, isEnjoyDiscount: item.is_enjoy_discount ?? null, + discount_name: item.discount_rate ?? null, tags: [], paid: false, })); @@ -281,16 +281,7 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => { // 获取折扣信息文字(从 tags 中提取 type 4 的标签,或计算折扣) const getDiscountText = (item: AddonItem) => { - const discountTag = item.tags?.find(t => t.type === 4); - if (discountTag) return discountTag.title; - - const orig = parseFloat(item.originalPrice || '0'); - const curr = parseFloat(item.currentPrice || '0'); - if (orig > 0 && curr < orig) { - const percent = Math.round((curr / orig) * 100); - return `渠道 ${percent} 折`; - } - return '渠道价'; + return item.discount_name; }; // 构建折扣选项列表 @@ -367,16 +358,7 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => { }); if (res.Status === 200 && res.Data?.pdf_url && res.Data?.pdf_sort !== undefined && res.Data?.pdf_sort !== null) { - // 保存加项PDF信息到localStorage(未签名状态) - setAddItemBillPdf(examId, { - pdf_sort: res.Data.pdf_sort, - combinationCode: combinationItemCodes, - payment_status: res.Data.payment_status ?? null, - payment_status_name: res.Data.payment_status_name ?? null, - pdf_name: res.Data.pdf_name || '加项单', - pdf_url: res.Data.pdf_url, - is_signed: false, - }); + return true; } else { console.error('获取加项PDF失败', res.Message);