LeftNav.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <template>
  2. <view class="">
  3. <view class="box">
  4. <view class="box2">
  5. <view class="banner" @click="navBtn(index)" v-for="(item, index) in navList" :key="item.name">
  6. <view class="">
  7. <image style="width: 120rpx; height: 120rpx" :src="item.img"></image>
  8. </view>
  9. <view class="nav_tit">{{ item.name }}</view>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'LeftNav',
  18. data() {
  19. return {
  20. navList: [
  21. {
  22. name: '湖里文化',
  23. img: '/static/img/img_湖里文化@2x.png',
  24. path: '/pages/index/huLiWenHua/huLiWenHua'
  25. },
  26. {
  27. name: '非遗百科',
  28. img: '/static/img/img_非遗百科@2x.png',
  29. path: '/pages/index/feiYiBaiKe/feiYiBaiKe'
  30. },
  31. {
  32. name: '非遗视频',
  33. img: '/static/img/img_非遗视频@2x.png',
  34. path: '/pages/index/feiYiShiPin/feiYiShiPin'
  35. },
  36. {
  37. name: '互动问答',
  38. img: '/static/img/img_互动问答@2x.png',
  39. path: '/pages/index/huDongWenDa/huDongWenDa'
  40. },
  41. {
  42. name: '非遗概览',
  43. img: '/static/img/img_非遗概览@2x.png',
  44. path: '/pages/index/feiYiGaiLan/feiYiGaiLan'
  45. },
  46. {
  47. name: '非遗政策',
  48. img: '/static/img/img_非遗政策@2x.png',
  49. path: '/pages/index/feiYiZhengCe/feiYiZhengCe'
  50. },
  51. {
  52. name: '回到首页',
  53. img: '/static/img/icon_back@2x.png',
  54. path: '/pages/index/index'
  55. },
  56. {
  57. name: '回到探索页',
  58. img: '/static/img/icon_back@2x.png',
  59. path: '/pages/index/startPage'
  60. }
  61. ]
  62. };
  63. },
  64. methods: {
  65. navBtn(index) {
  66. console.log(this.navList[index].path);
  67. uni.navigateTo({
  68. url: `${this.navList[index].path}`
  69. });
  70. }
  71. }
  72. };
  73. </script>
  74. <style>
  75. .box {
  76. width: 348rpx;
  77. height: 1080rpx;
  78. margin: auto;
  79. margin-top: 30%;
  80. background-color: #f8efe1;
  81. }
  82. .box2 {
  83. }
  84. .banner {
  85. cursor: pointer;
  86. display: flex;
  87. align-items: center;
  88. margin-bottom: 80rpx;
  89. }
  90. .nav_tit {
  91. background-image: linear-gradient(270deg, rgba(188, 95, 41, 1) 0, rgba(91, 60, 41, 1) 100%);
  92. font-size: 40rpx;
  93. letter-spacing: 0.2em;
  94. font-weight: NaN;
  95. text-align: left;
  96. white-space: nowrap;
  97. -webkit-background-clip: text;
  98. -webkit-text-fill-color: transparent;
  99. margin-left: 20rpx;
  100. }
  101. </style>