No Description

problem_detail.html 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta content="yes" name="apple-mobile-web-app-capable">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0,minimum-scale=1.0,user-scalable=0" />
  7. <title>常见问题</title>
  8. <link rel="stylesheet" type="text/css" href="../common/reset.css"/>
  9. <style type="text/css">
  10. body{background: #FFFFFF;min-height:100vh ;}
  11. .Q,.A{padding-right: 0.1rem;}
  12. .Q{padding-top: 0.2rem;display: flex;border-top: 0.01rem dashed #ccc;}
  13. .Q:nth-of-type(1){padding-top: 0.2rem;border-top: none;}
  14. .icon{margin-left: 0.2rem;margin-right: 0.15rem;width: 0.18rem;height: 0.18rem;}
  15. .Q h3{color: #333333;font-size: 0.15rem;line-height: 0.18rem;font-weight: bold;flex: 1;}
  16. .A{display: flex;margin-top: 0.2rem;}
  17. .A .icon{margin-top: 0.06rem;}
  18. .A .con{font-size: 0.15rem;color: #626262;line-height: 0.25rem;flex: 1;padding-bottom: 0.2rem;}
  19. .A .con img{max-width: calc(100% - 0.1rem);margin: 0.1rem 0;}
  20. .A .con p{margin: 0.1rem 0;}
  21. .A .con p:nth-of-type(1){margin: 0;}
  22. </style>
  23. </head>
  24. <body>
  25. <div id="content"></div>
  26. </body>
  27. </html>
  28. <script type="text/javascript" src="problem.js?v=1"></script>
  29. <script type="text/javascript">
  30. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  31. window.onresize = function(){
  32. document.documentElement.style.fontSize = 100 * (document.documentElement.clientWidth/375) + "px";
  33. }
  34. function parseQueryString(url) {
  35. var urlObj = {};
  36. var reg = /([^?=&]+)=([^?=&]+)/g;
  37. url.replace(reg, function($0, $1, $2) {
  38. urlObj[$1] = decodeURIComponent($2);
  39. })
  40. return urlObj;
  41. }
  42. var qs = parseQueryString(window.location.href);
  43. var id = 0;
  44. var Content = document.getElementById("content");
  45. var html = '';
  46. if(qs.id){
  47. id = qs.id
  48. }
  49. problem.forEach(function (items, index) {
  50. if(items.id == id){
  51. items.content.forEach(function (item, index) {
  52. html += '<div class="Q"><img class="icon" src="img/Q.png" /><h3>' + item.title + '</h3></div><div class="A"><img class="icon" src="img/A.png" /><div class="con">' + item.con + '</div></div><div class="bottom"></div>'
  53. })
  54. }
  55. })
  56. Content.innerHTML = html;
  57. </script>