加载中...

List


实例代码


<template>
  <list class="list" loadmoreoffset=2000>
    <cell class="cell" onclick="oncellclick" rownumber={{id}} repeat="{{shopList}}" scope="{{scopeValue}}" append="tree"
          composite={{composite}}>
      <div class="shopDiv">
        <div class="shopHeader" style="flex-direction:row;">
          <div style="flex:2;flex-direction:row;">
            <div>
              <image style="width:60;height:60;" src="{{PersonPhoto}}"></image>
            </div>
            <div style="flex-direction:column;margin-left:5;">
              <div style="margin-top:5;">
                <text style="font-size:20;">{{PersonName}}</text>
              </div>
              <div style="margin-top:5;">
                <text style="font-size:20;color:#cccccc;">{{PersonVisitTime}}</text>
              </div>
            </div>
          </div>
          <div style="flex:5;flex-direction:row;">
            <div style="flex-direction:row;margin-left:10;margin-top:10;">
              <div>
                <image style="width:20;height:20;"
                       src="https://img.alicdn.com/tps/i4/TB1zkDeIFXXXXXrXVXX07tlTXXX-200-200.png_88x88xz.jpg"></image>
              </div>
              <div>
                <text style="font-size:20;">Hope</text>
              </div>
            </div>
            <div style="position:absolute;left:90;top:10;flex-direction:row;">
              <div>
                <image style="width:20;height:20;"
                       src="//ku.shouce.ren/files/images/201611/582c09f8d287e.jpeg"></image>
              </div>
              <div>
                <text style="font-size:20;">Mem</text>
              </div>
            </div>
            <div style="position:absolute;left:170;top:10;flex-direction:row;">
              <div>
                <image style="width:20;height:20;"
                       src="//ku.shouce.ren/files/images/201611/582c09f8dce59.png"></image>
              </div>
              <div>
                <text style="font-size:20;">auth</text>
              </div>
            </div>
            <div style="position:absolute;left:250;top:10;flex-direction:row;">
              <div>
                <image style="width:20;height:20;"
                       src="//ku.shouce.ren/files/images/201611/582c09f8e637d.png"></image>
              </div>
              <div>
                <text style="font-size:20;">Friend</text>
              </div>
            </div>
            <div style="position:absolute;left:330;top:10;flex-direction:row;">
              <div>
                <image style="width:20;height:20;"
                       src="//ku.shouce.ren/files/images/201611/582c09f8ec2c6.png"></image>
              </div>
              <div>
                <text style="font-size:20;">issue</text>
              </div>
            </div>
            <div style="position:absolute;left:410;top:10;flex-direction:row;">
              <div>
                <image style="width:20;height:20;"
                       src="//ku.shouce.ren/files/images/201611/582c09f9036dd.png"></image>
              </div>
              <div>
                <text style="font-size:20;">super</text>
              </div>
            </div>
          </div>
        </div>
        <div class="shopBody" style="flex-direction:column;">
          <div class="descDiv" style="margin-top:10;margin-left:10;">
            <text class="shopDesc" style="font-size:25;">{{shopDesc}}</text>
          </div>
          <div style="flex-direction:row;">
            <div class="imgDiv" style="flex:1;flex-direction:column;margin:10;" repeat={{shopImgList}}>
              <div>
                <image class="shopImg" style="width:{{shopImgWidth}};height:{{shopImgHeight}};"
                       src="{{shopImg}}"></image>
              </div>
              <div style="flex:1;margin-top:10;flex-direction:row;">
                <div style="flex:1;justify-content:center;flex-direction:row;">
                  <div>
                    <image style="width:20;height:20;"
                           src="//ku.shouce.ren/files/images/201611/582c09f8e637d.png"></image>
                  </div>
                  <div style="margin-left:5;">
                    <text style="font-size:20;text-align:center;">Up</text>
                  </div>
                </div>
                <div style="flex:1;justify-content:center;flex-direction:row;">
                  <div>
                    <image style="width:20;height:20;"
                           src="//ku.shouce.ren/files/images/201611/582c09f8ec2c6.png"></image>
                  </div>
                  <div style="margin-left:5;">
                    <text style="font-size:20;text-align:center;">down</text>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="shopFooter" style="flex-direction:row;margin-top:10;margin-left:10;justify-content:flex-end;">
          <div style="margin-right:5;">
            <image class="shopLikeImg smallImg" src="{{shopLikeImg}}"></image>
          </div>
          <div style="margin-right:15;">
            <text class="shopLikeText" style="font-size:20;">{{shopLikeText}}</text>
          </div>
          <div style="margin-right:5;">
            <image class="shopCommentImg smallImg" src="{{shopCommentImg}}"></image>
          </div>
          <div style="margin-right:15;">
            <text class="shopCommentText" style="font-size:20;">{{shopCommentText}}</text>
          </div>
          <div style="margin-right:5;">
            <image class="shopLookImg smallImg" src="{{shopLookImg}}"></image>
          </div>
          <div style="margin-right:15;">
            <text class="shopLookText" style="font-size:20;">{{shopLookText}}</text>
          </div>
          <div style="margin-right:5;">
            <image class="shareImg smallImg" src="{{shareImg}}"></image>
          </div>
          <div style="margin-right:20;">
            <text class="shareText" style="font-size:20;">{{shareText}}</text>
          </div>
        </div>
      </div>
    </cell>
    <loading class="refresh-view" display="{{loading_display}}" onloading="onloading">
      <text class="refresh-arrow" style="text-align: center; color:rgb(238, 162, 54)" if="{{(refresh_display==='hide')}}">Load more</text>
      <loading-indicator style="height:60;width:60;color:#3192e1"></loading-indicator>
    </loading>
  </list>
