unityText.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <style>
  9. * {
  10. margin: 0;
  11. padding: 0;
  12. box-sizing: border-box;
  13. }
  14. html {
  15. background-color: transparent;
  16. user-select: none;
  17. }
  18. body {
  19. background-color: transparent;
  20. }
  21. .main {
  22. background-color: transparent;
  23. width: 100vw;
  24. height: 78vh;
  25. padding: 60px 40px 40px;
  26. }
  27. .title {
  28. font-weight: 700;
  29. font-size: 20px;
  30. line-height: 28px;
  31. text-align: center;
  32. margin-bottom: 30px;
  33. }
  34. .text {
  35. width: 100%;
  36. overflow-y: auto;
  37. }
  38. .text p {
  39. pointer-events: none;
  40. font-size: 14px;
  41. letter-spacing: 2px;
  42. min-height: 10px;
  43. line-height: 24px;
  44. }
  45. .text .media-wrap {
  46. pointer-events: none;
  47. text-align: center;
  48. margin: 10px 0;
  49. }
  50. .text .media-wrap img {
  51. max-width: 100%;
  52. }
  53. .text::-webkit-scrollbar {
  54. /*滚动条整体样式*/
  55. width: 3px;
  56. /*高宽分别对应横竖滚动条的尺寸*/
  57. height: 1px;
  58. }
  59. .text::-webkit-scrollbar-thumb {
  60. /*滚动条里面小方块*/
  61. border-radius: 10px;
  62. -webkit-box-shadow: inset 0 0 5px transparent;
  63. background: #a64735;
  64. }
  65. .text::-webkit-scrollbar-track {
  66. /*滚动条里面轨道*/
  67. -webkit-box-shadow: inset 0 0 5px transparent;
  68. border-radius: 10px;
  69. background: transparent;
  70. }
  71. </style>
  72. <body>
  73. <div class="main">
  74. <div class="title"></div>
  75. <div class="text"></div>
  76. </div>
  77. </body>
  78. <script>
  79. // const baseUrl = 'https://sit-chaozhoubwg.4dage.com'
  80. const baseUrl = ''
  81. const urlAll = window.location.href
  82. if (urlAll.includes('?id=')) {
  83. const arr = urlAll.split('?id=')
  84. const id = arr[1] || ''
  85. if (id) {
  86. fetch(`${baseUrl}/api/show/questionnaire/detail/${id}`)
  87. .then(response => response.json())
  88. .then(data => {
  89. // console.log(data)
  90. const titleDom = document.querySelector('.title')
  91. titleDom.innerHTML = data.data.name
  92. const textDom = document.querySelector('.text')
  93. textDom.innerHTML = data.data.description
  94. const titleHeight = titleDom.clientHeight
  95. const mainDom = document.querySelector('.main')
  96. const heightAll = mainDom.clientHeight
  97. textDom.style.height = heightAll - (titleHeight + 130) + 'px'
  98. });
  99. }
  100. }
  101. </script>
  102. </html>