Explorar el Código

upd(云机用户手册): 样式更新与内容截取

曾志翔 hace 3 años
padre
commit
a3f0a47e93
Se han modificado 1 ficheros con 63 adiciones y 7 borrados
  1. 63 7
      microserviceUserH5/vcloud/userManual.html

+ 63 - 7
microserviceUserH5/vcloud/userManual.html

@@ -11,11 +11,7 @@
     <title>双子星</title>
     <link rel="stylesheet" href="../static/css/normalize-8.0.1.css" />
     <script src="../static/js/vender/vue/vue.min.js"></script>
-    <style>
-      [v-cloak] {
-        display: none;
-      }
-    </style>
+
     <!-- <script src="https://cdn.staticfile.org/vue/2.2.2/vue.js"></script> -->
     <!-- <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"></script> -->
     <script src="../static/js/vender/config.js"></script>
@@ -34,11 +30,57 @@
     <script>
       toastr.options.positionClass = 'toast-center-center';
     </script>
+    <style>
+      [v-cloak] {
+        display: none;
+      }
+      @media screen and (max-width: 750px) {
+        html {
+          font-size: calc(100vw / 7.5);
+        }
+      }
+      @media screen and (min-width: 750px) {
+        html {
+          font-size: calc(750px / 7.5);
+        }
+      }
+      .phone-container {
+        color: #333333;
+        line-height: 1.5;
+      }
+      .user-Agreement-content {
+        font-size: 0.28rem;
+        line-height: 1.5;
+        text-align: justify;
+      }
+      h1 {
+        font-size: 0.32rem;
+      }
+      h2 {
+        font-size: 0.31rem;
+      }
+      h3 {
+        font-size: 0.3rem;
+      }
+      h4 {
+        font-size: 0.29rem;
+      }
+      h5 {
+        font-size: 0.28rem;
+      }
+      h6 {
+        font-size: 0.27rem;
+      }
+      .phone-container p {
+        font-size: 0.28rem;
+        color: #333;
+      }
+    </style>
   </head>
   <body>
     <div v-cloak id="app">
       <h1 class="text-center mt-2">{{title}}</h1>
-      <div class="p-2" v-html="content"></div>
+      <div class="p-2 phone-container" v-html="content"></div>
     </div>
     <script src="../static/js/vender/vue/axios.min.js"></script>
     <script src="../static/js/vender/vue/config.js"></script>
@@ -68,7 +110,21 @@
             .then(
               (response) => {
                 this.title = response.data.agreementName;
-                this.content = response.data.content;
+
+                const html = document.createElement('html');
+
+                html.innerHTML = response.data.content;
+
+                const phoneContainers =
+                  html.querySelectorAll('.phone-container');
+
+                if (phoneContainers.length > 0) {
+                  this.content = phoneContainers.item(
+                    phoneContainers.length - 1,
+                  ).innerHTML;
+                } else {
+                  this.content = response.data.content;
+                }
               },
               (error) => {
                 toastr.error(err.message);