You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

165 lines
5.5 KiB

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title></title>
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <link href="css/mui.min.css" rel="stylesheet" />
  8. <link href="css/style.css" rel="stylesheet" />
  9. <style>
  10. .mui-active img{width: 94%; margin: 10px;}
  11. .phnr{ width: 94%; padding-top:10px ; font-family: "微软雅黑"; font-size: 13px; text-indent: 2em; margin: auto;}
  12. .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{ border-bottom: 2px solid#c70f1a;}
  13. </style>
  14. </head>
  15. <body>
  16. <div class="mui-content">
  17. <div id="SegmentedControl" class="mui-segmented-control mui-segmented-control-inverted">
  18. <a class="mui-control-item mui-active" href="#item1mobile">
  19. 关于学院
  20. </a>
  21. <a class="mui-control-item" href="#item2mobile">
  22. 学院要闻
  23. </a>
  24. </div>
  25. <div class="mui-slider-group">
  26. <div id="item1mobile" class="mui-control-content mui-active">
  27. </div>
  28. <div id="item2mobile" class="mui-control-content">
  29. <ul class="mui-table-view" id="table">
  30. </ul>
  31. </div>
  32. </div>
  33. </div>
  34. <script src="js/mui.min.js"></script>
  35. <script src="js/serverurl.js"></script>
  36. <script src="js/tools.js"></script>
  37. <script src="js/jquery-1.10.2.min.js"></script>
  38. <script>
  39. mui.plusReady(function() {
  40. GetArticle('100029000000000013');
  41. });
  42. function OpenArticle(id) {
  43. mui.openWindow({
  44. url: "NewsDetail.html",
  45. id: 'NewsDetail' + id,
  46. extras: {
  47. NewsID: id
  48. },
  49. show: {
  50. aniShow: 'pop-in'
  51. }
  52. });
  53. }
  54. function GetArticle(id) {
  55. mui.post(api+'/user/aboutSchool',{},function(res){//
  56. if(res.code=="200"){
  57. GetData();
  58. table.innerHTML = "";
  59. table.innerText = "";
  60. var content=res.data.content;
  61. content = content.replace(/\/ueditor\/upload/g, web + "\/ueditor\/upload");
  62. document.getElementById("item1mobile").innerHTML = res.data.content;
  63. $('#item1mobile').html($('<div></div>').html(content).text());
  64. }else{
  65. plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
  66. }
  67. },'json')
  68. }
  69. function GetData() {
  70. var table = document.getElementById("table");
  71. // var xhr = new plus.net.XMLHttpRequest();
  72. // xhr.responseType = "json";
  73. // xhr.onreadystatechange = function() {
  74. // switch(xhr.readyState) {
  75. // case 4:
  76. // if(xhr.status == 200) {
  77. // table.innerHTML = "";
  78. // table.innerText = "";
  79. // if(xhr.response.msg != null && xhr.response.msg.length > 0) {
  80. // for(var i = 0; i < xhr.response.msg.length; i++) {
  81. // var dataobject = xhr.response.msg;
  82. // var li = document.createElement('li');
  83. // li.setAttribute("articleID", dataobject[i].articleID);
  84. // li.addEventListener("tap", function() {
  85. // OpenArticle(this.getAttribute("articleID"));
  86. // });
  87. // li.className = 'mui-table-view-cell mui-media';
  88. // li.innerHTML = '<a>' +
  89. // //'<img class="mui-media-object mui-pull-left" src="' + (dataobject[i].picUrl != undefined && dataobject[i].picUrl != null&&dataobject[i].picUrl!='' ? serverdomain + dataobject[i].picUrl : '/images/xysmall.jpg') + '">' +
  90. // '<div class="mui-media-body">' +
  91. // '' + dataobject[i].title + '' +
  92. // '<p class="mui - ellipsis">' + dataobject[i].common + '</p>' +
  93. // '<p class="time">' + jsonDateFormatDateTime(dataobject[i].date) + '</p>' +
  94. // '</div>' +
  95. // '</a>';
  96. // table.appendChild(li, table.firstChild);
  97. // }
  98. // } else {}
  99. // plus.nativeUI.closeWaiting();
  100. // } else {
  101. // plus.nativeUI.closeWaiting();
  102. // plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
  103. // }
  104. // break;
  105. // default:
  106. // break;
  107. // }
  108. // }
  109. // xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getArticleList&content={'type':'100028000000000006','app':'2'}"));
  110. // xhr.send();
  111. plus.nativeUI.showWaiting("数据加载中...");
  112. mui.post(api+'/user/getnews',{},function(res){
  113. if(res.code=="200"){
  114. plus.nativeUI.closeWaiting();
  115. for(var i = 0; i < res.data.length; i++) {
  116. var dataobject = res.data;
  117. var li = document.createElement('li');
  118. li.setAttribute("articleID", dataobject[i].articleID);
  119. li.addEventListener("tap", function() {
  120. OpenArticle(this.getAttribute("articleID"));
  121. });
  122. var content=dataobject[i].common;//
  123. li.className = 'mui-table-view-cell mui-media';
  124. li.innerHTML = '<a>' +
  125. //'<img class="mui-media-object mui-pull-left" src="' + (dataobject[i].picUrl != undefined && dataobject[i].picUrl != null&&dataobject[i].picUrl!='' ? serverdomain + dataobject[i].picUrl : '/images/xysmall.jpg') + '">' +
  126. '<div class="mui-media-body">' +
  127. '' + dataobject[i].title + '' +
  128. '<p class="mui - ellipsis bbb">' + content + '</p>' +
  129. '<p class="time">' + jsonDateFormatDateTime(dataobject[i].date) + '</p>' +
  130. '</div>' +
  131. '</a>';
  132. table.appendChild(li, table.firstChild);
  133. $.each($('.bbb'),function(i,item){
  134. $(item).html($(item).text());
  135. var str=$(item).text();
  136. $(item).html(str.substr(0,15)+"...")
  137. })
  138. }
  139. }
  140. },'json')
  141. }
  142. </script>
  143. </body>
  144. </html>