wangjunchen 3 years ago
parent
commit
d5ec9cb7e7
5 changed files with 80 additions and 3 deletions
  1. 49 0
      package-lock.json
  2. 1 0
      package.json
  3. 3 1
      src/main.js
  4. 5 0
      src/views/home/index.vue
  5. 22 2
      yarn.lock

+ 49 - 0
package-lock.json

@@ -18,6 +18,7 @@
         "postcss-pxtorem": "^6.0.0",
         "qrcode": "^1.5.1",
         "vant": "^2.12.48",
+        "vconsole": "^3.14.6",
         "vue": "^2.6.14",
         "vue-i18n": "^8.0.0",
         "vue-router": "^3.5.1",
@@ -4236,6 +4237,17 @@
         "url": "https://github.com/sponsors/mesqueeb"
       }
     },
+    "node_modules/copy-text-to-clipboard": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.0.1.tgz",
+      "integrity": "sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q==",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/copy-webpack-plugin": {
       "version": "9.1.0",
       "resolved": "https://registry.npmmirror.com/copy-webpack-plugin/-/copy-webpack-plugin-9.1.0.tgz",
@@ -7198,6 +7210,11 @@
         "multicast-dns": "cli.js"
       }
     },
+    "node_modules/mutation-observer": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/mutation-observer/-/mutation-observer-1.0.3.tgz",
+      "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
+    },
     "node_modules/mz": {
       "version": "2.7.0",
       "resolved": "https://registry.npmmirror.com/mz/-/mz-2.7.0.tgz",
@@ -10216,6 +10233,17 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/vconsole": {
+      "version": "3.14.6",
+      "resolved": "https://registry.npmjs.org/vconsole/-/vconsole-3.14.6.tgz",
+      "integrity": "sha512-8Ffk2SfNe6EzKqZ0aNnNjpAVBVT7zgJo81lYEJdKySYLVYBeSawdSkWi9fSjDg3WsQhgS1vNPmRqJDTuwdVbnQ==",
+      "dependencies": {
+        "@babel/runtime": "^7.17.2",
+        "copy-text-to-clipboard": "^3.0.1",
+        "core-js": "^3.11.0",
+        "mutation-observer": "^1.0.3"
+      }
+    },
     "node_modules/vue": {
       "version": "2.7.8",
       "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.8.tgz",
@@ -13866,6 +13894,11 @@
         "is-what": "^3.14.1"
       }
     },
+    "copy-text-to-clipboard": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.0.1.tgz",
+      "integrity": "sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q=="
+    },
     "copy-webpack-plugin": {
       "version": "9.1.0",
       "resolved": "https://registry.npmmirror.com/copy-webpack-plugin/-/copy-webpack-plugin-9.1.0.tgz",
@@ -15898,6 +15931,11 @@
         "thunky": "^1.0.2"
       }
     },
+    "mutation-observer": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/mutation-observer/-/mutation-observer-1.0.3.tgz",
+      "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
+    },
     "mz": {
       "version": "2.7.0",
       "resolved": "https://registry.npmmirror.com/mz/-/mz-2.7.0.tgz",
@@ -17940,6 +17978,17 @@
       "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
       "dev": true
     },
