LoginGuideCard.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="login-guide-card">
  3. <view class="guide-header">
  4. <text class="guide-icon">🔒</text>
  5. </view>
  6. <text class="guide-title">{{ title }}</text>
  7. <view class="guide-desc">
  8. <text class="guide-desc-item" v-for="(item, idx) in items" :key="idx">· {{ item }}</text>
  9. </view>
  10. <view class="guide-actions">
  11. <view class="guide-btn primary" @click="goLogin">立即登录</view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. props: {
  18. title: { type: String, default: '登录后查看完整内容' },
  19. items: {
  20. type: Array,
  21. default: function() {
  22. return ['查看个性化数据', '获取更多推荐']
  23. }
  24. }
  25. },
  26. methods: {
  27. goLogin: function() {
  28. // 走全局登录浮层(mixin 会沿 $parent 链找到宿主页面的 <login-sheet>);
  29. // 宿主页面未挂浮层时 mixin 自动回退整页登录
  30. this.openLoginSheet()
  31. }
  32. }
  33. }
  34. </script>
  35. <style scoped>
  36. .login-guide-card {
  37. margin: 20rpx 30rpx;
  38. background: linear-gradient(135deg, #FFF7ED, #FFE4D6);
  39. border-radius: 24rpx;
  40. padding: 40rpx 32rpx;
  41. text-align: center;
  42. }
  43. .guide-icon { font-size: 48rpx; }
  44. .guide-title {
  45. font-size: 32rpx;
  46. font-weight: bold;
  47. color: #333;
  48. margin: 16rpx 0;
  49. display: block;
  50. }
  51. .guide-desc { margin-bottom: 24rpx; }
  52. .guide-desc-item {
  53. font-size: 26rpx;
  54. color: #666;
  55. line-height: 1.8;
  56. display: block;
  57. }
  58. .guide-actions {
  59. display: flex;
  60. flex-direction: row;
  61. justify-content: center;
  62. }
  63. .guide-btn {
  64. padding: 16rpx 48rpx;
  65. border-radius: 40rpx;
  66. font-size: 28rpx;
  67. font-weight: 500;
  68. }
  69. .guide-btn.primary {
  70. background: linear-gradient(135deg, #F97316, #FB923C);
  71. color: #fff;
  72. }
  73. .guide-btn:active { opacity: 0.8; }
  74. </style>