credit.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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: #DC9845;
  23. }
  24. .price-wrap .price {
  25. flex: 1;
  26. font-weight: bold;
  27. font-size: .24rem;
  28. line-height: .45rem;
  29. color: #DC9845;
  30. }
  31. .price-wrap .price span {
  32. font-size: .32rem;
  33. }
  34. </style>
  35. {/block}
  36. {block name="content"}
  37. <div v-cloak id="app">
  38. <div class="credit-title">
  39. <div class="title">我的学分</div>
  40. <div class="credit">{{xuefencount}}</div>
  41. </div>
  42. <div class="credit-list">
  43. <br />
  44. <div class="public_title">
  45. <div class="name">
  46. <div class="title-circular"></div>
  47. <div class="title-text">学分明细</div>
  48. </div>
  49. </div>
  50. <div class="content">
  51. <ul v-if="activityList.length">
  52. <li v-for="(item, index) in activityList" :key="index" @click="specialDetails(item.id)">
  53. <div>
  54. <div>
  55. <img :src="item.image" alt="">
  56. </div>
  57. <div>
  58. <div>{{ item.title }}</div>
  59. <div>
  60. <span class="labelItem">{{ item.subject_name }}</span>
  61. <span class="creditinfo">{{ item.xuefen }}分</span>
  62. </div>
  63. <div class="price-wrap">
  64. <div class="price">¥<span>{{ item.money }}</span></div>
  65. <div>共{{ item.count }}节</div>
  66. </div>
  67. </div>
  68. </div>
  69. </li>
  70. </ul>
  71. <div v-if="!activityList.length && loadend" class="empty">
  72. <img src="{__WAP_PATH}zsff/images/empty.png" alt="暂无数据">
  73. <div>暂无数据</div>
  74. </div>
  75. </div>
  76. </div>
  77. <quick-menu></quick-menu>
  78. </div>
  79. {/block}
  80. {block name="foot"}
  81. <script>
  82. require(['vue', 'store', 'helper', '{__WAP_PATH}zsff/js/quick.js'], function (Vue, store, $h) {
  83. var app = new Vue({
  84. el: '#app',
  85. data: {
  86. navs: ['全部', '待核销', '已核销'],
  87. navActive: 0,
  88. activityList: [],
  89. loading: false,
  90. loadend: false,
  91. xuefencount:0,
  92. page: 1,
  93. limit: 20,
  94. loadTitle:''
  95. },
  96. mounted: function () {
  97. this.geLogList();
  98. this.$nextTick(function () {
  99. this.init();
  100. });
  101. },
  102. methods: {
  103. init: function () {
  104. var that = this;
  105. window.addEventListener('scroll', function () {
  106. var clientHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight,
  107. scrollHeight = document.documentElement.scrollHeight || document.body.scrollHeight,
  108. scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  109. if (clientHeight + scrollTop >= scrollHeight) {
  110. that.geLogList();
  111. }
  112. });
  113. },
  114. specialDetails: function (order_id) {
  115. return window.location.href=$h.U({ c: 'special', a: 'details', q: {id: order_id } });
  116. },
  117. // 获取历史列表
  118. geLogList: function () {
  119. var that = this;
  120. if (that.loading) return;
  121. if (that.loadend) return;
  122. that.loading = true;
  123. that.activityList = [];
  124. store.baseGet($h.U({ c: 'my', a: 'history', p: { page: that.page, limit: 10000, op:'xuefenlist' } }), function (res) {
  125. var list = res.data.data;
  126. that.activityList.push.apply(that.activityList, list);
  127. that.loadend = list.length < 10000;
  128. that.loadTitle = that.loadend ? '已全部加载完' : '上拉加载更多';
  129. that.page = that.page + 1;
  130. that.loading = false;
  131. that.xuefencount = 0;
  132. for (let i in that.activityList) {
  133. that.xuefencount += that.activityList[i].xuefen;
  134. }
  135. that.$set(this, 'activityList', that.activityList);
  136. }, function (res) {
  137. that.loadTitle = '上拉加载更多';
  138. that.loading = false;
  139. });
  140. }
  141. }
  142. });
  143. });
  144. </script>
  145. {/block}