navbars.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. margin-top: 24rpx;
  62. padding: 32rpx 0;
  63. background-color: #fff;
  64. border-radius: 16rpx;
  65. .nav-item{
  66. width: 164rpx;
  67. height: auto;
  68. float: left;
  69. margin-bottom: 30rpx;
  70. margin-right: 15.3rpx;
  71. &:nth-child(4){
  72. margin-right: 0;
  73. }
  74. &:nth-child(8){
  75. margin-right: 0;
  76. }
  77. .icon{
  78. width: 110rpx;
  79. height: 110rpx;
  80. margin: 0 auto;
  81. position: relative;
  82. .icon-image{
  83. width: 110rpx;
  84. height: 110rpx;
  85. display: block;
  86. }
  87. .icon-new{
  88. width: 44rpx;
  89. height: 22rpx;
  90. display: block;
  91. position: absolute;
  92. right: 0;
  93. top: 20rpx;
  94. }
  95. }
  96. .name{
  97. width: 100%;
  98. height: 40rpx;
  99. line-height: 40rpx;
  100. text-align: center;
  101. font-size: $font-size-26;
  102. color: #666666;
  103. }
  104. .nav-cell-main{
  105. width: 100%;
  106. height: auto;
  107. position: absolute;
  108. right: 0;
  109. .nav-cell{
  110. width: 164rpx;
  111. height: auto;
  112. float: left;
  113. margin-bottom: 30rpx;
  114. margin-right: 15.3rpx;
  115. &:nth-child(4){
  116. margin-right: 0;
  117. }
  118. &:nth-child(8){
  119. margin-right: 0;
  120. }
  121. .icon{
  122. width: 130rpx;
  123. height: 130rpx;
  124. margin: 0 auto;
  125. position: relative;
  126. .icon-image{
  127. width: 130rpx;
  128. height: 130rpx;
  129. display: block;
  130. }
  131. .icon-new{
  132. width: 44rpx;
  133. height: 22rpx;
  134. display: block;
  135. position: absolute;
  136. right: 0;
  137. top: 20rpx;
  138. }
  139. }
  140. .name{
  141. width: 100%;
  142. height: 40rpx;
  143. line-height: 40rpx;
  144. text-align: center;
  145. font-size: $font-size-28;
  146. color: #666666;
  147. }
  148. }
  149. }
  150. }
  151. }
  152. </style>