LoginGuide.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="login-guide" v-if="!isLoggedIn">
  3. <view class="guide-content">
  4. <image class="guide-icon" src="/static/images/login-icon.png" mode="aspectFit"></image>
  5. <text class="guide-title">{{ title || '登录后查看更多内容' }}</text>
  6. <text class="guide-desc">{{ desc || '登录后可以使用完整功能' }}</text>
  7. <button class="guide-btn" @click="goToLogin">立即登录</button>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import { isLoggedIn } from '@/utils/auth.js'
  13. export default {
  14. props: {
  15. title: {
  16. type: String,
  17. default: '登录后查看更多内容'
  18. },
  19. desc: {
  20. type: String,
  21. default: '登录后可以使用完整功能'
  22. }
  23. },
  24. data() {
  25. return {
  26. isLoggedIn: false
  27. }
  28. },
  29. onShow() {
  30. this.checkLoginStatus()
  31. },
  32. methods: {
  33. checkLoginStatus() {
  34. this.isLoggedIn = isLoggedIn()
  35. },
  36. goToLogin() {
  37. uni.navigateTo({
  38. url: '/pages/login/login'
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style scoped>
  45. .login-guide {
  46. min-height: 100vh;
  47. display: flex;
  48. align-items: center;
  49. justify-content: center;
  50. background: #f5f6fb;
  51. }
  52. .guide-content {
  53. display: flex;
  54. flex-direction: column;
  55. align-items: center;
  56. padding: 80rpx 40rpx;
  57. }
  58. .guide-icon {
  59. width: 200rpx;
  60. height: 200rpx;
  61. margin-bottom: 40rpx;
  62. opacity: 0.6;
  63. }
  64. .guide-title {
  65. font-size: 32rpx;
  66. font-weight: 500;
  67. color: #333;
  68. margin-bottom: 16rpx;
  69. }
  70. .guide-desc {
  71. font-size: 26rpx;
  72. color: #999;
  73. margin-bottom: 60rpx;
  74. }
  75. .guide-btn {
  76. width: 400rpx;
  77. height: 88rpx;
  78. background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  79. color: #fff;
  80. border-radius: 44rpx;
  81. font-size: 30rpx;
  82. font-weight: 500;
  83. border: none;
  84. display: flex;
  85. align-items: center;
  86. justify-content: center;
  87. }
  88. </style>