pagesProduct.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. /**
  57. * 页面跳转类型
  58. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  59. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  60. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  61. **/
  62. if(floor.linkType){
  63. const typeMap = {
  64. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  65. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  66. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  67. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  68. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  69. 8:`/h5/pages/activity/activity-list`,
  70. 9:`/second/pages/form/introduce`,
  71. 10:`/second/pages/product/product-list`,
  72. 11:`/second/pages/form/form`,
  73. 12:`/pages/search/search?keyWord=${floor.title}`,
  74. 13:`/h5/pages/article/page?link=${floor.link}`,
  75. 14:`/h5/pages/article/page?link=${floor.link}`,
  76. 15:`/h5/pages/article/page?link=${floor.link}`,
  77. 17:`/pages/login/register-select`,
  78. 18:`/h5/pages/article/page?link=${floor.link}`,
  79. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  80. }
  81. const url = typeMap[floor.linkType];
  82. this.$api.navigateTo(url)
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style lang="scss">
  89. .container-pages{
  90. width: 100%;
  91. height: auto;
  92. float: left;
  93. background-color: #F7F7F7;
  94. .tui-block__box {
  95. width: 100%;
  96. padding: 0 25rpx 25rpx;
  97. box-sizing: border-box;
  98. background-color: #F7F7F7;
  99. border-radius: 20rpx;
  100. overflow: hidden;
  101. }
  102. .tui-mtop__10 {
  103. margin-top: 10rpx;
  104. }
  105. .tui-group-name {
  106. width: 100%;
  107. height: 92rpx;
  108. padding: 20rpx 0;
  109. }
  110. .tui-group-title{
  111. width: 100%;
  112. float: left;
  113. font-size: 34rpx;
  114. font-weight: bold;
  115. text-align: left;
  116. line-height: 49rpx;
  117. color: #333;
  118. }
  119. .tui-sub__desc {
  120. width: 100%;
  121. float: left;
  122. color: rgba(153,153,153,0.9);
  123. font-size: $font-size-26;
  124. }
  125. .tui-goods__list {
  126. display: flex;
  127. align-items: center;
  128. }
  129. .tui-goods__item {
  130. background-color: #fff;
  131. width: 200rpx;
  132. height: 290rpx;
  133. box-sizing: border-box;
  134. display: flex;
  135. align-items: center;
  136. justify-content: center;
  137. flex-direction: column;
  138. flex-shrink: 0;
  139. margin-right: 12rpx;
  140. }
  141. .tui-goods__imgbox {
  142. width: 200rpx;
  143. height: 200rpx;
  144. display: flex;
  145. align-items: center;
  146. justify-content: center;
  147. box-sizing: border-box;
  148. }
  149. .tui-goods__img {
  150. max-width: 200rpx;
  151. max-height: 200rpx;
  152. display: block;
  153. border-radius: 10rpx 10rpx 0 0;
  154. }
  155. .tui-pri__box {
  156. max-width: 200rpx;
  157. display: flex;
  158. justify-content: center;
  159. align-items: center;
  160. box-sizing: border-box;
  161. padding: 0 10rpx;
  162. }
  163. .tui-sale-pri {
  164. display: flex;
  165. align-items: flex-end;
  166. padding: 10rpx 0 8rpx;
  167. box-sizing: border-box;
  168. font-size: 26rpx;
  169. line-height: 40rpx;
  170. color: #666666;
  171. white-space: normal;
  172. word-break: break-all;
  173. overflow: hidden;
  174. text-overflow: ellipsis;
  175. display: -webkit-box;
  176. -webkit-box-orient: vertical;
  177. -webkit-line-clamp: 2;
  178. }
  179. }
  180. </style>