news.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. {__NOLAYOUT__}
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title>A3Mall | Dashboard</title>
  7. <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  8. <link rel="stylesheet" href="{__SYSTEM_PATH__}/js/bootstrap/css/bootstrap.min.css">
  9. <link rel="stylesheet" href="{__SYSTEM_PATH__}/font/font-awesome/css/font-awesome.min.css">
  10. <link rel="stylesheet" href="{__SYSTEM_PATH__}/js/layui/css/layui.css">
  11. <link rel="stylesheet" href="{__SYSTEM_PATH__}/css/base.css">
  12. <script src="{__SYSTEM_PATH__}/js/jquery/jquery.min.js"></script>
  13. <script src="{__SYSTEM_PATH__}/js/bootstrap/js/bootstrap.min.js"></script>
  14. <script src="{__SYSTEM_PATH__}/js/layui/layui.js"></script>
  15. <script src="{__SYSTEM_PATH__}/js/common/common.js"></script>
  16. <style type="text/css">
  17. ::-webkit-scrollbar{width:3px;height:3px}
  18. ::-webkit-scrollbar-track{background:#ccc!important}
  19. ::-webkit-scrollbar-thumb{background-color:#666!important}
  20. header { text-align: center; height: 55px; line-height: 55px; font-size: 12px; }
  21. header span { background: #999; color: #fff; padding: 5px; border-radius: 10px; }
  22. .avatar { border-radius: 50%; height: 50px; width: 50px; background: #ccc;float: left; }
  23. .info {position: relative;left: 20px;top: 5px;display: inline-block;padding: .8rem .8rem .8rem;border: 1px solid #ccc;border-radius: 5px;background: #fff;font-size: 14px;width: 70%;word-break:break-all}
  24. .arrow:before {position: absolute;left: -5px;top: 50%;transform: translateY(-50%);display:inline-block;width:0;height:0;border-top: 3px solid transparent;border-right: 5px solid #ccc;border-bottom: 3px solid transparent;content: " ";}
  25. .info img { width: 100%; height: 80px; }
  26. .news-empty{width: 100%;height: 60px;line-height: 60px;border: 1px solid #ccc;font-size: 15px;text-align: center;border-radius: 5px;}
  27. .news-box .news {height: 120px;display: block;position: relative;background: no-repeat center center;background-size: cover;overflow: hidden;}
  28. .news-box .news span {white-space:nowrap; left: 0;right: 0;bottom: 0;color: #fff;height: 30px;line-height: 30px;text-indent: 10px;font-size: 12px;overflow: hidden;position: absolute;margin: 0 -1px 0 -1px;text-overflow: ellipsis;background: rgba(0, 0, 0, .7);}
  29. .hr {color: #fff;height: 1px;margin: 3px 0;border-top: 1px dashed #e7eaec;}
  30. .news-box .other {height: 40px;line-height: 40px;display: block;position: relative;}
  31. .news-box .other span:first-child {color: #333;float: left;width: 60%;height: 40px;overflow: hidden;max-height: none;position: relative;background: 0 0;text-overflow: ellipsis;}
  32. .news-box .other span:last-child {width: 50px;height: 40px;float: right;max-height: none;position: relative;background-size: cover;background-position: center center;}
  33. </style>
  34. </head>
  35. <body>
  36. <header>
  37. <span><?php echo date("H:i"); ?></span>
  38. </header>
  39. <div class="container">
  40. <?php if(empty($news["article"])) : ?>
  41. <div class="news-empty">
  42. 内容不存在!
  43. </div>
  44. <?php else : ?>
  45. <div class="news-box">
  46. <?php $i=0; foreach($news["article"] as $item) : ?>
  47. <?php if($i==0) : ?>
  48. <div class="news" style="background-image:url(<?php echo $item["local_url"]; ?>)">
  49. <span><?php echo $item["title"]; ?></span>
  50. </div>
  51. <div class="hr"></div>
  52. <?php else : ?>
  53. <div class="news other">
  54. <span><?php echo $item["title"]; ?></span>
  55. <span style="background-image:url(<?php echo $item["local_url"]; ?>);"></span>
  56. </div>
  57. <div class="hr"></div>
  58. <?php endif; ?>
  59. <?php $i++; endforeach; ?>
  60. </div>
  61. <?php endif; ?>
  62. </div>
  63. </body>
  64. </html>