Skip to content

Let's use AI to Earn!

xufeidegezhongyang

bulaienaofutuojiesenzhangb4c6d22f4671
diff --git a/src/app/i18n/locales/en/profile.json b/src/app/i18n/locales/en/profile.json
index e25bd51c..a050922d 100644
--- a/src/app/i18n/locales/en/profile.json
+++ b/src/app/i18n/locales/en/profile.json
@@ -44,7 +44,7 @@
"subscriptionMode": "Mode",
"refundedAmount": "Refunded",
"paymentIntent": "Payment Intent",
- "subscriptionId": "Subscription ID",
+ "paymentMethod": "Payment Method",
"paymentLink": "Payment Link",
"openPaymentPage": "Open Payment",
"totalRecords": "Total: {total}",
diff --git a/src/app/i18n/locales/en/vip.json b/src/app/i18n/locales/en/vip.json
index 2868fa76..8fbb8770 100644
--- a/src/app/i18n/locales/en/vip.json
+++ b/src/app/i18n/locales/en/vip.json
@@ -55,6 +55,12 @@
"previousPage": "Previous",
"nextPage": "Next",
"pageInfo": "Page {current} of {total}",
+ "continuousMember": "Continuous Member",
+ "singleMember": "Single Month Member",
+ "autoRenewalEnabled": "Auto-renewal Enabled",
+ "autoRenewalDisabled": "Auto-renewal Disabled",
+ "nextRenewalDate": "Next Renewal Date",
+ "membershipExpires": "Membership Expires",
"modal": {
"title": "7-Day Free Trial",
"highlight": "Get 100 Points",
diff --git a/src/app/i18n/locales/zh-CN/profile.json b/src/app/i18n/locales/zh-CN/profile.json
index 3378e161..2c389eff 100644
--- a/src/app/i18n/locales/zh-CN/profile.json
+++ b/src/app/i18n/locales/zh-CN/profile.json
@@ -42,9 +42,9 @@
"goToPayment": "前往支付",
"internalId": "内部ID",
"subscriptionMode": "订阅模式",
+ "paymentMethod": "支付方式",
"refundedAmount": "已退款金额",
"paymentIntent": "Payment Intent",
- "subscriptionId": "订阅ID",
"paymentLink": "支付链接",
"openPaymentPage": "打开支付页面",
"totalRecords": "共 {total} 条记录",
diff --git a/src/app/i18n/locales/zh-CN/vip.json b/src/app/i18n/locales/zh-CN/vip.json
index 3f428824..26c47ea2 100644
--- a/src/app/i18n/locales/zh-CN/vip.json
+++ b/src/app/i18n/locales/zh-CN/vip.json
@@ -48,6 +48,19 @@
"activatedAutoRenewalPlans": "已开通的自动续费套餐",
"noAutoRenewalItems": "你还没有开通自动续费项目哦",
"viewMorePlans": "查看更多套餐",
+ "continuousAnnual": "连续包年",
+ "oneTimePurchase": "一次性购买",
+ "alipayPayment": "支付宝支付",
+ "noMoreContent": "没有内容了",
+ "previousPage": "上一页",
+ "nextPage": "下一页",
+ "pageInfo": "第 {current} 页,共 {total} 页",
+ "continuousMember": "连续会员",
+ "singleMember": "单月会员",
+ "autoRenewalEnabled": "自动续费已开启",
+ "autoRenewalDisabled": "自动续费未开启",
+ "nextRenewalDate": "下次续费时间",
+ "membershipExpires": "有效期至",
"modal": {
"title": "免费试用7天会员",
"highlight": "立得100积分",
diff --git a/src/components/modals/PointsDetailModal.tsx b/src/components/modals/PointsDetailModal.tsx
index 64e37f4c..ebd0b683 100644
--- a/src/components/modals/PointsDetailModal.tsx
+++ b/src/components/modals/PointsDetailModal.tsx
@@ -139,7 +139,7 @@ const PointsDetailModal = memo(({ open, onClose }: PointsDetailModalProps) => {
</div>
{/* 列表 */}
- <div style={{ padding: '0 20px 16px 20px', minHeight: 360, maxHeight: '60vh', overflowY: 'auto' }}>
+ <div style={{ padding: '0 20px 16px 20px', minHeight: 399, maxHeight: '60vh', overflowY: 'auto' }}>
<Spin spinning={loading}>
{filtered.length === 0 ? (
<div style={{ textAlign: 'center', padding: '60px 0', color: '#9ca3af' }}>{translate('points.noData')}</div>
diff --git a/src/components/modals/SubscriptionManagementModal.tsx b/src/components/modals/SubscriptionManagementModal.tsx
index f482ec9c..c524a505 100644
--- a/src/components/modals/SubscriptionManagementModal.tsx
+++ b/src/components/modals/SubscriptionManagementModal.tsx
@@ -14,6 +14,9 @@ import {
import { Order, OrderListParams, SubscriptionListParams, RefundParams, UnsubscribeParams, OrderStatus, PaymentType } from "@/api/types/payment";
import styles from "./subscriptionManagementModal.module.css";
+import Image from "next/image";
+import plusvip from "@/assets/images/plusvip.png";
+
const { TabPane } = Tabs;
interface SubscriptionManagementModalProps {
@@ -333,6 +336,7 @@ const SubscriptionManagementModal = memo(({ open, onClose }: SubscriptionManagem
onCancel={onClose}
footer={null}
width={1000}
+
className={styles.subscriptionModal}
destroyOnClose
centered
@@ -344,57 +348,178 @@ const SubscriptionManagementModal = memo(({ open, onClose }: SubscriptionManagem
<h3>{tVip('myMembership' as any)}</h3>
<div className={styles.membershipCard}>
<div className={styles.membershipInfo}>
- <div className={styles.membershipIcon}>💎</div>
+ <div className={styles.membershipIcon}>
+ <Image src={plusvip} alt="plusvip" style={{ width: 28, height: 'auto', marginTop: -5 }}/>
+ </div>
<div className={styles.membershipDetails}>
- <div className={styles.membershipName}>{tVip('basicMembership' as any)}</div>
+ <div className={styles.membershipName}>
+ {userInfo?.vipInfo?.cycleType === 1
+ ? tVip('modal.vipInfo.monthly' as any)
+ : tVip('modal.vipInfo.yearly' as any)}
+ {userInfo?.vipInfo?.autoContinue === false && ` (${tVip('modal.vipInfo.singleMonth' as any)})`}
+ </div>
+ <div>
+
+
<div className={styles.membershipExpire}>
- {tVip('validUntil' as any)} 2025-09-29 15:04
+ {
+ tVip('membershipExpires' as any)
+ }
+ </div>
+ <div className={styles.membershipStatus}>
+ {userInfo?.vipInfo?.expireTime ? new Date(userInfo.vipInfo.expireTime).toLocaleString('zh-CN', {
+ year: 'numeric',
+ month: '2-digit',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit'
+ }) : '2025-09-29 15:04'}
+ </div>
</div>
</div>
</div>
</div>
+
+ {/* 根据 autoContinue 显示不同的内容 */}
+ {userInfo?.vipInfo?.autoContinue ? (
+ <div className={styles.autoRenewal}>
+ <h3>{tVip('activatedAutoRenewalPlans' as any)}</h3>
+ <div className={styles.activeSubscription}>
+ <div className={styles.subscriptionItem}>
+ <div className={styles.subscriptionInfo}>
+ <div className={styles.subscriptionName}>
+ {userInfo.vipInfo.cycleType === 1
+ ? tVip('modal.vipInfo.monthly' as any)
+ : tVip('modal.vipInfo.yearly' as any)}
+ </div>
+ <div className={styles.subscriptionStatus}>
+ {tVip('continuousMember' as any)}
+ </div>
+ </div>
+ <div className={styles.subscriptionActions}>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ ) : (
+ <div className={styles.autoRenewal}>
+ <h3>{tVip('activatedAutoRenewalPlans' as any)}</h3>
+ <div className={styles.emptyState}>
+ <p style={{marginBottom: 20}}>{tVip('noAutoRenewalItems' as any)}</p>
+ <Button className={styles.viewMoreBtn}>{tVip('viewMorePlans' as any)}</Button>
+ </div>
+ </div>
+ )}
+
</div>
- <div className={styles.autoRenewal}>
- <h3>{tVip('activatedAutoRenewalPlans' as any)}</h3>
- <div className={styles.emptyState}>
- <p>{tVip('noAutoRenewalItems' as any)}</p>
- <Button className={styles.viewMoreBtn}>{tVip('viewMorePlans' as any)}</Button>
- </div>
- </div>
+
</TabPane>
<TabPane tab={tVip('purchaseHistory' as any)} key="orders">
- <Card>
- <Table
- columns={orderColumns}
- dataSource={orders}
- loading={ordersLoading}
- rowKey="_id"
- onRow={(record) => ({
- onClick: () => {
- fetchOrderDetail(record.id);
- },
- style: { cursor: 'pointer' }
- })}
- pagination={{
- current: ordersPagination.current,
- pageSize: ordersPagination.pageSize,
- total: ordersPagination.total,
- onChange: (page, size) => {
- fetchOrders({ page: page - 1, size: size || 10 });
- },
- showSizeChanger: true,
- showQuickJumper: true,
- showTotal: (total) => tProfile('totalRecords', { total }),
- pageSizeOptions: ['10', '20', '50'],
- }}
- scroll={{ x: 1200 }}
- locale={{
- emptyText: ordersLoading ? tProfile('loading') : tProfile('noOrderRecords')
- }}
- />
- </Card>
+ <div className={styles.purchaseHistory}>
+ {ordersLoading ? (
+ <div className={styles.loadingContainer}>
+ <div className={styles.loadingText}>{tProfile('loading')}</div>
+ </div>
+ ) : orders.length > 0 ? (
+ <div className={styles.orderCards}>
+ {orders.map((order) => (
+ <div key={order._id} className={styles.orderCard}>
+ <div className={styles.orderHeader}>
+ <div className={styles.orderTitle}>
+ {userInfo?.vipInfo?.cycleType === 1
+ ? tVip('modal.vipInfo.monthly' as any)
+ : tVip('modal.vipInfo.yearly' as any)}
+ {userInfo?.vipInfo?.autoContinue === false && ` (${tVip('modal.vipInfo.singleMonth' as any)})`}
+ </div>
+ </div>
+ <div className={styles.orderDetails}>
+ <div className={styles.orderDetailItem}>
+ <span className={styles.detailLabel}>{tProfile('subscriptionMode')}:</span>
+ <span className={styles.detailValue}>
+ {order.mode === 'subscription' ? tVip('continuousAnnual' as any) : tVip('oneTimePurchase' as any)}
+ </span>
+ </div>
+ <div className={styles.orderDetailItem}>
+ <span className={styles.detailLabel}>{tProfile('amount')}:</span>
+ <span className={styles.detailValue}>¥{(order.amount / 100).toFixed(2)}</span>
+ </div>
+ <div className={styles.orderDetailItem}>
+ <span className={styles.detailLabel}>{tProfile('createTime')}:</span>
+ <span className={styles.detailValue}>
+ {new Date(order.created * 1000).toLocaleString('zh-CN', {
+ year: 'numeric',
+ month: '2-digit',
+ day: '2-digit',
+ hour: '2-digit',
+ minute: '2-digit'
+ })}
+ </span>
+ </div>
+ <div className={styles.orderDetailItem}>
+ <span className={styles.detailLabel}>{tProfile('orderId')}:</span>
+ <span className={styles.detailValue}>
+ {order.id}
+ <Button
+ type="text"
+ size="small"
+ className={styles.copyBtn}
+ onClick={() => {
+ navigator.clipboard.writeText(order.id);
+ message.success('已复制');
+ }}
+ >
+ 📋
+ </Button>
+ </span>
+ </div>
+ <div className={styles.orderDetailItem}>
+ <span className={styles.detailLabel}>{tProfile('paymentMethod' as any)}:</span>
+ <span className={styles.detailValue}>
+ {(order as any).payment_method || tVip('alipayPayment' as any)}
+ </span>
+ </div>
+ </div>
+ </div>
+ ))}
+ {ordersPagination.total > ordersPagination.pageSize ? (
+ <div className={styles.paginationContainer}>
+ <Button
+ disabled={ordersPagination.current === 1}
+ onClick={() => fetchOrders({
+ page: ordersPagination.current - 2,
+ size: ordersPagination.pageSize
+ })}
+ >
+ {tVip('previousPage' as any)}
+ </Button>
+ <span className={styles.paginationInfo}>
+ {tVip('pageInfo' as any).replace('{current}', ordersPagination.current.toString()).replace('{total}', Math.ceil(ordersPagination.total / ordersPagination.pageSize).toString())}
+ </span>
+ <Button
+ disabled={ordersPagination.current >= Math.ceil(ordersPagination.total / ordersPagination.pageSize)}
+ onClick={() => fetchOrders({
+ page: ordersPagination.current,
+ size: ordersPagination.pageSize
+ })}
+ >
+ {tVip('nextPage' as any)}
+ </Button>
+ </div>
+ ) : (
+ <div className={styles.noMoreContent}>
+ <p>{tVip('noMoreContent' as any)}</p>
+ </div>
+ )}
+ </div>
+ ) : (
+ <div className={styles.emptyState}>
+ <p>{tProfile('noOrderRecords')}</p>
+ </div>
+ )}
+ </div>
</TabPane>
</Tabs>
</div>
diff --git a/src/components/modals/subscriptionManagementModal.module.css b/src/components/modals/subscriptionManagementModal.module.css
index 6d1cd7a6..1a6e3cee 100644
--- a/src/components/modals/subscriptionManagementModal.module.css
+++ b/src/components/modals/subscriptionManagementModal.module.css
@@ -1,16 +1,33 @@
/* 订阅管理弹窗样式 */
.subscriptionModal {
background: white;
+ border-radius: 12px;
+}
+
+.subscriptionModal .ant-modal-content {
+ border-radius: 12px;
+ overflow: hidden;
+}
+
+.subscriptionModal .ant-modal-header {
+ border-radius: 12px 12px 0 0;
+ border-bottom: 1px solid #f0f0f0;
+}
+
+.subscriptionModal .ant-modal-body {
+ border-radius: 0 0 12px 12px;
+ padding: 0;
}
.modalContent {
background: white;
padding: 0;
+ margin-top: 8px;
}
/* 我的会员区域 */
.myMembership {
- margin-bottom: 24px;
+ min-height: 780px;
}
.myMembership h3 {
@@ -24,7 +41,6 @@
background: #f8f9fa;
border-radius: 8px;
padding: 16px;
- border: 1px solid #e5e7eb;
}
.membershipInfo {
@@ -35,17 +51,19 @@
.membershipIcon {
font-size: 24px;
- width: 40px;
- height: 40px;
+
display: flex;
align-items: center;
justify-content: center;
- background: #e0e7ff;
border-radius: 8px;
}
.membershipDetails {
flex: 1;
+ display: flex;
+ flex-direction: row;
+ justify-content: space-between;
+ align-items: center;
}
.membershipName {
@@ -62,9 +80,50 @@
/* 自动续费区域 */
.autoRenewal {
+ margin-top: 24px;
margin-bottom: 24px;
}
+/* 会员状态 */
+.membershipStatus {
+ font-size: 12px;
+ color: #666;
+ margin-top: 4px;
+}
+
+/* 活跃订阅区域 */
+.activeSubscription {
+ border-radius: 8px;
+}
+
+.subscriptionItem {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 12px 0;
+}
+
+.subscriptionInfo {
+ flex: 1;
+}
+
+.subscriptionName {
+ font-size: 16px;
+ font-weight: 600;
+ color: #1f2937;
+ margin-bottom: 4px;
+}
+
+.subscriptionStatus {
+ font-size: 14px;
+ color: #10b981;
+ font-weight: 500;
+}
+
+.subscriptionActions {
+ margin-left: 16px;
+}
+
.autoRenewal h3 {
margin: 0 0 16px 0;
font-size: 16px;
@@ -75,9 +134,7 @@
.emptyState {
text-align: center;
padding: 40px 20px;
- background: #f8f9fa;
border-radius: 8px;
- border: 1px solid #e5e7eb;
}
.emptyState p {
@@ -149,6 +206,136 @@
padding: 2px 8px;
}
+/* 购买记录卡片布局 */
+.purchaseHistory {
+ padding: 0;
+ min-height: 780px;
+}
+
+.loadingContainer {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 40px;
+}
+
+.loadingText {
+ color: #6b7280;
+ font-size: 14px;
+}
+
+.orderCards {
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+}
+
+.orderCard {
+ background: #f8f9fa;
+ border-radius: 8px;
+ padding: 20px;
+ border: 1px solid #e5e7eb;
+ transition: all 0.2s ease;
+}
+
+.orderCard:hover {
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
+ transform: translateY(-1px);
+}
+
+.orderHeader {
+ margin-bottom: 16px;
+ padding-bottom: 12px;
+}
+
+.orderTitle {
+ font-size: 18px;
+ font-weight: 600;
+ color: #111827;
+}
+
+.orderDetails {
+ display: flex;
+ flex-direction: column;
+ gap: 12px;
+}
+
+.orderDetailItem {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 2px 0;
+}
+
+.detailLabel {
+ font-size: 14px;
+ color: #6b7280;
+ font-weight: 500;
+ min-width: 100px;
+}
+
+.detailValue {
+ font-size: 14px;
+ color: #111827;
+ font-weight: 500;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.copyBtn {
+ padding: 4px 8px;
+ height: auto;
+ font-size: 12px;
+ border: none;
+ background: transparent;
+ color: #6b7280;
+ cursor: pointer;
+ border-radius: 4px;
+ transition: all 0.2s ease;
+}
+
+.copyBtn:hover {
+ background: #e5e7eb;
+ color: #374151;
+}
+
+.paginationContainer {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 16px;
+ margin-top: 24px;
+ padding: 16px 0;
+}
+
+.paginationInfo {
+ font-size: 14px;
+ color: #6b7280;
+}
+
+.emptyState {
+ text-align: center;
+ padding: 60px 20px;
+ color: #6b7280;
+}
+
+.emptyState p {
+ margin: 0;
+ font-size: 14px;
+}
+
+.noMoreContent {
+ text-align: center;
+ padding: 20px;
+ color: #6b7280;
+ font-size: 14px;
+}
+
+.noMoreContent p {
+ margin: 0;
+}
+
/* 响应式设计 */
@media (max-width: 768px) {
.subscriptionModal {
@@ -170,4 +357,19 @@
.actionButtons .ant-btn {
width: 100%;
}
+
+ .orderDetailItem {
+ flex-direction: column;
+ align-items: flex-start;
+ gap: 4px;
+ }
+
+ .detailLabel {
+ min-width: auto;
+ }
+
+ .paginationContainer {
+ flex-direction: column;
+ gap: 12px;
+ }
}