instrument-recommend.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template name="recommend">
  2. <!-- 项目仪器推荐 -->
  3. <view class="recommend clearfix">
  4. <view class="recommend-list" v-if="list.length>0">
  5. <view class="row-list" v-for="(pros, idx) in list" :key="idx" @click.stop="NavToDetailPage(pros)">
  6. <view class="list-image"><image :src="pros.image" mode=""></image></view>
  7. <view class="list-name">{{pros.title}}</view>
  8. </view>
  9. </view>
  10. <view class="recommend-empty" v-else>暂无相关推荐商品</view>
  11. </view>
  12. </template>
  13. <script>
  14. import authorize from '@/common/config/authorize.js'
  15. export default{
  16. name:'recommend',
  17. props:{
  18. list: {
  19. // Unistars类型
  20. type: Array
  21. }
  22. },
  23. components:{
  24. },
  25. data() {
  26. return{
  27. }
  28. },
  29. created() {
  30. },
  31. methods:{
  32. NavToDetailPage(value) {//跳转
  33. /**
  34. * 页面跳转类型
  35. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  36. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  37. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  38. **/
  39. if(value.linkType){
  40. const typeMap = {
  41. 1:`/pages/goods/goods-instrument?linkId=${value.linkParam.id}&title=${value.title}`,
  42. 2:`/pages/goods/instrument-details?id=${value.linkParam.id}`,
  43. 5:`/pages/goods/product?id=${value.linkParam.id}`,
  44. // 7:`/pages/supplier/user/my-shop?shopId=${value.linkParam.id}`,
  45. 8:'/pages/h5/activity/activity-list',
  46. 9:'/pages/second/form/introduce',
  47. 10:'/pages/second/product/product-list',
  48. 11:'/pages/second/form/form',
  49. 12:`/pages/search/search?keyWord=${value.title}`,
  50. 13:`/pages/h5/article/path?link=${value.link}`,
  51. 14:`/pages/h5/article/path?link=${value.link}`,
  52. 15:`/pages/h5/article/path?link=${value.link}`,
  53. 17:'/pages/login/register-select',
  54. 18:`/pages/h5/article/path?link=${value.link}`,
  55. 19:`/pages/search/search-supplier?keyWord=${value.title}`
  56. }
  57. const url = typeMap[value.linkType]
  58. this.$api.navigateTo(url)
  59. }
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. .recommend{
  66. background: #F7F7F7;
  67. width: 100%;
  68. .recommend-empty{
  69. width: 702rpx;
  70. height: 100rpx;
  71. line-height: 100rpx;
  72. padding: 0 24rpx;
  73. font-size: $font-size-28;
  74. color: #999999;
  75. text-align: center;
  76. }
  77. .recommend-list{
  78. width: 100%;
  79. height: auto;
  80. position: relative;
  81. box-sizing: border-box;
  82. padding: 0rpx 24rpx;
  83. .row-list{
  84. width: 340rpx;
  85. height: auto;
  86. float: left;
  87. margin-right: 20rpx;
  88. margin-bottom: 20rpx;
  89. border-radius: 20rpx;
  90. background: #FFFFFF;
  91. &:nth-child(2n){
  92. margin-right: 0;
  93. }
  94. .list-image{
  95. width: 100%;
  96. height: 340rpx;
  97. border-radius: 20rpx 20rpx 0 0;
  98. image{
  99. width: 100%;
  100. height: 340rpx;
  101. border-radius: 20rpx 20rpx 0 0;
  102. }
  103. }
  104. .list-name{
  105. font-size: $font-size-28;
  106. color: $text-color;
  107. line-height:88rpx;
  108. padding: 0 10rpx;
  109. overflow: hidden;
  110. white-space: nowrap;
  111. text-overflow: ellipsis;
  112. }
  113. }
  114. }
  115. .swiper__recommenddots-box{
  116. position: absolute;
  117. bottom: -20rpx;
  118. left: 0;
  119. right: 0;
  120. /* #ifndef APP-NVUE */
  121. display: flex;
  122. /* #endif */
  123. flex: 1;
  124. flex-direction: row;
  125. justify-content: center;
  126. align-items: center;
  127. height: 60rpx;
  128. background: #FFFFFF;
  129. .swiper__dots-item{
  130. width: 8rpx;
  131. height: 8rpx;
  132. border-radius: 100%;
  133. margin-left: 6px;
  134. background-color:rgba(0,0,0,.3);
  135. }
  136. .swiper__dots-long{
  137. width: 32rpx;
  138. height: 8rpx;
  139. border-radius: 4rpx;
  140. background-color: #000;
  141. transition: all 0.4s;
  142. }
  143. }
  144. }
  145. </style>