diff --git a/apps/admin/config/constants.ts b/apps/admin/config/constants.ts index f572573..a1755c8 100644 --- a/apps/admin/config/constants.ts +++ b/apps/admin/config/constants.ts @@ -4,10 +4,13 @@ import packageJSON from '../package.json'; export const locales = packageJSON.i18n.outputLocales; export const defaultLocale = packageJSON.i18n.entry; -export const NEXT_PUBLIC_DEFAULT_LANGUAGE = env('NEXT_PUBLIC_DEFAULT_LANGUAGE') ?? defaultLocale; +export const NEXT_PUBLIC_DEFAULT_LANGUAGE = + env('NEXT_PUBLIC_DEFAULT_LANGUAGE') ?? process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE ?? defaultLocale; export const NEXT_PUBLIC_SITE_URL = env('NEXT_PUBLIC_SITE_URL') ?? process.env.NEXT_PUBLIC_SITE_URL; export const NEXT_PUBLIC_API_URL = env('NEXT_PUBLIC_API_URL') ?? process.env.NEXT_PUBLIC_API_URL; -export const NEXT_PUBLIC_DEFAULT_USER_EMAIL = env('NEXT_PUBLIC_DEFAULT_USER_EMAIL'); -export const NEXT_PUBLIC_DEFAULT_USER_PASSWORD = env('NEXT_PUBLIC_DEFAULT_USER_PASSWORD'); +export const NEXT_PUBLIC_DEFAULT_USER_EMAIL = + env('NEXT_PUBLIC_DEFAULT_USER_EMAIL') ?? process.env.NEXT_PUBLIC_DEFAULT_USER_EMAIL; +export const NEXT_PUBLIC_DEFAULT_USER_PASSWORD = + env('NEXT_PUBLIC_DEFAULT_USER_PASSWORD') ?? process.env.NEXT_PUBLIC_DEFAULT_USER_PASSWORD; diff --git a/apps/admin/services/admin/typings.d.ts b/apps/admin/services/admin/typings.d.ts index e0ae306..afd36b2 100644 --- a/apps/admin/services/admin/typings.d.ts +++ b/apps/admin/services/admin/typings.d.ts @@ -172,7 +172,7 @@ declare namespace API { show: boolean; sell: boolean; deduction_ratio: number; - purchase_with_discount: boolean; + allow_deduction: boolean; reset_cycle: number; renewal_reset: boolean; }; @@ -548,6 +548,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -556,8 +557,6 @@ declare namespace API { trade_no: string; status: number; subscribe_id: number; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -570,6 +569,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -579,8 +579,6 @@ declare namespace API { status: number; subscribe_id: number; subscribe: Subscribe; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -747,7 +745,7 @@ declare namespace API { sell: boolean; sort: number; deduction_ratio: number; - purchase_with_discount: boolean; + allow_deduction: boolean; reset_cycle: number; renewal_reset: boolean; created_at: number; @@ -975,7 +973,7 @@ declare namespace API { sell: boolean; sort: number; deduction_ratio: number; - purchase_with_discount: boolean; + allow_deduction: boolean; reset_cycle: number; renewal_reset: boolean; }; @@ -1010,6 +1008,8 @@ declare namespace API { email: string; avatar: string; balance: number; + commission: number; + deduction: number; telegram: number; refer_code: string; referer_id: number; diff --git a/apps/admin/services/common/typings.d.ts b/apps/admin/services/common/typings.d.ts index f969c57..c465373 100644 --- a/apps/admin/services/common/typings.d.ts +++ b/apps/admin/services/common/typings.d.ts @@ -165,6 +165,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -173,8 +174,6 @@ declare namespace API { trade_no: string; status: number; subscribe_id: number; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -187,6 +186,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -196,8 +196,6 @@ declare namespace API { status: number; subscribe_id: number; subscribe: Subscribe; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -333,7 +331,7 @@ declare namespace API { sell: boolean; sort: number; deduction_ratio: number; - purchase_with_discount: boolean; + allow_deduction: boolean; reset_cycle: number; renewal_reset: boolean; created_at: number; @@ -416,6 +414,8 @@ declare namespace API { email: string; avatar: string; balance: number; + commission: number; + deduction: number; telegram: number; refer_code: string; referer_id: number; diff --git a/apps/user/app/(main)/(user)/sidebar-right.tsx b/apps/user/app/(main)/(user)/sidebar-right.tsx index 4f42ffa..66dd831 100644 --- a/apps/user/app/(main)/(user)/sidebar-right.tsx +++ b/apps/user/app/(main)/(user)/sidebar-right.tsx @@ -35,30 +35,48 @@ export function SidebarRight({ ...props }: React.ComponentProps) - - {t('inviteCode')} - - - - { - if (result) { - toast.success(t('copySuccess')); - } - }} - > - - - - {t('copyInviteLink')} - - + + {t('deductBalance')} - {user?.refer_code} + + + + + + {t('commission')} + + + + + + {user?.refer_code && ( + + + {t('inviteCode')} + + + + { + if (result) { + toast.success(t('copySuccess')); + } + }} + > + + + + {t('copyInviteLink')} + + + + {user?.refer_code} + + )} ); diff --git a/apps/user/app/(main)/(user)/wallet/page.tsx b/apps/user/app/(main)/(user)/wallet/page.tsx index d36201a..d7f404f 100644 --- a/apps/user/app/(main)/(user)/wallet/page.tsx +++ b/apps/user/app/(main)/(user)/wallet/page.tsx @@ -4,7 +4,7 @@ import { Display } from '@/components/display'; import { ProList, ProListActions } from '@/components/pro-list'; import useGlobalStore from '@/config/use-global'; import { queryUserBalanceLog } from '@/services/user/user'; -import { Card, CardContent, CardHeader, CardTitle } from '@workspace/ui/components/card'; +import { Card, CardContent } from '@workspace/ui/components/card'; import { useTranslations } from 'next-intl'; import { useRef } from 'react'; @@ -16,19 +16,48 @@ export default function Page() { const t = useTranslations('wallet'); const { user } = useGlobalStore(); const ref = useRef(null); - + const totalAssets = (user?.balance || 0) + (user?.commission || 0) + (user?.deduction || 0); return ( <> - - {t('title')} - - -
- + +

{t('totalAssets')}

+
+
+
+

总资产

+

+ +

+
+ +
-
- +
+
+

+ {t('balance')} +

+

+ +

+
+
+

+ {t('deductBalance')} +

+

+ +

+
+
+

+ {t('commission')} +

+

+ +

+
diff --git a/apps/user/components/affiliate/index.tsx b/apps/user/components/affiliate/index.tsx index a5f1d79..6eea822 100644 --- a/apps/user/components/affiliate/index.tsx +++ b/apps/user/components/affiliate/index.tsx @@ -4,7 +4,8 @@ import { Display } from '@/components/display'; import { Empty } from '@/components/empty'; import { ProList } from '@/components/pro-list'; import useGlobalStore from '@/config/use-global'; -import { queryUserAffiliate } from '@/services/user/user'; +import { queryUserAffiliate, queryUserAffiliateList } from '@/services/user/user'; +import { useQuery } from '@tanstack/react-query'; import { Button } from '@workspace/ui/components/button'; import { Card, @@ -24,6 +25,13 @@ export default function Affiliate() { const t = useTranslations('affiliate'); const { user, common } = useGlobalStore(); const [sum, setSum] = useState(); + const { data } = useQuery({ + queryKey: ['queryUserAffiliate'], + queryFn: async () => { + const response = await queryUserAffiliate(); + return response.data.data; + }, + }); return (
@@ -35,7 +43,7 @@ export default function Affiliate() {
- + ({t('commissionRate')}: {common?.invite?.referral_percentage}%) @@ -53,7 +61,7 @@ export default function Affiliate() { {user?.refer_code} { if (result) { toast.success(t('copySuccess')); @@ -70,7 +78,7 @@ export default function Affiliate() { > request={async (pagination, filter) => { - const response = await queryUserAffiliate({ ...pagination, ...filter }); + const response = await queryUserAffiliateList({ ...pagination, ...filter }); setSum(response.data.data?.sum); return { list: response.data.data?.list || [], diff --git a/apps/user/config/constants.ts b/apps/user/config/constants.ts index 1c5a6d7..30c94b7 100644 --- a/apps/user/config/constants.ts +++ b/apps/user/config/constants.ts @@ -4,19 +4,28 @@ import packageJSON from '../package.json'; export const locales = packageJSON.i18n.outputLocales; export const defaultLocale = packageJSON.i18n.entry; -export const NEXT_PUBLIC_DEFAULT_LANGUAGE = env('NEXT_PUBLIC_DEFAULT_LANGUAGE') ?? defaultLocale; +export const NEXT_PUBLIC_DEFAULT_LANGUAGE = + env('NEXT_PUBLIC_DEFAULT_LANGUAGE') ?? process.env.NEXT_PUBLIC_DEFAULT_LANGUAGE ?? defaultLocale; export const NEXT_PUBLIC_SITE_URL = env('NEXT_PUBLIC_SITE_URL') ?? process.env.NEXT_PUBLIC_SITE_URL; export const NEXT_PUBLIC_API_URL = env('NEXT_PUBLIC_API_URL') ?? process.env.NEXT_PUBLIC_API_URL; -export const NEXT_PUBLIC_DEFAULT_USER_EMAIL = env('NEXT_PUBLIC_DEFAULT_USER_EMAIL'); -export const NEXT_PUBLIC_DEFAULT_USER_PASSWORD = env('NEXT_PUBLIC_DEFAULT_USER_PASSWORD'); +export const NEXT_PUBLIC_DEFAULT_USER_EMAIL = + env('NEXT_PUBLIC_DEFAULT_USER_EMAIL') ?? process.env.NEXT_PUBLIC_DEFAULT_USER_EMAIL; +export const NEXT_PUBLIC_DEFAULT_USER_PASSWORD = + env('NEXT_PUBLIC_DEFAULT_USER_PASSWORD') ?? process.env.NEXT_PUBLIC_DEFAULT_USER_PASSWORD; -export const NEXT_PUBLIC_EMAIL = env('NEXT_PUBLIC_EMAIL'); +export const NEXT_PUBLIC_EMAIL = env('NEXT_PUBLIC_EMAIL') ?? process.env.NEXT_PUBLIC_EMAIL; -export const NEXT_PUBLIC_TELEGRAM_LINK = env('NEXT_PUBLIC_TELEGRAM_LINK'); -export const NEXT_PUBLIC_DISCORD_LINK = env('NEXT_PUBLIC_DISCORD_LINK'); -export const NEXT_PUBLIC_GITHUB_LINK = env('NEXT_PUBLIC_GITHUB_LINK'); -export const NEXT_PUBLIC_LINKEDIN_LINK = env('NEXT_PUBLIC_LINKEDIN_LINK'); -export const NEXT_PUBLIC_TWITTER_LINK = env('NEXT_PUBLIC_TWITTER_LINK'); -export const NEXT_PUBLIC_INSTAGRAM_LINK = env('NEXT_PUBLIC_INSTAGRAM_LINK'); +export const NEXT_PUBLIC_TELEGRAM_LINK = + env('NEXT_PUBLIC_TELEGRAM_LINK') ?? process.env.NEXT_PUBLIC_TELEGRAM_LINK; +export const NEXT_PUBLIC_DISCORD_LINK = + env('NEXT_PUBLIC_DISCORD_LINK') ?? process.env.NEXT_PUBLIC_DISCORD_LINK; +export const NEXT_PUBLIC_GITHUB_LINK = + env('NEXT_PUBLIC_GITHUB_LINK') ?? process.env.NEXT_PUBLIC_GITHUB_LINK; +export const NEXT_PUBLIC_LINKEDIN_LINK = + env('NEXT_PUBLIC_LINKEDIN_LINK') ?? process.env.NEXT_PUBLIC_LINKEDIN_LINK; +export const NEXT_PUBLIC_TWITTER_LINK = + env('NEXT_PUBLIC_TWITTER_LINK') ?? process.env.NEXT_PUBLIC_TWITTER_LINK; +export const NEXT_PUBLIC_INSTAGRAM_LINK = + env('NEXT_PUBLIC_INSTAGRAM_LINK') ?? process.env.NEXT_PUBLIC_INSTAGRAM_LINK; diff --git a/apps/user/locales/cs-CZ/layout.json b/apps/user/locales/cs-CZ/layout.json index 423c922..5c667bf 100644 --- a/apps/user/locales/cs-CZ/layout.json +++ b/apps/user/locales/cs-CZ/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Zůstatek na účtu", + "commission": "Provize", "copyInviteLink": "Zkopírovat odkaz na pozvánku", "copySuccess": "Odkaz na pozvánku byl úspěšně zkopírován", + "deductBalance": "Odečíst zůstatek", "inviteCode": "pozvánkový kód", "recharge": "Dobít" } diff --git a/apps/user/locales/cs-CZ/wallet.json b/apps/user/locales/cs-CZ/wallet.json index b06fb88..de34d1f 100644 --- a/apps/user/locales/cs-CZ/wallet.json +++ b/apps/user/locales/cs-CZ/wallet.json @@ -1,8 +1,10 @@ { "amount": "Částka", "balance": "zůstatek", + "commission": "Provize", "createdAt": "čas", - "title": "Zůstatek na účtu", + "deductBalance": "Odečíst zůstatek", + "totalAssets": "Přehled aktiv", "type": { "0": "Typ", "1": "Dobití", diff --git a/apps/user/locales/de-DE/layout.json b/apps/user/locales/de-DE/layout.json index ab62fb1..5d10a04 100644 --- a/apps/user/locales/de-DE/layout.json +++ b/apps/user/locales/de-DE/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Kontostand", + "commission": "Provision", "copyInviteLink": "Einladungslink kopieren", "copySuccess": "Einladungslink erfolgreich kopiert", + "deductBalance": "Guthaben abziehen", "inviteCode": "Einladungscode", "recharge": "Aufladen" } diff --git a/apps/user/locales/de-DE/wallet.json b/apps/user/locales/de-DE/wallet.json index f88c0a6..38f2bfb 100644 --- a/apps/user/locales/de-DE/wallet.json +++ b/apps/user/locales/de-DE/wallet.json @@ -1,8 +1,10 @@ { "amount": "Betrag", "balance": "Kontostand", + "commission": "Provision", "createdAt": "Zeit", - "title": "Kontostand", + "deductBalance": "Guthaben abziehen", + "totalAssets": "Vermögensübersicht", "type": { "0": "Typ", "1": "Aufladen", diff --git a/apps/user/locales/en-US/layout.json b/apps/user/locales/en-US/layout.json index e61bd74..1ef1c96 100644 --- a/apps/user/locales/en-US/layout.json +++ b/apps/user/locales/en-US/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Account Balance", + "commission": "Commission", "copyInviteLink": "Copy Invite Link", "copySuccess": "Invite Link Copied Successfully", + "deductBalance": "Deduct Balance", "inviteCode": "Invite Code", "recharge": "Recharge" } diff --git a/apps/user/locales/en-US/wallet.json b/apps/user/locales/en-US/wallet.json index 53d135f..a583c4e 100644 --- a/apps/user/locales/en-US/wallet.json +++ b/apps/user/locales/en-US/wallet.json @@ -1,8 +1,10 @@ { "amount": "Amount", "balance": "Balance", + "commission": "Commission", "createdAt": "Time", - "title": "Account Balance", + "deductBalance": "Deduct Balance", + "totalAssets": "Asset overview", "type": { "0": "Type", "1": "Recharge", diff --git a/apps/user/locales/es-ES/layout.json b/apps/user/locales/es-ES/layout.json index fa96914..222afd7 100644 --- a/apps/user/locales/es-ES/layout.json +++ b/apps/user/locales/es-ES/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Saldo de la cuenta", + "commission": "Comisión", "copyInviteLink": "Copiar enlace de invitación", "copySuccess": "Enlace de invitación copiado con éxito", + "deductBalance": "Descontar Saldo", "inviteCode": "Código de invitación", "recharge": "recargar" } diff --git a/apps/user/locales/es-ES/wallet.json b/apps/user/locales/es-ES/wallet.json index 38c69c5..5910a4a 100644 --- a/apps/user/locales/es-ES/wallet.json +++ b/apps/user/locales/es-ES/wallet.json @@ -1,8 +1,10 @@ { "amount": "Cantidad", "balance": "saldo", + "commission": "Comisión", "createdAt": "hora", - "title": "Saldo de la cuenta", + "deductBalance": "Descontar Saldo", + "totalAssets": "Resumen de activos", "type": { "0": "tipo", "1": "recarga", diff --git a/apps/user/locales/es-MX/layout.json b/apps/user/locales/es-MX/layout.json index fa96914..222afd7 100644 --- a/apps/user/locales/es-MX/layout.json +++ b/apps/user/locales/es-MX/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Saldo de la cuenta", + "commission": "Comisión", "copyInviteLink": "Copiar enlace de invitación", "copySuccess": "Enlace de invitación copiado con éxito", + "deductBalance": "Descontar Saldo", "inviteCode": "Código de invitación", "recharge": "recargar" } diff --git a/apps/user/locales/es-MX/wallet.json b/apps/user/locales/es-MX/wallet.json index 7d2e815..7fc9646 100644 --- a/apps/user/locales/es-MX/wallet.json +++ b/apps/user/locales/es-MX/wallet.json @@ -1,8 +1,10 @@ { "amount": "Monto", "balance": "saldo", + "commission": "Comisión", "createdAt": "Hora", - "title": "Saldo de la cuenta", + "deductBalance": "Descontar Saldo", + "totalAssets": "Resumen de activos", "type": { "0": "Tipo", "1": "Recarga", diff --git a/apps/user/locales/fa-IR/layout.json b/apps/user/locales/fa-IR/layout.json index 317e734..034863a 100644 --- a/apps/user/locales/fa-IR/layout.json +++ b/apps/user/locales/fa-IR/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "موجودی حساب", + "commission": "کمیسیون", "copyInviteLink": "کپی کردن لینک دعوت", "copySuccess": "لینک دعوت با موفقیت کپی شد", + "deductBalance": "کسر موجودی", "inviteCode": "کد دعوت", "recharge": "شارژ مجدد" } diff --git a/apps/user/locales/fa-IR/wallet.json b/apps/user/locales/fa-IR/wallet.json index 0e3f23c..623995f 100644 --- a/apps/user/locales/fa-IR/wallet.json +++ b/apps/user/locales/fa-IR/wallet.json @@ -1,8 +1,10 @@ { "amount": "مقدار", "balance": "تعادل", + "commission": "کمیسیون", "createdAt": "زمان", - "title": "موجودی حساب", + "deductBalance": "کسر موجودی", + "totalAssets": "بررسی کلی دارایی‌ها", "type": { "0": "نوع", "1": "شارژ", diff --git a/apps/user/locales/fi-FI/layout.json b/apps/user/locales/fi-FI/layout.json index 36ac1ce..a281eb6 100644 --- a/apps/user/locales/fi-FI/layout.json +++ b/apps/user/locales/fi-FI/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Tilin saldo", + "commission": "Komissio", "copyInviteLink": "Kopioi kutsulinkki", "copySuccess": "Kutsulinkki kopioitu onnistuneesti", + "deductBalance": "Vähennä saldoa", "inviteCode": "kutsukoodi", "recharge": "lataa saldoa" } diff --git a/apps/user/locales/fi-FI/wallet.json b/apps/user/locales/fi-FI/wallet.json index 48a0d84..e45b563 100644 --- a/apps/user/locales/fi-FI/wallet.json +++ b/apps/user/locales/fi-FI/wallet.json @@ -1,8 +1,10 @@ { "amount": "Määrä", "balance": "Saldo", + "commission": "Komissio", "createdAt": "Aika", - "title": "Tilin saldo", + "deductBalance": "Vähennä saldoa", + "totalAssets": "Varojen yleiskatsaus", "type": { "0": "Tyyppi", "1": "Lataus", diff --git a/apps/user/locales/fr-FR/layout.json b/apps/user/locales/fr-FR/layout.json index b9c0b20..a1c2371 100644 --- a/apps/user/locales/fr-FR/layout.json +++ b/apps/user/locales/fr-FR/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Solde du compte", + "commission": "Commission", "copyInviteLink": "Copier le lien d'invitation", "copySuccess": "Lien d'invitation copié avec succès", + "deductBalance": "Déduire le solde", "inviteCode": "codeInvitation", "recharge": "Recharger" } diff --git a/apps/user/locales/fr-FR/wallet.json b/apps/user/locales/fr-FR/wallet.json index d24ed0f..4a637b5 100644 --- a/apps/user/locales/fr-FR/wallet.json +++ b/apps/user/locales/fr-FR/wallet.json @@ -1,8 +1,10 @@ { "amount": "Montant", "balance": "Solde", + "commission": "Commission", "createdAt": "temps", - "title": "Solde du compte", + "deductBalance": "Déduire le solde", + "totalAssets": "Aperçu des actifs", "type": { "0": "Type", "1": "Recharge", diff --git a/apps/user/locales/hi-IN/layout.json b/apps/user/locales/hi-IN/layout.json index 3ba6fd1..93d8dab 100644 --- a/apps/user/locales/hi-IN/layout.json +++ b/apps/user/locales/hi-IN/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "खाता शेष", + "commission": "आयोग", "copyInviteLink": "आमंत्रण लिंक कॉपी करें", "copySuccess": "आमंत्रण लिंक सफलतापूर्वक कॉपी हो गई", + "deductBalance": "शेष राशि घटाएं", "inviteCode": "आमंत्रण कोड", "recharge": "रिचार्ज" } diff --git a/apps/user/locales/hi-IN/wallet.json b/apps/user/locales/hi-IN/wallet.json index 00a591c..c470f6b 100644 --- a/apps/user/locales/hi-IN/wallet.json +++ b/apps/user/locales/hi-IN/wallet.json @@ -1,8 +1,10 @@ { "amount": "राशि", "balance": "शेष", + "commission": "आयोग", "createdAt": "समय", - "title": "खाते का शेष", + "deductBalance": "शेष राशि घटाएं", + "totalAssets": "संपत्ति अवलोकन", "type": { "0": "प्रकार", "1": "रिचार्ज", diff --git a/apps/user/locales/hu-HU/layout.json b/apps/user/locales/hu-HU/layout.json index d471a5f..f1f5c2d 100644 --- a/apps/user/locales/hu-HU/layout.json +++ b/apps/user/locales/hu-HU/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Számlaegyenleg", + "commission": "Jutalék", "copyInviteLink": "Meghívó link másolása", "copySuccess": "A meghívó link másolása sikerült", + "deductBalance": "Egyenleg levonása", "inviteCode": "meghívókód", "recharge": "feltöltés" } diff --git a/apps/user/locales/hu-HU/wallet.json b/apps/user/locales/hu-HU/wallet.json index c4f20f8..90a2374 100644 --- a/apps/user/locales/hu-HU/wallet.json +++ b/apps/user/locales/hu-HU/wallet.json @@ -1,8 +1,10 @@ { "amount": "Összeg", "balance": "Egyenleg", + "commission": "Jutalék", "createdAt": "idő", - "title": "Számlaegyenleg", + "deductBalance": "Egyenleg levonása", + "totalAssets": "Eszközök áttekintése", "type": { "0": "Típus", "1": "Feltöltés", diff --git a/apps/user/locales/ja-JP/layout.json b/apps/user/locales/ja-JP/layout.json index 041a7a0..167314f 100644 --- a/apps/user/locales/ja-JP/layout.json +++ b/apps/user/locales/ja-JP/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "口座残高", + "commission": "手数料", "copyInviteLink": "招待リンクをコピー", "copySuccess": "招待リンクのコピーに成功しました", + "deductBalance": "残高を差し引く", "inviteCode": "招待コード", "recharge": "チャージ" } diff --git a/apps/user/locales/ja-JP/wallet.json b/apps/user/locales/ja-JP/wallet.json index 22a4570..8098604 100644 --- a/apps/user/locales/ja-JP/wallet.json +++ b/apps/user/locales/ja-JP/wallet.json @@ -1,8 +1,10 @@ { "amount": "金額", "balance": "残高", + "commission": "手数料", "createdAt": "時間", - "title": "アカウント残高", + "deductBalance": "残高を差し引く", + "totalAssets": "資産概要", "type": { "0": "タイプ", "1": "チャージ", diff --git a/apps/user/locales/ko-KR/layout.json b/apps/user/locales/ko-KR/layout.json index 2a18ec4..bbf49ce 100644 --- a/apps/user/locales/ko-KR/layout.json +++ b/apps/user/locales/ko-KR/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "계좌 잔액", + "commission": "커미션", "copyInviteLink": "초대 링크 복사", "copySuccess": "초대 링크가 성공적으로 복사되었습니다", + "deductBalance": "잔액 차감", "inviteCode": "초대 코드", "recharge": "충전" } diff --git a/apps/user/locales/ko-KR/wallet.json b/apps/user/locales/ko-KR/wallet.json index 1ce663b..4845d9e 100644 --- a/apps/user/locales/ko-KR/wallet.json +++ b/apps/user/locales/ko-KR/wallet.json @@ -1,8 +1,10 @@ { "amount": "금액", "balance": "잔액", + "commission": "위원회", "createdAt": "시간", - "title": "계정 잔액", + "deductBalance": "잔액 차감", + "totalAssets": "자산 개요", "type": { "0": "유형", "1": "충전", diff --git a/apps/user/locales/no-NO/layout.json b/apps/user/locales/no-NO/layout.json index f2f4735..b06ffce 100644 --- a/apps/user/locales/no-NO/layout.json +++ b/apps/user/locales/no-NO/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Kontosaldo", + "commission": "Kommisjon", "copyInviteLink": "Kopier invitasjonslenke", "copySuccess": "Invitasjonslenke kopiert", + "deductBalance": "Trekk fra saldo", "inviteCode": "invitasjonskode", "recharge": "Lad opp" } diff --git a/apps/user/locales/no-NO/wallet.json b/apps/user/locales/no-NO/wallet.json index 87aa319..5ba1611 100644 --- a/apps/user/locales/no-NO/wallet.json +++ b/apps/user/locales/no-NO/wallet.json @@ -1,8 +1,10 @@ { "amount": "Beløp", "balance": "Balanse", + "commission": "Kommisjon", "createdAt": "Tid", - "title": "Kontosaldo", + "deductBalance": "Trekk fra saldo", + "totalAssets": "Eiendelsoversikt", "type": { "0": "Type", "1": "Innskudd", diff --git a/apps/user/locales/pl-PL/layout.json b/apps/user/locales/pl-PL/layout.json index 1d07240..ae21e37 100644 --- a/apps/user/locales/pl-PL/layout.json +++ b/apps/user/locales/pl-PL/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Saldo konta", + "commission": "Prowizja", "copyInviteLink": "Skopiuj link zaproszenia", "copySuccess": "Pomyślnie skopiowano link zaproszenia", + "deductBalance": "Potrąć saldo", "inviteCode": "kod zaproszenia", "recharge": "doładowanie" } diff --git a/apps/user/locales/pl-PL/wallet.json b/apps/user/locales/pl-PL/wallet.json index 04d5705..54b271f 100644 --- a/apps/user/locales/pl-PL/wallet.json +++ b/apps/user/locales/pl-PL/wallet.json @@ -1,8 +1,10 @@ { "amount": "kwota", "balance": "saldo", + "commission": "Prowizja", "createdAt": "czas", - "title": "Saldo konta", + "deductBalance": "Potrąć saldo", + "totalAssets": "Przegląd aktywów", "type": { "0": "Typ", "1": "Doładowanie", diff --git a/apps/user/locales/pt-BR/layout.json b/apps/user/locales/pt-BR/layout.json index bd07c97..32d92d8 100644 --- a/apps/user/locales/pt-BR/layout.json +++ b/apps/user/locales/pt-BR/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Saldo da Conta", + "commission": "Comissão", "copyInviteLink": "Copiar link de convite", "copySuccess": "Link de convite copiado com sucesso", + "deductBalance": "Deduzir Saldo", "inviteCode": "Código de Convite", "recharge": "recarregar" } diff --git a/apps/user/locales/pt-BR/wallet.json b/apps/user/locales/pt-BR/wallet.json index 4821b55..ad761a4 100644 --- a/apps/user/locales/pt-BR/wallet.json +++ b/apps/user/locales/pt-BR/wallet.json @@ -1,8 +1,10 @@ { "amount": "quantia", "balance": "saldo", + "commission": "Comissão", "createdAt": "hora", - "title": "Saldo da Conta", + "deductBalance": "Deduzir Saldo", + "totalAssets": "Visão geral dos ativos", "type": { "0": "tipo", "1": "recarga", diff --git a/apps/user/locales/ro-RO/layout.json b/apps/user/locales/ro-RO/layout.json index 17c62a5..36657e3 100644 --- a/apps/user/locales/ro-RO/layout.json +++ b/apps/user/locales/ro-RO/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Soldul contului", + "commission": "Comision", "copyInviteLink": "Copiază linkul de invitație", "copySuccess": "Linkul de invitație a fost copiat cu succes", + "deductBalance": "Scade Soldul", "inviteCode": "Cod de invitație", "recharge": "Reîncărcare" } diff --git a/apps/user/locales/ro-RO/wallet.json b/apps/user/locales/ro-RO/wallet.json index d702ec4..a1b8a96 100644 --- a/apps/user/locales/ro-RO/wallet.json +++ b/apps/user/locales/ro-RO/wallet.json @@ -1,8 +1,10 @@ { "amount": "Sumă", "balance": "Sold", + "commission": "Comision", "createdAt": "Timp", - "title": "Soldul contului", + "deductBalance": "Scade Soldul", + "totalAssets": "Prezentare generală a activelor", "type": { "0": "Tip", "1": "Reîncărcare", diff --git a/apps/user/locales/ru-RU/layout.json b/apps/user/locales/ru-RU/layout.json index a285b84..44a70ef 100644 --- a/apps/user/locales/ru-RU/layout.json +++ b/apps/user/locales/ru-RU/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Баланс счета", + "commission": "Комиссия", "copyInviteLink": "Скопировать ссылку приглашения", "copySuccess": "Ссылка для приглашения успешно скопирована", + "deductBalance": "Списать с баланса", "inviteCode": "Код приглашения", "recharge": "Пополнение" } diff --git a/apps/user/locales/ru-RU/wallet.json b/apps/user/locales/ru-RU/wallet.json index f5a82e1..6aeb862 100644 --- a/apps/user/locales/ru-RU/wallet.json +++ b/apps/user/locales/ru-RU/wallet.json @@ -1,8 +1,10 @@ { "amount": "сумма", "balance": "Баланс", + "commission": "Комиссия", "createdAt": "время", - "title": "Баланс счета", + "deductBalance": "Списать с баланса", + "totalAssets": "Обзор активов", "type": { "0": "Тип", "1": "Пополнение", diff --git a/apps/user/locales/th-TH/layout.json b/apps/user/locales/th-TH/layout.json index 724d3b2..b37e30d 100644 --- a/apps/user/locales/th-TH/layout.json +++ b/apps/user/locales/th-TH/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "ยอดเงินในบัญชี", + "commission": "คอมมิชชั่น", "copyInviteLink": "คัดลอกลิงก์เชิญ", "copySuccess": "คัดลอกลิงก์เชิญสำเร็จ", + "deductBalance": "หักยอดเงิน", "inviteCode": "รหัสเชิญ", "recharge": "เติมเงิน" } diff --git a/apps/user/locales/th-TH/wallet.json b/apps/user/locales/th-TH/wallet.json index 5e26bd4..150799b 100644 --- a/apps/user/locales/th-TH/wallet.json +++ b/apps/user/locales/th-TH/wallet.json @@ -1,8 +1,10 @@ { "amount": "จำนวนเงิน", "balance": "ยอดคงเหลือ", + "commission": "คอมมิชชั่น", "createdAt": "เวลา", - "title": "ยอดคงเหลือในบัญชี", + "deductBalance": "หักยอดเงิน", + "totalAssets": "ภาพรวมสินทรัพย์", "type": { "0": "ประเภท", "1": "เติมเงิน", diff --git a/apps/user/locales/tr-TR/layout.json b/apps/user/locales/tr-TR/layout.json index 80a2f1e..5664ad7 100644 --- a/apps/user/locales/tr-TR/layout.json +++ b/apps/user/locales/tr-TR/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Hesap Bakiyesi", + "commission": "Komisyon", "copyInviteLink": "Davet Bağlantısını Kopyala", "copySuccess": "Davet bağlantısı başarıyla kopyalandı", + "deductBalance": "Bakiyeden Düş", "inviteCode": "davetKodu", "recharge": "şarj et" } diff --git a/apps/user/locales/tr-TR/wallet.json b/apps/user/locales/tr-TR/wallet.json index f86e1cf..595dc5f 100644 --- a/apps/user/locales/tr-TR/wallet.json +++ b/apps/user/locales/tr-TR/wallet.json @@ -1,8 +1,10 @@ { "amount": "Tutar", "balance": "Bakiye", + "commission": "Komisyon", "createdAt": "zaman", - "title": "Hesap Bakiyesi", + "deductBalance": "Bakiyeden Düş", + "totalAssets": "Varlık genel bakışı", "type": { "0": "Tür", "1": "Yükleme", diff --git a/apps/user/locales/uk-UA/layout.json b/apps/user/locales/uk-UA/layout.json index 0e278d1..b0c3c48 100644 --- a/apps/user/locales/uk-UA/layout.json +++ b/apps/user/locales/uk-UA/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Баланс рахунку", + "commission": "Комісія", "copyInviteLink": "Скопіювати посилання запрошення", "copySuccess": "Посилання для запрошення успішно скопійовано", + "deductBalance": "Відняти баланс", "inviteCode": "Код запрошення", "recharge": "Поповнення" } diff --git a/apps/user/locales/uk-UA/wallet.json b/apps/user/locales/uk-UA/wallet.json index 4353c77..f85f1fd 100644 --- a/apps/user/locales/uk-UA/wallet.json +++ b/apps/user/locales/uk-UA/wallet.json @@ -1,8 +1,10 @@ { "amount": "Сума", "balance": "Баланс", + "commission": "Комісія", "createdAt": "Час", - "title": "Баланс рахунку", + "deductBalance": "Відняти баланс", + "totalAssets": "Огляд активів", "type": { "0": "Тип", "1": "Поповнення", diff --git a/apps/user/locales/vi-VN/layout.json b/apps/user/locales/vi-VN/layout.json index 78da57c..3797fc9 100644 --- a/apps/user/locales/vi-VN/layout.json +++ b/apps/user/locales/vi-VN/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "Số dư tài khoản", + "commission": "Hoa hồng", "copyInviteLink": "Sao chép liên kết mời", "copySuccess": "Sao chép liên kết mời thành công", + "deductBalance": "Trừ Số Dư", "inviteCode": "Mã mời", "recharge": "Nạp tiền" } diff --git a/apps/user/locales/vi-VN/wallet.json b/apps/user/locales/vi-VN/wallet.json index 0bd9b00..feedaeb 100644 --- a/apps/user/locales/vi-VN/wallet.json +++ b/apps/user/locales/vi-VN/wallet.json @@ -1,8 +1,10 @@ { "amount": "Số tiền", "balance": "Số dư", + "commission": "Hoa hồng", "createdAt": "Thời gian", - "title": "Số dư tài khoản", + "deductBalance": "Trừ Số Dư", + "totalAssets": "Tổng quan tài sản", "type": { "0": "Loại", "1": "Nạp tiền", diff --git a/apps/user/locales/zh-CN/layout.json b/apps/user/locales/zh-CN/layout.json index af163cb..d8fee38 100644 --- a/apps/user/locales/zh-CN/layout.json +++ b/apps/user/locales/zh-CN/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "账户余额", + "commission": "佣金", "copyInviteLink": "复制邀请链接", "copySuccess": "邀请链接复制成功", + "deductBalance": "抵扣余额", "inviteCode": "邀请码", "recharge": "充值" } diff --git a/apps/user/locales/zh-CN/wallet.json b/apps/user/locales/zh-CN/wallet.json index 6036bd5..61bf66e 100644 --- a/apps/user/locales/zh-CN/wallet.json +++ b/apps/user/locales/zh-CN/wallet.json @@ -1,8 +1,10 @@ { "amount": "金额", "balance": "余额", + "commission": "佣金", "createdAt": "时间", - "title": "账户余额", + "deductBalance": "抵扣余额", + "totalAssets": "资产概览", "type": { "0": "类型", "1": "充值", diff --git a/apps/user/locales/zh-HK/layout.json b/apps/user/locales/zh-HK/layout.json index e185bea..708a5f9 100644 --- a/apps/user/locales/zh-HK/layout.json +++ b/apps/user/locales/zh-HK/layout.json @@ -1,7 +1,9 @@ { "accountBalance": "帳戶餘額", + "commission": "佣金", "copyInviteLink": "複製邀請連結", "copySuccess": "邀請連結複製成功", + "deductBalance": "抵扣餘額", "inviteCode": "邀請碼", "recharge": "儲值" } diff --git a/apps/user/locales/zh-HK/wallet.json b/apps/user/locales/zh-HK/wallet.json index 85c3443..c1259d1 100644 --- a/apps/user/locales/zh-HK/wallet.json +++ b/apps/user/locales/zh-HK/wallet.json @@ -1,8 +1,10 @@ { "amount": "金額", "balance": "餘額", + "commission": "佣金", "createdAt": "時間", - "title": "帳戶餘額", + "deductBalance": "抵扣餘額", + "totalAssets": "資產概覽", "type": { "0": "類型", "1": "充值", diff --git a/apps/user/services/common/typings.d.ts b/apps/user/services/common/typings.d.ts index f969c57..c465373 100644 --- a/apps/user/services/common/typings.d.ts +++ b/apps/user/services/common/typings.d.ts @@ -165,6 +165,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -173,8 +174,6 @@ declare namespace API { trade_no: string; status: number; subscribe_id: number; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -187,6 +186,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -196,8 +196,6 @@ declare namespace API { status: number; subscribe_id: number; subscribe: Subscribe; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -333,7 +331,7 @@ declare namespace API { sell: boolean; sort: number; deduction_ratio: number; - purchase_with_discount: boolean; + allow_deduction: boolean; reset_cycle: number; renewal_reset: boolean; created_at: number; @@ -416,6 +414,8 @@ declare namespace API { email: string; avatar: string; balance: number; + commission: number; + deduction: number; telegram: number; refer_code: string; referer_id: number; diff --git a/apps/user/services/user/typings.d.ts b/apps/user/services/user/typings.d.ts index 93bae00..16ec50e 100644 --- a/apps/user/services/user/typings.d.ts +++ b/apps/user/services/user/typings.d.ts @@ -187,6 +187,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -195,8 +196,6 @@ declare namespace API { trade_no: string; status: number; subscribe_id: number; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -209,6 +208,7 @@ declare namespace API { quantity: number; price: number; amount: number; + deduction: number; discount: number; coupon: string; coupon_discount: number; @@ -218,8 +218,6 @@ declare namespace API { status: number; subscribe_id: number; subscribe: Subscribe; - subscription_discount_id: number; - subscription_discount_price: number; created_at: number; updated_at: number; }; @@ -241,23 +239,29 @@ declare namespace API { price: number; amount: number; discount: number; + deduction: number; coupon: string; coupon_discount: number; fee_amount: number; - subscribe_discount: number; - discount_list: SubscribeDiscountInfo[]; }; type PreRenewalOrderResponse = { orderNo: string; }; + type PreUnsubscribeRequest = { + id: number; + }; + + type PreUnsubscribeResponse = { + deduction_amount: number; + }; + type PurchaseOrderRequest = { subscribe_id: number; quantity: number; payment: string; coupon?: string; - discount_subscribe_id: number; }; type PurchaseOrderResponse = { @@ -329,8 +333,22 @@ declare namespace API { total: number; }; - type QueryUserAffiliateResponse = { - sum: number; + type QueryUserAffiliateCountResponse = { + registers: number; + total_commission: number; + }; + + type QueryUserAffiliateListParams = { + page: number; + size: number; + }; + + type QueryUserAffiliateListRequest = { + page: number; + size: number; + }; + + type QueryUserAffiliateListResponse = { list: UserAffiliate[]; total: number; }; @@ -366,12 +384,10 @@ declare namespace API { }; type RenewalOrderRequest = { - subscribe_id: number; + user_subscribe_id: number; quantity: number; payment: string; coupon?: string; - subscribe_token: string; - discount_subscribe_id: number; }; type RenewalOrderResponse = { @@ -379,8 +395,7 @@ declare namespace API { }; type ResetTrafficOrderRequest = { - subscribe_id: number; - subscribe_token: string; + user_subscribe_id: number; payment: string; }; @@ -485,7 +500,7 @@ declare namespace API { sell: boolean; sort: number; deduction_ratio: number; - purchase_with_discount: boolean; + allow_deduction: boolean; reset_cycle: number; renewal_reset: boolean; created_at: number; @@ -504,13 +519,6 @@ declare namespace API { discount: number; }; - type SubscribeDiscountInfo = { - id: number; - name: string; - price: number; - expire_time: string; - }; - type SubscribeGroup = { id: number; name: string; @@ -570,6 +578,10 @@ declare namespace API { security_config: SecurityConfig; }; + type UnsubscribeRequest = { + id: number; + }; + type UpdateUserNotifyRequest = { enable_balance_notify: boolean; enable_login_notify: boolean; @@ -597,6 +609,8 @@ declare namespace API { email: string; avatar: string; balance: number; + commission: number; + deduction: number; telegram: number; refer_code: string; referer_id: number; diff --git a/apps/user/services/user/user.ts b/apps/user/services/user/user.ts index c55086f..0fab5ee 100644 --- a/apps/user/services/user/user.ts +++ b/apps/user/services/user/user.ts @@ -2,10 +2,10 @@ /* eslint-disable */ import request from '@/utils/request'; -/** Query User Affiliate GET /v1/public/user/affiliate */ +/** Query User Affiliate Count GET /v1/public/user/affiliate/count */ export async function queryUserAffiliate(options?: { [key: string]: any }) { - return request( - '/v1/public/user/affiliate', + return request( + '/v1/public/user/affiliate/count', { method: 'GET', ...(options || {}), @@ -13,6 +13,24 @@ export async function queryUserAffiliate(options?: { [key: string]: any }) { ); } +/** Query User Affiliate List GET /v1/public/user/affiliate/list */ +export async function queryUserAffiliateList( + // 叠加生成的Param类型 (非body参数swagger默认没有生成对象) + params: API.QueryUserAffiliateListParams, + options?: { [key: string]: any }, +) { + return request( + '/v1/public/user/affiliate/list', + { + method: 'GET', + params: { + ...params, + }, + ...(options || {}), + }, + ); +} + /** Query User Balance Log GET /v1/public/user/balance_log */ export async function queryUserBalanceLog(options?: { [key: string]: any }) { return request( @@ -106,3 +124,33 @@ export async function unbindTelegram(options?: { [key: string]: any }) { ...(options || {}), }); } + +/** 此处后端没有提供注释 POST /v1/public/user/unsubscribe */ +export async function unsubscribe(body: API.UnsubscribeRequest, options?: { [key: string]: any }) { + return request('/v1/public/user/unsubscribe', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }); +} + +/** Pre Unsubscribe POST /v1/public/user/unsubscribe/pre */ +export async function preUnsubscribe( + body: API.PreUnsubscribeRequest, + options?: { [key: string]: any }, +) { + return request( + '/v1/public/user/unsubscribe/pre', + { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + data: body, + ...(options || {}), + }, + ); +}