123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body {
- user-select: none;
- width: 100%;
- height: 100%;
- }
- .title {
- box-shadow: 0 1px 6px #ccc;
- position: fixed;
- z-index: 10;
- right: 0;
- left: 0;
- height: 44px;
- padding-right: 10px;
- padding-left: 10px;
- border-bottom: 0;
- background-color: #f7f7f7;
- text-align: center;
- font-size: 17px;
- font-weight: 500;
- line-height: 44px;
- }
- .content {
- padding: 85px 15px 15px;
- }
- p {
- font-size: 14px;
- margin-top: 0;
- margin-bottom: 10px;
- color: #8f8f94;
- text-align: center;
- }
- /* 移动端样式兼容 */
- @media screen and (max-width: 500px) {
- * {
- max-width: 100% !important;
- width: 100% !important;
- height: auto !important;
- }
- html{
- width: calc(100% - 20px) !important;
- }
- body{
- width: 100%;
- height: auto;
- overflow-x: hidden;
- padding-bottom: 80px;
- }
- .title {
- position: relative;
- background-color: transparent;
- color: #F0D99C;
- box-shadow: none;
- line-height: 30px;
- }
- .content{
- padding: 0;
- }
- p {
- color: #fff;
- }
- }
- </style>
- </head>
- <script>
- const id = window.location.href.split('?sId=')[1]
- const fetchUrl = window.location.href.includes('localhost:') ? 'https://ypbwg.4dage.com' : ''
- fetch(`${fetchUrl}/api/show/knowledge/cms/detail/${id}`)
- .then(response => response.json())
- .then(data => {
- const dataRes = data.data
- const titleDom = document.querySelector('.title')
- const contentDom = document.querySelector('.content')
- titleDom.innerHTML = dataRes.cName
- contentDom.innerHTML = dataRes.cContent
- });
- </script>
- <body>
- <!-- 标题 -->
- <div class="title"></div>
- <!-- 主要内容 -->
- <div class="content"></div>
- </body>
- </html>
|