navbars.vue 4.0 KB

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