teacher_list.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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_top"}
  13. <style>
  14. .list .item {
  15. display: -webkit-box;
  16. display: -webkit-flex;
  17. display: flex;
  18. -webkit-box-align: center;
  19. -webkit-align-items: center;
  20. align-items: center;
  21. position: relative;
  22. height: 2rem;
  23. padding: 0 .3rem;
  24. }
  25. .list .item::after {
  26. content: "";
  27. position: absolute;
  28. right: 0;
  29. bottom: 0;
  30. left: 1.49rem;
  31. border-bottom: 1px solid #f2f2f2;
  32. }
  33. .list .item .img {
  34. width: 1.3rem;
  35. height: 1.3rem;
  36. border-radius: 50%;
  37. }
  38. .list .item .text {
  39. -webkit-box-flex: 1;
  40. -webkit-flex: 1;
  41. flex: 1;
  42. min-width: 0;
  43. margin-left: .22rem;
  44. }
  45. .list .item .name {
  46. overflow: hidden;
  47. white-space: nowrap;
  48. text-overflow: ellipsis;
  49. font-weight: bold;
  50. font-size: .3rem;
  51. line-height: .42rem;
  52. color: #282828;
  53. }
  54. .list .item .label {
  55. display: -webkit-box;
  56. display: -webkit-flex;
  57. display: flex;
  58. -webkit-box-align: center;
  59. -webkit-align-items: center;
  60. align-items: center;
  61. margin-top: .06rem;
  62. }
  63. .list .item .label .cell {
  64. height: .34rem;
  65. padding: 0 .12rem;
  66. border-radius: .1rem;
  67. background-color: #FFF0E5;
  68. font-size: .22rem;
  69. line-height: .34rem;
  70. color: #FF6B00;
  71. }
  72. .list .item .label .cell ~ .cell {
  73. margin-left: .1rem;
  74. }
  75. .list .item .attr {
  76. margin-top: .09rem;
  77. font-size: .26rem;
  78. line-height: .37rem;
  79. color: #385270;
  80. }
  81. .empty {
  82. margin-top: 2rem;
  83. font-size: .28rem;
  84. text-align: center;
  85. color: #999;
  86. }
  87. .empty .img {
  88. width: 4.14rem;
  89. height: 2.4rem;
  90. }
  91. .loading {
  92. font-size: .4rem;
  93. text-align: center;
  94. color: #999;
  95. }
  96. .loaded {
  97. font-size: .28rem;
  98. line-height: .72rem;
  99. text-align: center;
  100. color: #999;
  101. }
  102. </style>
  103. {/block}
  104. {block name="content"}
  105. <div v-cloak id="app">
  106. <div v-if="lecturerList.length" class="list">
  107. <a v-for="(item, index) in lecturerList" :key="index" class="item" :href="$h.U({c:'special',a:'teacher_detail'})+'?id=' + item.id">
  108. <img class="img" :src="item.lecturer_head">
  109. <div class="text">
  110. <div class="name">{{ item.lecturer_name }}</div>
  111. <div v-if="item.label.length" class="label">
  112. <template v-for="(itm, idx) in item.label">
  113. <div v-if="idx < 3" :key="idx" class="cell">{{ itm }}</div>
  114. </template>
  115. </div>
  116. <div class="attr">{{ item.study }}人学习 | {{ item.curriculum }}课时</div>
  117. </div>
  118. </a>
  119. <div v-show="loading" class="loading">
  120. <span class="fa fa-spinner"></span>
  121. </div>
  122. <div v-if="finished" class="loaded">{{loadTitle}}</div>
  123. </div>
  124. <div v-else-if="finished" class="empty">
  125. <img class="img" src="/wap/first/zsff/images/empty-box.png">
  126. <div>暂无讲师</div>
  127. </div>
  128. <quick-menu></quick-menu>
  129. </div>
  130. {/block}
  131. {block name="foot"}
  132. <script>
  133. require(['vue', 'store', 'helper', '{__WAP_PATH}zsff/js/quick.js'], function (Vue, storeApi, $h) {
  134. var vm = new Vue({
  135. el: '#app',
  136. data: {
  137. loading: false,
  138. finished: false,
  139. page: 1,
  140. limit: 10,
  141. lecturerList: []
  142. },
  143. created: function () {
  144. this.getLecturerList();
  145. },
  146. mounted: function () {
  147. this.$nextTick(function () {
  148. var that = this;
  149. $h.EventUtil.listenTouchDirection(document, function () {
  150. that.getLecturerList();
  151. });
  152. });
  153. },
  154. methods: {
  155. // 讲师列表
  156. getLecturerList: function () {
  157. var that = this;
  158. if (this.loading || this.finished) {
  159. return;
  160. }
  161. that.loading = true;
  162. $h.loadFFF();
  163. storeApi.baseGet($h.U({
  164. c: 'Special',
  165. a: 'lecturerList',
  166. q: {
  167. page: that.page++,
  168. limit: that.limit
  169. }
  170. }), function (res) {
  171. var arr = res.data.data;
  172. that.loading = false;
  173. $h.loadClear();
  174. that.lecturerList = that.lecturerList.concat(arr);
  175. that.finished = arr.length < that.limit;
  176. that.loadTitle = that.finished ? '已全部加载' : '上拉加载更多';
  177. }, function (res) {
  178. $h.loadClear();
  179. that.loadTitle = '上拉加载更多';
  180. that.loading = false;
  181. });
  182. }
  183. }
  184. });
  185. });
  186. </script>
  187. {/block}