teacher_list.html 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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. input[type="search"]::-webkit-search-cancel-button {
  15. display: none;
  16. }
  17. .form {
  18. display: flex;
  19. align-items: center;
  20. height: .66rem;
  21. padding-right: .2rem;
  22. padding-left: .3rem;
  23. border-radius: .33rem;
  24. margin: .18rem .6rem;
  25. background-color: #F7F7F7;
  26. }
  27. .form .label {
  28. flex: 1;
  29. display: flex;
  30. align-items: center;
  31. }
  32. .form .iconsousuo {
  33. font-size: .23rem;
  34. color: #939393;
  35. }
  36. .form .input {
  37. flex: 1;
  38. padding-left: .11rem;
  39. font-size: .26rem;
  40. }
  41. .form .input::placeholder {
  42. color: #999999;
  43. }
  44. .form .iconguanbi1 {
  45. font-size: .26rem;
  46. color: #CCCCCC;
  47. cursor: pointer;
  48. }
  49. .list .item {
  50. position: relative;
  51. padding: .1rem .1rem .1rem;
  52. width: 33.333%;
  53. float: left;
  54. }
  55. .list .item::before {
  56. content: " ";
  57. position: absolute;
  58. top: 0;
  59. right: 0;
  60. left: .3rem;
  61. z-index: 2;
  62. height: 1px;
  63. border-top: 1px solid #F2F2F2;
  64. color: #F2F2F2;
  65. transform-origin: 0 0;
  66. transform: scaleY(0.5);
  67. }
  68. .list .item:first-child::before {
  69. display: none;
  70. }
  71. .list .image {
  72. width: 100%;
  73. height: 34vw;
  74. border-radius: 5%;
  75. background-color: #9D8585;
  76. overflow: hidden;
  77. }
  78. .list .image img {
  79. width: 100%;
  80. height: 100%;
  81. }
  82. .list .text {
  83. flex: 1;
  84. display: flex;
  85. align-items: center;
  86. }
  87. .list .text-content {
  88. flex: 1;
  89. }
  90. .list .name {
  91. font-weight: 500;
  92. font-size: .3rem;
  93. line-height: .42rem;
  94. color: #282828;
  95. }
  96. .list .tags {
  97. display: flex;
  98. margin-top: .1rem;
  99. }
  100. .list .tag {
  101. height: .32rem;
  102. padding: 0 .12rem;
  103. border-radius: .04rem;
  104. margin-left: .1rem;
  105. background-color: rgba(255, 107, 0, 0.1);
  106. font-size: .22rem;
  107. line-height: .32rem;
  108. color: #FF6B00;
  109. }
  110. .list .tag:first-child {
  111. margin-left: 0;
  112. }
  113. .list .attr {
  114. margin-top: .1rem;
  115. font-size: .26rem;
  116. line-height: .37rem;
  117. height: 1.2rem;
  118. overflow: hidden;
  119. color: #666666;
  120. }
  121. .list button {
  122. width: 1.2rem;
  123. height: .48rem;
  124. border: 1px solid #191C6E;
  125. border-radius: .24rem;
  126. font-size: .22rem;
  127. color: #191C6E;
  128. }
  129. .list .iconfont {
  130. margin-right: .05rem;
  131. vertical-align: middle;
  132. font-size: .15rem;
  133. }
  134. .list .followed {
  135. border-color: #999999;
  136. color: #999999;
  137. }
  138. .empty {
  139. display: block;
  140. width: 4.14rem;
  141. margin: 2rem auto 0;
  142. }
  143. </style>
  144. {/block}
  145. {block name="content"}
  146. <div v-cloak id="app">
  147. <!-- <form class="form" @submit.prevent="get_lecturer_list">
  148. <label class="label">
  149. <i class="iconfont iconsousuo"></i>
  150. <input v-model.trim="search" type="search" placeholder="输入要搜索的讲师" required class="input">
  151. </label>
  152. <i v-show="search" class="iconfont iconguanbi1" @click="search = ''"></i>
  153. </form> -->
  154. <div class="public_title">
  155. <div class="name">
  156. <div class="title-circular"></div>
  157. <div class="title-text">权威师资</div>
  158. </div>
  159. </div>
  160. <div v-if="lecturerList.length" class="list">
  161. <a v-for="item in lecturerList" :key="item.id" :href="'{:url('merchant/teacher_detail')}?id=' + item.id" class="item">
  162. <div class="image">
  163. <img :src="item.lecturer_head">
  164. </div>
  165. <div class="text">
  166. <div class="text-content">
  167. <div class="name">{{ item.lecturer_name }}</div>
  168. <!-- <div class="tags">
  169. <div v-for="label in item.label" :key="label" class="tag">{{ label }}</div>
  170. {{ item.study }}人学习 | {{ item.curriculum }}课时
  171. </div> -->
  172. <div class="attr">{{ item.explain }}</div>
  173. </div>
  174. <!-- <button :class="{ followed: item.is_follow }" @click.prevent="follow(item)"><i v-show="!item.is_follow"
  175. class="iconfont icontianjia"></i>{{ item.is_follow ? '取消关注' : '关注' }}</button> -->
  176. </div>
  177. </a>
  178. </div>
  179. <img v-else-if="finished" src="{__WAP_PATH}zsff/images/empty.png" class="empty">
  180. </div>
  181. {/block}
  182. {block name="foot"}
  183. <script>
  184. require(['vue', 'helper', 'store'], function (Vue, $h, store) {
  185. new Vue({
  186. el: '#app',
  187. data: {
  188. finished: false,
  189. page: 1,
  190. limit: 10,
  191. lecturerList: [],
  192. search: ''
  193. },
  194. watch: {
  195. search: function (value) {
  196. this.lecturerList = [];
  197. this.finished = false;
  198. this.page = 1;
  199. if (!value) {
  200. this.get_lecturer_list();
  201. }
  202. }
  203. },
  204. created: function () {
  205. var vm = this;
  206. this.get_lecturer_list();
  207. $h.EventUtil.listenTouchDirection(document, function () {
  208. vm.get_lecturer_list();
  209. });
  210. },
  211. methods: {
  212. // 讲师列表
  213. get_lecturer_list: function () {
  214. var vm = this;
  215. if (this.finished) {
  216. return;
  217. }
  218. $h.loadFFF();
  219. store.baseGet($h.U({
  220. c: 'merchant',
  221. a: 'get_lecturer_list',
  222. q: {
  223. page: this.page++,
  224. limit: this.limit,
  225. search: this.search
  226. }
  227. }), function (res) {
  228. var data = res.data.data;
  229. $h.loadClear();
  230. vm.lecturerList = vm.lecturerList.concat(data);
  231. vm.finished = vm.limit > data.length;
  232. });
  233. },
  234. follow: function (item) {
  235. var vm = this;
  236. store.baseGet($h.U({
  237. c: 'merchant',
  238. a: 'user_follow',
  239. q: {
  240. mer_id: item.mer_id,
  241. is_follow: Number(!item.is_follow)
  242. }
  243. }), function (res) {
  244. item.is_follow = !item.is_follow;
  245. $h.pushMsg(item.is_follow ? '关注成功' : '取消关注成功');
  246. });
  247. }
  248. }
  249. });
  250. });
  251. </script>
  252. {/block}