123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>首页-特训营-创业帮</title>
- <meta name="keywords" content="首页-特训营-创业帮">
- <meta name="description" content="首页-特训营-创业帮">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="首页-特训营-创业帮">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body class="train_record ovh">
- <div class="iphonetitle"></div>
- <div id="app">
- <van-nav-bar class="camp_title f16" title="特训营排行" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
- <template #left>
- <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
- </template>
- </van-nav-bar>
- <div class="ovh-x" ref="wrapper1">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" v-cloak :class="listisnodata ? 'isnodata':''" style="height:100%;">
- <van-tabs class="ranking recordtabs" v-model="active" v-cloak @click="checktabs">
- <van-tab title="团队排行">
- <van-list v-model="loading" finished-text="没有更多数据了" :finished="finished0" @load="onLoad" :immediate-check="false">
- <div class="title df pr16 pl16 c999 f12">
- <div class="ranking">排名</div>
- <div class="count">激活总数</div>
- </div>
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <div class="rankingpanel" v-if="teamList.length !== 0">
- <div class="panelitem df cm" v-for="(item,index) in teamList" :key="index">
- <div class="rank rel">
- <div class="num abs f14 c666" v-if="index > 2">{{index + 1}}</div><img src="./static/images/user-rank-1.png" alt="" v-if="index === 0"><img src="./static/images/user-rank-2.png" alt="" v-if="index === 1"><img src="./static/images/user-rank-3.png" alt="" v-if="index === 2">
- </div>
- <div class="teaminfo flex1">
- <div class="teamname c333 f14">{{item.TeamName}}</div>
- <div class="oinfo c999"><span>{{item.TeamStartDate}} - {{item.TeamEndDate}}</span><span>{{item.MemberCount}}人</span><span></span></div>
- </div>
- <div class="usercount f16 b">{{item.TeamActMerNum}}户</div>
- </div>
- </div>
- </van-list>
- </van-tab>
- <van-tab title="个人排行">
- <van-list v-model="loading" finished-text="没有更多数据了" :finished="finished1" @load="onLoad" :immediate-check="false">
- <div class="title df pr16 pl16 c999 f12">
- <div class="ranking">排名</div>
- <div class="count">激活总数</div>
- </div>
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <div class="rankingpanel" v-if="userList.length !== 0">
- <div class="panelitem df cm" v-for="(item,index) in userList" :key="index">
- <div class="rank rel">
- <div class="num abs f14 c666" v-if="index > 2">{{index + 1}}</div><img src="./static/images/user-rank-1.png" alt="" v-if="index === 0"><img src="./static/images/user-rank-2.png" alt="" v-if="index === 1"><img src="./static/images/user-rank-3.png" alt="" v-if="index === 2">
- </div>
- <div class="teaminfo flex1 df">
- <div class="userimg"><img :src="item.MakerHeadPhoto" alt=""></div>
- <div class="userinfo">
- <div class="teamname c333 f14"> <span class="c333 f12 mr8">{{item.MakerName}}</span><span class="c999 f12">{{item.TeamName}}</span></div>
- <div class="oinfo c999"><span>{{item.TeamStartDate}} - {{item.TeamEndDate}}</span></div>
- </div>
- </div>
- <div class="usercount f16 b">{{item.TeamActMerNum}}户</div>
- </div>
- </div>
- </van-list>
- </van-tab>
- </van-tabs>
- </van-pull-refresh>
- </div>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- isnodata:false,
- toptitleisshow:true,
- //- 滚动加载
- loading: false,
- finished0: false,
- finished1: false,
- pageinfo0:{
- PageSize:10,
- PageNum:1,
- },
- pageinfo1:{
- PageSize:10,
- PageNum:1,
- },
- //- 刷新
- refreshing: false,
- active:0,
- teamList:[
- ],
- userList:[
- ],
- }
- },
- created() {
- this.getteamrankinglist();
- },
- mounted(){
- this.$nextTick(() => {
- this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 90}px`;
- });
- },
- computed:{
- listisnodata(){
- if(this.active === 0 && this.teamList.length === 0) {
- return true;
- }else if(this.active === 1 && this.userList.length === 0){
- return true;
- }else{
- return false;
- };
- }
- },
- methods: {
- checktabs(active){
- this.userList = [];
- this.teamList = [];
- if(active === 1) {
- this.getpersonrankinglist();
- }else {
- this.getteamrankinglist();
- };
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- onLoad() {
- if(this.active === 0) {
- if (this.refreshing) {
- this.teamList = [];
- this.refreshing = false;
- this.pageinfo0.PageNum = 0;
- };
- this.pageinfo0.PageNum++;
- this.getteamrankinglist();
- } else {
- if (this.refreshing) {
- this.userList = [];
- this.refreshing = false;
- this.pageinfo0.PageNum = 0;
- };
- this.pageinfo0.PageNum++;
- this.getpersonrankinglist();
- }
- },
- onRefresh() {
- // 清空列表数据
- this.finished0 = false;
- this.finished1 = false;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onLoad();
- },
- //- 团队排行榜
- async getteamrankinglist(){
- PublicLib.ShowLoading({Message:''});
- const res = await getRequest('api/v1/teampersondaytop/teamlist',JSON.stringify({...this.pageinfo0}));
- if(res.status !== '1') return tips('获取团队排行失败,请重试!');
- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo0.PageSize) {
- this.finished0 = true;
- };
- this.teamList.push(...res.data);
- if(this.teamList.length === 0) {this.isnodata = true}else{this.isnodata = false};
- this.loading = false;
- },
- //- 个人排行榜
- async getpersonrankinglist(){
- PublicLib.ShowLoading({Message:''});
- const res = await getRequest('api/v1/teampersondaytop/list',JSON.stringify({...this.pageinfo1}));
- if(res.status !== '1') return tips('获取个人排行失败,请重试!');
- PublicLib.HideLoading();
- if(res.data.length < this.pageinfo1.PageSize) {
- this.finished1 = true;
- };
- this.userList.push(...res.data);
- if(this.userList.length === 0) {this.isnodata = true}else{this.isnodata = false};
- this.loading = false;
- }
- },
- });
- </script>
- </body>
- </html>
|