navbars.vue 5.1 KB

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