notice_body.html 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
  6. <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
  7. <title>AUI快速完成布局</title>
  8. <link rel="stylesheet" type="text/css" href="../../css/aui.css" />
  9. <link rel="stylesheet" type="text/css" href="../../css/html.css" />
  10. </head>
  11. <body>
  12. <div class="aui-content aui-margin-b-15" id="app" v-cloak>
  13. <ul class="aui-list aui-list-in">
  14. <li class="aui-list-item" v-for="(d,i) in list">
  15. <div class="aui-list-item-inner">
  16. <div class="aui-list-item-title">
  17. {{d.tmpltypeTitle}}
  18. </div>
  19. <!--<div class="aui-list-item-right">
  20. {{d.templtypeTitle}}
  21. </div>-->
  22. </div>
  23. </li>
  24. </ul>
  25. </div>
  26. </body>
  27. <script type="text/javascript" src="../../script/api.js"></script>
  28. <script type="text/javascript" src="../../script/aui-scroll.js"></script>
  29. <script type="text/javascript" src="../../script/vue.js"></script>
  30. <script type="text/javascript" src="../../script/httpRequest.js"></script>
  31. <script type="text/javascript" src="../../script/vue_plugins.js"></script>
  32. <script type="text/javascript">
  33. apiready = function() {
  34. new Vue({
  35. el : '#app',
  36. data : {
  37. // 获取消息接口
  38. getNewsListUrl : 'getNewsList',
  39. list : [], // addressee_id
  40. // 分页展示
  41. upLock : true,
  42. current : 1,
  43. total : 1,
  44. downData : 'down',
  45. },
  46. methods : {
  47. init : function() {
  48. var _this = this;
  49. this.agentId = $api.getStorage('agentid');
  50. this.getNewsList();
  51. this.configHeaderRefush(function() {
  52. _this.downData = 'down';
  53. _this.current = 1;
  54. _this.getNewsList();
  55. });
  56. // 上拉分页展示
  57. this.configBottomRefush(function(status) {
  58. if (_this.hasData == true) {
  59. // 开启上拉加载
  60. if (_this.total > _this.current) {
  61. _this.downData = 'up';
  62. _this.current = _this.current + 1;
  63. _this.getNewsList();
  64. } else {
  65. // 上啦没有数据了
  66. _this.upLock = false;
  67. }
  68. }
  69. })
  70. },
  71. // 获取消息列表
  72. getNewsList : function() {
  73. var data = {
  74. addressee_id : this.agentId,
  75. url : 'json',
  76. type : 'body',
  77. }, _this = this;
  78. this.$post(this.getNewsListUrl, data, function(ret) {
  79. if (ret.code == 0) {
  80. _this.list = ret.list;
  81. _this.total = ret.page.pages;
  82. if (_this.downData == 'up') {
  83. _this.list = _this.list.concat(ret.page.records);
  84. } else {
  85. _this.list = ret.page.records;
  86. if (_this.list.length > 0) {
  87. _this.hasData = true;
  88. } else {
  89. _this.hasData = false;
  90. }
  91. }
  92. }
  93. })
  94. }
  95. },
  96. mounted : function() {
  97. this.init();
  98. }
  99. })
  100. }
  101. </script>
  102. </html>