Skip to content

Commit

Permalink
✨ feat(subscribe): Add subscription credits
Browse files Browse the repository at this point in the history
  • Loading branch information
web-ppanel committed Dec 31, 2024
1 parent 701cdee commit 5bc7905
Show file tree
Hide file tree
Showing 93 changed files with 1,224 additions and 1,098 deletions.
4 changes: 4 additions & 0 deletions apps/admin/services/admin/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,8 @@ 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;
};
Expand All @@ -577,6 +579,8 @@ declare namespace API {
status: number;
subscribe_id: number;
subscribe: Subscribe;
subscription_discount_id: number;
subscription_discount_price: number;
created_at: number;
updated_at: number;
};
Expand Down
4 changes: 4 additions & 0 deletions apps/admin/services/common/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ 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;
};
Expand All @@ -194,6 +196,8 @@ declare namespace API {
status: number;
subscribe_id: number;
subscribe: Subscribe;
subscription_discount_id: number;
subscription_discount_price: number;
created_at: number;
updated_at: number;
};
Expand Down
15 changes: 7 additions & 8 deletions apps/user/app/(main)/(user)/dashboard/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Button } from '@workspace/ui/components/button';
import { Card, CardContent, CardHeader, CardTitle } from '@workspace/ui/components/card';
import { Separator } from '@workspace/ui/components/separator';
import { Tabs, TabsList, TabsTrigger } from '@workspace/ui/components/tabs';
import { getNextResetDate, isBrowser } from '@workspace/ui/utils';
import { isBrowser } from '@workspace/ui/utils';
import { differenceInDays } from 'date-fns';
import { useTranslations } from 'next-intl';
import Image from 'next/image';
Expand All @@ -35,12 +35,12 @@ import { QRCodeCanvas } from 'qrcode.react';
import { useState } from 'react';
import { toast } from 'sonner';

import Renewal from '@/components/subscribe/renewal';
import ResetTraffic from '@/components/subscribe/reset-traffic';
import useGlobalStore from '@/config/use-global';
import { getStat } from '@/services/common/common';
import { getPlatform } from '@/utils/common';
import CopyToClipboard from 'react-copy-to-clipboard';
import Renewal from '../order/renewal';
import ResetTraffic from '../order/reset-traffic';
import Subscribe from '../subscribe/page';

export default function Content() {
Expand Down Expand Up @@ -173,15 +173,14 @@ export default function Content() {
</li>
<li>
<span className='text-muted-foreground'>{t('nextResetDays')}</span>
<span className='text-2xl font-semibold'>
{differenceInDays(getNextResetDate(item.start_time), new Date()) ||
t('unknown')}
</span>
<span className='text-2xl font-semibold'>{t('unknown')}</span>
</li>
<li>
<span className='text-muted-foreground'>{t('expirationDays')}</span>
<span className='text-2xl font-semibold'>
{differenceInDays(new Date(item.expire_time), new Date()) || t('unknown')}
{item.expire_time
? differenceInDays(new Date(item.expire_time), new Date()) || t('unknown')
: t('noLimit')}
</span>
</li>
</ul>
Expand Down
235 changes: 0 additions & 235 deletions apps/user/app/(main)/(user)/order/purchase.tsx

This file was deleted.

Loading

0 comments on commit 5bc7905

Please sign in to comment.