pagesProduct.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template name="pagesProduct">
  2. <view>
  3. <view class="container-pages clearfix">
  4. <view class="tui-block__box tui-mtop__10" v-for="(item, index) in pagesProductList" :key="index">
  5. <view class="tui-group-name" >
  6. <view class="tui-group-title">
  7. <text>{{ item.title }}</text>
  8. </view>
  9. <view class="tui-sub__desc">{{ item.detail }}</view>
  10. </view>
  11. <scroll-view scroll-x>
  12. <view class="tui-goods__list">
  13. <view class="tui-goods__item"v-for="(floor, flIndex) in item.floorData" :key="flIndex" @tap="NavToDetailPage(floor)" >
  14. <view class="tui-goods__imgbox">
  15. <image :src="floor.image" mode="widthFix" class="tui-goods__img"></image>
  16. </view>
  17. <view class="tui-pri__box">
  18. <view class="tui-sale-pri">{{ floor.title }}</view>
  19. </view>
  20. </view>
  21. </view>
  22. </scroll-view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { mapState,mapMutations} from 'vuex';
  29. export default{
  30. name:"pagesProduct",
  31. props:{
  32. list:{
  33. type:Array
  34. },
  35. userIdentity:{
  36. type:Number
  37. }
  38. },
  39. data() {
  40. return{
  41. pagesProductList:[],
  42. }
  43. },
  44. filters: { NumFormat:function(text) {//处理金额 return Number(text).toFixed(2); }, },
  45. created(){
  46. this.initData(this.list)
  47. },
  48. computed: {
  49. ...mapState(['hasLogin','userInfo','isActivity'])
  50. },
  51. methods:{
  52. initData(res){
  53. this.pagesProductList = res
  54. },
  55. NavToDetailPage(floor) {//跳转
  56. console.log(floor)
  57. /**
  58. * 页面跳转类型
  59. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  60. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  61. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  62. **/
  63. if(floor.linkType){
  64. const typeMap = {
  65. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  66. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  67. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  68. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  69. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  70. 8:`/h5/pages/activity/activity-list`,
  71. 9:`/second/pages/form/introduce`,
  72. 10:`/second/pages/product/product-list`,
  73. 11:`/second/pages/form/form`,
  74. 12:`/pages/search/search?keyWord=${floor.title}`,
  75. 13:`/h5/pages/article/page?link=${floor.link}`,
  76. 14:`/h5/pages/article/page?link=${floor.link}`,
  77. 15:`/h5/pages/article/page?link=${floor.link}`,
  78. 17:`/pages/login/register-select`,
  79. 18:`/h5/pages/article/page?link=${floor.link}`,
  80. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  81. }
  82. const url = typeMap[floor.linkType];
  83. this.$api.navigateTo(url)
  84. }
  85. }
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .container-pages{
  91. width: 100%;
  92. height: auto;
  93. float: left;
  94. background-color: #F7F7F7;
  95. .tui-block__box {
  96. width: 100%;
  97. padding: 0 25rpx 25rpx;
  98. box-sizing: border-box;
  99. background-color: #F7F7F7;
  100. border-radius: 20rpx;
  101. overflow: hidden;
  102. }
  103. .tui-mtop__10 {
  104. margin-top: 10rpx;
  105. }
  106. .tui-group-name {
  107. width: 100%;
  108. height: 92rpx;
  109. padding: 20rpx 0;
  110. }
  111. .tui-group-title{
  112. width: 100%;
  113. float: left;
  114. font-size: 34rpx;
  115. font-weight: bold;
  116. text-align: left;
  117. line-height: 49rpx;
  118. color: #333;
  119. }
  120. .tui-sub__desc {
  121. width: 100%;
  122. float: left;
  123. color: rgba(153,153,153,0.9);
  124. font-size: $font-size-26;
  125. }
  126. .tui-goods__list {
  127. display: flex;
  128. align-items: center;
  129. }
  130. .tui-goods__item {
  131. background-color: #fff;
  132. width: 200rpx;
  133. height: 290rpx;
  134. box-sizing: border-box;
  135. display: flex;
  136. align-items: center;
  137. justify-content: center;
  138. flex-direction: column;
  139. flex-shrink: 0;
  140. margin-right: 12rpx;
  141. }
  142. .tui-goods__imgbox {
  143. width: 200rpx;
  144. height: 200rpx;
  145. display: flex;
  146. align-items: center;
  147. justify-content: center;
  148. box-sizing: border-box;
  149. }
  150. .tui-goods__img {
  151. max-width: 200rpx;
  152. max-height: 200rpx;
  153. display: block;
  154. border-radius: 10rpx 10rpx 0 0;
  155. }
  156. .tui-pri__box {
  157. max-width: 200rpx;
  158. display: flex;
  159. justify-content: center;
  160. align-items: center;
  161. box-sizing: border-box;
  162. padding: 0 10rpx;
  163. }
  164. .tui-sale-pri {
  165. display: flex;
  166. align-items: flex-end;
  167. padding: 10rpx 0 8rpx;
  168. box-sizing: border-box;
  169. font-size: 26rpx;
  170. line-height: 40rpx;
  171. color: #666666;
  172. white-space: normal;
  173. word-break: break-all;
  174. overflow: hidden;
  175. text-overflow: ellipsis;
  176. display: -webkit-box;
  177. -webkit-box-orient: vertical;
  178. -webkit-line-clamp: 2;
  179. }
  180. }
  181. </style>