navbars.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template name="navbars">
  2. <view>
  3. <view class="navbars-content clearfix">
  4. <view class="nav-item" v-for="(item, index) in list" :key="index" @click="handleJumpLink(item, index)">
  5. <view class="icon"> <image class="icon-image" :src="item.image" mode="widthFix"></image> </view>
  6. <view class="name">{{ item.topic }}</view>
  7. </view>
  8. </view>
  9. </view>
  10. </template>
  11. <script>
  12. import jumpMixins from '@/mixins/jumpMixins.js'
  13. export default {
  14. mixins: [jumpMixins],
  15. name: 'navbars',
  16. props: {
  17. list: {
  18. type: Array
  19. }
  20. },
  21. data() {
  22. return {
  23. current: 100
  24. }
  25. },
  26. created() {
  27. },
  28. computed: {},
  29. methods: {
  30. }
  31. }
  32. </script>
  33. <style lang="scss">
  34. .navbars-content {
  35. width: 100%;
  36. height: auto;
  37. box-sizing: border-box;
  38. padding: 0 24rpx;
  39. margin-top: 48rpx;
  40. .nav-item {
  41. width: 164rpx;
  42. height: auto;
  43. float: left;
  44. margin-bottom: 30rpx;
  45. margin-right: 15.3rpx;
  46. &:nth-child(4) {
  47. margin-right: 0;
  48. }
  49. &:nth-child(8) {
  50. margin-right: 0;
  51. }
  52. .icon {
  53. width: 110rpx;
  54. height: 110rpx;
  55. margin: 0 auto;
  56. position: relative;
  57. .icon-image {
  58. width: 110rpx;
  59. height: 110rpx;
  60. display: block;
  61. }
  62. .icon-new {
  63. width: 44rpx;
  64. height: 22rpx;
  65. display: block;
  66. position: absolute;
  67. right: 0;
  68. top: 20rpx;
  69. }
  70. }
  71. .name {
  72. width: 100%;
  73. height: 40rpx;
  74. line-height: 40rpx;
  75. text-align: center;
  76. font-size: $font-size-26;
  77. color: #666666;
  78. }
  79. .nav-cell-main {
  80. width: 100%;
  81. height: auto;
  82. position: absolute;
  83. right: 0;
  84. .nav-cell {
  85. width: 164rpx;
  86. height: auto;
  87. float: left;
  88. margin-bottom: 30rpx;
  89. margin-right: 15.3rpx;
  90. &:nth-child(4) {
  91. margin-right: 0;
  92. }
  93. &:nth-child(8) {
  94. margin-right: 0;
  95. }
  96. .icon {
  97. width: 130rpx;
  98. height: 130rpx;
  99. margin: 0 auto;
  100. position: relative;
  101. .icon-image {
  102. width: 130rpx;
  103. height: 130rpx;
  104. display: block;
  105. }
  106. .icon-new {
  107. width: 44rpx;
  108. height: 22rpx;
  109. display: block;
  110. position: absolute;
  111. right: 0;
  112. top: 20rpx;
  113. }
  114. }
  115. .name {
  116. width: 100%;
  117. height: 40rpx;
  118. line-height: 40rpx;
  119. text-align: center;
  120. font-size: $font-size-28;
  121. color: #666666;
  122. }
  123. }
  124. }
  125. }
  126. }
  127. </style>