newList.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <link rel="shortcut icon" href="imgs/favicon.png" type="image/x-icon">
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>新闻列表</title>
  8. <link rel="stylesheet" type="text/css" href="css/screen.css" media="screen" />
  9. <link rel="stylesheet" href="css/main.min.css">
  10. <link rel="stylesheet" href="css/style.css">
  11. <link rel="stylesheet" href="css/page.css">
  12. <link rel="stylesheet" type="text/css" href="css/cc-css-tools.css" />
  13. <link rel="stylesheet" href="js/bootstrap-3.4.1-dist/css/bootstrap.min.css">
  14. <script src="js/jquery3.6.min.js"></script>
  15. <script src="js/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
  16. <script src="/js/rem.js"></script>
  17. <script src="/js/page.js"></script>
  18. <style type="text/css">
  19. .bannerbg {
  20. background: url(../images/bannerbg12.png) center center no-repeat;
  21. background-size: 100% 100%;
  22. }
  23. a,a:hover {
  24. text-decoration: none !important;
  25. }
  26. .newsListCentent:hover{
  27. border-radius: 5px;
  28. box-shadow: 0 0 7px rgb(84 84 84 / 20%);
  29. }
  30. .newsListItem{
  31. margin: 60px 10px 10px 10px;
  32. display: flex;
  33. cursor: pointer;
  34. }
  35. .listLeft{
  36. padding: 10px;
  37. }
  38. .listRight{
  39. display: flex;
  40. flex-direction: column;
  41. justify-content: space-around;
  42. }
  43. .myLine{
  44. height: 10px;
  45. border-bottom: 1px solid rgb(211, 199, 199);
  46. width: 100%;
  47. margin: 0 auto;
  48. }
  49. .listRight .type{
  50. width: 65px;
  51. height: 24px;
  52. background-color: rgb(66, 10, 119);
  53. color: white;
  54. text-align: center;
  55. line-height: 22px;
  56. border-radius: 3px;
  57. }
  58. .listRight .title{
  59. color: black;
  60. font-size: 18px;
  61. font-weight: 700;
  62. overflow: hidden;
  63. text-overflow: ellipsis;
  64. display: -webkit-box;
  65. -webkit-box-orient: vertical;
  66. -webkit-line-clamp: 1;
  67. }
  68. .pageing{
  69. font-size: 16px;
  70. height: 150px;
  71. display: flex;
  72. justify-content: center;
  73. align-items: center;
  74. }
  75. </style>
  76. </head>
  77. <body>
  78. <div class="navbgbox">
  79. <div class="navbg">
  80. <div class="nav about_nav">
  81. <div style="position: relative">
  82. <a href="index.html" class="nav_logo">
  83. <img src="images/dgt_logo.png" width="171" height="70">
  84. </a>
  85. <div class="guanggao">
  86. <strong style="color: #999999; margin-left : -140px; font-size: 14px">智慧科技 · 神州软件</strong>
  87. </div>
  88. </div>
  89. <div class="nav_a">
  90. <a href="index.html">首页</a>
  91. <a href="product.html">智慧企业</a>
  92. <a href="wisdom.html">智慧城市</a>
  93. <a href="fangan.html">解决方案</a>
  94. <a href="technology.html">技术服务</a>
  95. <a href="news.html" class="cur">新闻中心</a>
  96. <a href="about_us.html">关于我们</a>
  97. <a href="contact.html">联系我们</a>
  98. <!-- <img width="70px" src="imgs/QRcode1.jpg" alt=""> -->
  99. </div>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="banner">
  104. <div class="bannerbg">
  105. <div class="shade">
  106. <div class="cc-tc-w bannerBoxTitle">
  107. <div class="bannerTitle">新闻中心</div>
  108. <div class="bannerTitle-eng">News Center</div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="g-content--other">
  114. <div class="m-about">
  115. <div class="f-in">
  116. <div class="bnv">
  117. <a href="news.html">新闻中心</a> 》当前页
  118. </div>
  119. <div class="newsList"></div>
  120. <div class="pageing"></div>
  121. </div>
  122. </div>
  123. </div>
  124. <div class="footerbg">
  125. <div style="height: auto;" class="footer">
  126. <div>
  127. <span><a href="index.html">首页</a>|</span><span><a href="product.html">智慧企业</a>|</span><span><a
  128. href="wisdom.html">智慧城市</a>|</span><span><a href="fangan.html">解决方案</a>|</span><span><a
  129. href="technology.html">技术服务</a>|</span><span><a href="news.html">新闻中心</a>|</span><span><a
  130. href="about_us.html">关于我们</a>|</span><span><a href="contact.html">联系我们</a></span>
  131. <p>
  132. <span>
  133. 上海市长宁区福泉路111号神州数码(上海)科技园 </span>
  134. <span>|</span>
  135. <span>北京市海淀区上地九街九号数码科技广场 </span>
  136. <span>|</span>
  137. <span>洛阳市洛龙区金城寨街正大国际中心</span>
  138. </p>
  139. <p style="padding-top: 5px;">
  140. <span>苏州市相城区元和街道嘉元路959号元和大厦 </span>
  141. <span>|</span>
  142. <span>杭州市下城区延安路385号杭州嘉里中心 </span>
  143. </p>
  144. <a href="http://www.beian.miit.gov.cn/">沪ICP备16042560号</a>
  145. </div>
  146. <div class="leftImg">
  147. <img src="imgs/QRcode1.jpg" alt="">
  148. </div>
  149. </div>
  150. </div>
  151. </body>
  152. <script>
  153. function infoData() {
  154. let param = GetRequest();
  155. let type = param['type'];
  156. $.ajax({
  157. type: "post", //请求类型
  158. dataType: "json", //请求数据返回类型
  159. headers:{"content-type":"application/json;charset=utf-8"}, //请求头类型
  160. url: "https://xiaoyou.dgtis.com/admin/news/listForDGTSiteNews", //请求地址
  161. async: false, //同步或者异步 ,ajax 就是为了异步而生
  162. data: JSON.stringify({
  163. page: 1,
  164. limit: 5,
  165. type: type,
  166. title: '',
  167. }), //传参
  168. success: function (result) { //成功
  169. if (result.errno === 0) {
  170. console.log(result);
  171. let newListData = result.data.items;
  172. total = result.data.total;
  173. let newsList = document.querySelector(".newsList");
  174. for (let i = 0; i < newListData.length; i++) {
  175. let typeName = ''
  176. if(newListData[i].type=='companyNews'){
  177. typeName = '公司新闻'
  178. }
  179. if(newListData[i].type=='industryInfo'){
  180. typeName = '行业资讯'
  181. }
  182. if(newListData[i].type=='companyDynamic'){
  183. typeName = '公司动态'
  184. }
  185. newsList.innerHTML +=`<a href="newDetail.html?id=${newListData[i].id}">
  186. <div class="newsListCentent">
  187. <div class="newsListItem">
  188. <div class="listLeft">
  189. <img src="${newListData[i].image}" width="300" height="150">
  190. </div>
  191. <div class="listRight">
  192. <div class="type">${typeName}</div>
  193. <div class="title">${newListData[i].title}</div>
  194. <div class="date">时间:${newListData[i].pubDate}</div>
  195. </div>
  196. </div>
  197. <div class="myLine"></div>
  198. </div>
  199. </a>`
  200. }
  201. } else {
  202. console.log(result);
  203. console.log("失败");
  204. }
  205. },
  206. error: function (result) { //失败
  207. console.log(result);
  208. console.log("异常");
  209. }
  210. });
  211. }
  212. function changeData(page) {
  213. let newsList = document.querySelector(".newsList");
  214. newsList.innerHTML = '';
  215. let param = GetRequest();
  216. let type = param['type'];
  217. console.log(type);
  218. $.ajax({
  219. type: "post", //请求类型
  220. dataType: "json", //请求数据返回类型
  221. headers:{"content-type":"application/json;charset=utf-8"}, //请求头类型
  222. url: "https://xiaoyou.dgtis.com/admin/news/listForDGTSiteNews", //请求地址
  223. async: false, //同步或者异步 ,ajax 就是为了异步而生
  224. data: JSON.stringify({
  225. page: page,
  226. limit: 5,
  227. type: type,
  228. title: '',
  229. }), //传参
  230. success: function (result) { //成功
  231. if (result.errno === 0) {
  232. console.log(result);
  233. let newListData = result.data.items;
  234. let newsList = document.querySelector(".newsList");
  235. for (let i = 0; i < newListData.length; i++) {
  236. let typeName = ''
  237. if(newListData[i].type=='companyNews'){
  238. typeName = '公司新闻'
  239. }
  240. if(newListData[i].type=='industryInfo'){
  241. typeName = '行业资讯'
  242. }
  243. if(newListData[i].type=='companyDynamic'){
  244. typeName = '公司动态'
  245. }
  246. newsList.innerHTML +=`<a href="newDetail.html?id=${newListData[i].id}">
  247. <div class="newsListCentent">
  248. <div class="newsListItem">
  249. <div class="listLeft">
  250. <img src="${newListData[i].image}" width="300" height="150">
  251. </div>
  252. <div class="listRight">
  253. <div class="type">${typeName}</div>
  254. <div class="title">${newListData[i].title}</div>
  255. <div class="date">时间:${newListData[i].pubDate}</div>
  256. </div>
  257. </div>
  258. <div class="myLine"></div>
  259. </div>
  260. </a>`
  261. }
  262. } else {
  263. console.log(result);
  264. console.log("失败");
  265. }
  266. },
  267. error: function (result) { //失败
  268. console.log(result);
  269. console.log("异常");
  270. }
  271. });
  272. }
  273. function GetRequest() {
  274. var url = location.search; //获取url中"?"符后的字串
  275. var theRequest = new Object();
  276. if (url.indexOf("?") != -1) {
  277. var str = url.substr(1);
  278. strs = str.split("&");
  279. for (var i = 0; i < strs.length; i++) {
  280. theRequest[strs[i].split("=")[0]] = decodeURIComponent(strs[i].split("=")[1]);
  281. }
  282. }
  283. return theRequest;
  284. }
  285. function goTop() {
  286. $(document.documentElement).animate({
  287. scrollTop: 0
  288. }, 200);
  289. //支持chrome
  290. $(document.body).animate({
  291. scrollTop: 0
  292. }, 200);
  293. }
  294. function getPageCount(totalCount, pageSize) {
  295. let pageCount = Math.ceil((totalCount / pageSize));
  296. return pageCount;
  297. }
  298. </script>
  299. </html>