pageSpecial.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template name="pagesProduct">
  2. <view>
  3. <view class="container-pages clearfix">
  4. <scroll-view scroll-x>
  5. <view class="tui-goods__list">
  6. <view class="tui-goods__item" v-for="(item,index) in dataList" :key="index">
  7. <view class="tui-group-name">
  8. <view class="tui-group-title"><text>{{ item.title }}</text></view>
  9. <view class="iconfont icon-xiayibu"></view>
  10. </view>
  11. <view class="tui-goods__main" :class="flIndex == 0 ? 'one' : ''" v-for="(live, flIndex) in item.listData" :key="flIndex">
  12. <view class="tui-goods__imgbox" v-if="flIndex === 0">
  13. <image :src="live.banner" mode="" class="tui-goods__img"></image>
  14. <view class="tui-goods__name">{{ live.title }}</view>
  15. <view class="tui-goods__statu" v-if="item.type == 1">
  16. <image :src="iconLive" mode="widthFix" class="icon-live" v-if="live.status == 1"></image>
  17. <text class="iconfont icon-weikaishi" v-if="live.status == 0"></text>
  18. <text class="iconfont icon-jieshu" v-if="live.status == 2"></text>
  19. <text>{{ live.status | statusType }}</text>
  20. </view>
  21. </view>
  22. <view class="tui-goods__text" v-if="flIndex > 0">{{ live.title }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </scroll-view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { mapState,mapMutations} from 'vuex';
  32. export default{
  33. name:"pagesProduct",
  34. props:{
  35. list:{
  36. type:Array
  37. }
  38. },
  39. data() {
  40. return{
  41. dataList:[],
  42. iconLive:'https://static-b.caimei365.com/app/img/icon/icon-live.gif'
  43. }
  44. },
  45. filters: {
  46. statusType:function(value) {
  47. switch (value) {
  48. case 0:
  49. return '未开始';
  50. break;
  51. case 1:
  52. return '直播中';
  53. break;
  54. case 2:
  55. return '已结束';
  56. break;
  57. }
  58. },
  59. NumFormat:function(value) {//处理金额
  60. return Number(value).toFixed(2);
  61. },
  62. },
  63. created(){
  64. this.initData(this.list)
  65. },
  66. methods:{
  67. initData(data){
  68. this.dataList = data
  69. console.log(this.dataList)
  70. },
  71. NavToDetailPage(floor) {//跳转
  72. /**
  73. * 页面跳转类型
  74. * 1、二级页面,2、搜索项目仪器,3、直播页面,4、自由页面,5、商品详情,6、仪器项目详情,7、供应商主页
  75. * 8、专题活动页,9、二手市场介绍,10、二手商品列表,11、二手商品发布,12、商品搜索,13、信息详情
  76. * 14、品牌招商介绍页,15、维修保养介绍页,16、首页,17、注册页,18、信息中心,19、供应商列表
  77. **/
  78. if(floor.linkType){
  79. const typeMap = {
  80. 1:`/pages/goods/goods-instrument?linkId=${floor.linkParam.id}&title=${floor.title}`,
  81. 2:`/pages/goods/instrument-details?id=${floor.linkParam.id}`,
  82. 4:`/h5/pages/activity/activity?id=${floor.linkParam.id}`,
  83. 5:`/pages/goods/product?id=${floor.linkParam.id}`,
  84. 7:`/supplier/pages/user/my-shop?shopId=${floor.linkParam.id}`,
  85. 8:`/h5/pages/activity/activity-list`,
  86. 9:`/second/pages/form/introduce`,
  87. 10:`/second/pages/product/product-list`,
  88. 11:`/second/pages/form/form`,
  89. 12:`/pages/search/search?keyWord=${floor.title}`,
  90. 13:`/h5/pages/article/page?link=${floor.link}`,
  91. 14:`/h5/pages/article/page?link=${floor.link}`,
  92. 15:`/h5/pages/article/page?link=${floor.link}`,
  93. 17:`/pages/login/register-select`,
  94. 18:`/h5/pages/article/page?link=${floor.link}`,
  95. 19:`/pages/search/search-supplier?keyWord=${floor.title}`
  96. }
  97. const url = typeMap[floor.linkType];
  98. this.$api.navigateTo(url)
  99. }
  100. }
  101. }
  102. }
  103. </script>
  104. <style lang="scss">
  105. .container-pages{
  106. width: 100%;
  107. height:508rpx;
  108. padding: 24rpx;
  109. float: left;
  110. background-color: #F7F7F7;
  111. margin-top: 16rpx;
  112. box-sizing: border-box;
  113. background-color: #F7F7F7;
  114. overflow: hidden;
  115. display: flex;
  116. align-items: center;
  117. .tui-goods__list {
  118. display: flex;
  119. align-items: center;
  120. }
  121. .tui-goods__item {
  122. background-color: #fff;
  123. width: 307rpx;
  124. height: 460rpx;
  125. border-radius: 16rpx;
  126. box-sizing: border-box;
  127. margin-right: 16rpx;
  128. padding: 17rpx;
  129. }
  130. .tui-group-name{
  131. width: 100%;
  132. height: 36rpx;
  133. float: left;
  134. margin-bottom: 13rpx;
  135. .tui-group-title{
  136. font-size: 26rpx;
  137. line-height: 36rpx;
  138. float: left;
  139. color: #333333;
  140. }
  141. .icon-xiayibu{
  142. font-size: 26rpx;
  143. line-height: 36rpx;
  144. float: right;
  145. color: #909090;
  146. }
  147. }
  148. .tui-goods__main{
  149. width: 100%;
  150. height: auto;
  151. float: left;
  152. position: relative;
  153. &.one{
  154. margin-bottom: 14rpx;
  155. }
  156. }
  157. .tui-goods__imgbox {
  158. width: 273rpx;
  159. height: 273rpx;
  160. box-sizing: border-box;
  161. border-radius: 8rpx;
  162. }
  163. .tui-goods__img {
  164. max-width: 273rpx;
  165. max-height: 273rpx;
  166. border-radius: 8rpx;
  167. display: block;
  168. }
  169. .tui-goods__name{
  170. width: 100%;
  171. height: 48rpx;
  172. float: left;
  173. line-height: 48rpx;
  174. box-sizing: border-box;
  175. padding-left: 12rpx;
  176. font-size: $font-size-24;
  177. color: #FFFFFF;
  178. background-color: rgba(0,0,0,0.4);
  179. position: absolute;
  180. bottom: 0;
  181. left: 0;
  182. white-space: nowrap;
  183. text-overflow: ellipsis;
  184. overflow: hidden;
  185. border-radius:0 0 8rpx 8rpx;
  186. }
  187. .tui-goods__statu{
  188. padding-left: 45rpx;
  189. padding-right: 10rpx;
  190. height: 35rpx;
  191. position: absolute;
  192. top: 17rpx;
  193. left: 17rpx;
  194. background-color: rgba(0,0,0,0.4);
  195. border-radius: 18rpx;
  196. line-height: 35rpx;
  197. color: #FFFFFF;
  198. text-align: right;
  199. font-size: $font-size-20;
  200. .icon-live{
  201. width: 17rpx;
  202. height: 17rpx;
  203. display: block;
  204. margin: 0 auto;
  205. position: absolute;
  206. left: 15rpx;
  207. top: 9rpx;
  208. }
  209. .iconfont{
  210. width: 35rpx;
  211. height: 35rpx;
  212. line-height: 35rpx;
  213. display: block;
  214. position: absolute;
  215. left: 10rpx;
  216. font-size: $font-size-30;
  217. &.icon-weikaishi{
  218. color: #E56D00;
  219. }
  220. &.icon-jieshu{
  221. color: #333333;
  222. }
  223. }
  224. }
  225. .tui-goods__text{
  226. width: 100%;
  227. height: 44rpx;
  228. float: left;
  229. line-height: 44rpx;
  230. box-sizing: border-box;
  231. padding-left: 12rpx;
  232. font-size: $font-size-24;
  233. color: #666666;
  234. white-space: nowrap;
  235. text-overflow: ellipsis;
  236. overflow: hidden;
  237. position: relative;
  238. &::before{
  239. content: '';
  240. width: 8rpx;
  241. height: 8rpx;
  242. border-radius: 50%;
  243. background-color: #cccccc;
  244. position: absolute;
  245. left: 0;
  246. top: 18rpx;
  247. }
  248. }
  249. }
  250. </style>