instrument-recommend.vue 3.9 KB

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