app-list.html 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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,maximum-scale=1,user-scalable=no">
  7. <meta name="apple-mobile-web-app-capable" content="yes">
  8. <meta name="apple-mobile-web-app-status-bar-style" content="black">
  9. <link rel="stylesheet" type="text/css" href="../../css/common/mui.min.css" />
  10. <link rel="stylesheet" type="text/css" href="../../css/common/common.css" />
  11. <link rel="stylesheet" type="text/css" href="../../css/information/information-detail.css" />
  12. </head>
  13. <body>
  14. <header id="header" class="mui-bar mui-bar-nav">
  15. <a class="mui-action-back mui-icon mui-icon-arrowleft">
  16. <span class="back">返回</span>
  17. </a>
  18. <h1 class="mui-title">资讯详情</h1>
  19. </header>
  20. <div class="mui-content">
  21. </div>
  22. <script src="../../libs/mui.min.js"></script>
  23. <script type="text/javascript">
  24. mui.plusReady(function() {
  25. var str = plus.storage.getItem('user');
  26. var user = JSON.parse(str);
  27. var token = user.Data.Token;
  28. var self = plus.webview.currentWebview();
  29. var exist = self.exist;
  30. GetInfo();
  31. function GetInfo() {
  32. var postData = {
  33. "": exist, //类型
  34. }
  35. mui.ajax("http://www.bosshand.cn/api/Plat/GetChannelsModelById", {
  36. dataType: 'json',
  37. data: postData,
  38. type: "post",
  39. contentType: 'application/x-www-form-urlencoded',
  40. headers: {
  41. authorization: token
  42. },
  43. success: function(resp) {
  44. if(resp.Code == 200) {
  45. var html = '';
  46. html += '<div class="content">';
  47. html += ' <div class="boss-info-centent" id="boss-info-centent">';
  48. html += '<div class="boss-info-title"><h2>' + resp.Data.Name + '</h3></div>';
  49. html += '<div class="datetime">发布时间:' + getLocalDate(resp.Data.CreateTime) + '</div>';
  50. html += '<div class="boss-info-img-list">';
  51. if(resp.Data.ChannelsImg != "") {
  52. var imglist = resp.Data.ChannelsImg;
  53. if(imglist.indexOf(",") > 0) {
  54. imglist = imglist.split(',');
  55. if(imglist != null) {
  56. for(var i = 0; i < imglist.length; i++) {
  57. html += '<img src="http://www.bosshand.cn/' + imglist[i] + '" />';
  58. }
  59. }
  60. } else {
  61. html += '<img style="width:100%" src="http://www.bosshand.cn/' + imglist + '" />';
  62. }
  63. }
  64. html += ' </div>';
  65. html += '<div class="boss-info-detail">' + resp.Data.Content + '</div>';
  66. html += ' </div>';
  67. html += '</div>';
  68. mui(".mui-content")[0].innerHTML = html;
  69. //清除所有的style样式表
  70. var tags = document.body.getElementsByTagName('*');
  71. for(var i = 0; i < tags.length; i++) {
  72. tags[i].removeAttribute('style');
  73. }
  74. }
  75. }
  76. });
  77. }
  78. //时间转换
  79. function getLocalDate(now) {
  80. var date = now.replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '');
  81. var arr = date.split(' ');
  82. //日期
  83. var arrDate = arr[0].split('-');
  84. //时间
  85. var arrTime = arr[1].split(':');
  86. return arrDate[0] + '年' + arrDate[1] + '月' + arrDate[2] + '日' + ' ' + arrTime[0] + ':' + arrTime[1];
  87. }
  88. })
  89. </script>
  90. </body>
  91. </html>