Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
dangqianhuiyuandegezhongzhuangtai
bulaienaofutuojiesenzhange668841021fe
diff --git a/src/app/[lng]/profile/page.tsx b/src/app/[lng]/profile/page.tsxindex a9dec358..d18e9d27 100644--- a/src/app/[lng]/profile/page.tsx+++ b/src/app/[lng]/profile/page.tsx@@ -986,7 +986,7 @@ export default function ProfilePage() {>{renderProfileContent()}</TabPane>- <TabPane+ {/* <TabPanetab={<span><ShoppingCartOutlined />@@ -996,7 +996,7 @@ export default function ProfilePage() {key="orders">{renderOrderContent()}- </TabPane>+ </TabPane> */}</Tabs>diff --git a/src/app/i18n/locales/en/vip.json b/src/app/i18n/locales/en/vip.jsonindex 913d09e7..63da3c38 100644--- a/src/app/i18n/locales/en/vip.json+++ b/src/app/i18n/locales/en/vip.json@@ -62,6 +62,7 @@"autoRenewalDisabled": "Auto-renewal Disabled","nextRenewalDate": "Next Renewal Date","membershipExpires": "Membership Expires",+ "currentPlan": "Current Plan","modal": {"title": "7-Day Free Trial","highlight": "Get 100 Points",diff --git a/src/app/i18n/locales/zh-CN/vip.json b/src/app/i18n/locales/zh-CN/vip.jsonindex be102611..72c8feb4 100644--- a/src/app/i18n/locales/zh-CN/vip.json+++ b/src/app/i18n/locales/zh-CN/vip.json@@ -62,6 +62,7 @@"autoRenewalDisabled": "自动续费未开启","nextRenewalDate": "下次续费时间","membershipExpires": "有效期至",+ "currentPlan": "当前计划","modal": {"title": "免费试用7天会员","highlight": "立得100积分",diff --git a/src/components/modals/PointsDetailModal.tsx b/src/components/modals/PointsDetailModal.tsxindex ebd0b683..639d9bcd 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: 399, maxHeight: '60vh', overflowY: 'auto' }}>+ <div style={{ padding: '0 20px 16px 20px', minHeight: 550, 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.tsxindex 6a48b6b1..e1cea540 100644--- a/src/components/modals/SubscriptionManagementModal.tsx+++ b/src/components/modals/SubscriptionManagementModal.tsx@@ -262,7 +262,9 @@ const SubscriptionManagementModal = memo(({ open, onClose }: SubscriptionManagemsubscription.amount && (<div className={styles.subscriptionDetailItem}><span className={styles.detailLabel}>{tProfile('amount')}:</span>- <span className={styles.detailValue}>¥{(subscription.amount / 100).toFixed(2)}</span>+ <span className={styles.detailValue}>+ {subscription.currency}+ {(subscription.amount / 100).toFixed(2)}</span></div>)}@@ -404,7 +406,11 @@ const SubscriptionManagementModal = memo(({ open, onClose }: SubscriptionManagem</div><div className={styles.orderDetailItem}><span className={styles.detailLabel}>{tProfile('amount')}:</span>- <span className={styles.detailValue}>¥{(order.amount / 100).toFixed(2)}</span>+ <span className={styles.detailValue}>+ { (order.amount / 100).toFixed(2) } + { order.currency }+ </span>+</div><div className={styles.orderDetailItem}><span className={styles.detailLabel}>{tProfile('createTime')}:</span>diff --git a/src/components/modals/VipContentModal.tsx b/src/components/modals/VipContentModal.tsxindex 5b96a5c1..190caf52 100644--- a/src/components/modals/VipContentModal.tsx+++ b/src/components/modals/VipContentModal.tsx@@ -41,6 +41,24 @@ const VipContentModal = memo(({ open, onClose }: VipContentModalProps) => {userStore.userInfo.vipInfo.expireTime &&new Date(userStore.userInfo.vipInfo.expireTime) > new Date();}, [userStore.userInfo]);++ // 判断用户是否已经是相同类型的会员且未过期+ const isCurrentPlan = useMemo(() => {+ if (!userStore.userInfo?.vipInfo || !isVip) {+ return {+ month: false,+ year: false,+ once: false+ };+ }++ const vipInfo = userStore.userInfo.vipInfo;+ return {+ month: vipInfo.cycleType === 1, // 1 是月度+ year: vipInfo.cycleType === 2, // 2 是年度+ once: false // 一次性购买不在此判断范围内+ };+ }, [userStore.userInfo, isVip]);const handleTabClick = (tab: 'year' | 'month' | 'once') => {setActiveTab(tab);@@ -70,6 +88,13 @@ const VipContentModal = memo(({ open, onClose }: VipContentModalProps) => {return;}+ // 检查用户是否已经是相同类型的会员且未过期+ if (isCurrentPlan[planType]) {+ message.warning(translate('currentPlan'));+ setLoading(false);+ return;+ }+// 根据选择的计划映射到支付类型let paymentType;let paymentMethod;@@ -277,8 +302,9 @@ const VipContentModal = memo(({ open, onClose }: VipContentModalProps) => {className={vipStyles.primaryBtn}onClick={() => handleActivate('year')}loading={loading}+ disabled={isCurrentPlan.year}>- {translate('modal.plans.yearly.button')}+ {isCurrentPlan.year ? translate('currentPlan') : translate('modal.plans.yearly.button')}</Button><div className={vipStyles.benefitBox}><span className={vipStyles.dot} /> {translate('modal.plans.yearly.points')}</div><div className={vipStyles.subDesc}>{translate('modal.plans.yearly.description')}</div>@@ -326,8 +352,9 @@ const VipContentModal = memo(({ open, onClose }: VipContentModalProps) => {className={vipStyles.primaryBtn}onClick={() => handleActivate('month')}loading={loading}+ disabled={isCurrentPlan.month}>- {translate('modal.plans.monthly.button')}+ {isCurrentPlan.month ? translate('currentPlan') : translate('modal.plans.monthly.button')}</Button><div className={vipStyles.benefitBox}><span className={vipStyles.dot} /> {translate('modal.plans.monthly.points')}</div><div className={vipStyles.subDesc}>{translate('modal.plans.monthly.description')}</div>diff --git a/src/components/modals/subscriptionManagementModal.module.css b/src/components/modals/subscriptionManagementModal.module.cssindex 53a36d1d..3867f801 100644--- a/src/components/modals/subscriptionManagementModal.module.css+++ b/src/components/modals/subscriptionManagementModal.module.css@@ -194,7 +194,7 @@.autoRenewal h3 {margin: 0 0 16px 0;- font-size: 16px;+ font-size: 14px;font-weight: 500;color: #111827;}