PromotionSection.tsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import React from 'react';
  2. import { Gift, TrendingUp, CreditCard } from 'lucide-react';
  3. const promos = [
  4. {
  5. title: '新人特惠礼包',
  6. price: '¥9.9',
  7. original: '¥99',
  8. desc: '含 500 积分 + 7天模型广场试用',
  9. badge: '限时',
  10. color: 'bg-blue-600',
  11. },
  12. {
  13. title: '超值进阶套餐',
  14. price: '¥198',
  15. original: '¥299',
  16. desc: '含 12000 积分 + 专属客服支持',
  17. badge: 'HOT',
  18. color: 'bg-orange-500',
  19. },
  20. {
  21. title: '企业年度订阅',
  22. price: '¥1999',
  23. original: '¥2599',
  24. desc: '无限次文本生成 + 5折视频渲染',
  25. badge: '推荐',
  26. color: 'bg-indigo-600',
  27. },
  28. ];
  29. const PromotionSection: React.FC = () => {
  30. return (
  31. <div className="grid grid-cols-1 md:grid-cols-3 gap-6">
  32. {promos.map((p, i) => (
  33. <div key={i} className="relative bg-white p-6 rounded-2xl border border-gray-100 flex flex-col hover:border-blue-200 transition-all cursor-pointer overflow-hidden group">
  34. {p.badge && (
  35. <div className={`absolute top-0 right-0 px-3 py-1 ${p.color} text-white text-[10px] font-bold rounded-bl-xl`}>
  36. {p.badge}
  37. </div>
  38. )}
  39. <div className="flex items-center space-x-3 mb-4">
  40. <div className={`w-10 h-10 rounded-xl ${p.color}/10 flex items-center justify-center`}>
  41. <CreditCard className={`w-5 h-5 ${p.color.replace('bg-', 'text-')}`} />
  42. </div>
  43. <h3 className="font-bold text-gray-900 text-sm">{p.title}</h3>
  44. </div>
  45. <div className="flex items-baseline space-x-2 mb-2">
  46. <span className="text-2xl font-bold text-gray-900">{p.price}</span>
  47. <span className="text-xs text-gray-400 line-through">{p.original}</span>
  48. </div>
  49. <p className="text-xs text-gray-500 mb-6 flex-1">{p.desc}</p>
  50. <button className={`w-full py-2.5 rounded-xl text-xs font-bold border border-gray-200 group-hover:bg-gray-50 transition-colors`}>
  51. 立即抢购
  52. </button>
  53. </div>
  54. ))}
  55. </div>
  56. );
  57. };
  58. export default PromotionSection;