前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >微信小程序仿微信运动步数排行-交互

微信小程序仿微信运动步数排行-交互

作者头像
王小婷
发布2018-08-02 16:44:47
1.1K0
发布2018-08-02 16:44:47
举报
文章被收录于专栏:编程微刊编程微刊编程微刊

效果图如下:

图片.png

wxml:

<view class="item-box">
  <view class="items">
    <view wx:for="{{list}}"  wx:key="{{index}}"  class="item"> 
      <view bindtouchstart="touchS" bindtouchmove="touchM" bindtouchend="touchE" data-index="{{index}}" style="{{item.txtStyle}}" class="inner txt">
      <image class="item-icon" mode="widthFix" src="{{item.url}}"></image>
       <i> {{item.name}}</i>
      <span class="item-data">
     <i class="rankpace"> {{item.steps}}</i>
      </span>
      
      </view>
    </view>
  </view>
</view>

wxss:

/* pages/leftSwiperDel/index.wxss */
view{
    box-sizing: border-box;
}
.item-box{
    width: 700rpx;
    margin: 0 auto;
    padding:40rpx 0;
}
.items{
    width: 100%;
}
.item{
    position: relative;
    border-top: 2rpx solid #eee;
    height: 120rpx;
    line-height: 120rpx;
    overflow: hidden;
     
}


.item:last-child{
    border-bottom: 2rpx solid #eee;
}
.inner{
    position: absolute;
    top:0;
}
.inner.txt{
    background-color: #fff;
    width: 100%;
    z-index: 5;
    padding:0 10rpx;
    transition: left 0.2s ease-in-out;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.inner.del{
    background-color: #e64340;
    width: 180rpx;text-align: center;
    z-index: 4;
    right: 0;
    color: #fff
}
.item-icon{
    width: 64rpx;
    height: 64rpx;
    vertical-align: middle;
    margin-right: 16rpx;
    margin-left:13px;
    border-radius:50%;

}

.item-data{
  float: right;
  margin-right:5%;}

.rankpace{
  color: #fa7e04;
}

js:

// pages/leftSwiperDel/index.js
Page({
  data: {
    list: null,
  },
  onLoad: function (options) {
    var that = this;

    //加载数据
    wx.request({
      url: "https://pig.intmote.com/bison_xc/wx/sort.do",
      method: 'GET',
      header: {
        'Content-type': 'application/json'
      },
      success: function (res) {
        console.log(res.data)
        that.setData({ list: res.data });
      },
    });
    
  },
})
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.07.12 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档