history.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  1. <!-- +---------------------------------------------------------------------- -->
  2. <!-- | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -->
  3. <!-- +---------------------------------------------------------------------- -->
  4. <!-- | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -->
  5. <!-- +---------------------------------------------------------------------- -->
  6. <!-- | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -->
  7. <!-- +---------------------------------------------------------------------- -->
  8. <!-- | Author: CRMEB Team <admin@crmeb.com> -->
  9. <!-- +---------------------------------------------------------------------- -->
  10. {extend name="public/container"}
  11. {block name="title"}学籍档案{/block}
  12. {block name="head"}
  13. <style>
  14. body {
  15. background: #F5F5F5;
  16. }
  17. .price-wrap {
  18. display: flex;
  19. align-items: center;
  20. font-size: .24rem;
  21. line-height: .33rem;
  22. color: #FF6B00;
  23. }
  24. .price-wrap .price {
  25. flex: 1;
  26. font-weight: bold;
  27. font-size: .24rem;
  28. line-height: .45rem;
  29. color: #FF6B00;
  30. }
  31. .price-wrap .price span {
  32. font-size: .32rem;
  33. }
  34. .activity-list li > div > div > div:last-child {
  35. font-weight: normal;
  36. }
  37. .honor-list-page li {
  38. padding-right: .3rem;
  39. padding-left: .3rem;
  40. border-radius: .12rem;
  41. background-color: #fff;
  42. }
  43. .honor-list-page li ~ li {
  44. margin-top: .2rem;
  45. }
  46. .honor-list-page li .name {
  47. overflow: hidden;
  48. white-space: nowrap;
  49. text-overflow: ellipsis;
  50. padding: .3rem 0 0.3rem 0 !important;
  51. font-size: .3rem;
  52. color: #282828;
  53. display: block;
  54. }
  55. .honor-list-page li .name img {
  56. width: .25rem;
  57. margin-right: .05rem;
  58. pointer-events: none;
  59. -webkit-touch-callout: none;
  60. object-fit:contain;
  61. height: auto;
  62. display: inline;
  63. }
  64. .honor-list-page li .desc {
  65. display: -webkit-box;
  66. display: flex;
  67. -webkit-box-pack: justify;
  68. justify-content: space-between;
  69. -webkit-box-align: center;
  70. align-items: center;
  71. height: 1.48rem;
  72. border-top: 1px dashed #e3e3e3 !important;
  73. font-size: .3rem;
  74. color: #9e9e9e;
  75. }
  76. .honor-list-page li .attr {
  77. display: -webkit-box;
  78. display: flex;
  79. margin-left: -.3rem;
  80. font-size: .24rem;
  81. text-align: center;
  82. color: #999;
  83. }
  84. .honor-list-page li .cell {
  85. position: relative;
  86. padding-right: .35rem;
  87. padding-left: .35rem;
  88. }
  89. .honor-list-page li .cell::before {
  90. content: "";
  91. position: absolute;
  92. top: 50%;
  93. left: 0;
  94. height: .4rem;
  95. border-left: 1px solid rgba(0, 0, 0, .05);
  96. -webkit-transform: translateY(-50%);
  97. transform: translateY(-50%);
  98. }
  99. .honor-list-page li .cell:first-child::before {
  100. display: none;
  101. }
  102. .honor-list-page li a {
  103. height: .5rem;
  104. padding-right: .27rem;
  105. padding-left: .27rem;
  106. border: 1px solid #191C6E;
  107. border-radius: .25rem;
  108. font-size: .24rem;
  109. line-height: .5rem;
  110. text-align: center;
  111. color: #191C6E;
  112. }
  113. </style>
  114. {/block}
  115. {block name="content"}
  116. <div class="activity-list" v-cloak id="app">
  117. <div class="tab">
  118. <div v-for="(item, index) in navs" :key="index" :class="{ on: navActive === index }" @click="navActives(index)">{{ item }}</div>
  119. </div>
  120. <div class="content" style="margin-top:1rem !important;">
  121. <ul v-if="navActive == 0" class="credit-list" style="margin-top: 0 !important;">
  122. <!-- 学习记录 -->
  123. <li v-for="(item, index) in activityList" :key="index" @click="specialDetails(item.id)">
  124. <div>
  125. <div>
  126. <img :src="item.image" alt="">
  127. </div>
  128. <div>
  129. <div>{{ item.title }}</div>
  130. <div>
  131. <span class="labelItem">{{ item.subject_name }}</span>
  132. <!-- <span class="creditinfo">3分</span> -->
  133. </div>
  134. <div class="price-wrap">
  135. <div class="price">¥<span>{{ item.money }}</span></div>
  136. <div>共{{ item.count }}节</div>
  137. </div>
  138. </div>
  139. </div>
  140. </li>
  141. </ul>
  142. <ul v-if="navActive == 1">
  143. <!-- 我的学分 -->
  144. <div class="credit-title">
  145. <div class="title">我的学分</div>
  146. <div class="credit">{{xuefencount}}</div>
  147. </div>
  148. <div class="credit-list">
  149. <br />
  150. <div class="public_title">
  151. <div class="name">
  152. <div class="title-circular"></div>
  153. <div class="title-text">学分明细</div>
  154. </div>
  155. </div>
  156. <div class="content">
  157. <ul v-if="activityList.length">
  158. <li v-for="(item, index) in activityList" :key="index" @click="specialDetails(item.id)">
  159. <div>
  160. <div>
  161. <img :src="item.image" alt="">
  162. </div>
  163. <div>
  164. <div>{{ item.title }}</div>
  165. <div>
  166. <span class="labelItem">{{ item.subject_name }}</span>
  167. <span class="creditinfo">{{ item.xuefen }}分</span>
  168. </div>
  169. <div class="price-wrap">
  170. <div class="price">¥<span>{{ item.money }}</span></div>
  171. <div>共{{ item.count }}节</div>
  172. </div>
  173. </div>
  174. </div>
  175. </li>
  176. </ul>
  177. </div>
  178. </div>
  179. </ul>
  180. <ul v-if="navActive == 2">
  181. <!-- 学习时间 -->
  182. <div class="credit-title">
  183. <div class="title">学习时间</div>
  184. <div class="credit">{{shichang}}分钟</div>
  185. </div>
  186. <div class="credit-list">
  187. <br />
  188. <div class="public_title">
  189. <div class="name">
  190. <div class="title-circular"></div>
  191. <div class="title-text">学习课程</div>
  192. </div>
  193. </div>
  194. <div class="content">
  195. <ul v-if="activityList.length">
  196. <li v-for="(item, index) in activityList" :key="index" @click="specialDetails(item.id)">
  197. <div>
  198. <div>
  199. <img :src="item.image" alt="">
  200. </div>
  201. <div>
  202. <div>{{ item.title }}</div>
  203. <div>
  204. <span class="labelItem">{{ item.subject_name }}</span>
  205. <!-- <span class="creditinfo">3分</span> -->
  206. </div>
  207. <div class="price-wrap">
  208. <div class="price">¥<span>{{ item.money }}</span></div>
  209. <div>共{{ item.count }}节</div>
  210. </div>
  211. </div>
  212. </div>
  213. </li>
  214. </ul>
  215. </div>
  216. </div>
  217. </ul>
  218. <ul v-if="navActive == 3">
  219. <!-- 我的证书 -->
  220. <div class="honor-list-page">
  221. <ul v-if="activityList.length">
  222. <li v-for="item in activityList" :key="item.id">
  223. <div class="name">
  224. <img src="{__WAP_PATH}zsff/images/question01.png">{{ item.certtitle }}
  225. </div>
  226. <div class="desc">
  227. <div v-if="item.obtain == 1 || item.obtain == 3">发放时间<br />{{item.add_time}}</div>
  228. <div v-else class="attr">
  229. <div class="cell">
  230. 题目数
  231. <div>{{ item.content.item_number }}</div>
  232. </div>
  233. <div class="cell">
  234. 错题数
  235. <div>{{ item.content.wrong_question }}</div>
  236. </div>
  237. <div class="cell">
  238. 本次用时
  239. <div>{{ item.content.duration | formatTime }}</div>
  240. </div>
  241. </div>
  242. <a :href="'{:url('topic/certificate_detail')}?obtain=' + item.obtain + '&id=' + item.id">查看证书</a>
  243. </div>
  244. </li>
  245. </ul>
  246. <img v-else-if="page > 1 && !loading" class="empty" src="{__WAP_PATH}zsff/images/no_certificate.png">
  247. </div>
  248. </ul>
  249. <div v-if="!activityList.length && loadend" class="empty">
  250. <img src="{__WAP_PATH}zsff/images/empty.png" alt="暂无数据">
  251. <div>暂无数据</div>
  252. </div>
  253. </div>
  254. <quick-menu></quick-menu>
  255. </div>
  256. {/block}
  257. {block name="foot"}
  258. <script>
  259. require(['vue', 'store', 'helper', '{__WAP_PATH}zsff/js/quick.js', 'moment'], function (Vue, store, $h, quick, moment) {
  260. var app = new Vue({
  261. el: '#app',
  262. data: {
  263. navs: ['学习记录', '我的学分', '学习时间', '我的证书'],
  264. navActive: 0,
  265. activityList: [],
  266. loading: false,
  267. loadend: false,
  268. page: 1,
  269. limit: 20,
  270. loadTitle:'',
  271. xuefencount:0,
  272. shichang:0,
  273. },
  274. mounted: function () {
  275. this.getActivitySignList();
  276. this.$nextTick(function () {
  277. this.init();
  278. });
  279. },
  280. methods: {
  281. navActives: function (index) {
  282. var that = this;
  283. that.navActive = index;
  284. that.page = 1;
  285. that.loading = false;
  286. that.loadend = false;
  287. that.activityList = [];
  288. that.getActivitySignList();
  289. },
  290. init: function () {
  291. var that = this;
  292. window.addEventListener('scroll', function () {
  293. var clientHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
  294. scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight,
  295. scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  296. if (clientHeight + scrollTop >= scrollHeight) {
  297. that.getActivitySignList();
  298. }
  299. });
  300. },
  301. activityDetails: function (order_id) {
  302. return window.location.href=$h.U({ c: 'my', a: 'sign_my_order', q: {order_id: order_id } });
  303. },
  304. specialDetails: function (order_id) {
  305. return window.location.href=$h.U({ c: 'special', a: 'details', q: {id: order_id } });
  306. },
  307. // 获取活动列表
  308. getActivitySignList: function () {
  309. var that = this;
  310. if (that.loading) return;
  311. if (that.loadend) return;
  312. that.loading = true;
  313. that.activityList = [];
  314. if (that.navActive == 3) {
  315. store.basePost($h.U({
  316. c: 'topic',
  317. a: 'getUserCertificate'
  318. }), {
  319. page: this.page++,
  320. limit: this.limit
  321. }, function (res) {
  322. var activityList = res.data.data;
  323. for (let i in activityList) {
  324. that.xuefencount += activityList[i].xuefen;
  325. console.log(activityList[i].xuefen);
  326. activityList[i].add_time = moment(activityList[i].add_time * 1000).format('YYYY.MM.DD')
  327. }
  328. that.activityList = that.activityList.concat(activityList);
  329. that.loading = false;
  330. that.loadend = activityList.length < that.limit;
  331. that.loadTitle = that.loadend ? '已全部加载完' : '上拉加载更多';
  332. that.finished = that.limit > activityList.length;
  333. that.$set(this, 'activityList', that.activityList);
  334. });
  335. } else if (that.navActive == 1) {
  336. store.baseGet($h.U({ c: 'my', a: 'history', p: { page: that.page, limit: 10000, op:'xuefenlist' } }), function (res) {
  337. var list = res.data.data;
  338. that.activityList.push.apply(that.activityList, list);
  339. that.loadend = list.length < 10000;
  340. that.loadTitle = that.loadend ? '已全部加载完' : '上拉加载更多';
  341. that.page = that.page + 1;
  342. that.loading = false;
  343. that.xuefencount = 0;
  344. for (let i in that.activityList) {
  345. that.xuefencount += that.activityList[i].xuefen;
  346. }
  347. that.$set(this, 'activityList', that.activityList);
  348. }, function (res) {
  349. // that.loadTitle = '上拉加载更多';
  350. // that.loading = false;
  351. });
  352. } else if (that.navActive == 2) {
  353. store.baseGet($h.U({ c: 'my', a: 'history', p: { page: that.page, limit: 10000, op:'shichanglist' } }), function (res) {
  354. var list = res.data.data;
  355. that.activityList.push.apply(that.activityList, list);
  356. that.loadend = list.length < that.limit;
  357. that.loadTitle = that.loadend ? '已全部加载完' : '上拉加载更多';
  358. that.page = that.page + 1;
  359. that.loading = false;
  360. that.shichang = 0;
  361. for (let i in that.activityList) {
  362. console.log(that.activityList[i].shichang);
  363. if (that.activityList[i].shichang){
  364. that.shichang += parseInt(that.activityList[i].shichang / 60000);
  365. }
  366. }
  367. that.$set(this, 'activityList', that.activityList);
  368. }, function (res) {
  369. // that.loadTitle = '上拉加载更多';
  370. // that.loading = false;
  371. });
  372. } else {
  373. store.baseGet($h.U({ c: 'my', a: 'special_log', p: { page: that.page, limit: that.limit, op:'list' } }), function (res) {
  374. var list = res.data.data;
  375. that.activityList.push.apply(that.activityList, list);
  376. that.loadend = list.length < that.limit;
  377. that.loadTitle = that.loadend ? '已全部加载完' : '上拉加载更多';
  378. that.page = that.page + 1;
  379. that.loading = false;
  380. that.$set(this, 'activityList', that.activityList);
  381. }, function (res) {
  382. that.loadTitle = '上拉加载更多';
  383. that.loading = false;
  384. });
  385. }
  386. }
  387. }
  388. });
  389. });
  390. </script>
  391. {/block}