LoginGuideCard.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="lgc">
  3. <view class="lgc-head">
  4. <view class="lgc-icon"></view>
  5. <text class="lgc-title">{{ title }}</text>
  6. </view>
  7. <view class="lgc-list">
  8. <view class="lgc-item" v-for="(item, idx) in items" :key="idx">
  9. <view class="lgc-check"></view>
  10. <text class="lgc-text">{{ item }}</text>
  11. </view>
  12. </view>
  13. <view class="lgc-btn" @click="goLogin">
  14. <text class="lgc-btn-text">手机号快捷登录</text>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. props: {
  21. title: { type: String, default: '登录后查看完整内容' },
  22. items: {
  23. type: Array,
  24. default: function() {
  25. return ['查看个性化数据', '获取更多推荐']
  26. }
  27. }
  28. },
  29. methods: {
  30. goLogin: function() {
  31. // 走全局登录浮层(mixin 会沿 $parent 链找到宿主页面的 <login-sheet>);
  32. // 宿主页面未挂浮层时 mixin 自动回退整页登录
  33. this.openLoginSheet()
  34. }
  35. }
  36. }
  37. </script>
  38. <style scoped lang="scss">
  39. // 图标走 data-URI SVG 背景(mp-weixin 模板内禁写 svg 标签),颜色由品牌令牌插值,不硬编码色值
  40. $lgc-brand-hex: '#{$brand-primary}';
  41. $lgc-brand: str-slice($lgc-brand-hex, 2);
  42. .lgc {
  43. margin: 0;
  44. background: $facade-brand-tint;
  45. border: 1rpx solid rgba($brand-primary, 0.14);
  46. border-radius: 24rpx;
  47. padding: 32rpx 28rpx;
  48. display: flex;
  49. flex-direction: column;
  50. }
  51. .lgc-head {
  52. display: flex;
  53. flex-direction: row;
  54. align-items: center;
  55. }
  56. .lgc-icon {
  57. width: 36rpx;
  58. height: 36rpx;
  59. flex-shrink: 0;
  60. background-repeat: no-repeat;
  61. background-position: center;
  62. background-size: 36rpx 36rpx;
  63. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23#{$lgc-brand}' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='10' width='16' height='10.5' rx='2.5'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  64. }
  65. .lgc-title {
  66. flex: 1;
  67. min-width: 0;
  68. margin-left: 14rpx;
  69. font-size: calc(30rpx * var(--font-scale, 1));
  70. font-weight: 700;
  71. color: $facade-text-strong;
  72. line-height: 1.4;
  73. }
  74. .lgc-list {
  75. margin-top: 20rpx;
  76. display: flex;
  77. flex-direction: column;
  78. }
  79. .lgc-item {
  80. display: flex;
  81. flex-direction: row;
  82. align-items: flex-start;
  83. margin-top: 14rpx;
  84. }
  85. .lgc-item:first-child { margin-top: 0; }
  86. .lgc-check {
  87. width: 28rpx;
  88. height: 28rpx;
  89. flex-shrink: 0;
  90. margin-top: 6rpx;
  91. background-repeat: no-repeat;
  92. background-position: center;
  93. background-size: 28rpx 28rpx;
  94. background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23#{$lgc-brand}' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  95. }
  96. .lgc-text {
  97. flex: 1;
  98. min-width: 0;
  99. margin-left: 12rpx;
  100. font-size: calc(24rpx * var(--font-scale, 1));
  101. color: $facade-text-body;
  102. line-height: 1.6;
  103. }
  104. .lgc-btn {
  105. margin-top: 28rpx;
  106. padding: 24rpx 0;
  107. border-radius: 999rpx;
  108. background: linear-gradient(135deg, $brand-primary, $brand-primary-dark);
  109. display: flex;
  110. flex-direction: row;
  111. align-items: center;
  112. justify-content: center;
  113. box-shadow: 0 10rpx 24rpx rgba($brand-primary, 0.2);
  114. }
  115. .lgc-btn:active { opacity: 0.9; }
  116. .lgc-btn-text {
  117. font-size: calc(28rpx * var(--font-scale, 1));
  118. font-weight: 600;
  119. color: $app-surface;
  120. }
  121. </style>