trainingCamp-ranking.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  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" style="padding:0;">
  18. <div id="app">
  19. <van-nav-bar class="camp_title f16" title="特训营排行" @click-left="goback" v-if="toptitleisshow" left-arrow v-cloak>
  20. <template #left>
  21. <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
  22. </template>
  23. </van-nav-bar>
  24. <van-pull-refresh v-model="refreshing" @refresh="onRefresh" v-cloak :class="teamList.length === 0 ? 'isnodata':''">
  25. <van-tabs class="ranking recordtabs" v-model="active" v-cloak @click="checktabs">
  26. <van-tab title="团队排行">
  27. <van-list v-model="loading" finished-text="没有更多数据了" :finished="finished0" @load="onLoad" :immediate-check="false">
  28. <div class="title df pr16 pl16 c999 f12">
  29. <div class="ranking">排名</div>
  30. <div class="count">参与总数</div>
  31. </div>
  32. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  33. <div class="rankingpanel" v-if="teamList.length !== 0">
  34. <div class="panelitem df cm" v-for="(item,index) in teamList" :key="index">
  35. <div class="rank rel">
  36. <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">
  37. </div>
  38. <div class="teaminfo flex1">
  39. <div class="teamname c333 f14">{{item.TeamName}}</div>
  40. <div class="oinfo c999"><span>{{item.TeamStartDate}} - {{item.TeamEndDate}}</span><span>{{item.MemberCount}}人</span><span></span></div>
  41. </div>
  42. <div class="usercount f16 b">{{item.TeamActMerNum}}户</div>
  43. </div>
  44. </div>
  45. </van-list>
  46. </van-tab>
  47. <van-tab title="个人排行">
  48. <van-list v-model="loading" finished-text="没有更多数据了" :finished="finished1" @load="onLoad" :immediate-check="false">
  49. <div class="title df pr16 pl16 c999 f12">
  50. <div class="ranking">排名</div>
  51. <div class="count">参与总数</div>
  52. </div>
  53. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata2"></van-empty>
  54. <div class="rankingpanel" v-if="userList.length !== 0">
  55. <div class="panelitem df cm" v-for="(item,index) in userList" :key="index">
  56. <div class="rank rel">
  57. <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">
  58. </div>
  59. <div class="teaminfo flex1 df">
  60. <div class="userimg"><img :src="item.MakerHeadPhoto" alt=""></div>
  61. <div class="userinfo">
  62. <div class="teamname c333 f14"> <span class="c333 f12 mr8">{{item.MakerName}}</span><span class="c999 f12">{{item.TeamName}}</span></div>
  63. <div class="oinfo c999"><span>{{item.TeamStartDate}} - {{item.TeamEndDate}}</span></div>
  64. </div>
  65. </div>
  66. <div class="usercount f16 b">{{item.TeamActMerNum}}户</div>
  67. </div>
  68. </div>
  69. </van-list>
  70. </van-tab>
  71. </van-tabs>
  72. </van-pull-refresh>
  73. </div>
  74. <script src="./static/js/klm-vv.min.js"></script>
  75. <script src="./static/js/klm-axios-config.js"></script>
  76. <script>
  77. // 在 #app 标签下渲染一个按钮组件
  78. let app = new Vue({
  79. el: '#app',
  80. data() {
  81. return {
  82. isnodata:false,
  83. isnodata2:false,
  84. toptitleisshow:true,
  85. //- 滚动加载
  86. loading: false,
  87. finished0: false,
  88. finished1: false,
  89. pageinfo0:{
  90. PageSize:10,
  91. PageNum:1,
  92. },
  93. pageinfo1:{
  94. PageSize:10,
  95. PageNum:1,
  96. },
  97. //- 刷新
  98. refreshing: false,
  99. active:0,
  100. teamList:[
  101. ],
  102. userList:[
  103. ],
  104. }
  105. },
  106. created() {
  107. this.getteamrankinglist();
  108. },
  109. methods: {
  110. checktabs(active){
  111. this.userList = [];
  112. this.teamList = [];
  113. if(active === 1) {
  114. this.getpersonrankinglist();
  115. }else {
  116. this.getteamrankinglist();
  117. }
  118. },
  119. goback(){
  120. PublicLib.GoBack({Level:1});
  121. },
  122. onLoad() {
  123. if(this.active === 0) {
  124. if (this.refreshing) {
  125. this.teamList = [];
  126. this.refreshing = false;
  127. this.pageinfo0.PageNum = 0;
  128. }
  129. this.pageinfo0.PageNum++;
  130. this.getteamrankinglist();
  131. } else {
  132. if (this.refreshing) {
  133. this.userList = [];
  134. this.refreshing = false;
  135. this.pageinfo0.PageNum = 0;
  136. }
  137. this.pageinfo0.PageNum++;
  138. this.getpersonrankinglist();
  139. }
  140. },
  141. onRefresh() {
  142. // 清空列表数据
  143. this.finished0 = false;
  144. this.finished1 = false;
  145. // 重新加载数据
  146. // 将 loading 设置为 true,表示处于加载状态
  147. this.loading = true;
  148. this.onLoad();
  149. },
  150. //- 团队排行榜
  151. async getteamrankinglist(){
  152. PublicLib.ShowLoading({Message:''});
  153. const res = await getRequest('/api/v1/teampersondaytop/teamlist',JSON.stringify({...this.pageinfo0}));
  154. if(res.status !== '1') return tips('获取团队排行失败,请重试!');
  155. PublicLib.HideLoading();
  156. if(res.data.length < this.pageinfo0.PageSize) {
  157. this.finished0 = true;
  158. };
  159. this.teamList.push(...res.data);
  160. this.teamList = [
  161. {
  162. TeamStartDate: "2021-12-21", //队伍开始时间
  163. TeamEndDate: "2022-01-02", //队伍结束时间
  164. TeamActMerNum: "65", //队伍直营激活商户数
  165. MemberCount: "15", //队伍人数
  166. TeamName: "实干兴邦队", //队伍名称
  167. },
  168. {
  169. TeamStartDate: "2021-12-14", //队伍开始时间
  170. TeamEndDate: "2021-12-21", //队伍结束时间
  171. TeamActMerNum: "48", //队伍直营激活商户数
  172. MemberCount: "12", //队伍人数
  173. TeamName: "飞鹰战队", //队伍名称
  174. },
  175. {
  176. TeamStartDate: "2021-12-08", //队伍开始时间
  177. TeamEndDate: "2021-12-17", //队伍结束时间
  178. TeamActMerNum: "39", //队伍直营激活商户数
  179. MemberCount: "8", //队伍人数
  180. TeamName: "狼牙特战队", //队伍名称
  181. },
  182. {
  183. TeamStartDate: "2021-12-17", //队伍开始时间
  184. TeamEndDate: "2021-12-28", //队伍结束时间
  185. TeamActMerNum: "28", //队伍直营激活商户数
  186. MemberCount: "7", //队伍人数
  187. TeamName: "百亿军团队", //队伍名称
  188. },
  189. ];
  190. if(this.teamList.length === 0) {this.isnodata = true}else{this.isnodata = false};
  191. this.loading = false;
  192. },
  193. //- 个人排行榜
  194. async getpersonrankinglist(){
  195. PublicLib.ShowLoading({Message:''});
  196. const res = await getRequest('/api/v1/teampersondaytop/list',JSON.stringify({...this.pageinfo1}));
  197. if(res.status !== '1') return tips('获取个人排行失败,请重试!');
  198. PublicLib.HideLoading();
  199. if(res.data.length < this.pageinfo1.PageSize) {
  200. this.finished1 = true;
  201. };
  202. this.userList.push(...res.data);
  203. this.loading = false;
  204. this.userList = [
  205. {
  206. TeamStartDate: "2021-12-21", //队伍开始时间
  207. TeamEndDate: "2022-01-02", //队伍结束时间
  208. TeamActMerNum: "12", //队伍直营激活商户数
  209. TeamName: "惠*航", //队伍名称
  210. MakerHeadPhoto:'./static/images/user-img-color@3x.png'
  211. },
  212. {
  213. TeamStartDate: "2021-12-14", //队伍开始时间
  214. TeamEndDate: "2021-12-21", //队伍结束时间
  215. TeamActMerNum: "10", //队伍直营激活商户数
  216. TeamName: "张*源", //队伍名称
  217. MakerHeadPhoto:'./static/images/user-img-color@3x.png'
  218. },
  219. {
  220. TeamStartDate: "2021-12-08", //队伍开始时间
  221. TeamEndDate: "2021-12-17", //队伍结束时间
  222. TeamActMerNum: "9", //队伍直营激活商户数
  223. TeamName: "徐*", //队伍名称
  224. MakerHeadPhoto:'./static/images/user-img-color@3x.png'
  225. },
  226. {
  227. TeamStartDate: "2021-12-17", //队伍开始时间
  228. TeamEndDate: "2021-12-28", //队伍结束时间
  229. TeamActMerNum: "7", //队伍直营激活商户数
  230. TeamName: "李*雷", //队伍名称
  231. MakerHeadPhoto:'./static/images/user-img-color@3x.png'
  232. },
  233. {
  234. TeamStartDate: "2021-12-17", //队伍开始时间
  235. TeamEndDate: "2021-12-28", //队伍结束时间
  236. TeamActMerNum: "7", //队伍直营激活商户数
  237. TeamName: "谢*", //队伍名称
  238. MakerHeadPhoto:'./static/images/user-img-color@3x.png'
  239. },
  240. ];
  241. if(this.userList.length === 0) {this.isnodata2 = true}else{this.isnodata2 = false};
  242. }
  243. },
  244. });
  245. </script>
  246. </body>
  247. </html>