diff --git a/src/components/Subscription/SubscriptionContentNew.tsx b/src/components/Subscription/SubscriptionContentNew.tsx index f92fb3a3..d5fdf662 100644 --- a/src/components/Subscription/SubscriptionContentNew.tsx +++ b/src/components/Subscription/SubscriptionContentNew.tsx @@ -243,7 +243,7 @@ export default function SubscriptionContentNew() { }, credentials: 'include', body: JSON.stringify({ - plan_type: selectedPlan.name, + plan_name: selectedPlan.name, billing_cycle: selectedCycle, promo_code: promoCodeApplied ? promoCode : null, }), @@ -582,18 +582,28 @@ export default function SubscriptionContentNew() { h="100%" borderRadius="20px" overflow="hidden" + bg={isPremium ? 'rgba(10, 10, 10, 0.5)' : 'rgba(10, 10, 10, 0.3)'} border={isPremium ? '1px solid rgba(212, 175, 55, 0.3)' : '1px solid rgba(255, 255, 255, 0.1)'} + boxShadow={isPremium ? '0 20px 60px rgba(212, 175, 55, 0.2)' : '0 20px 60px rgba(0, 0, 0, 0.3)'} transition="all 0.4s cubic-bezier(0.4, 0, 0.2, 1)" + _hover={{ + transform: 'translateY(-8px)', + borderColor: isPremium ? 'rgba(212, 175, 55, 0.5)' : 'rgba(255, 255, 255, 0.2)', + boxShadow: isPremium + ? '0 30px 80px rgba(212, 175, 55, 0.3)' + : '0 30px 80px rgba(0, 0, 0, 0.5)', + }} _before={ isPremium ? { content: '""', position: 'absolute', - top: '-144px', - left: '52px', - width: '420px', - maskImage: 'radial-gradient(circle at center, black 20%, transparent 52%)', - WebkitMaskImage: 'radial-gradient(circle at center, black 20%, transparent 52%)', + top: '50%', + left: '50%', + transform: 'translate(-50%, -50%)', + width: '120%', + height: '120%', + background: 'radial-gradient(circle at center, rgba(212, 175, 55, 0.1) 0%, transparent 70%)', pointerEvents: 'none', zIndex: 0, } @@ -609,26 +619,24 @@ export default function SubscriptionContentNew() { pointerEvents: 'none', }} > - {/* 推荐标签 */} - {plan.badge && ( - - {plan.displayName} - - )} + {/* 套餐标题 */} + + {plan.displayName} + - + ¥{getCurrentPrice(plan)} - - /{currentPriceOption?.label || '月'} + + / {currentPriceOption?.label || '月'} - + {/* 功能列表 */} - + {plan.features.map((feature: any, idx: number) => ( - + {feature.name} {feature.limit && ( - + ({feature.limit}) )} - + ))} @@ -851,13 +888,127 @@ export default function SubscriptionContentNew() { {!paymentOrder ? ( - - - 套餐: {selectedPlan?.displayName} · {selectedCycle === 'monthly' ? '月付' : selectedCycle === 'quarterly' ? '季付' : selectedCycle === 'semiannual' ? '半年付' : '年付'} - - - ¥{priceInfo?.final_amount || getCurrentPrice(selectedPlan)} - + + {/* 价格明细 */} + {selectedPlan && priceInfo && ( + + + + + {selectedPlan.displayName} · {selectedCycle === 'monthly' ? '月付' : selectedCycle === 'quarterly' ? '季付' : selectedCycle === 'semiannual' ? '半年付' : '年付'} + + + ¥{priceInfo.original_price?.toFixed(2) || getCurrentPrice(selectedPlan).toFixed(2)} + + + + {/* 升级抵扣价值 */} + {priceInfo.is_upgrade && priceInfo.remaining_value > 0 && ( + + + 当前订阅剩余价值抵扣 + + + -¥{priceInfo.remaining_value.toFixed(2)} + + + )} + + {/* 优惠码折扣 */} + {promoCodeApplied && priceInfo.discount_amount > 0 && ( + + + + + 优惠码折扣 + + + + -¥{priceInfo.discount_amount.toFixed(2)} + + + )} + + + + + 实付金额: + + ¥{priceInfo.final_amount.toFixed(2)} + + + + + )} + + {/* 优惠码输入 */} + {selectedPlan && ( + + + { + setPromoCode(e.target.value.toUpperCase()); + setPromoCodeError(''); + }} + size="md" + isDisabled={promoCodeApplied} + bg="rgba(255, 255, 255, 0.05)" + border="1px solid rgba(255, 255, 255, 0.1)" + color="white" + _placeholder={{ color: 'rgba(255, 255, 255, 0.4)' }} + _hover={{ borderColor: 'rgba(212, 175, 55, 0.3)' }} + _focus={{ borderColor: '#D4AF37', boxShadow: '0 0 0 1px #D4AF37' }} + /> + + + {promoCodeError && ( + + {promoCodeError} + + )} + {promoCodeApplied && priceInfo && ( + + + + 优惠码已应用!节省 ¥{priceInfo.discount_amount.toFixed(2)} + + + + )} + + )} + ) : (