zoukankan      html  css  js  c++  java
  • 小程序里写瀑布流图片展示

    展示效果

    1.结构

    <view class='shopping-list'>
      <view class='title'>--个人作品--</view>
      <view class='collection-list'>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image mode="widthFix" src='http://source.unsplash.com/random/340x340'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x500'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x400'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x390'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
            <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x700'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
            <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x300'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
      </view>
    </view>
    <view class='shopping-list'>
      <view class='title'>--个人作品--</view>
      <view class='collection-list'>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image mode="widthFix" src='http://source.unsplash.com/random/340x340'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x500'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x400'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
        <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x390'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
            <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x700'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
            <view class='list-content' bindtap='collectionDetail'>
          <view class='colllection-img'>
            <image  mode="widthFix" src='http://source.unsplash.com/random/340x300'></image>
          </view>
          <view class='collection-name'>
            <text>明清古玉和田玉天然和田玉挂件</text>
          </view>
          <view class='collection-price'>
            <text class="priceSign">¥</text>
            <text class="priceValue">20000</text>
          </view>
        </view>
      </view>
    </view>
    

      2.样式

    /* 瀑布流 */
    .shopping-list{
      width: 100%;
      background: #F3F3F3;
    }
    .shopping-list .title{
      text-align: center;
      padding-top: 30rpx;
    }
    .collection-list{
      /* font-size: 0; */
      margin: 30rpx 24rpx 0 24rpx;
      /* 设置两列 */
      columns: 2;
      /* 两列之间的宽度 */
      column-gap: 24rpx;
    }
    .list-content{
      width: 100%;
      /* 强制文字和图片不分离
      如果不添加,文字显示会有bug
      */
      break-inside: avoid;
    }
    .colllection-img{
      width: 100%;
    }
    
    .colllection-img image{
      width: 100%;
    }
    .collection-name text{
      font-size: 26rpx;
      font-family: PingFang SC;
      font-weight: bold;
      color: #333333;
      line-height: 32rpx;
    }
    .collection-price .priceSign{
      font-size: 21rpx;
      font-family: PingFang SC;
      font-weight: bold;
      color: #C30D23;
      line-height: 32rpx;
    }
    .collection-price .priceValue{
      font-size: 21rpx;
      font-family: PingFang SC;
      font-weight: bold;
      color: #C30D23;
      line-height: 32rpx;
    }
    努力才会有收获,坚持才会成功。
  • 相关阅读:
    Java的protect修饰限制
    Java静态导入包
    Java代码块
    Java多态类型转换
    Java中只有值传递!!!
    测试
    编译原理实验-LL1语法分析器(自动生成First集、Follow集求法)java实现
    用面向对象的思维设计相关类,从而实现直线与直线、直线与圆、直线与矩形的交点。
    java常见类库学习(1)String、StringBuilder、StringBuffer
    JAVA —Lock锁
  • 原文地址:https://www.cnblogs.com/97Coding/p/15085547.html
Copyright © 2011-2022 走看看