index.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. {extend name="public/base"/}
  2. {block name="css"}
  3. <style>
  4. .substring {overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
  5. .new-se-group {width: 100%;height: 155px;background-image: url("/static/home/images/nebanner.jpg");background-repeat: no-repeat;background-position: center center;}
  6. .new-se-group .new-se-main {width: 1200px;height: 99px;padding-top: 56px;margin: 0 auto;}
  7. .new-se-group .new-se-main .ip-group {margin: 0 auto;background: #FFF;height: 45px;width: 770px;-webkit-border-radius: 3px;-moz-border-radius: 3px;border-radius: 3px;}
  8. .new-se-group .new-se-main .ip-box {float: left;padding-top: 7px;width: 626px;padding-left: 17px;}
  9. .new-se-main .ip-box input {width: 616px;height: 28px;line-height: 36px;border: 0;}
  10. .new-se-group .new-se-main .ip-btn {float: left;width: 127px;height: 45px;background-color: #dd4250;font-size: 18px;text-align: center;line-height: 45px;border: 0;color: #FFFFFF;cursor: pointer;border-radius: 0 3px 3px 0;}
  11. .list_content {background-color: #FFF;margin: 0 auto;width: 1200px;margin-top: 40px;}
  12. .list_content .ul {padding: 0 35px;}
  13. .list_content .ul .li {padding: 25px 0;border-bottom: 1px solid #ECECEC;}
  14. .list_content .ul .li .notice {font-size: 16px;font-weight: bold;}
  15. .list_content .ul .li .date {margin: 5px 0;font-size: 12px;color: rgb(156, 155, 155);}
  16. .list_content .article {position: relative;line-height: 14px;}
  17. .list_content .article .article-content {display: inline-block;width: 1053px;font-size: 12px;color: #999999;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
  18. .list_content .article .article-all {font-size: 12px;color: #2C619D;position: absolute;right: 0;}
  19. .el-pagination {justify-content: center;padding:10px 0;}
  20. .el-pagination.is-background .el-pager li.is-active {background-color: #dd4250;color: var(--el-color-white);}
  21. </style>
  22. {/block}
  23. {block name="body"}
  24. <div class="new-se-group">
  25. <div class="new-se-main">
  26. <div class="ip-group">
  27. <div class="ip-box"><input type="text" v-model="keyword" placeholder="请输入关键字" /></div>
  28. <div class="ip-btn" @click="onSubmit">搜公告</div>
  29. <div class="clear"></div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="list_content" v-loading="loading">
  34. <ul class="ul">
  35. <li class="li" v-for="item in list" @click="toDetail(item.id)">
  36. <div class="notice">
  37. <a href="https://hxks.hxrc-app.com/content/recruit/article/show?id=702" style="color:black">
  38. {{item.title}}
  39. </a>
  40. </div>
  41. <div class="date">日期:{{item.update_show}}&nbsp;浏览{{item.volume}}次
  42. </div>
  43. <div class="article">
  44. <div class="article-content">{{item.summary}}</div>
  45. <a href="https://hxks.hxrc-app.com/content/recruit/article/show?id=702" class="article-all">查看全文</a>
  46. </div>
  47. </li>
  48. </ul>
  49. <el-empty description="暂无更多数据" v-show="list.length == 0"></el-empty>
  50. <el-pagination background :hide-on-single-page="false" :page-size="limit" layout="prev, pager, next" :total="total" @current-change="onPage"></el-pagination>
  51. </div>
  52. {/block}
  53. {block name="script"}
  54. <script>
  55. function v_setup() {
  56. let base = {};
  57. base.keyword = Vue.ref("{$keyword}");
  58. base.onSubmit = () => {
  59. location.href = "{:url('news/index')}?keyword=" + base.keyword.value;
  60. };
  61. base.loading = Vue.ref(true);
  62. base.page = Vue.ref(1);
  63. base.total = Vue.ref({$total});
  64. base.limit = Vue.ref({$limit});
  65. base.list = Vue.reactive([]);
  66. base.onPage = num => {
  67. base.page.value = num;
  68. base.getList();
  69. };
  70. base.getList = () => {
  71. base.loading.value = true;
  72. postJson("{:url('news/list')}", {page:base.page.value,limit:base.limit.value,keyword:base.keyword.value}).then(function ({data}) {
  73. base.loading.value = false;
  74. if (data.length === 0) {
  75. base.finished.value = true;
  76. } else {
  77. base.list = data;
  78. }
  79. });
  80. };
  81. base.getList();
  82. base.toDetail = id => {
  83. location.href = "{:url('news/detail')}?id=" + id;
  84. };
  85. return base;
  86. }
  87. </script>
  88. {/block}