Authored by huzhiming

feat(arcitle):添加闲鱼社区模块部分代码 reviewed by tao.huang

  1 +<template>
  2 + <div class="horizontalSlide">
  3 + <ul class="list-warp">
  4 + <li class="list-item" v-for="(item, index) in value" :key="index">
  5 + <ImageFormat
  6 + class="image"
  7 + src="//img11.static.yhbimg.com/goodsimg/2018/12/28/15/0160a985f0b5999b77436b7af78a85f3df.jpg" alt="加载失败"
  8 + :width="136" :height="180"
  9 + @error="imageformatError"/>
  10 + <div class="info">
  11 + <p class="title">Off-White™ x Nike Air Max 90 全新款「Desert Ore」配色曝光 Off-White™ x Nike Air Max 90 全新款「Desert Ore」配色曝光</p>
  12 + <div class="bottom">
  13 + <span class='icon-ufo'></span>
  14 + <span class="price">¥1299</span>
  15 + <span class="icon-goumai"></span>
  16 + </div>
  17 + </div>
  18 + </li>
  19 + </ul>
  20 + </div>
  21 +</template>
  22 +
  23 +<script>
  24 +export default {
  25 + name: 'horizontalSlide',
  26 + props: ['value'],
  27 + data() {
  28 + return {};
  29 + },
  30 +
  31 + methods: {
  32 + imageformatError() {
  33 + console.log(6666);
  34 + }
  35 + },
  36 + computed: {},
  37 + components: {}
  38 +}
  39 +</script>
  40 +<style lang="scss" scoped>
  41 +.horizontalSlide {
  42 + overflow: hidden;
  43 + overflow-x: scroll;
  44 + -webkit-overflow-scrolling: touch;
  45 + -webkit-overscroll-behavior-x: contain;
  46 + scroll-behavior: smooth;
  47 +}
  48 +.list-warp {
  49 + overflow-x: scroll;
  50 + width: max-content;
  51 + font-size: 0;
  52 +}
  53 +.list-item {
  54 + display: inline-flex;
  55 + width: 600px;
  56 + height: 180px;
  57 + margin-right: 24px;
  58 + border-radius: 8px;
  59 + .image {
  60 + min-width: 136px;
  61 + min-height: 180px;
  62 + max-width: 136px;
  63 + max-height: 180px;
  64 + border-radius: 8px 0 0 8px;
  65 + filter: contrast(0.9);
  66 + }
  67 + .title {
  68 + font-size: 24px;
  69 + color: #999;
  70 + line-height: 34px;
  71 + word-break: break-all;
  72 + overflow: hidden;
  73 + text-overflow: ellipsis;
  74 + display: -webkit-box;
  75 + -webkit-line-clamp: 2;
  76 + -webkit-box-orient: vertical;
  77 + }
  78 + .bottom {
  79 + display: flex;
  80 + align-items: center;
  81 + justify-content: space-between;
  82 + }
  83 + .info {
  84 + padding: 20px;
  85 + display: flex;
  86 + flex-direction: column;
  87 + justify-content: space-between;
  88 + border: 1px solid #F0F0F0;
  89 + border-radius: 0 8px 8px 0;
  90 + }
  91 + .price {
  92 + margin-left: 16px;
  93 + font-size: 28px;
  94 + font-family: 'BrownStd-Regular';
  95 + vertical-align: middle;
  96 + flex: 1 1 auto;
  97 + }
  98 + .icon-goumai {
  99 + float: right;
  100 + }
  101 +}
  102 +</style>
@@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
9 !--> 9 !-->
10 <template> 10 <template>
11 <div class="article-waterfall-wrap"> 11 <div class="article-waterfall-wrap">
12 - hello 12 + <horizontalSlide v-model="items" :style="{'margin': '20px 0 0 12px'}"></horizontalSlide>
13 <!-- <div class="water"> 13 <!-- <div class="water">
14 <div class="piping" ref="piping0"></div> 14 <div class="piping" ref="piping0"></div>
15 <div class="piping" ref="piping1"></div> 15 <div class="piping" ref="piping1"></div>
@@ -22,6 +22,8 @@ @@ -22,6 +22,8 @@
22 <script> 22 <script>
23 import axios from 'axios'; 23 import axios from 'axios';
24 24
  25 +import horizontalSlide from './components/horizontalSlide'
  26 +
25 export default { 27 export default {
26 name: 'Article', 28 name: 'Article',
27 mixins: [], 29 mixins: [],
@@ -32,6 +34,8 @@ export default { @@ -32,6 +34,8 @@ export default {
32 }, 34 },
33 data() { 35 data() {
34 return { 36 return {
  37 + items: [...Array(20).keys()].map(item => item),
  38 +
35 moments: [], 39 moments: [],
36 available: 1, 40 available: 1,
37 height1: 0, 41 height1: 0,
@@ -159,7 +163,9 @@ export default { @@ -159,7 +163,9 @@ export default {
159 }, 163 },
160 computed: {}, 164 computed: {},
161 watch: {}, 165 watch: {},
162 - components: {} 166 + components: {
  167 + horizontalSlide
  168 + }
163 }; 169 };
164 </script> 170 </script>
165 171
@@ -719,3 +719,13 @@ img[lazy=loaded] { @@ -719,3 +719,13 @@ img[lazy=loaded] {
719 background: url(~statics/image/order/logo@3x.png) no-repeat; 719 background: url(~statics/image/order/logo@3x.png) no-repeat;
720 background-size: cover; 720 background-size: cover;
721 } 721 }
  722 +
  723 +.icon-goumai {
  724 + width: 120px;
  725 + height: 50px;
  726 + vertical-align: middle;
  727 + display: inline-flex;
  728 + background: url(~statics/image/order/goumai@3x.png) no-repeat;
  729 + background-size: cover;
  730 +}
  731 +