|
@@ -19,7 +19,7 @@
|
|
title="錢包名稱"
|
|
title="錢包名稱"
|
|
:value="currentWallet.username"
|
|
:value="currentWallet.username"
|
|
is-link
|
|
is-link
|
|
- @click="changePop(1)"
|
|
|
|
|
|
+ @click="changePop(1,'sy')"
|
|
></van-cell>
|
|
></van-cell>
|
|
<van-cell
|
|
<van-cell
|
|
title="查看私鑰"
|
|
title="查看私鑰"
|
|
@@ -27,6 +27,12 @@
|
|
is-link
|
|
is-link
|
|
@click="changePop(2)"
|
|
@click="changePop(2)"
|
|
></van-cell>
|
|
></van-cell>
|
|
|
|
+ <van-cell v-if="currentWallet.words"
|
|
|
|
+ title="查看助記詞"
|
|
|
|
+ value=""
|
|
|
|
+ is-link
|
|
|
|
+ @click="changePop(2,'zjc')"
|
|
|
|
+ ></van-cell>
|
|
</van-list>
|
|
</van-list>
|
|
|
|
|
|
<van-button class="footer-btn" size="large" @click="changePop(3)">删除钱包</van-button>
|
|
<van-button class="footer-btn" size="large" @click="changePop(3)">删除钱包</van-button>
|
|
@@ -50,7 +56,7 @@
|
|
<div>
|
|
<div>
|
|
<div class="pop-title-key">
|
|
<div class="pop-title-key">
|
|
<svg-icon style="width: 24px; height: 24px" name="left-arrow"/>
|
|
<svg-icon style="width: 24px; height: 24px" name="left-arrow"/>
|
|
- <div class="title">查看私钥</div>
|
|
|
|
|
|
+ <div class="title">{{status == 'zjc'?'查看助记词':'查看私钥'}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="pop-text">{{ qrtext }}</div>
|
|
<div class="pop-text">{{ qrtext }}</div>
|
|
<div class="qrcode">
|
|
<div class="qrcode">
|
|
@@ -65,6 +71,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
|
+import { cryptoDecode } from "@/utils/crypto.js"
|
|
import { ref, computed } from 'vue';
|
|
import { ref, computed } from 'vue';
|
|
import QrcodeVue from 'qrcode.vue';
|
|
import QrcodeVue from 'qrcode.vue';
|
|
import { useWalletStore } from '@/stores/modules/walletStore';
|
|
import { useWalletStore } from '@/stores/modules/walletStore';
|
|
@@ -83,18 +90,21 @@ const currentWallet = computed(() => {
|
|
return walletStore.walletList.find(item => item.id === id) || {};
|
|
return walletStore.walletList.find(item => item.id === id) || {};
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-const qrtext = currentWallet.value.privateKey;
|
|
|
|
|
|
+const qrtext = ref('');
|
|
|
|
|
|
// 弹窗控制
|
|
// 弹窗控制
|
|
const show = ref(false);
|
|
const show = ref(false);
|
|
const showkey = ref(false);
|
|
const showkey = ref(false);
|
|
const text = ref('');
|
|
const text = ref('');
|
|
const type = ref('');
|
|
const type = ref('');
|
|
|
|
+const status = ref('');
|
|
|
|
|
|
// 弹窗操作
|
|
// 弹窗操作
|
|
-const changePop = v => {
|
|
|
|
|
|
+const changePop = (v,val) => {
|
|
show.value = true;
|
|
show.value = true;
|
|
type.value = v;
|
|
type.value = v;
|
|
|
|
+ status.value = val;
|
|
|
|
+ qrtext.value = val == 'zjc'?currentWallet.value.words.join(','):currentWallet.value.privateKey;
|
|
};
|
|
};
|
|
|
|
|
|
const cancel = () => {
|
|
const cancel = () => {
|
|
@@ -110,8 +120,8 @@ const confirm = () => {
|
|
// 删除钱包
|
|
// 删除钱包
|
|
walletStore.deleteWallet(id, text.value);
|
|
walletStore.deleteWallet(id, text.value);
|
|
} else if (type.value == 2) {
|
|
} else if (type.value == 2) {
|
|
- // 查看私钥
|
|
|
|
- if (text.value !== currentWallet.value.accountPassword) {
|
|
|
|
|
|
+ // 查看私钥或者密码
|
|
|
|
+ if (text.value !== cryptoDecode(currentWallet.value.accountPassword)) {
|
|
showNotify({ type: 'warning', message: '请输入正确的密码' });
|
|
showNotify({ type: 'warning', message: '请输入正确的密码' });
|
|
} else {
|
|
} else {
|
|
showkey.value = true;
|
|
showkey.value = true;
|