SelfTestCard.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="self-test-card" @click="$emit('tap')">
  3. <view class="self-test-head">
  4. <text class="self-test-icon">⚡</text>
  5. <view class="self-test-info">
  6. <text class="self-test-title">{{ title }}</text>
  7. <text class="self-test-sub">{{ sub }}</text>
  8. <text v-if="badgeCount > 0" class="self-test-badge">有 {{ badgeCount }} 项调研待填</text>
  9. </view>
  10. <text class="self-test-arrow">›</text>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'SelfTestCard',
  17. props: {
  18. title: {
  19. type: String,
  20. default: ''
  21. },
  22. sub: {
  23. type: String,
  24. default: ''
  25. },
  26. badgeCount: {
  27. type: Number,
  28. default: 0
  29. },
  30. icon: {
  31. type: String,
  32. default: '⚡'
  33. }
  34. }
  35. }
  36. </script>
  37. <style scoped lang="scss">
  38. /* ① 了解区 — 自测大卡(引导"从了解开始");样式与 pages/index-home/index.vue 原内联区块一致 */
  39. .self-test-card {
  40. margin: 20rpx $uni-space-lg 16rpx;
  41. background: linear-gradient(135deg, $brand-primary, $brand-primary-light);
  42. border-radius: 24rpx;
  43. padding: 24rpx 28rpx;
  44. }
  45. .self-test-head { display: flex; align-items: center; }
  46. .self-test-icon { font-size: calc(40rpx * var(--font-scale, 1)); margin-right: 16rpx; }
  47. .self-test-info { flex: 1; }
  48. .self-test-title { font-size: calc(28rpx * var(--font-scale, 1)); font-weight: bold; color: $app-surface; display: block; }
  49. .self-test-sub { font-size: calc(22rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.8); display: block; margin-top: 4rpx; }
  50. .self-test-badge { display: inline-block; align-self: flex-start; margin-top: 8rpx; font-size: calc(20rpx * var(--font-scale, 1)); color: $brand-primary; background: rgba($brand-primary, 0.1); padding: 4rpx 14rpx; border-radius: 999rpx; }
  51. .self-test-arrow { font-size: calc(36rpx * var(--font-scale, 1)); color: rgba($app-surface, 0.7); }
  52. </style>