navbars.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template name="navbars">
  2. <view>
  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. /**
  38. * 页面跳转类型
  39. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  40. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  41. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  42. * 23、新活动专题页面
  43. **/
  44. console.log(pros)
  45. if(pros.linkType){
  46. const typeMap = {
  47. 1:`/pages/goods/goods-instrument?linkId=${pros.linkParam.id}&title=${pros.name}`,
  48. 3:'/pages/h5/article/path-live',
  49. 4:'/pages/h5/other/brands',
  50. 10:'/pages/second/product/product-list',
  51. 14:'/pages/h5/other/brand',
  52. 15:'/pages/h5/other/repair',
  53. 18:`/pages/h5/article/path?link=${pros.link}`,
  54. 20:`/pages/goods/good-floor?linkId=${pros.linkParam.id}&title=${pros.name}`,
  55. 21:'/pages/h5/activity/meobohui',
  56. 22:`/pages/goods/good-floor-temp?linkId=${pros.linkParam.id}&title=${pros.name}`,
  57. 23:`/pages/h5/activity/activity-topic?linkId=${pros.linkParam.id}`, //活动专题页面
  58. 25:'/pages/goods/goods-doc-list' ,//美业资料
  59. 28:`/pages/h5/article/path?link=${pros.link}` // 采美认证通
  60. }
  61. const url = typeMap[pros.linkType]
  62. this.$api.navigateTo(url)
  63. }
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="scss">
  69. .navbars-content{
  70. width: 100%;
  71. height: auto;
  72. box-sizing: border-box;
  73. padding: 0 24rpx;
  74. margin-top: 24rpx;
  75. .nav-item{
  76. width: 164rpx;
  77. height: auto;
  78. float: left;
  79. margin-bottom: 30rpx;
  80. margin-right: 15.3rpx;
  81. &:nth-child(4){
  82. margin-right: 0;
  83. }
  84. &:nth-child(8){
  85. margin-right: 0;
  86. }
  87. .icon{
  88. width: 110rpx;
  89. height: 110rpx;
  90. margin: 0 auto;
  91. position: relative;
  92. .icon-image{
  93. width: 110rpx;
  94. height: 110rpx;
  95. display: block;
  96. }
  97. .icon-new{
  98. width: 44rpx;
  99. height: 22rpx;
  100. display: block;
  101. position: absolute;
  102. right: 0;
  103. top: 20rpx;
  104. }
  105. }
  106. .name{
  107. width: 100%;
  108. height: 40rpx;
  109. line-height: 40rpx;
  110. text-align: center;
  111. font-size: $font-size-26;
  112. color: #666666;
  113. }
  114. .nav-cell-main{
  115. width: 100%;
  116. height: auto;
  117. position: absolute;
  118. right: 0;
  119. .nav-cell{
  120. width: 164rpx;
  121. height: auto;
  122. float: left;
  123. margin-bottom: 30rpx;
  124. margin-right: 15.3rpx;
  125. &:nth-child(4){
  126. margin-right: 0;
  127. }
  128. &:nth-child(8){
  129. margin-right: 0;
  130. }
  131. .icon{
  132. width: 130rpx;
  133. height: 130rpx;
  134. margin: 0 auto;
  135. position: relative;
  136. .icon-image{
  137. width: 130rpx;
  138. height: 130rpx;
  139. display: block;
  140. }
  141. .icon-new{
  142. width: 44rpx;
  143. height: 22rpx;
  144. display: block;
  145. position: absolute;
  146. right: 0;
  147. top: 20rpx;
  148. }
  149. }
  150. .name{
  151. width: 100%;
  152. height: 40rpx;
  153. line-height: 40rpx;
  154. text-align: center;
  155. font-size: $font-size-28;
  156. color: #666666;
  157. }
  158. }
  159. }
  160. }
  161. }
  162. </style>