123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <template>
- <view class="container">
- <view class="headbox">
- <view class="headnav x-bc">
- <view :class="activeTab == 0 ? 'headnav-item headnav-active':'headnav-item'" @click="handleNav(0)">
- <view>直播计划</view>
- <view class="headnav-num">3</view>
- <image src="@/static/images/idle.png" mode="aspectFill"></image>
- </view>
- <view :class="activeTab == 1? 'headnav-item headnav-active':'headnav-item'" @click="handleNav(1)">
- <view>今日直播</view>
- <view class="headnav-num">3</view>
- <image src="@/static/images/streaming.png" mode="aspectFill"></image>
- </view>
- <view :class="activeTab == 2 ? 'headnav-item headnav-active':'headnav-item'" @click="handleNav(2)">
- <view>往日直播</view>
- <view class="headnav-num">3</view>
- <image src="@/static/images/finished.png" mode="aspectFill"></image>
- </view>
- </view>
- <view class="x-bc">
- <view :class="searchbarNav == index ? 'searchbar x-c searchbar-active':'searchbar x-c'" v-for="(item,index) in searchbar" :key="index" @click="clickSearchbar(index)">
- <text>{{item.name}}</text><u-icon class="arrow-down" name="arrow-down" :color="searchbarNav == index ?'#1677ff':'#999'" size="12"></u-icon>
- </view>
- </view>
- </view>
- <view class="coursebox" :style="{height: contentH}">
- <!-- <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" :down="downOption" :up="upOption" @down="downCallback" @up="upCallback"> -->
- <view class="courselist">
- <courseItem :activeTab="activeTab" />
- </view>
- <!-- </mescroll-body> -->
- </view>
- </view>
- </template>
- <script>
- import courseItem from "../components/courseItem.vue"
- export default {
- components: {
- courseItem
- },
- data() {
- return {
- contentH: 0,
- activeTab: 0,
- searchbarNav: 'colse',
- searchbar: [{
- name: '训练营-营期'
- },
- {
- name: '课程状态'
- }],
- mescroll:null,
- downOption: {
- auto:false//不要自动加载
- },
- upOption: {
- onScroll:false,
- use: true, // 是否启用上拉加载; 默认true
- page: {
- num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- size: 10 // 每页数据的数量,默认10
- },
- noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
- textNoMore:"已经到底了",
- empty: {
- icon:'/static/images/empty.png',
- tip: '暂无数据'
- }
- },
- dataList: []
- }
- },
- mounted() {
- const windowHeight = uni.getSystemInfoSync().windowHeight
- this.contentH = `calc(${windowHeight}px - 132px - 56px)`
- },
- methods: {
- handleNav(type) {
- this.activeTab = type
- },
- clickSearchbar(type) {
- this.searchbarNav = type == this.searchbarNav ? 'colse' : type
- },
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
- /*下拉刷新的回调 */
- downCallback(mescroll) {
- mescroll.resetUpScroll()
- },
- upCallback(page) {
- // //联网加载数据
- // var that = this;
- // var data={
- // customerName:this.searchKey,
- // pageNum: page.num,
- // pageSize: page.size
- // };
- // uni.showLoading({
- // title:"加载中..."
- // })
- // getMyCustomerList(data).then(res => {
- // uni.hideLoading()
- // if(res.code==200){
- // //设置列表数据
- // if (page.num == 1) {
- // that.dataList = res.data.list;
-
- // } else {
- // that.dataList = that.dataList.concat(res.data.list);
-
- // }
- // that.mescroll.endBySize(res.data.list.length, res.data.total);
-
- // }else{
- // uni.showToast({
- // icon:'none',
- // title: "请求失败",
- // });
- // that.dataList = null;
- // that.mescroll.endErr();
- // }
- // });
- },
- }
- }
- </script>
- <style lang="scss">
- .container {
- font-family: PingFang SC, PingFang SC;
- font-weight: 400;
- font-size: 14px;
- color: #222;
- }
- .headbox {
- background-color: #fff;
- }
- .headnav {
- padding: 15px 12px;
- margin: 0 -10px -10px 0;
- box-sizing: border-box;
- image {
- height: 60px;
- width: 50px;
- position: absolute;
- z-index: 0;
- bottom: 0;
- right: 0;
- display: none;
- }
- &-item {
- flex: 1;
- font-size: 16px;
- padding: 10px;
- border-radius: 10px;
- background: #f5f5f5;
- margin: 0 10px 10px 0;
- position: relative;
- z-index: 1;
- overflow: hidden;
- color: #555;
- }
- &-active {
- background-color: rgb(231, 241, 255) !important;
- .headnav-num {
- color: #1677ff !important;
- }
- image {
- display: block !important;
- }
- }
- &-num {
- font-family: DIN, DIN;
- font-weight: bold;
- font-size: 25px;
- margin: 5px 0;
- }
- }
- .searchbar {
- flex: 1;
- padding-bottom: 10px;
- .arrow-down {
- margin-left: 5px;
- }
- &-active {
- color: #1677ff !important;
- .arrow-down {
- transform: rotate(180deg);
- }
- }
- }
- .coursebox {
- position: relative;
- overflow-y: auto;
- box-sizing: border-box;
- }
- .courselist {
- padding: 12px;
- box-sizing: border-box;
-
- }
- </style>
|