From 7649468d66e1ccd47f3dc321977898a87a7b2b4e Mon Sep 17 00:00:00 2001 From: MickWang <1244134672@qq.com> Date: Tue, 6 Aug 2024 21:52:13 +0800 Subject: [PATCH] update url params for intent url --- .../common/input/TransactionAddress.vue | 19 ++++++++++++-- views/transactions/Deposit.vue | 26 +++++++++++++++++-- views/transactions/DepositSubmitted.vue | 16 +++++++++++- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/components/common/input/TransactionAddress.vue b/components/common/input/TransactionAddress.vue index 62d910297..558d08262 100644 --- a/components/common/input/TransactionAddress.vue +++ b/components/common/input/TransactionAddress.vue @@ -5,14 +5,17 @@
{{ label }}
-
+
+ To account {{ shortenAddress(receipt) }} +
+
{{ inputVisible ? "To another account" : defaultLabel }} {{ inputVisible ? "Use my account" : "Change" }}
-
+
{ + const receipt = route.query.receipt as string; + if (isAddress(receipt)) { + return receipt; + } else { + return ""; + } +}); + const emit = defineEmits<{ (eventName: "update:error", error?: string): void; (eventName: "update:modelValue", amount: string): void; diff --git a/views/transactions/Deposit.vue b/views/transactions/Deposit.vue index 0c8fd3f02..aae05ddf0 100644 --- a/views/transactions/Deposit.vue +++ b/views/transactions/Deposit.vue @@ -382,6 +382,9 @@ > Continue + + Go Back + @@ -467,8 +473,8 @@ import { getWaitTime } from "@/data/networks"; import { useDestinationsStore } from "@/store/destinations"; import { useNetworkStore } from "@/store/network"; import { useOnboardStore } from "@/store/onboard"; -import { useSearchtokenStore } from "@/store/searchToken"; import { usePreferencesStore } from "@/store/preferences"; +import { useSearchtokenStore } from "@/store/searchToken"; import { useZkSyncEthereumBalanceStore } from "@/store/zksync/ethereumBalance"; import { useZkSyncProviderStore } from "@/store/zksync/provider"; import { useZkSyncTokensStore } from "@/store/zksync/tokens"; @@ -530,6 +536,14 @@ const pageDesc = computed(() => { return props.isIntegrate ? desc : ""; }); +const receipt = computed(() => { + return route.query.receipt; +}); + +const fromLink = computed(() => { + return route.query.fromLink; +}); + const step = ref<"form" | "confirm" | "submitted">("form"); const isMerge = ref(true); const destination = computed(() => destinations.value.nova); @@ -662,7 +676,11 @@ const queryAddress = useRouteQuery("address", undefined, { transform: String, mode: "replace", }); -const address = ref((queryAddress.value !== "undefined" && queryAddress.value) || ""); +const address = ref( + (receipt.value && isAddress(receipt.value as string) + ? (receipt.value as string) + : queryAddress.value !== "undefined" && queryAddress.value) || "" +); const isAddressInputValid = computed(() => { if (address.value) { return isAddress(address.value); @@ -829,6 +847,10 @@ const buttonContinue = () => { } }; +const handleGoBack = () => { + window.open(fromLink.value as string, "_self"); +}; + const buttonWrap = () => { if (continueButtonDisabled.value) { return; diff --git a/views/transactions/DepositSubmitted.vue b/views/transactions/DepositSubmitted.vue index ac280f1af..8a129faf4 100644 --- a/views/transactions/DepositSubmitted.vue +++ b/views/transactions/DepositSubmitted.vue @@ -27,6 +27,7 @@ Make another transaction + + Go Back +