Răsfoiți Sursa

添加竞赛跳转

wkw 3 săptămâni în urmă
părinte
comite
174b99d0ce
3 a modificat fișierele cu 27 adăugiri și 3 ștergeri
  1. 1 1
      src/views/dapp/index.vue
  2. 13 1
      src/views/me/index.vue
  3. 13 1
      src/views/wallet/index.vue

+ 1 - 1
src/views/dapp/index.vue

@@ -228,7 +228,7 @@ const handleVisitDapp = (item) => {
 
   const dapp = cryptoEncode(
     JSON.stringify({
-      address: walletStore.address,
+      address: walletStore.account,
       privateKey: walletStore.privateKey,
     })
   );

+ 13 - 1
src/views/me/index.vue

@@ -68,6 +68,8 @@
 <script setup> 
 import { useSystemStore } from "@/stores/modules/systemStore"
 import { useWalletStore } from "@/stores/modules/walletStore";
+import { openDapp } from "@/composables/dAppView";
+import { cryptoEncode } from "@/utils/crypto";
 import { useCopy } from "@/hooks/use-copy.js";
 useCopy();
 const systemStore = useSystemStore();
@@ -76,7 +78,7 @@ const router = useRouter();
 
 const vanListConfig = [
   { title: '元宝兑换', icon:"ingot",  url: 'exchange',status:true },
-  { title: '竞赛', icon:"competition",  url: '/',status:true },
+  { title: '竞赛', icon:"competition",  url: '',status:true },
   { title: '节点分红', icon:"red-envelope",  url: 'nodeDividend',status:systemStore.Administrator.is_white },
   // { title: '帮助中心', icon:"help",  url: '/' },
   { title: $t('router.AboutUs'), icon:"me",  url: 'aboutUs',status:true },
@@ -91,6 +93,16 @@ const formatAddress = (address) => {
   return address.slice(0, 8) + '...' + address.slice(-6);
 };
 const evGoPath = (path)=>{
+  if(path == ''){
+    const dapp = cryptoEncode(
+      JSON.stringify({
+        address: walletStore.account,
+        privateKey: walletStore.privateKey,
+      })
+    );
+    openDapp('http://192.168.0.70:8088/#/', { dapp });
+    return;
+  }
   router.push(path)
 }
 const goToaPage = (url) => {

+ 13 - 1
src/views/wallet/index.vue

@@ -51,7 +51,7 @@
           <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="3" />
           <div>转账</div>
         </div>
-        <div class="box-cont">
+        <div class="box-cont" @click="goToDapp">
           <svg-icon class="box-cont-icon" style="width: 30px; height: 30px;" name="4" />
           <div>竞赛</div>
         </div>
@@ -197,6 +197,8 @@
   import { useWalletStore } from "@/stores/modules/walletStore";
   import { useSystemStore } from "@/stores/modules/systemStore";
   import {  transactions, tokenTransfers } from "@/api/path/backend.api";
+  import { openDapp } from "@/composables/dAppView";
+  import { cryptoEncode } from "@/utils/crypto";
   import { useCopy } from "@/hooks/use-copy.js";
   useCopy();
 
@@ -327,6 +329,16 @@
   const gethotTokens = async () => {
     await walletStore.updateTokenVal();
   }
+  // 跳转竞赛
+  const goToDapp = () => {
+    const dapp = cryptoEncode(
+      JSON.stringify({
+        address: walletStore.account,
+        privateKey: walletStore.privateKey,
+      })
+    );
+    openDapp('http://192.168.0.70:8088/#/', { dapp });
+  }
 
   const formatAddress = (address) => {
     if (!address) return '';