more_list.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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"}{$search} 搜索{/block}
  12. {block name="head_top"}
  13. <style>
  14. body {
  15. background-color: #f2f2f2;
  16. }
  17. </style>
  18. {/block}
  19. {block name="content"}
  20. <div class="search-page" id="app" v-cloak>
  21. <div class="searchResult swiper-details" ref="list">
  22. <div v-if="where.type===0">
  23. <div class="title acea-row row-middle line1">专题</div>
  24. <div class="swiper-list2">
  25. <div class="item acea-row row-between-wrapper" v-for="item in searchList">
  26. <a class="pictrue" :href="getSpecialUrl(item.id)"><img :src="item.image"></a>
  27. <div class="underline">
  28. <a class="text-pic acea-row row-column" :href="getSpecialUrl(item.id)">
  29. <div class="name line1" v-text="item.title"></div>
  30. <div class="notes line1" v-text="item.abstract"></div>
  31. <div class="bottom acea-row row-between-wrapper">
  32. <div class="acea-row row-middle">
  33. <div class="num acea-row row-center-wrapper" v-for="(vo,index) in item.label" v-text="vo" v-if="index <= 1"></div>
  34. </div>
  35. <div class="money">{{item.is_pink ? (item.pink_money == 0 ? '免费':'¥'+item.pink_money): (item.money <= 0 ? '免费':'¥'+item.money) }}</div>
  36. </div>
  37. </a>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <div v-else>
  43. <div class="title acea-row row-middle line1">任务视频</div>
  44. <div class="video-listn">
  45. <div class="item acea-row row-between-wrapper" v-for="item in searchList">
  46. <a class="pictrue" :href="getTashUrl(item.special_id)"><img :src="item.image"></a>
  47. <div class="underline">
  48. <a class="text acea-row row-center row-column" :href="getTashUrl(item.special_id)">
  49. <div class="name line1" v-text="item.title">7课掌握病句解析技巧</div>
  50. <div class="num acea-row row-middle"><span class="iconfont icon-bofang1"></span>{{item.play_count}}</div>
  51. </a>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <p class="loading-line" style="background-color: #ffffff">
  58. <span v-show="loading==true" class="fa fa-spinner loadingpic" style="font-size: 0.4rem"></span>
  59. <span v-text="loadTitle">没有更多内容了</span>
  60. </p>
  61. <quick-menu></quick-menu>
  62. </div>
  63. {/block}
  64. {block name='foot'}
  65. <script>
  66. var type = {$type}, search = '{$search}';
  67. require(['vue', 'helper', 'store', '{__WAP_PATH}zsff/js/quick.js'], function (Vue, $h, app) {
  68. new Vue({
  69. el: '#app',
  70. data: {
  71. searchList: [],
  72. loadTitle: '',
  73. loading: false,
  74. loadend: false,
  75. where: {
  76. type: type,
  77. search: search || '',
  78. page: 1,
  79. limit: 10
  80. }
  81. },
  82. methods: {
  83. getMoreList: function () {
  84. if (this.loading) return;
  85. if (this.loaded) return;
  86. this.loading = true;
  87. this.loadTitle = '';
  88. app.baseGet($h.U({c: 'index', a: 'get_more_list', q: this.where}), function (res) {
  89. var list = res.data.data.more_list;
  90. var searchList = $h.SplitArray(list, this.searchList);
  91. this.where.page = res.data.data.page;
  92. this.loading = false;
  93. this.loaded = list.length < this.where.limit;
  94. this.loadTitle = this.loaded ? '没有更多内容了' : '加载更多';
  95. this.$set(this, 'searchList', searchList);
  96. this.$nextTick(function () {
  97. this.EventUtil();
  98. }.bind(this));
  99. }.bind(this), function (res) {
  100. this.loading = false;
  101. this.loadTitle = '加载更多';
  102. }.bind(this));
  103. },
  104. EventUtil: function () {
  105. this.$nextTick(function () {
  106. $h.EventUtil.listenTouchDirection(document, function () {
  107. this.loading == false && this.getMoreList();
  108. }.bind(this), false);
  109. })
  110. },
  111. getSpecialUrl: function (id) {
  112. return $h.U({c: 'special', a: 'details', q: {id: id}});
  113. },
  114. getTashUrl: function (id) {
  115. return $h.U({c: 'special', a: 'details', q: {id: id}}) + '#tash';
  116. }
  117. },
  118. mounted: function () {
  119. this.getMoreList();
  120. }
  121. });
  122. });
  123. </script>
  124. {/block}