instrument-recommend.vue 3.9 KB

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