PUGE há 6 anos atrás
pai
commit
f20d3d119e
3 ficheiros alterados com 24 adições e 3 exclusões
  1. 1 0
      img/setting.svg
  2. 2 1
      js/popup.js
  3. 21 2
      popup.html

+ 1 - 0
img/setting.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1573139356165" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2041" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64"><defs><style type="text/css"></style></defs><path d="M881 512c0-52.4 32.9-96.8 79-114.5-11-43.2-28-83.9-50.2-121.3C864.6 296.3 810 288.1 773 251c-37-37-45.2-91.7-25.1-136.8C710.4 92 669.7 75 626.5 64c-17.8 46.1-62.2 79-114.5 79-52.4 0-96.8-32.9-114.5-79-43.2 11-83.9 28-121.3 50.2 20.1 45.2 11.9 99.8-25.1 136.8-37 37-91.7 45.2-136.8 25.2C92 313.6 75 354.3 64 397.5c46.1 17.8 79 62.2 79 114.5 0 52.4-32.9 96.8-79 114.5 11 43.2 28 83.9 50.2 121.3C159.4 727.7 214 735.9 251 773c37 37 45.2 91.7 25.1 136.8C313.6 932 354.3 949 397.5 960c17.8-46.1 62.2-79 114.5-79 52.4 0 96.8 32.9 114.5 79 43.2-11 83.9-28 121.3-50.2-20.1-45.2-11.9-99.8 25.1-136.8 37-37 91.7-45.2 136.8-25.2C932 710.4 949 669.7 960 626.5c-46.1-17.7-79-62.1-79-114.5zM512 635c-67.9 0-123-55.1-123-123s55.1-123 123-123 123 55.1 123 123-55.1 123-123 123z" p-id="2042"></path></svg>

+ 2 - 1
js/popup.js

@@ -50,7 +50,7 @@ buttonItem.onclick = function () {
 let userInfo = localStorage.getItem('userInfo')
 if (userInfo) {
 	userInfo = JSON.parse(userInfo)
-  document.getElementsByClassName('user')[0].innerHTML = `金币:  ${userInfo.gold}`
+  // document.getElementsByClassName('user')[0].innerHTML = `金币:  ${userInfo.gold}`
   document.getElementsByClassName('login')[0].getElementsByClassName.display = 'none'
 }
 // 获取当前选项卡ID
@@ -69,6 +69,7 @@ window.onload = function() {
   // alert("页面加载完成!"); 
   // 获取是否有脚本
   getSchemeData.then((dataTemp) => {
+    console.log(dataTemp)
     const scriptBox = document.getElementsByClassName('script-box')[0]
     if (dataTemp.err !== 0) {
       scriptBox.classList.add('no-scheme')

+ 21 - 2
popup.html

@@ -28,7 +28,6 @@
         background-color: #009fe9;
         color: white;
         padding: 0 10px;
-        height: 26px;
       }
       .no-script {
         display: none;
@@ -39,6 +38,12 @@
       .no-scheme .no-script {
         display: block;
       }
+      .scheme .loading {
+        display: none;
+      }
+      .scheme .button-box {
+        display: block;
+      }
       .login {
         display: none;
       }
@@ -60,6 +65,17 @@
       .button-box {
         display: none;
       }
+      .no-script img {
+        width: 100%;
+      }
+      .no-script p {
+        line-height: 20px;
+        text-align: center;
+        margin: 0;
+        padding: 0;
+        color: #999;
+        font-size: 14px;
+      }
     </style>
   </head>
   <body>
@@ -69,7 +85,10 @@
     </div>
     <div class="script-box">
       <img class="loading" src="./img/loading.svg">
-      <img class="no-script" src="./img/no-script.svg">
+      <div class="no-script">
+        <img src="./img/no-script.svg">
+        <p>此页面没有适用脚本!</p>
+      </div>
       <div class="button-box">
         <button>获取方案</button>
       </div>