前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >小程序左右标签滑块排行榜

小程序左右标签滑块排行榜

作者头像
达达前端
发布2019-07-03 17:42:57
6480
发布2019-07-03 17:42:57
举报
文章被收录于专栏:达达前端达达前端
小程序左右标签滑块排行榜

效果:

效果

代码语言:javascript
复制
<view class="menu">
  <view class="{{currentTab==0?'select':'default'}}" data-current="0" bindtap="switchNav">成绩</view>
  <view class="{{currentTab==1?'select':'default'}}" data-current="1" bindtap="switchNav">勤奋</view>
  <view class="{{currentTab==2?'select':'default'}}" data-current="2" bindtap="switchNav">考勤</view>
</view>
<view class="content">
  <view class="hr"></view>
  <swiper current="{{currentTab}}" style="height:800px;">
    <swiper-item>
      <include src="cj.wxml" />
    </swiper-item>
    <swiper-item>
      <include src="qinfen.wxml" />
    </swiper-item>
    <swiper-item>
      <include src="kq.wxml" />
    </swiper-item>
  </swiper>
</view>
代码语言:javascript
复制
.menu {
  display: flex;
  flex-direction: row;
  width: 100%;
  background-color: #09f;
  height: 40px;
}

.select {
  font-size: 12px;
  color: #09f;
  width: 33%;
  background-color: #fff;
  text-align: center;
  height: 30px;
  line-height: 30px;
  border: 1px solid #fff;
  border-radius: 3px;
}

.default {
  width: 33%;
  font-size: 12px;
  text-align: center;
  height: 30px;
  line-height: 30px;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 3px;
}

.rank {
  width: 100%;
  text-align: center;
  background-color: #193d56;
  height: 200px;
  align-items: center;
}

.rank image {
  margin-top: 20px;
  border-radius: 50%;
}

.name {
  margin-top: 10px;
  margin-bottom: 10px;
  color: #fff;
}

.stat {
  color: #fff;
  font-size: 15px;
}

.item {
  display: flex;
  flex-direction: row;
  padding: 10px;
  align-items: center;
}

.num {
  width: 10%;
}

.desc {
  margin-left: 20px;
  width: 55%;
}

.name1 {
  font-size: 16px;
}

.school {
  margin-top: 5px;
  font-size: 12px;
}

.count {
  width: 15%;
  text-align: right;
}

.unit {
  width: 5%;
  font-size: 11px;
  text-align: right;
}

.line {
  border: 1px solid #ccc;
  opacity: 0.2;
}

.schoolName {
  width: 70%;
}
代码语言:javascript
复制
{
  "navigationBarTitleText": "排行榜"
}
代码语言:javascript
复制
Page({
  data: {
    currentTab: 0
  },
  switchNav: function(e) {
    var page = this;
    var index = e.target.dataset.current;
    if (this.data.currentTab == index) {
      return false;
    } else {
      page.setData({
        currentTab: index
      });
    }
  }
})

往后余生,唯独有你 简书作者:达叔小生 90后帅气小伙,良好的开发习惯;独立思考的能力;主动并且善于沟通 简书博客: https://www.jianshu.com/u/c785ece603d1

结语

  • 下面我将继续对 其他知识 深入讲解 ,有兴趣可以继续关注
  • 小礼物走一走 or 点赞
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018.11.30 ,如有侵权请联系 cloudcommunity@tencent.com 删除

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

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

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

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