wkw 3 тижнів тому
батько
коміт
fb5eb8751c

+ 0 - 1
src/views/login/backupMnemonic/index.vue

@@ -34,7 +34,6 @@
 
 <script setup>
 import { createAccent } from "@/api/path/login.api";
-import { useSystemStore } from "@/stores/modules/systemStore";
 import { useWalletStore } from "@/stores/modules/walletStore";
 
 // 一键复制文本

+ 1 - 3
src/views/login/createWallet/index.vue

@@ -71,9 +71,7 @@ import { cryptoEncode } from "@/utils/crypto.js"
 import { useWalletStore } from "@/stores/modules/walletStore";
 
 const router = useRouter();
-const route = useRoute();
 const walletStore = useWalletStore();
-// const network = JSON.parse(route.query.network);
 
 const form = ref({});
 const show = ref(false);
@@ -88,7 +86,7 @@ const onSubmit = ()=>{
 const goTo = () => {
   let data = _.cloneDeep(form.value)
   data.password = cryptoEncode(data.password) 
-  // 将网络和钱包信息保存
+  // 将钱包信息保存
   walletStore.username = data.username
   walletStore.accountPassword = data.password
   walletStore.accountHint = data.promptMessage

+ 1 - 5
src/views/login/importMethod/index.vue

@@ -19,10 +19,7 @@
 </template>
 
 <script setup>
-import { useRoute } from 'vue-router'
 const router = useRouter();
-const route = useRoute();
-const network = route.query.network;
 const tabList = [
     {
         name:'私鑰導入',
@@ -41,8 +38,7 @@ const goTo = (i) => {
     router.push({
         path: '/importWallet',
         query: {
-            type:i,
-            network:network
+            type:i
         }
     })
 }

+ 0 - 5
src/views/login/importWallet/index.vue

@@ -84,16 +84,11 @@ const form = ref({
   userKey: "",
 });
 
-const ddd = ref("0");
- 
 const onSubmit = async () => {
   if (form.value.password !== form.value.confirmPassword) {
     $msg($t("form.InconsistentPasswords"));
     return;
   }
-  let data = _.cloneDeep(form.value);
-  console.log("data= ", data);
-
   walletStore.username = form.value.username;
   walletStore.privateKey = form.value.userKey;
   walletStore.accountPassword = form.value.password;

+ 14 - 10
src/views/wallet/index.vue

@@ -87,8 +87,8 @@
           </div>
           <div class="tree">
             <div class="tree-lf">
-              <div class="tree-lf-icon" v-for="(item,i) in 10" :class="i == 0?'active-bg':''">
-                <svg-icon style="width: 32px; height: 32px;" name="acc" />
+              <div class="tree-lf-icon" v-for="(item,i) in networkList" :class="i == 0?'active-bg':''">
+                <van-image lazy-load class="network-item-icon" :src="item.icon" />
               </div>
             </div>
             <div class="tree-ri">
@@ -177,17 +177,16 @@
   
   <script setup>
   import { useRouter } from 'vue-router'
-  import { useSystemStore } from "@/stores/modules/systemStore";
-  import {  useWalletStore } from "@/stores/modules/walletStore";
-  const systemStore = useSystemStore();
+  import { getNetwork } from '@/api/path/login.api'
+  import { useWalletStore } from "@/stores/modules/walletStore";
   const router = useRouter();
-
-
-
   const walletStore = useWalletStore();
+
+  
   const isShow = ref(true);
   const showWallet = ref(false);
   const showHistory = ref(false);
+  const networkList = ref([]);
   const type = ref('');
   const goToPage = (url) => {
     router.push(url)
@@ -205,9 +204,14 @@
       }
     })
   }
+  const initNetwork =  async () => {
+    const { data } = await getNetwork({})
+    networkList.value = data
+  }
   onMounted(async ()=>{
-    // const aa = await walletStore.getBalance();
-    // console.log("---",aa)
+    initNetwork();
+    const aa = await walletStore.getBalance();
+    console.log("---",aa)
   })
   </script>