</template>

<style>
  .flexRow {
    flex-direction: row;
  }

  .flexColumn {
    flex-direction: column;
  }

  .text {
  }

  .div {
  }

  .fixed {
    position: fixed;
    bottom: 50px;
    left: 50px;
    width: 300px;
    height: 50px;
    align-items: center;
    justify-content: center
  }

  .shopImg {
    width: 220;
    height: 220;
  }

  .list {
    flex-direction: column;
    overflow: hidden;
    width: 750;
    height: 1200;
    background-color: #dddddd;
  }

  .cell {
    background-color: #dddddd;
    flex-direction: column;
    width: 750;
  }

  .shopDiv {
    flex-direction: column;
    background-color: #ffffff;
    margin: 5;
    padding: 10;
    border-width: 1;
    border-color: #cccccc;
    overflow: visible;
  }

  .shopRowList {
    flex-direction: column;
    border-width: 1;
    border-color: #cccccc;
    overflow: visible;
    margin: 5;
    padding: 10;
    background-color: #ffffff;
  }

  .shopHeader {
    flex-direction: row;
    width: 720;
  }

  .shopFooter {
    flex-direction: row;
    width: 720;
  }

  .smallImg {
    width: 20;
    height: 20;
  }

  .refresh-view {
    height: 120px;
    width: 750px;
    display: -ms-flex;
    display: -webkit-flex;
    display: flex;
    -ms-flex-align: center;
    -webkit-align-items: center;
    -webkit-box-align: center;
    align-items: center;
  }
</style>

<script>
  module.exports = {
    data: {
      refresh_display : 'hide',
      loading_display : 'hide',
      backgroundColor: 'red',
      composite: 'false',
      shopList: [
        {
          id: 1,
          scopeValue: 1,
          PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
          PersonName: 'Mendeleyev',
          PersonVisitTime: 'today',
          shopDesc: 'Genius only means hard-working all one\'s life',
          shopImgList: [{
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1rtOnHpXXXXXLaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
          }, {
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd4.alicdn.com/bao/uploaded/i4/TB15KrfFVXXXXXJXXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
          }, {
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd2.alicdn.com/bao/uploaded/i2/TB1t5YBGVXXXXXcaXXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
          }],
          shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
          shopLikeText: '6',
          shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
          shopCommentText: '97',
          shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
          shopLookText: '1003',
          shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
          shareText: "10",

        },
        {
          id: 2,
          scopeValue: 2,
          PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
          PersonName: 'Napoleon',
          PersonVisitTime: 'yesterday',
          shopDesc: 'The man who has made up his mind to win will never say "impossible "',
          shopImgList: [{
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd1.alicdn.com/imgextra/i1/2655929383/TB2.qITjpXXXXcIXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
          }, {
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd3.alicdn.com/imgextra/i3/2655929383/TB2eWwZjpXXXXbHXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
          }, {
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd2.alicdn.com/imgextra/i2/2655929383/TB2tgQWjpXXXXbZXXXXXXXXXXXX_!!2655929383.jpg_220x220.jpg'
          }],
          shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
          shopLikeText: '6',
          shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
          shopCommentText: '97',
          shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
          shopLookText: '1003',
          shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
          shareText: "10",

        }, {
          id: 10,
          scopeValue: 5,
          PersonPhoto: 'https://gw.alicdn.com/tps/i3/TB1yeWeIFXXXXX5XFXXuAZJYXXX-210-210.png_60x60.jpg',
          PersonName: 'YIMING',
          PersonVisitTime: 'yesterday',
          shopDesc: 'The secret of success is constancy to purpose',
          shopImgList: [{
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd3.alicdn.com/bao/uploaded/i3/TB17zXOGXXXXXbEXVXXXXXXXXXX_!!0-item_pic.jpg_220x220.jpg'
          }, {
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd1.alicdn.com/imgextra/i1/2265445951/TB22ACTbFXXXXXBXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
          }, {
            shopImgWidth: 220,
            shopImgHeight: 220,
            shopImg: 'https://gd3.alicdn.com/imgextra/i3/2265445951/TB2oXqUbFXXXXXIXXXXXXXXXXXX_!!2265445951.jpg_220x220.jpg'
          }],
          shopLikeImg: 'https://img.alicdn.com/tps/i1/TB1jTxXIVXXXXb8XXXX07tlTXXX-200-200.png_88x88xz.jpg',
          shopLikeText: '6',
          shopCommentImg: 'https://img.alicdn.com/tps/i1/TB1kTKyIVXXXXacXFXX07tlTXXX-200-200.png_88x88xz.jpg',
          shopCommentText: '97',
          shopLookImg: 'https://img.alicdn.com/imgextra/i4/397746073/TB2IseKeFXXXXcVXXXXXXXXXXXX-397746073.png_88x88xz.jpg',
          shopLookText: '1003',
          shareImg: 'https://cbu01.alicdn.com/cms/upload/2015/930/224/2422039_702806130.png_88x88xz.jpg',
          shareText: "10",
        }
      ],
    },
    methods: {
      oncellclick: function(e) {
        this.$call('modal', 'toast', {
          'message': 'row ' + e.target.attr.rownumber + ' clicked',
          'duration': 2.0
        });
      },
      onfixedclick: function(e) {
        if (e.target.style.backgroundColor == 'red') {
          this.backgroundColor = 'green';
          this.composite = true;
        }
        else {
          this.backgroundColor = 'red';
          this.composite = false;
        }
      },
      onloading: function (e) {
        this.loading_display = "show"
        setTimeout(function () {
          this.loading_display = 'hide'
        }.bind(this), 1000)
      }
    }

  }
</script>



还没有评论.