trainingCamp-ranking.html 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>首页-特训营-创业帮</title>
  6. <meta name="keywords" content="首页-特训营-创业帮">
  7. <meta name="description" content="首页-特训营-创业帮">
  8. <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  11. <meta content="telephone=no" name="format-detection">
  12. <meta content="email=no" name="format-detection">
  13. <meta name="apple-mobile-web-app-title" content="首页-特训营-创业帮">
  14. <meta http-equiv="Cache-Control" content="no-siteapp">
  15. <link rel="stylesheet" href="./static/css/main.css">
  16. </head>
  17. <body class="train_record ovh">
  18. <div class="iphonetitle"></div>
  19. <div id="app">
  20. <van-nav-bar class="camp_title f16" title="特训营排行" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
  21. <template #left>
  22. <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
  23. </template>
  24. </van-nav-bar>
  25. <div class="ovh-x" ref="wrapper1">
  26. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" v-cloak :class="listisnodata ? 'isnodata':''" style="height:100%;">
  27. <van-tabs class="ranking recordtabs" v-model="active" v-cloak @click="checktabs">
  28. <van-tab title="团队排行">
  29. <van-list v-model="loading" finished-text="没有更多数据了" :finished="finished0" @load="onLoad" :immediate-check="false">
  30. <div class="title df pr16 pl16 c999 f12">
  31. <div class="ranking">排名</div>
  32. <div class="count">激活总数</div>
  33. </div>
  34. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  35. <div class="rankingpanel" v-if="teamList.length !== 0">
  36. <div class="panelitem df cm" v-for="(item,index) in teamList" :key="index">
  37. <div class="rank rel">
  38. <div class="num abs f14 c666" v-if="index &gt; 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">
  39. </div>
  40. <div class="teaminfo flex1">
  41. <div class="teamname c333 f14">{{item.TeamName}}</div>
  42. <div class="oinfo c999"><span>{{item.TeamStartDate}} - {{item.TeamEndDate}}</span><span>{{item.MemberCount}}人</span><span></span></div>
  43. </div>
  44. <div class="usercount f16 b">{{item.TeamActMerNum}}户</div>
  45. </div>
  46. </div>
  47. </van-list>
  48. </van-tab>
  49. <van-tab title="个人排行">
  50. <van-list v-model="loading" finished-text="没有更多数据了" :finished="finished1" @load="onLoad" :immediate-check="false">
  51. <div class="title df pr16 pl16 c999 f12">
  52. <div class="ranking">排名</div>
  53. <div class="count">激活总数</div>
  54. </div>
  55. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  56. <div class="rankingpanel" v-if="userList.length !== 0">
  57. <div class="panelitem df cm" v-for="(item,index) in userList" :key="index">
  58. <div class="rank rel">
  59. <div class="num abs f14 c666" v-if="index &gt; 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">
  60. </div>
  61. <div class="teaminfo flex1 df">
  62. <div class="userimg"><img :src="item.MakerHeadPhoto" alt=""></div>
  63. <div class="userinfo">
  64. <div class="teamname c333 f14"> <span class="c333 f12 mr8">{{item.MakerName}}</span><span class="c999 f12">{{item.TeamName}}</span></div>
  65. <div class="oinfo c999"><span>{{item.TeamStartDate}} - {{item.TeamEndDate}}</span></div>
  66. </div>
  67. </div>
  68. <div class="usercount f16 b">{{item.TeamActMerNum}}户</div>
  69. </div>
  70. </div>
  71. </van-list>
  72. </van-tab>
  73. </van-tabs>
  74. </van-pull-refresh>
  75. </div>
  76. </div>
  77. <script src="./static/js/klm-vv.min.js"></script>
  78. <script src="./static/js/appfunc.min.js"></script>
  79. <script src="./static/js/klm-axios-config.js"></script>
  80. <script src="./static/js/publicfn.js"></script>
  81. <script>
  82. // 在 #app 标签下渲染一个按钮组件
  83. let app = new Vue({
  84. el: '#app',
  85. data() {
  86. return {
  87. isnodata:false,
  88. toptitleisshow:true,
  89. //- 滚动加载
  90. loading: false,
  91. finished0: false,
  92. finished1: false,
  93. pageinfo0:{
  94. PageSize:10,
  95. PageNum:1,
  96. },
  97. pageinfo1:{
  98. PageSize:10,
  99. PageNum:1,
  100. },
  101. //- 刷新
  102. refreshing: false,
  103. active:0,
  104. teamList:[
  105. ],
  106. userList:[
  107. ],
  108. }
  109. },
  110. created() {
  111. this.getteamrankinglist();
  112. },
  113. mounted(){
  114. this.$nextTick(() => {
  115. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 90}px`;
  116. });
  117. },
  118. computed:{
  119. listisnodata(){
  120. if(this.active === 0 && this.teamList.length === 0) {
  121. return true;
  122. }else if(this.active === 1 && this.userList.length === 0){
  123. return true;
  124. }else{
  125. return false;
  126. };
  127. }
  128. },
  129. methods: {
  130. checktabs(active){
  131. this.userList = [];
  132. this.teamList = [];
  133. if(active === 1) {
  134. this.getpersonrankinglist();
  135. }else {
  136. this.getteamrankinglist();
  137. };
  138. },
  139. goback(){
  140. PublicLib.GoBack({Level:1});
  141. },
  142. onLoad() {
  143. if(this.active === 0) {
  144. if (this.refreshing) {
  145. this.teamList = [];
  146. this.refreshing = false;
  147. this.pageinfo0.PageNum = 0;
  148. };
  149. this.pageinfo0.PageNum++;
  150. this.getteamrankinglist();
  151. } else {
  152. if (this.refreshing) {
  153. this.userList = [];
  154. this.refreshing = false;
  155. this.pageinfo0.PageNum = 0;
  156. };
  157. this.pageinfo0.PageNum++;
  158. this.getpersonrankinglist();
  159. }
  160. },
  161. onRefresh() {
  162. // 清空列表数据
  163. this.finished0 = false;
  164. this.finished1 = false;
  165. // 重新加载数据
  166. // 将 loading 设置为 true,表示处于加载状态
  167. this.loading = true;
  168. this.onLoad();
  169. },
  170. //- 团队排行榜
  171. async getteamrankinglist(){
  172. PublicLib.ShowLoading({Message:''});
  173. const res = await getRequest('api/v1/teampersondaytop/teamlist',JSON.stringify({...this.pageinfo0}));
  174. if(res.status !== '1') return tips('获取团队排行失败,请重试!');
  175. PublicLib.HideLoading();
  176. if(res.data.length < this.pageinfo0.PageSize) {
  177. this.finished0 = true;
  178. };
  179. this.teamList.push(...res.data);
  180. if(this.teamList.length === 0) {this.isnodata = true}else{this.isnodata = false};
  181. this.loading = false;
  182. },
  183. //- 个人排行榜
  184. async getpersonrankinglist(){
  185. PublicLib.ShowLoading({Message:''});
  186. const res = await getRequest('api/v1/teampersondaytop/list',JSON.stringify({...this.pageinfo1}));
  187. if(res.status !== '1') return tips('获取个人排行失败,请重试!');
  188. PublicLib.HideLoading();
  189. if(res.data.length < this.pageinfo1.PageSize) {
  190. this.finished1 = true;
  191. };
  192. this.userList.push(...res.data);
  193. if(this.userList.length === 0) {this.isnodata = true}else{this.isnodata = false};
  194. this.loading = false;
  195. }
  196. },
  197. });
  198. </script>
  199. </body>
  200. </html>