123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>AUI快速完成布局</title>
- <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
- <link rel="stylesheet" type="text/css" href="../../css/html.css" />
- </head>
- <body>
- <div class="aui-content aui-margin-b-15" id="app" v-cloak>
- <ul class="aui-list aui-list-in">
- <li class="aui-list-item" v-for="(d,i) in list">
- <div class="aui-list-item-inner">
- <div class="aui-list-item-title">
- {{d.tmpltypeTitle}}
- </div>
- <!--<div class="aui-list-item-right">
- {{d.templtypeTitle}}
- </div>-->
- </div>
- </li>
- </ul>
- </div>
- </body>
- <script type="text/javascript" src="../../script/api.js"></script>
- <script type="text/javascript" src="../../script/aui-scroll.js"></script>
- <script type="text/javascript" src="../../script/vue.js"></script>
- <script type="text/javascript" src="../../script/httpRequest.js"></script>
- <script type="text/javascript" src="../../script/vue_plugins.js"></script>
- <script type="text/javascript">
- apiready = function() {
- new Vue({
- el : '#app',
- data : {
- // 获取消息接口
- getNewsListUrl : 'getNewsList',
- list : [], // addressee_id
- // 分页展示
- upLock : true,
- current : 1,
- total : 1,
- downData : 'down',
- },
- methods : {
- init : function() {
- var _this = this;
- this.agentId = $api.getStorage('agentid');
- this.getNewsList();
- this.configHeaderRefush(function() {
- _this.downData = 'down';
- _this.current = 1;
- _this.getNewsList();
- });
- // 上拉分页展示
- this.configBottomRefush(function(status) {
- if (_this.hasData == true) {
- // 开启上拉加载
- if (_this.total > _this.current) {
- _this.downData = 'up';
- _this.current = _this.current + 1;
- _this.getNewsList();
- } else {
- // 上啦没有数据了
- _this.upLock = false;
- }
- }
- })
- },
- // 获取消息列表
- getNewsList : function() {
- var data = {
- addressee_id : this.agentId,
- url : 'json',
- type : 'body',
- }, _this = this;
- this.$post(this.getNewsListUrl, data, function(ret) {
- if (ret.code == 0) {
- _this.list = ret.list;
- _this.total = ret.page.pages;
- if (_this.downData == 'up') {
- _this.list = _this.list.concat(ret.page.records);
- } else {
- _this.list = ret.page.records;
- if (_this.list.length > 0) {
- _this.hasData = true;
- } else {
- _this.hasData = false;
- }
- }
- }
- })
- }
- },
- mounted : function() {
- this.init();
- }
- })
- }
- </script>
- </html>
|