wkw 2 долоо хоног өмнө
parent
commit
2e90157019

+ 7 - 1
src/views/me/addAddress/index.vue

@@ -28,7 +28,7 @@
                         :autosize="true"
                     >
                         <template #right-icon>
-                            <svg-icon style="width: 16px; height: 16px;" name="sm" />
+                            <svg-icon style="width: 16px; height: 16px;" name="sm" @click="changeSM"/>
                         </template>
                     </van-field>
                 </div>
@@ -56,6 +56,7 @@
 
 <script setup>
 import { useRouter,useRoute } from 'vue-router'
+import { startScan } from "@/composables/barcodeScanner.js"
 import { useWalletStore } from "@/stores/modules/walletStore";
 import { useSystemStore } from "@/stores/modules/systemStore";
 const systemStore = useSystemStore();
@@ -72,6 +73,11 @@ const walletAddress = ref('')
 const isConfirm = computed(()=>{
     return !(addressName.value.trim() && walletAddress.value.trim());
 })
+// 扫码
+const changeSM = async () => {
+    const result = await startScan();
+    walletAddress.value = result.ScanResult;
+}
 // 切换网络
 const changeList = (item) => {
     showWallet.value = false;

+ 8 - 1
src/views/wallet/transferDetail/index.vue

@@ -22,7 +22,7 @@
                         :autosize="true"
                     >
                         <template #right-icon>
-                            <svg-icon style="width: 16px; height: 16px;" name="sm" />
+                            <svg-icon style="width: 16px; height: 16px;" name="sm" @click="changeSM"/>
                         </template>
                     </van-field>
                 </div>
@@ -103,6 +103,7 @@
 
 <script setup>
 import { verifyFingerprint } from "@/components/Biometrics/biometrics.js"
+import { startScan } from "@/composables/barcodeScanner.js"
 import { cryptoDecode } from "@/utils/crypto.js"
 import { useRouter,useRoute } from 'vue-router'
 import { useWalletStore } from "@/stores/modules/walletStore";
@@ -110,6 +111,7 @@ import Web3 from "web3";
 import pubData from "@/utils/pub.json";
 import { showLoadingToast,showToast } from 'vant';
 import { showNotify } from 'vant';
+
 const router = useRouter();
 const route = useRoute();
 const walletStore = useWalletStore();
@@ -193,6 +195,11 @@ const changeList = (item) => {
     showWallet.value = false;
     unitNum.value = ''
 }
+// 扫码
+const changeSM = async () => {
+    const result = await startScan();
+    walletAddress.value = result.ScanResult;
+}
 // 确认
 const confirm = async () => {
     showWallet.value = false;