LeftNav.vue 2.2 KB

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