index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view class="fav-page">
  3. <view class="fav-hd" :style="{ paddingTop: statusBar + 'px' }">
  4. <text class="fav-title">我的收藏</text>
  5. </view>
  6. <view class="fav-body">
  7. <text class="fav-empty-emoji">💛</text>
  8. <text class="fav-empty-title">收藏列表</text>
  9. <text class="fav-empty-tip">还没有收藏的内容</text>
  10. <text class="fav-empty-tip">去首页发现感兴趣的攻略吧</text>
  11. </view>
  12. <app-tabbar active="favorite" />
  13. </view>
  14. </template>
  15. <script>
  16. import AppTabbar from '@/components/app-tabbar/app-tabbar.vue'
  17. export default {
  18. components: { AppTabbar },
  19. data() {
  20. return {
  21. statusBar: 0
  22. }
  23. },
  24. onLoad() {
  25. try {
  26. this.statusBar = uni.getSystemInfoSync().statusBarHeight || 0
  27. } catch (_) {}
  28. },
  29. onShow() {
  30. // 每次 onShow 都强制 hide 系统 tabbar,原因同 pages/index/index.vue
  31. setTimeout(() => {
  32. try { uni.hideTabBar({ animation: false }) } catch (_) {}
  33. }, 0)
  34. }
  35. }
  36. </script>
  37. <style>
  38. .fav-page {
  39. min-height: 100vh;
  40. background-color: #f5f6fa;
  41. display: flex;
  42. flex-direction: column;
  43. }
  44. .fav-hd {
  45. padding: 24rpx 32rpx;
  46. background-color: #ffffff;
  47. border-bottom: 1rpx solid rgba(0, 0, 0, 0.04);
  48. }
  49. .fav-title {
  50. font-size: 36rpx;
  51. font-weight: 700;
  52. color: #1a1d29;
  53. }
  54. .fav-body {
  55. flex: 1;
  56. display: flex;
  57. flex-direction: column;
  58. align-items: center;
  59. justify-content: center;
  60. padding: 0 48rpx;
  61. }
  62. .fav-empty-emoji {
  63. font-size: 96rpx;
  64. margin-bottom: 32rpx;
  65. }
  66. .fav-empty-title {
  67. font-size: 32rpx;
  68. font-weight: 600;
  69. color: #1a1d29;
  70. margin-bottom: 16rpx;
  71. }
  72. .fav-empty-tip {
  73. font-size: 26rpx;
  74. color: #8a8d9e;
  75. line-height: 40rpx;
  76. }
  77. </style>