trainingCamp-record.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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 pb0 ovh">
  18. <div id="app">
  19. <van-nav-bar class="user_rank_explan_title" title="参团记录" @click-left="goback" v-if="toptitleisshow" @click-right="rules" left-arrow v-cloak>
  20. <template #left> <img src="./static/images/left.png" alt=""></template>
  21. <template #right>
  22. <van-icon name="bar-chart-o" size="20" color="#666666"></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 style="height:100%;">
  27. <van-tabs class="recordtabs" v-model="active" @click="checktab">
  28. <van-tab title="组队记录">
  29. <van-list v-model="loading" :finished="finished0" @load="onLoad" :immediate-check="false" :class="teamInfo.length === 0 ? 'isnodata':''">
  30. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
  31. <div class="camp_enrollinfopanel rel recordtop" v-for="item in teamInfo" :key="item.Id" :class="failfn(item.Status)? 'greybg':''">
  32. <div class="titlepanel df">
  33. <div class="text c333 f18 b" :class="failfn(item.Status)? 'fail':''">{{item.TeamName}} <img class="iconnotes" src="./static/images/icon-notes.png" alt="" v-if="item.Status === 1 || item.Status === 4">
  34. <div class="slogan f12 c999 n">{{item.WatchWord}}</div>
  35. </div><span class="sign recordend tr" v-if="item.Status !== 0">组队待审核
  36. <div class="begin f12 recordendcolor">离开始还剩:{{item.OverDays}}天</div></span><span class="sign recordend tr" v-if="item.Status === 1">组队审核通过(报名中)
  37. <div class="begin f12 recordendcolor">离开始还剩:{{item.OverDays}}天</div></span><span class="end recordend tr doing" v-if="item.Status === 2">活动进行中
  38. <div style="opacity: 0;">这个div是为了布局</div></span><span class="end recordend tr" v-if="item.Status === 3">活动已结束
  39. <div style="opacity: 0;">这个div是为了布局</div></span><span class="end recordend tr greybg" v-if="item.Status === 4">组队审核失败
  40. <div style="opacity: 0;">这个div是为了布局</div></span><span class="end recordend tr greybg" v-if="item.Status === 5">组队失败(人数未达标)
  41. <div style="opacity: 0;">这个div是为了布局</div></span>
  42. </div>
  43. <div class="mainpanel f12 c666 rel">
  44. <div class="info">队长:{{item.TeamLeader}}</div>
  45. <div class="info">人数:{{item.MemberCount}}人 </div>
  46. <div class="info">时间:{{item.EffectStartDate}}~{{item.EffectEndDate}}</div>
  47. <div class="info">地点:{{item.Areas}}
  48. <button class="f14 cfff" v-if="item.Status !== 0" @click="tipexamine(item.Id)">提醒审核</button>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="bottomline tc c999 f12 pr16 pl16 rel" v-if="tipsisshow0 &amp;&amp; !isnodata">
  53. <div class="line abs"></div><span>我是有底线的</span>
  54. </div>
  55. </van-list>
  56. </van-tab>
  57. <van-tab title="报名记录">
  58. <van-list v-model="loading" :finished="finished1" @load="onLoad" :immediate-check="false" :class="signList.length === 0 ? 'isnodata':''">
  59. <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata2"></van-empty>
  60. <div class="camp_enrollinfopanel rel recordtop" v-for="item in signList" :key="item.Id" :class="failfn(item.Status)? 'greybg':''">
  61. <div class="titlepanel df">
  62. <div class="text c333 f18 b" :class="failfn(item.Status)? 'fail':''">{{item.TeamName}} <img class="iconnotes" src="./static/images/icon-notes.png" alt="" v-if="item.Status === 1 || item.Status === 2 || item.Status === 4">
  63. <div class="slogan f12 c999 n">{{item.WatchWord}}</div>
  64. </div><span class="sign recordend tr" v-if="item.Status !== 0">报名待审核
  65. <div class="begin f12 recordendcolor">离开始还剩:{{item.OverDays}}天</div></span><span class="sign recordend tr" v-if="item.Status === 1">报名审核通过
  66. <div class="begin f12 recordendcolor">离开始还剩:{{item.OverDays}}天</div></span><span class="end recordend tr doing" v-if="item.Status === 2">活动进行中
  67. <div style="opacity: 0;">这个div是为了布局</div></span><span class="end recordend tr" v-if="item.Status === 3">活动已结束
  68. <div style="opacity: 0;">这个div是为了布局</div></span><span class="end tr greybg" v-if="item.Status === 4">报名失败
  69. <div style="opacity: 0;">这个div是为了布局</div></span><span class="end tr greybg" v-if="item.Status === 5">报名已取消
  70. <div style="opacity: 0;">这个div是为了布局</div></span>
  71. </div>
  72. <div class="mainpanel f12 c666 rel">
  73. <div class="info">队长:{{item.TeamLeader}}</div>
  74. <div class="info">人数:{{item.MemberCount}}人</div>
  75. <div class="info">时间:2020-01-10~2020-02-02</div>
  76. <div class="info">地点:{{item.Areas}}
  77. <button class="f14 c999 cancel signbtn" v-if="item.Status !== 0" @click="cancelsignup(item.Id)">取消报名</button><br>
  78. <button class="f14 cfff signbtn" v-if="item.Status !== 0" @click="tipsignup(item.Id)">提醒审核</button>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="bottomline tc c999 f12 pr16 pl16 rel" v-if="tipsisshow1 &amp;&amp; !isnodata2">
  83. <div class="line abs"></div><span>我是有底线的</span>
  84. </div>
  85. </van-list>
  86. </van-tab>
  87. </van-tabs>
  88. </van-pull-refresh>
  89. </div>
  90. </div>
  91. <script src="./static/js/klm-vv.min.js"></script>
  92. <script src="./static/js/appfunc.min.js"></script>
  93. <script src="./static/js/klm-axios-config.js"></script>
  94. <script src="./static/js/publicfn.js"></script>
  95. <script>
  96. function OnStart(){
  97. PublicLib.SetStatusBarStyle({type:'default', isShow:1});
  98. };
  99. PublicLib.SetStatusBarBgColor({bgcolor:'ffffff'});
  100. // 在 #app 标签下渲染一个按钮组件
  101. let app = new Vue({
  102. el: '#app',
  103. data() {
  104. return {
  105. isnodata:false,
  106. isnodata2:false,
  107. toptitleisshow:true,
  108. //- 滚动加载
  109. loading: false,
  110. finished0: false,
  111. finished1: false,
  112. //- 刷新
  113. refreshing: false,
  114. //- 是否显示完成
  115. tipsisshow0:false,
  116. tipsisshow1:false,
  117. active: 0,
  118. teamInfo:[
  119. ],
  120. signList:[
  121. ],
  122. pageinfo0:{
  123. PageSize:10,
  124. PageNum:1
  125. },
  126. pageinfo1:{
  127. PageSize:10,
  128. PageNum:1
  129. },
  130. }
  131. },
  132. created() {
  133. this.getcreatedteamrecord();
  134. },
  135. mounted(){
  136. this.$nextTick(() => {
  137. this.$refs.wrapper1.style.height = `${document.documentElement.clientHeight - 98}px`;
  138. });
  139. },
  140. methods: {
  141. goback(){
  142. PublicLib.GoBack({Level:1});
  143. },
  144. failfn(status){
  145. if(status=== 4 || status === 5) {
  146. return true;
  147. };
  148. return false;
  149. },
  150. onLoad() {
  151. if(this.active === 0) {
  152. if (this.refreshing) {
  153. this.teamInfo = [];
  154. this.refreshing = false;
  155. this.pageinfo0.PageNum = 0;
  156. };
  157. this.pageinfo0.PageNum++;
  158. this.getcreatedteamrecord();
  159. } else {
  160. if (this.refreshing) {
  161. this.signList = [];
  162. this.refreshing = false;
  163. this.pageinfo1.PageNum = 0;
  164. };
  165. this.pageinfo1.PageNum++;
  166. this.getsignuprecord();
  167. }
  168. },
  169. onRefresh() {
  170. // 清空列表数据
  171. this.finished0 = false;
  172. this.finished1 = false;
  173. //- 隐藏底线完
  174. this.tipsisshow0=false,
  175. this.tipsisshow1=false,
  176. // 重新加载数据
  177. // 将 loading 设置为 true,表示处于加载状态
  178. this.loading = true;
  179. this.onLoad();
  180. },
  181. checktab(index){
  182. if(index === 1) {
  183. this.signList = [];
  184. this.getsignuprecord();
  185. }else{
  186. this.teamInfo = [];
  187. this.getcreatedteamrecord();
  188. };
  189. },
  190. async getsignuprecord(){
  191. PublicLib.ShowLoading({Message:''});
  192. const UserId = PublicLib.getCookieInfo('userId');
  193. const res = await getRequest('api/v1/teamofferapply/signuplist',JSON.stringify({UserId,...this.pageinfo1}));
  194. if(res.status !== '1') return tips('获取报名记录失败,请重试!');
  195. PublicLib.HideLoading();
  196. if(res.data.length < this.pageinfo0.PageSize) {
  197. this.finished1 = true;
  198. this.tipsisshow1 = true;
  199. };
  200. this.signList.push(...res.data);
  201. console.log(this.signList)
  202. this.loading = false;
  203. if(this.signList.length === 0) {this.isnodata2 = true}else{this.isnodata2 = false};
  204. },
  205. async getcreatedteamrecord(){
  206. PublicLib.ShowLoading({Message:''});
  207. const UserId = PublicLib.getCookieInfo('userId');
  208. const res = await getRequest('api/v1/teamapply/mylist',JSON.stringify({UserId,...this.pageinfo0}));
  209. if(res.status !== '1') return tips('获取组队记录失败,请重试!');
  210. PublicLib.HideLoading();
  211. if(res.data.length < this.pageinfo1.PageSize) {
  212. this.finished0 = true;
  213. this.tipsisshow0 = true;
  214. };
  215. this.teamInfo.push(...res.data);
  216. this.loading = false;
  217. if(this.teamInfo.length === 0) {this.isnodata = true}else{this.isnodata = false};
  218. },
  219. //- 提醒审核
  220. tipexamine:undebounce(async function(Id){
  221. const res = await postRequest('api/v1/teamapply/ring',JSON.stringify({Id}));
  222. if(res.status !== '1') return tips('提醒审核失败,请重试!');
  223. tips('提醒审核成功!');
  224. }),
  225. //- async tipexamine(Id){
  226. //- const res = await postRequest('api/v1/teamapply/ring',JSON.stringify({Id}));
  227. //- if(res.status !== '1') return tips('提醒审核失败,请重试!');
  228. //- tips('提醒审核成功!');
  229. //- },
  230. //- 取消报名
  231. async cancelsignup(Id){
  232. const res = await postRequest('api/v1/teamofferapply/cancelsignup',JSON.stringify({Id}));
  233. if(res.status !== '1') return tips('取消报名失败,请重试!');
  234. tips('报名取消成功!');
  235. this.getsignuprecord();
  236. },
  237. //- 取消报名
  238. tipsignup:undebounce(async function(Id){
  239. const res = await postRequest('api/v1/teamofferapply/ring',JSON.stringify({Id}));
  240. if(res.status !== '1') return tips('提醒审核失败,请重试!');
  241. tips('提醒审核成功!');
  242. }),
  243. //- 营训规则
  244. rules(){
  245. PublicLib.Goto({Url:'trainingCamp-rules'});
  246. }
  247. },
  248. });
  249. </script>
  250. </body>
  251. </html>