123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <!DOCTYPE html>
- <html lang="zh">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <style>
- * {
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- html {
- background-color: transparent;
- user-select: none;
- }
- body {
- background-color: transparent;
- }
- .main {
- background-color: transparent;
- width: 100vw;
- height: 78vh;
- padding: 60px 40px 40px;
- }
- .title {
- font-weight: 700;
- font-size: 20px;
- line-height: 28px;
- text-align: center;
- margin-bottom: 30px;
- }
- .text {
- width: 100%;
- overflow-y: auto;
- }
- .text p {
- pointer-events: none;
- font-size: 14px;
- letter-spacing: 2px;
- min-height: 10px;
- line-height: 24px;
- }
- .text .media-wrap {
- pointer-events: none;
- text-align: center;
- margin: 10px 0;
- }
- .text .media-wrap img {
- max-width: 100%;
- }
- .text::-webkit-scrollbar {
- /*滚动条整体样式*/
- width: 3px;
- /*高宽分别对应横竖滚动条的尺寸*/
- height: 1px;
- }
- .text::-webkit-scrollbar-thumb {
- /*滚动条里面小方块*/
- border-radius: 10px;
- -webkit-box-shadow: inset 0 0 5px transparent;
- background: #a64735;
- }
- .text::-webkit-scrollbar-track {
- /*滚动条里面轨道*/
- -webkit-box-shadow: inset 0 0 5px transparent;
- border-radius: 10px;
- background: transparent;
- }
- </style>
- <body>
- <div class="main">
- <div class="title"></div>
- <div class="text"></div>
- </div>
- </body>
- <script>
- // const baseUrl = 'https://sit-chaozhoubwg.4dage.com'
- const baseUrl = ''
- const urlAll = window.location.href
- if (urlAll.includes('?id=')) {
- const arr = urlAll.split('?id=')
- const id = arr[1] || ''
- if (id) {
- fetch(`${baseUrl}/api/show/questionnaire/detail/${id}`)
- .then(response => response.json())
- .then(data => {
- // console.log(data)
- const titleDom = document.querySelector('.title')
- titleDom.innerHTML = data.data.name
- const textDom = document.querySelector('.text')
- textDom.innerHTML = data.data.description
- const titleHeight = titleDom.clientHeight
- const mainDom = document.querySelector('.main')
- const heightAll = mainDom.clientHeight
- textDom.style.height = heightAll - (titleHeight + 130) + 'px'
- });
- }
- }
- </script>
- </html>
|