|
- <!doctype html>
- <html>
-
- <head>
- <meta charset="UTF-8">
- <title></title>
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <link href="css/mui.min.css" rel="stylesheet" />
- <link href="css/style.css" rel="stylesheet" />
- <style>
- .mui-active img{width: 94%; margin: 10px;}
- .phnr{ width: 94%; padding-top:10px ; font-family: "微软雅黑"; font-size: 13px; text-indent: 2em; margin: auto;}
- .mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active{ border-bottom: 2px solid#c70f1a;}
- </style>
- </head>
-
- <body>
- <div class="mui-content">
- <div id="SegmentedControl" class="mui-segmented-control mui-segmented-control-inverted">
- <a class="mui-control-item mui-active" href="#item1mobile">
- 关于学院
- </a>
- <a class="mui-control-item" href="#item2mobile">
- 学院要闻
- </a>
- </div>
- <div class="mui-slider-group">
- <div id="item1mobile" class="mui-control-content mui-active">
-
- </div>
- <div id="item2mobile" class="mui-control-content">
- <ul class="mui-table-view" id="table">
-
- </ul>
-
- </div>
-
- </div>
-
- </div>
- <script src="js/mui.min.js"></script>
- <script src="js/serverurl.js"></script>
- <script src="js/tools.js"></script>
- <script src="js/jquery-1.10.2.min.js"></script>
- <script>
- mui.plusReady(function() {
- GetArticle('100029000000000013');
- });
-
- function OpenArticle(id) {
- mui.openWindow({
- url: "NewsDetail.html",
- id: 'NewsDetail' + id,
- extras: {
- NewsID: id
- },
- show: {
- aniShow: 'pop-in'
- }
- });
- }
-
- function GetArticle(id) {
-
-
- mui.post(api+'/user/aboutSchool',{},function(res){//
- if(res.code=="200"){
- GetData();
- table.innerHTML = "";
- table.innerText = "";
- var content=res.data.content;
- content = content.replace(/\/ueditor\/upload/g, web + "\/ueditor\/upload");
- document.getElementById("item1mobile").innerHTML = res.data.content;
-
- $('#item1mobile').html($('<div></div>').html(content).text());
- }else{
- plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
- }
- },'json')
- }
-
- function GetData() {
- var table = document.getElementById("table");
- // var xhr = new plus.net.XMLHttpRequest();
- // xhr.responseType = "json";
- // xhr.onreadystatechange = function() {
- // switch(xhr.readyState) {
- // case 4:
- // if(xhr.status == 200) {
- // table.innerHTML = "";
- // table.innerText = "";
- // if(xhr.response.msg != null && xhr.response.msg.length > 0) {
- // for(var i = 0; i < xhr.response.msg.length; i++) {
- // var dataobject = xhr.response.msg;
- // var li = document.createElement('li');
-
- // li.setAttribute("articleID", dataobject[i].articleID);
- // li.addEventListener("tap", function() {
- // OpenArticle(this.getAttribute("articleID"));
- // });
- // li.className = 'mui-table-view-cell mui-media';
- // li.innerHTML = '<a>' +
- // //'<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') + '">' +
- // '<div class="mui-media-body">' +
- // '' + dataobject[i].title + '' +
- // '<p class="mui - ellipsis">' + dataobject[i].common + '</p>' +
- // '<p class="time">' + jsonDateFormatDateTime(dataobject[i].date) + '</p>' +
- // '</div>' +
- // '</a>';
-
- // table.appendChild(li, table.firstChild);
- // }
- // } else {}
- // plus.nativeUI.closeWaiting();
- // } else {
- // plus.nativeUI.closeWaiting();
- // plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
- // }
- // break;
- // default:
- // break;
- // }
- // }
- // xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getArticleList&content={'type':'100028000000000006','app':'2'}"));
- // xhr.send();
- plus.nativeUI.showWaiting("数据加载中...");
- mui.post(api+'/user/getnews',{},function(res){
- if(res.code=="200"){
- plus.nativeUI.closeWaiting();
-
- for(var i = 0; i < res.data.length; i++) {
- var dataobject = res.data;
- var li = document.createElement('li');
- li.setAttribute("articleID", dataobject[i].articleID);
- li.addEventListener("tap", function() {
- OpenArticle(this.getAttribute("articleID"));
- });
- var content=dataobject[i].common;//
-
- li.className = 'mui-table-view-cell mui-media';
- li.innerHTML = '<a>' +
- //'<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') + '">' +
- '<div class="mui-media-body">' +
- '' + dataobject[i].title + '' +
- '<p class="mui - ellipsis bbb">' + content + '</p>' +
- '<p class="time">' + jsonDateFormatDateTime(dataobject[i].date) + '</p>' +
- '</div>' +
- '</a>';
-
- table.appendChild(li, table.firstChild);
-
- $.each($('.bbb'),function(i,item){
-
- $(item).html($(item).text());
- var str=$(item).text();
- $(item).html(str.substr(0,15)+"...")
- })
- }
- }
- },'json')
- }
- </script>
- </body>
-
- </html>
|