+    "vconsole": {
+      "version": "3.14.6",
+      "resolved": "https://registry.npmjs.org/vconsole/-/vconsole-3.14.6.tgz",
+      "integrity": "sha512-8Ffk2SfNe6EzKqZ0aNnNjpAVBVT7zgJo81lYEJdKySYLVYBeSawdSkWi9fSjDg3WsQhgS1vNPmRqJDTuwdVbnQ==",
+      "requires": {
+        "@babel/runtime": "^7.17.2",
+        "copy-text-to-clipboard": "^3.0.1",
+        "core-js": "^3.11.0",
+        "mutation-observer": "^1.0.3"
+      }
+    },
     "vue": {
       "version": "2.7.8",
       "resolved": "https://registry.npmmirror.com/vue/-/vue-2.7.8.tgz",

+ 1 - 0
package.json

@@ -17,6 +17,7 @@
     "postcss-pxtorem": "^6.0.0",
     "qrcode": "^1.5.1",
     "vant": "^2.12.48",
+    "vconsole": "^3.14.6",
     "vue": "^2.6.14",
     "vue-i18n": "^8.0.0",
     "vue-router": "^3.5.1",

+ 3 - 1
src/main.js

@@ -9,8 +9,10 @@ import '@/utils/css.css'
 import 'normalize.css'
 import i18n from '@/lang'
 // import '@/utils/web3'
+import VConsole from 'vconsole';
+const vConsole = new VConsole();
 
-
+Vue.use(vConsole);
 Vue.use(Vant);
 Vue.config.productionTip = false
 

+ 5 - 0
src/views/home/index.vue

@@ -432,6 +432,11 @@ export default {
       let gasPrice = await web3.eth.getGasPrice().then(res => {
         return res
       })
+      console.log(this.battleID);
+      if(this.battleID >= 1000) {
+         this.$router.push('/drawCard')
+         return false
+      }
       contractData.data.gameContract.methods
         .join(type)
         .call(

+ 22 - 2
yarn.lock

@@ -904,7 +904,7 @@
     "@babel/types" "^7.4.4"
     "esutils" "^2.0.2"
 
-"@babel/runtime@^7.12.13", "@babel/runtime@^7.8.4", "@babel/runtime@7.x":
+"@babel/runtime@^7.12.13", "@babel/runtime@^7.17.2", "@babel/runtime@^7.8.4", "@babel/runtime@7.x":
   "integrity" "sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw=="
   "resolved" "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.18.9.tgz"
   "version" "7.18.9"
@@ -2321,6 +2321,11 @@
   dependencies:
     "is-what" "^3.14.1"
 
+"copy-text-to-clipboard@^3.0.1":
+  "integrity" "sha512-rvVsHrpFcL4F2P8ihsoLdFHmd404+CMg71S756oRSeQgqk51U3kicGdnvfkrxva0xXH92SjGS62B0XIJsbh+9Q=="
+  "resolved" "https://registry.npmjs.org/copy-text-to-clipboard/-/copy-text-to-clipboard-3.0.1.tgz"
+  "version" "3.0.1"
+
 "copy-webpack-plugin@^9.0.1":
   "integrity" "sha512-rxnR7PaGigJzhqETHGmAcxKnLZSR5u1Y3/bcIv/1FnqXedcL/E2ewK7ZCNrArJKCiSv8yVXhTqetJh8inDvfsA=="
   "resolved" "https://registry.npmmirror.com/copy-webpack-plugin/-/copy-webpack-plugin-9.1.0.tgz"
@@ -2341,7 +2346,7 @@
     "browserslist" "^4.21.2"
     "semver" "7.0.0"
 
-"core-js@^3.8.3":
+"core-js@^3.11.0", "core-js@^3.8.3":
   "integrity" "sha512-7Vh11tujtAZy82da4duVreQysIoO2EvVrur7y6IzZkH1IHPSekuDi8Vuw1+YKjkbfWLRD7Nc9ICQ/sIUDutcyg=="
   "resolved" "https://registry.npmmirror.com/core-js/-/core-js-3.23.5.tgz"
   "version" "3.23.5"
@@ -3918,6 +3923,11 @@
     "dns-packet" "^5.2.2"
     "thunky" "^1.0.2"
 
+"mutation-observer@^1.0.3":
+  "integrity" "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA=="
+  "resolved" "https://registry.npmjs.org/mutation-observer/-/mutation-observer-1.0.3.tgz"
+  "version" "1.0.3"
+
 "mz@^2.4.0":
   "integrity" "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q=="
   "resolved" "https://registry.npmmirror.com/mz/-/mz-2.7.0.tgz"
@@ -5506,6 +5516,16 @@
   "resolved" "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz"
   "version" "1.1.2"
 
+"vconsole@^3.14.6":
+  "integrity" "sha512-8Ffk2SfNe6EzKqZ0aNnNjpAVBVT7zgJo81lYEJdKySYLVYBeSawdSkWi9fSjDg3WsQhgS1vNPmRqJDTuwdVbnQ=="
+  "resolved" "https://registry.npmjs.org/vconsole/-/vconsole-3.14.6.tgz"
+  "version" "3.14.6"
+  dependencies:
+    "@babel/runtime" "^7.17.2"
+    "copy-text-to-clipboard" "^3.0.1"
+    "core-js" "^3.11.0"
+    "mutation-observer" "^1.0.3"
+
 "vue-hot-reload-api@^2.3.0":
   "integrity" "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog=="
   "resolved" "https://registry.npmmirror.com/vue-hot-reload-api/-/vue-hot-reload-api-2.3.4.tgz"