谢杰标 2 роки тому
батько
коміт
4d01a356ae
5 змінених файлів з 100 додано та 6 видалено
  1. 48 0
      index.html
  2. 1 1
      manifest.json
  3. 5 5
      pages5/scan/examact.vue
  4. 37 0
      static/adapt-pc/pc.css
  5. 9 0
      static/adapt-pc/pc.js

+ 48 - 0
index.html

@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html lang="zh-CN">
+  <head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+    <title><%= htmlWebpackPlugin.options.title %></title>
+    <!-- Open Graph data -->
+    <!-- <meta property="og:title" content="Title Here" /> -->
+    <!-- <meta property="og:url" content="http://www.example.com/" /> -->
+    <!-- <meta property="og:image" content="http://example.com/image.jpg" /> -->
+    <!-- <meta property="og:description" content="Description Here" /> -->
+    <script>
+      var coverSupport =
+        "CSS" in window &&
+        typeof CSS.supports === "function" &&
+        (CSS.supports("top: env(a)") || CSS.supports("top: constant(a)"));
+      document.write(
+        '<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
+          (coverSupport ? ", viewport-fit=cover" : "") +
+          '" />'
+      );
+    </script>
+    <link
+      rel="stylesheet"
+      href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css"
+    />
+    <link rel="stylesheet" href="<%= BASE_URL %>static/adapt-pc/pc.css" />
+  </head>
+  <body>
+    <noscript>
+      <strong>Please enable JavaScript to continue.</strong>
+    </noscript>
+    <div id="app"></div>
+    <!-- built files will be auto injected -->
+    <uni-adapt-pc></uni-adapt-pc>
+    <!--  -->
+    <script type="text/html" id="tpl-adapt-pc">
+      <div class="container">
+        <iframe src="helang-mobile-href"></iframe>
+      </div>
+    </script>
+
+    <script
+      type="text/JavaScript"
+      src="<%= BASE_URL %>static/adapt-pc/pc.js"
+    ></script>
+  </body>
+</html>

+ 1 - 1
manifest.json

@@ -118,7 +118,7 @@
                 }
             }
         },
-        "template" : "",
+        "template" : "index.html",
         "devServer" : {
             "https" : false
         }

+ 5 - 5
pages5/scan/examact.vue

@@ -107,14 +107,15 @@ export default {
         if (res.data.code === 200) {
           //跳转去对应域名
           this.toDatail();
+        }else{
+          this.$u.toast(res.data.msg);
         }
       });
     },
     toDatail() {
       if (this.jump) {
-        window.location.href = this.tenantInfo.scheme
-          ? this.tenantInfo.scheme
-          : "https://" + this.jump;
+        window.location.href =
+          (this.tenantInfo.scheme || "https://") + this.jump;
         return;
       }
       uni.navigateTo({
@@ -133,7 +134,6 @@ export default {
         ? domain
         : "120.79.166.78:19006";
       this.val = this.jump || domain + "/pages/questionBank/index?isAct=1";
-      console.log(this.val)
       return map[domain];
     },
   },
@@ -161,7 +161,7 @@ export default {
     width: 620rpx;
     height: 102rpx;
     position: absolute;
-    top: 806rpx;
+    top: 786rpx;
     left: 50%;
     margin-left: -310rpx;
     background: linear-gradient(90deg, #1762ff 0%, #4af7da 100%);

+ 37 - 0
static/adapt-pc/pc.css

@@ -0,0 +1,37 @@
+
+body[adapt='pc']>*{
+	display: none !important;
+}
+ 
+body[adapt='pc']>uni-adapt-pc{
+	display: block !important;
+}
+ 
+body[adapt='pc'] {
+	margin: 0;
+	background-color: #fff;
+	width: 100vw;
+	height: 100vh;
+}
+ 
+body[adapt='pc'] uni-adapt-pc .container{
+	position: fixed;
+	width: 375px;
+	height: 100%;
+	z-index: 1;
+	top: 0;
+	right: 0;
+	bottom: 0;
+	left: 0;
+	margin: auto;
+	max-height: 680px;
+	box-sizing: border-box;
+	border: 1px solid #ddd;
+	box-shadow: 0 0 10px #ddd;
+}
+ 
+body[adapt='pc'] uni-adapt-pc iframe{
+	width: 100%;
+	height: 100%;
+	border: none;
+}

+ 9 - 0
static/adapt-pc/pc.js

@@ -0,0 +1,9 @@
+;(function(){
+	if(window.innerWidth < 768){
+		return;
+	}
+	var tpl = document.querySelector("#tpl-adapt-pc").innerHTML || '';
+	tpl = tpl.replace('helang-mobile-href',window.location.href);
+	document.querySelector("uni-adapt-pc").innerHTML = tpl;
+	document.body.setAttribute("adapt","pc");
+})();