From 3878c2e0f41fadc84f6a6e062ae28fe8a67c1f78 Mon Sep 17 00:00:00 2001 From: callmeyan Date: Thu, 6 Jun 2024 16:30:24 +0800 Subject: [PATCH] update ui --- src/components/bill/bill-detail-items.tsx | 3 +- src/components/bill/detail.tsx | 3 +- src/components/icons/index.tsx | 35 ++++++++++++++--------- src/i18n/translations/en.json | 3 +- src/i18n/translations/sc.json | 3 +- src/i18n/translations/tc.json | 3 +- src/pages/bill/query.tsx | 17 ++++++++++- src/pages/manual/index.tsx | 21 ++++++++++++-- src/service/api/bill.ts | 2 +- 9 files changed, 67 insertions(+), 23 deletions(-) diff --git a/src/components/bill/bill-detail-items.tsx b/src/components/bill/bill-detail-items.tsx index 94f8153..82def98 100644 --- a/src/components/bill/bill-detail-items.tsx +++ b/src/components/bill/bill-detail-items.tsx @@ -1,7 +1,7 @@ import React, {useMemo} from "react"; import {useTranslation} from "react-i18next"; -import {IconBillType, IconMoney, IconStudentId} from "@/components/icons"; +import {IconBillType, IconMoney, IconStudentEmail, IconStudentId} from "@/components/icons"; import MoneyFormat from "@/components/money-format.tsx"; import './bill.less' @@ -21,6 +21,7 @@ const BillDetailItems = (prop: { bill: BillModel }) => { } title={t('manual.student_number')} value={prop.bill.student_number || prop.bill.application_number}/> } title={t('bill.title_student_name')} value={`${prop.bill.student_english_name}/${prop.bill.student_chinese_name}`}/> + } title={'Email'} value={prop.bill.student_email}/> } title={t('manual.amount')} value={}/> ) } diff --git a/src/components/bill/detail.tsx b/src/components/bill/detail.tsx index e69a03e..a631646 100644 --- a/src/components/bill/detail.tsx +++ b/src/components/bill/detail.tsx @@ -5,6 +5,7 @@ import {useTranslation} from "react-i18next"; import {BillDetailItems, useBillQRCode} from "@/components/bill/index.ts"; import './bill.less' +import dayjs from "dayjs"; type BillDetailProps = { @@ -22,7 +23,7 @@ const BillDetail:BasicComponent = ({bill,onCancel})=>{
-
{t('manual.exp_time')} {'12:00'}
+
{t('manual.exp_time')} {dayjs(bill.expiration_time).format('HH:mm')}
diff --git a/src/components/icons/index.tsx b/src/components/icons/index.tsx index d25da87..2f4004d 100644 --- a/src/components/icons/index.tsx +++ b/src/components/icons/index.tsx @@ -43,16 +43,16 @@ export const IconMoney = ({style}: IconProps) => { - + + fill="#FF8432" fillOpacity="1"/> + fill="#FF8432" fillOpacity="1"/> @@ -68,26 +68,35 @@ export const IconStudentId = ({style}: IconProps) => { - + + fill="#00C479" fillOpacity="1"/> + fillOpacity="1"/> - + + fillOpacity="1"/> ) } +export const IconStudentEmail = ({style}: IconProps) => { + return ( + + + ) +} export const IconBillType = ({style}: IconProps) => { return ( @@ -98,25 +107,25 @@ export const IconBillType = ({style}: IconProps) => { - + + fill="#FFC65F" fillOpacity="1"/> + fill="#FFC65F" fillOpacity="1"/> + fillOpacity="1"/> + fill="#FFC65F" fillOpacity="1"/> diff --git a/src/i18n/translations/en.json b/src/i18n/translations/en.json index a48e4ed..26e35c8 100644 --- a/src/i18n/translations/en.json +++ b/src/i18n/translations/en.json @@ -69,7 +69,8 @@ }, "manual": { "amount": "Amount", - "amount_required": "require bill amount", + "amount_gt0": "must be greater than 0", + "amount_required": "require", "bill_type": "Bill Type", "bill_type_required": "please select bill type", "btn_generate": "Generate Bill", diff --git a/src/i18n/translations/sc.json b/src/i18n/translations/sc.json index 03c9665..a079b0a 100644 --- a/src/i18n/translations/sc.json +++ b/src/i18n/translations/sc.json @@ -69,7 +69,8 @@ }, "manual": { "amount": "金额", - "amount_required": "请填写账单金额", + "amount_gt0": "账单金额必须大于0", + "amount_required": "请填写", "bill_type": "账单类型", "bill_type_required": "请选择账单类型", "btn_generate": "生成账单", diff --git a/src/i18n/translations/tc.json b/src/i18n/translations/tc.json index d9b5fb1..f1db67b 100644 --- a/src/i18n/translations/tc.json +++ b/src/i18n/translations/tc.json @@ -69,7 +69,8 @@ }, "manual": { "amount": "金額", - "amount_required": "請填寫帳單金額", + "amount_gt0": "帳單金額必須大於0", + "amount_required": "請填寫", "bill_type": "帳單類型", "bill_type_required": "請選擇帳單類型", "btn_generate": "產生帳單", diff --git a/src/pages/bill/query.tsx b/src/pages/bill/query.tsx index 0b5cfb3..a268076 100644 --- a/src/pages/bill/query.tsx +++ b/src/pages/bill/query.tsx @@ -47,7 +47,7 @@ const BillQuery = () => { - {AppMode == 'development' && Payment} + {AppMode == 'development' && 支付} } { bill.status == BillStatus.PAID @@ -59,6 +59,21 @@ const BillQuery = () => { } return (
+ { setState({loading: true,errorMessage:''}) createManualBill(values).then((ret) => { + console.log(ret) frm.current?.formApi.reset(); Toast.info({ content: t('manual.success'), }) - getBillDetail(ret.id).then(setBillInfo); + setBillInfo(ret) + //getBillDetail(ret.id).then(setBillInfo); }).catch((e: BizError) => { Sentry.captureMessage('Error: create manual bill error',{ level: 'error', @@ -48,6 +50,9 @@ export default function Index() { setState({loading: false}) }) } + // useEffect(()=>{ + // getBillDetail(100009).then(setBillInfo); + // },[]) const BillInfo = ({bill}: { bill?: BillModel }) => { if (!bill) return null; @@ -77,7 +82,17 @@ export default function Index() { { + console.log(_,v) + return !isNaN(v) && Number(v)>0; + }, + message: t('manual.amount_gt0') + } + ]} /> ('/manual_payment', params) + return post('/manual_payment', params) } // 获取账单详情