trainingCamp-record.html 12 KB

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