knowInfo.html 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. * {
  9. margin: 0;
  10. padding: 0;
  11. box-sizing: border-box;
  12. }
  13. body {
  14. user-select: none;
  15. width: 100%;
  16. height: 100%;
  17. }
  18. .title {
  19. box-shadow: 0 1px 6px #ccc;
  20. position: fixed;
  21. z-index: 10;
  22. right: 0;
  23. left: 0;
  24. height: 44px;
  25. padding-right: 10px;
  26. padding-left: 10px;
  27. border-bottom: 0;
  28. background-color: #f7f7f7;
  29. text-align: center;
  30. font-size: 17px;
  31. font-weight: 500;
  32. line-height: 44px;
  33. }
  34. .content {
  35. padding: 85px 15px 15px;
  36. }
  37. p {
  38. font-size: 14px;
  39. margin-top: 0;
  40. margin-bottom: 10px;
  41. color: #8f8f94;
  42. text-align: center;
  43. }
  44. /* 移动端样式兼容 */
  45. @media screen and (max-width: 500px) {
  46. * {
  47. max-width: 100% !important;
  48. width: 100% !important;
  49. height: auto !important;
  50. }
  51. html{
  52. width: calc(100% - 20px) !important;
  53. }
  54. body{
  55. width: 100%;
  56. height: auto;
  57. overflow-x: hidden;
  58. padding-bottom: 80px;
  59. }
  60. .title {
  61. position: relative;
  62. background-color: transparent;
  63. color: #F0D99C;
  64. box-shadow: none;
  65. line-height: 30px;
  66. }
  67. .content{
  68. padding: 0;
  69. }
  70. p {
  71. color: #fff;
  72. }
  73. }
  74. </style>
  75. </head>
  76. <script>
  77. const id = window.location.href.split('?sId=')[1]
  78. const fetchUrl = window.location.href.includes('localhost:') ? 'https://ypbwg.4dage.com' : ''
  79. fetch(`${fetchUrl}/api/show/knowledge/cms/detail/${id}`)
  80. .then(response => response.json())
  81. .then(data => {
  82. const dataRes = data.data
  83. const titleDom = document.querySelector('.title')
  84. const contentDom = document.querySelector('.content')
  85. titleDom.innerHTML = dataRes.cName
  86. contentDom.innerHTML = dataRes.cContent
  87. });
  88. </script>
  89. <body>
  90. <!-- 标题 -->
  91. <div class="title"></div>
  92. <!-- 主要内容 -->
  93. <div class="content"></div>
  94. </body>
  95. </html>