商品列表-结构

新建一个HotShopList.vue的组件
html代码实现如下

<template>
    <div class="shop-container">
        <ul class="shop-list">
              <li class="shop-list-item">
                  <img src="./../../imgs/shop_list/shop_item.png" alt="">
                  <h4>我是标题标题标题</h4>
                  <div class="list-item-bottom">
                      <span class="item-price">$26.9</span>
                      <span class="item-counter">已拼成999件</span>
                      <span class="item-user">
                          <img src="./../../imgs/shop_list/user1.jpg" alt="">
                          <img src="./../../imgs/shop_list/user2.jpg" alt="">
                      </span>
                      <span class="item-buy">
                           <button>去拼单</button>
                      </span>
                  </div>
              </li>
        </ul>
</template>

CSS代码实现如下

<style  scoped lang="stylus" ref="stylesheet/stylus">
   .shop-container
      margin-bottom 50px   //内容距离底部有距离
      background-color #f5f5f5
      .shop-list
         .shop-list-item
            margin-bottom 10px
            background-color #fff
            display flex
            flex-direction column
            .list-item-title
                line-height 22px
                width 94%
                margin-left 3%
                height 44px
                overflow hidden   //标题太长需要隐藏
                .list-item-bottom
                    margin 10px 0
                    display flex
                    flex-direction row
                    justify-content space-around
                    align-items center
                    .item-price
                      font-size 18px
                      text-align center
                      font-weight bolder
                      color red
                      flex 1
                     .item-counter
                       flex 2
                       font-size 12px
                       color #ccccc
                     .item-user
                       display flex
                       justify-content center
                       align-items center
                       flex 1
                         img
                            width 40px
                            border-radius 50%         
                         img:nth-child(2)
                            magrin-left -6px
                       .item-buy
                            flex 2
                            button
                                width 80%
                                height 34px
                                border none
                                color #fff
                                display flex
                                font-size 15px
                                justify-content center
                                align-items center
                                margin-left 10px
                                background-color red
                                border-radius 10px

效果如图


微信截图_20181130021105.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,387评论 25 708
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 12,958评论 2 59
  • 晚上近11点,大巴终于到站,走在深夜的布拉格街头,还是有一些人流,有些饭馆甚至还在营业。到达住宿处后,我们有些饿了...
    非模范EF阅读 274评论 0 1
  • 婷婷的倚在今日 似往昔的袅娜 又迥乎明日的窈窕 不期然的与森林突瞥 单人之众,众人之单 尬于近,怯于离 夹着阳光的...
    凡久匠阅读 209评论 0 3
  • 一拍即合的旅程 青海之行在心中萦绕已久,但是最终的决定却是在一个一团浆糊似的日子里做出的。 这还得感谢朋友的一个电...
    泊在浅滩阅读 461评论 3 4