diff --git a/src/app/[lng]/components/ContractBox/ContractBase.tsx b/src/app/[lng]/components/ContractBox/ContractBase.tsx index 4e0fa37..38d0f0c 100644 --- a/src/app/[lng]/components/ContractBox/ContractBase.tsx +++ b/src/app/[lng]/components/ContractBox/ContractBase.tsx @@ -4,8 +4,8 @@ import PropTypes from 'prop-types'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEye } from '@fortawesome/free-solid-svg-icons'; import Image from 'next/image'; -import { maxCharacters } from '@/app/utils/contract'; import { Contract } from '@/app/type/type'; +import { faMessage, faEnvelope } from '@fortawesome/free-regular-svg-icons'; export const ContractBase = ({ t, fitXs, r }: { t: any; fitXs: boolean; r: Contract }) => { const { @@ -16,8 +16,8 @@ export const ContractBase = ({ t, fitXs, r }: { t: any; fitXs: boolean; r: Contr monthly_rental, modify_time, view = 128, - description, creator, + processing_fee, } = r; const currency = 'NTD'; const selection = { @@ -46,6 +46,13 @@ export const ContractBase = ({ t, fitXs, r }: { t: any; fitXs: boolean; r: Contr return '無法計算'; } }; + const price = () => { + let d = new Date(expiry_date).getTime(); + let now = new Date().getTime(); + + const monthCount = Math.round(Math.abs(d - now) / 1000 / 60 / 60 / 24 / 30); + return monthly_rental * monthCount + processing_fee; + }; return (
-
-

{maxCharacters(title, 15)}

-

+

+
+ {title} +
+
{gym_typeCaption()} {store} -

- -

+

+
{t('creator')}: {creator.first_name} -

+
+
+ + +
-
-

+

+