unified_list.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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"}{$title}{/block}
  12. {block name="head_top"}
  13. <style>
  14. .studyCourse .item .info {
  15. margin-top: .06rem;
  16. font-size: .24rem;
  17. color: #999;
  18. }
  19. .studyCourse .item .info .iconfont {
  20. margin-right: .08rem;
  21. font-size: .24rem;
  22. color: #999;
  23. }
  24. .swiper-list2 .item .underline {
  25. min-width: 0;
  26. }
  27. .loading {
  28. font-size: .4rem;
  29. text-align: center;
  30. color: #999;
  31. }
  32. .loaded {
  33. font-size: .28rem;
  34. line-height: .72rem;
  35. text-align: center;
  36. color: #999;
  37. }
  38. .nothing {
  39. position: absolute;
  40. top: 30%;
  41. left: 50%;
  42. width: 4rem;
  43. height: 4rem;
  44. background: url("{__WAP_PATH}zsff/images/nothing.png") center/contain no-repeat;
  45. -webkit-transform: translate(-50%, -50%);
  46. transform: translate(-50%, -50%);
  47. }
  48. .swiper-list2 .item .pictrue img {
  49. object-fit: cover;
  50. }
  51. </style>
  52. {/block}
  53. {block name="content"}
  54. <div class="course-list index" id="app" v-cloak ref="index" style="-webkit-overflow-scrolling: touch;">
  55. <div class="nav" v-if="category.length">
  56. <div class="item" :class="where.cid==0 ? 'on':''" @click="where.cid=0">全部</div>
  57. <div class="item" v-for="item in category" :class="where.cid==item.id ? 'on':''" @click="where.cid=item.id">
  58. {{item.title}}</div>
  59. </div>
  60. <div class="studyCourse" ref="list">
  61. <!--小图-->
  62. <div v-if="List.length" class="swiper-list2">
  63. <a class="item acea-row" v-for="vo in List" :href="getDetails(vo.id)">
  64. <div class="pictrue">
  65. <img :src="vo.image_input">
  66. </div>
  67. <div class="underline text-pic acea-row row-column row-between">
  68. <div class="name line1" v-text="vo.title"></div>
  69. <div class="acea-row row-between-wrapper info" v-text="vo.synopsis"></div>
  70. <div class="acea-row row-between-wrapper">
  71. <div class="info">访问量:{{vo.visit ? vo.visit : '0'}}</div>
  72. <div class="info">{{vo.add_time}}</div>
  73. </div>
  74. </div>
  75. </a>
  76. </div>
  77. </div>
  78. <div v-show="loading" class="loading">
  79. <span class="fa fa-spinner"></span>
  80. </div>
  81. <div v-if="where.page > 2 && loadend" class="loaded">已全部加载</div>
  82. <div v-if="!List.length && !loading" class="nothing"></div>
  83. <quick-menu></quick-menu>
  84. </div>
  85. {/block}
  86. {block name='foot'}
  87. <script>
  88. var category = {$category};
  89. require(['vue', 'helper', 'store','{__WAP_PATH}zsff/js/quick.js'], function (Vue, $h, storeApi) {
  90. new Vue({
  91. el: '#app',
  92. data: {
  93. where: {
  94. page: 1,
  95. limit: 10,
  96. cid: 0,
  97. },
  98. category: category,
  99. loading: false,
  100. loadend: false,
  101. List: [],
  102. },
  103. watch: {
  104. 'where.cid': function (n) {
  105. this.where.page = 1;
  106. this.loadend = false;
  107. this.$set(this, 'List', []);
  108. this.get_unifiend_list();
  109. }
  110. },
  111. methods: {
  112. getDetails: function (id) {
  113. return $h.U({ c: 'article', a: 'details', q: { id: id } });
  114. },
  115. get_unifiend_list: function () {
  116. if (this.loading) return;
  117. if (this.loadend) return;
  118. this.loading = true;
  119. storeApi.baseGet($h.U({ c: 'article', a: 'get_unifiend_list', q: this.where }), function (res) {
  120. var list = res.data.data;
  121. var List = $h.SplitArray(list, this.List);
  122. this.loading = false;
  123. this.where.page = this.where.page + 1;
  124. this.loadend = list.length < this.where.limit;
  125. this.$set(this, 'List', List);
  126. this.$nextTick(function () {
  127. this.EventUtil();
  128. }.bind(this))
  129. }.bind(this), function (res) {
  130. this.loading = false;
  131. }.bind(this));
  132. },
  133. EventUtil: function () {
  134. var that = this;
  135. $h.EventUtil.listenTouchDirection(document, function () {
  136. that.loading == false && that.get_unifiend_list();
  137. }, false);
  138. }
  139. },
  140. mounted: function () {
  141. this.get_unifiend_list();
  142. }
  143. })
  144. })
  145. </script>
  146. {/block}