|
- <!DOCTYPE html>
- <html>
-
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <title></title>
- <script src="js/mui.min.js"></script>
- <link href="css/mui.min.css" rel="stylesheet" />
- <link href="css/style.css" rel="stylesheet" />
- <script src="js/serverurl.js"></script>
- <script src="js/tools.js"></script>
- <script src="js/jquery-1.10.2.min.js"></script>
- <style type="text/css">
- .NewsContent {
- margin-top: 15px;
- padding: 5px 5px;
- font-size: 14px;
- color: #333333;
- width: 350px;
- }
-
- .NewsContent p,
- p {
- color: #333333;
- font-size: 14px;
- width: 350px;
- }
- </style>
- </head>
-
- <body>
- <header class="mui-bar mui-bar-nav">
- <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
- <h1 id="title" class="mui-title"></h1>
- <a class="mui-icon mui-icon-reload mui-pull-right" style="font-weight:bold; color: #FFFFFF;" id="btreload"></a>
- </header>
- <div class="mui-content" style="background-color:#fff">
- <div style="height: 48px; font-size: 18px; padding-left: 8px; padding-top: 6px; font-family: '微软雅黑';">
- <div id="NewsTitle"></div>
- </div>
- <div id="CreateDate" style="padding-left: 8px; font-size: 11px;color: #8F8F94; ">2015</div>
- <div style="clear: both;"></div>
- <div id="NewsContent" class="NewsContent">
- </div>
- </div>
- <script type="text/javascript">
- mui.plusReady(function() {
- var self = plus.webview.currentWebview();
- var NewsID = self.NewsID;
- //刷新按钮
- var refbutton = document.getElementById("btreload");
- refbutton.addEventListener('tap', function(event) {
- plus.webview.currentWebview().reload();
- plus.nativeUI.showWaiting();
- });
-
- //请求详情
- // var xhr = new plus.net.XMLHttpRequest();
- // xhr.responseType = "json";
- // xhr.onreadystatechange = function() {
- // switch(xhr.readyState) {
- // case 4:
- // if(xhr.status == 200) {
- // if(xhr.response.result == "ok") {
- // var dataobject = xhr.response.msg;
- // document.getElementById("NewsTitle").innerText = dataobject.title;
- // document.getElementById("CreateDate").innerText = jsonDateFormatDateTime(dataobject.date);
- // document.getElementById("NewsContent").innerHTML = dataobject.content;
- // plus.nativeUI.closeWaiting();
- // }
- // } else {
- // plus.nativeUI.closeWaiting();
- // plus.nativeUI.toast('世界上最遥远的距离就是没有网络。');
- // }
- // break;
- // default:
- // break;
- // }
- // }
- // var widths = plus.screen.resolutionWidth - 10;
- // xhr.open("GET", encodeURI(serverdomain + "/WebService/UserService.ashx?Action=getSchoolNews&content={'articleID':'" + NewsID + "','app':'1'}&width=" + widths + ""));
- // xhr.send();
- console.log(NewsID)
- mui.post(api+'/user/getCompanyNewsDetail',{data:NewsID},function(res){
- plus.nativeUI.closeWaiting();
- if(res.code=="200"){
- var dataobject = res.data;
- document.getElementById("NewsTitle").innerText = dataobject.title;
- document.getElementById("CreateDate").innerText = jsonDateFormatDateTime(dataobject.date);
- document.getElementById("NewsContent").innerHTML = dataobject.content;
-
- $("#NewsContent").html($("#NewsContent").text())//
- }
- },'json')
- });
- </script>
- </body>
-
- </html>
|