DimensionIntroCard.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="dim-intro-card" :style="'background:' + bgGradient">
  3. <view class="dim-intro-header">
  4. <text class="dim-intro-icon">{{ icon }}</text>
  5. <view class="dim-intro-text">
  6. <text class="dim-intro-title">{{ dimName }}</text>
  7. <text class="dim-intro-subtitle">{{ subtitle }}</text>
  8. </view>
  9. </view>
  10. <view class="dim-intro-features">
  11. <view class="dim-intro-feature" v-for="(f, i) in features" :key="i">
  12. <text class="dim-intro-bullet">●</text>
  13. <text class="dim-intro-feature-text">{{ f }}</text>
  14. </view>
  15. </view>
  16. <view class="dim-intro-footer" v-if="learnMoreText">
  17. <text class="dim-intro-link" @click="onLearnMore">{{ learnMoreText }}</text>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { BrandColors } from '../utils/brand-colors.js'
  23. var DIM_CONFIG = {
  24. body: { icon: '🌏', name: '身', subtitle: '科学管理全家健康数据', features: ['七维雷达图', '健康报告解读', '能量打卡', '精准营养方案'], gradient: 'linear-gradient(135deg, #FFF7ED, rgba(255,140,66,0.12))', color: BrandColors.body },
  25. mind: { icon: '🔥', name: '心', subtitle: '关注全家心理健康与情绪成长', features: ['EMI心理测评', '情绪趋势追踪', '家庭天盘', '疏导工具'], gradient: 'linear-gradient(135deg, #FFF0F5, rgba(255,107,157,0.12))', color: BrandColors.mind },
  26. wisdom: { icon: '⚡', name: '智', subtitle: '提升全家认知能力与学习效率', features: ['认知雷达图', '认知训练', '测评预约', '成长记录'], gradient: 'linear-gradient(135deg, #F0F0FF, rgba(99,102,241,0.12))', color: BrandColors.wisdom },
  27. action: { icon: '🌿', name: '行', subtitle: '改善全家关系与沟通能力', features: ['关系质量问卷', '互动记录', '任务协作', '家庭挑战'], gradient: 'linear-gradient(135deg, #F0FFF4, rgba(16,185,129,0.12))', color: BrandColors.success },
  28. wealth: { icon: '💧', name: '富', subtitle: '分享价值,收获财富', features: ['财富能量仪表盘', '推广收益统计', '邀请返利', '会员权益'], gradient: 'linear-gradient(135deg, #FFFBEB, rgba(245,158,11,0.12))', color: BrandColors.wealth }
  29. }
  30. export default {
  31. name: 'DimensionIntroCard',
  32. props: {
  33. dimCode: {
  34. type: String,
  35. required: true,
  36. validator: function(v) { return DIM_CONFIG.hasOwnProperty(v) }
  37. },
  38. learnMoreText: {
  39. type: String,
  40. default: '了解更多 ›'
  41. },
  42. learnMoreUrl: {
  43. type: String,
  44. default: ''
  45. }
  46. },
  47. computed: {
  48. dimConfig: function() {
  49. return DIM_CONFIG[this.dimCode]
  50. },
  51. icon: function() { return this.dimConfig.icon },
  52. dimName: function() { return this.dimConfig.name },
  53. subtitle: function() { return this.dimConfig.subtitle },
  54. features: function() { return this.dimConfig.features },
  55. bgGradient: function() { return this.dimConfig.gradient }
  56. },
  57. methods: {
  58. onLearnMore: function() {
  59. if (this.learnMoreUrl) {
  60. uni.navigateTo({ url: this.learnMoreUrl })
  61. }
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss">
  67. .dim-intro-card {
  68. margin: 16rpx 30rpx 0;
  69. padding: 24rpx 28rpx;
  70. border-radius: 16rpx;
  71. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.04);
  72. }
  73. .dim-intro-header {
  74. display: flex;
  75. flex-direction: row;
  76. align-items: center;
  77. margin-bottom: 20rpx;
  78. }
  79. .dim-intro-icon {
  80. font-size: 48rpx;
  81. margin-right: 16rpx;
  82. }
  83. .dim-intro-text {
  84. flex: 1;
  85. }
  86. .dim-intro-title {
  87. font-size: 28rpx;
  88. font-weight: bold;
  89. color: $facade-text-strong;
  90. display: block;
  91. }
  92. .dim-intro-subtitle {
  93. font-size: 22rpx;
  94. color: $facade-text-body;
  95. margin-top: 4rpx;
  96. display: block;
  97. }
  98. .dim-intro-features {
  99. margin-bottom: 16rpx;
  100. }
  101. .dim-intro-feature {
  102. display: flex;
  103. flex-direction: row;
  104. align-items: center;
  105. margin-bottom: 8rpx;
  106. }
  107. .dim-intro-bullet {
  108. font-size: 16rpx;
  109. color: $facade-text-muted;
  110. margin-right: 8rpx;
  111. }
  112. .dim-intro-feature-text {
  113. font-size: 24rpx;
  114. color: $facade-text-strong;
  115. }
  116. .dim-intro-footer {
  117. text-align: right;
  118. }
  119. .dim-intro-link {
  120. font-size: 24rpx;
  121. color: $facade-text-muted;
  122. }
  123. </style>