navbars.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template name="navbars">
  2. <view class="navbar">
  3. <view class="navbars-content clearfix">
  4. <view class="nav-item" v-for="(item,index) in navList" :key="index" @click="NavToDetailPage(item,index)">
  5. <view class="icon">
  6. <image class="icon-image" :src="item.icon" mode="widthFix"></image>
  7. </view>
  8. <view class="name">{{ item.name }}</view>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default{
  15. name:'navbars',
  16. props:{
  17. list:{
  18. type:Array
  19. }
  20. },
  21. data() {
  22. return{
  23. current:100,
  24. navList:[]
  25. }
  26. },
  27. created(){
  28. this.initData(this.list)
  29. },
  30. computed: {
  31. },
  32. methods:{
  33. initData(list){
  34. this.navList = list
  35. },
  36. NavToDetailPage(pros,index) {//跳转
  37. if(index === 3){
  38. let linkPath = 'https://static.caimei365.com/app/caimei-activity-h5/html/2023/activity_02.html'
  39. this.$api.navigateTo(`/pages/h5/activity/activity?link=${linkPath}&linkId=382`)
  40. }else{
  41. /**
  42. * 页面跳转
  43. **/
  44. this.$api.FlooryNavigateTo(pros)
  45. }
  46. }
  47. }
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .navbar {
  52. background: #f7f7f7;
  53. display: flex;
  54. align-items: center;
  55. justify-content: center;
  56. }
  57. .navbars-content{
  58. width: 94%;
  59. height: auto;
  60. box-sizing: border-box;
  61. padding: 20rpx 0 0 0;
  62. background-color: #fff;
  63. border-radius: 16rpx;
  64. .nav-item{
  65. width: 164rpx;
  66. height: auto;
  67. float: left;
  68. margin-bottom: 30rpx;
  69. margin-right: 15.3rpx;
  70. &:nth-child(4){
  71. margin-right: 0;
  72. }
  73. &:nth-child(8){
  74. margin-right: 0;
  75. }
  76. .icon{
  77. width: 110rpx;
  78. height: 110rpx;
  79. margin: 0 auto;
  80. position: relative;
  81. .icon-image{
  82. width: 110rpx;
  83. height: 110rpx;
  84. display: block;
  85. }
  86. .icon-new{
  87. width: 44rpx;
  88. height: 22rpx;
  89. display: block;
  90. position: absolute;
  91. right: 0;
  92. top: 20rpx;
  93. }
  94. }
  95. .name{
  96. width: 100%;
  97. height: 40rpx;
  98. line-height: 40rpx;
  99. text-align: center;
  100. font-size: $font-size-26;
  101. color: #666666;
  102. }
  103. .nav-cell-main{
  104. width: 100%;
  105. height: auto;
  106. position: absolute;
  107. right: 0;
  108. .nav-cell{
  109. width: 164rpx;
  110. height: auto;
  111. float: left;
  112. margin-bottom: 30rpx;
  113. margin-right: 15.3rpx;
  114. &:nth-child(4){
  115. margin-right: 0;
  116. }
  117. &:nth-child(8){
  118. margin-right: 0;
  119. }
  120. .icon{
  121. width: 130rpx;
  122. height: 130rpx;
  123. margin: 0 auto;
  124. position: relative;
  125. .icon-image{
  126. width: 130rpx;
  127. height: 130rpx;
  128. display: block;
  129. }
  130. .icon-new{
  131. width: 44rpx;
  132. height: 22rpx;
  133. display: block;
  134. position: absolute;
  135. right: 0;
  136. top: 20rpx;
  137. }
  138. }
  139. .name{
  140. width: 100%;
  141. height: 40rpx;
  142. line-height: 40rpx;
  143. text-align: center;
  144. font-size: $font-size-28;
  145. color: #666666;
  146. }
  147. }
  148. }
  149. }
  150. }
  151. </style>