123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="utf-8" />
- <meta http-equv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <meta name="format-detection" content="telephone=no" />
- <title>潜山市党建引领信用村(社区)建设</title>
- <meta name="keywords" content="潜山市党建引领信用村(社区)建设">
- <meta name="description" content="潜山市党建引领信用村(社区)建设">
- <script src="static/js/vue.js"></script>
- <script type="text/javascript" src="static/js/vue-router.js"></script>
- <script src="static/js/index.js" type="text/javascript"></script>
- <script type="text/javascript" src="./static/js/jquery.min.js"></script>
- <script src="static/js/common.js"></script>
- <link href="static/css/common.css" rel="stylesheet" />
- <link href="static/css/style.css" rel="stylesheet" />
- <link rel="stylesheet" href="static/css/theme-chalk/index.css">
- <style></style>
- </head>
- <body class="qpolicy" id="qpolicy">
- <div id="appse">
- <header>
- <div class="quset">
- <div class="qusetimg"><img src="static/images/back.png" class="backimg" /></div>
- 政策指南
- </div>
- </header>
- </div>
- <div id="app" style="padding: 0;padding-top: 1rem;">
- <main>
- <div class="policy" v-if="policylist.length">
- <div class="policylist" v-for="(item,index) in policylist" @click="getDetail(item.policyId)">
- <div class="ovone f28 c2 mb2 fw">{{item.policyTitle}}</div>
- <p class="overtwo f24 ca mb2" v-html='item.policyContent'></p>
- <div class="f2 c6">{{item.createTime}}</div>
- </div>
- <div v-if="finished" class="poloding">暂无更多数据</div>
- </div>
- <!-- 暂无记录 -->
- <div v-else class="nobox">
- <img src="static/images/nico.png" class="noimg"/>
- </div>
- </main>
- </div>
- <script type="text/javascript">
- var app = new Vue({
- el: '#app',
- data: {
- policylist: [],
- base_url: 'http://118.31.23.65:5007/prod-api',
- pageNum: 1,
- pageSize: 10,
- finished: false,
- loading:false
- },
- created() {
- this.getDataFn()
- },
- mounted() {
- window.addEventListener("scroll", this.hanldeScroll, true);
- },
- destroyed(){
- console.log(7)
- window.removeEventListener("scroll", this.hanldeScroll, false);
- },
- methods: {
- getDataFn() {
- var that = this;
- var params = {
- pageNum: this.pageNum,
- pageSize: this.pageSize
- }
- $.ajax({
- url: this.base_url + '/system/h5/guideList',
- type: 'get',
- data: params,
- dataType: 'json',
- success: function(res) {
- if (res.code == 200) {
- that.loading=false;
- var pages=(that.pageNum-1)*that.pageSize+res.rows.length
- if (that.pageNum == 1) {
- that.policylist = res.rows || [];
- if(res.total==pages){
- that.finished=true
- }
- } else {
- that.policylist = that.policylist.concat(res.rows)
- if(res.total==pages){
- that.finished=true
- }
- }
- } else {
- that.$message({
- message: res.msg,
- type: 'error',
- center: true,
- });
- }
- }
- })
- },
- hanldeScroll(e) {
- var that=this;
- let scrollTargetBox = document.querySelector('.qpolicy');
- var scrollHeight = scrollTargetBox.scrollHeight; //204
-
- var scrollTop = document.documentElement.scrollTop; //0-18
-
- var clientHeight = document.documentElement.clientHeight; //172
- var scrbottom=scrollHeight - clientHeight - scrollTop
- if(scrbottom <20 && !that.finished && !that.loading ){
- that.loading=true
- that.pageNum = that.pageNum + 1;
- that.getDataFn();
-
- }
- },
- getDetail(e) {
- window.location.href = 'policydetail.html?id=' + e
- }
- }
- })
- </script>
- <script type="text/javascript">
- $(document).ready(function() {
- $('.backimg').click(function() {
- window.history.go(-1)
- })
- })
- </script>
- </body>
- </html>
|