navbars.vue 4.0 KB

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