seller flow + blockchain integration

This commit is contained in:
brunoedcf
2022-12-23 15:51:13 -03:00
parent 17d6e86508
commit 0de0046064
8 changed files with 61 additions and 32 deletions

View File

@@ -11,6 +11,8 @@ const props = defineProps({
tokenValue: Number,
});
console.log(props.pixTarget, props.tokenValue);
const qrCode = ref<string>("");
const qrCodePayload = ref<string>("");
const isPixValid = ref<boolean>(false);

View File

@@ -4,9 +4,11 @@ import CustomButton from "@/components/CustomButton.vue";
// Emits
const emit = defineEmits(["sendNetwork"]);
const sendNetworkHandle = () => {
emit("sendNetwork");
};
// props and store references
const props = defineProps({
pixKey: String,
offer: Number,
});
</script>
<template>
@@ -27,12 +29,12 @@ const sendNetworkHandle = () => {
>
<div>
<p>Tokens ofertados</p>
<p class="text-2xl text-gray-900">100 BRZ</p>
<p class="text-2xl text-gray-900">{{ props.offer }} BRZ</p>
</div>
<div class="my-3">
<p>Chave Pix</p>
<p class="text-xl text-gray-900 break-words">
c02942far7047f6shri5ifh371908973
{{ props.pixKey }}
</p>
</div>
<div class="mb-5">
@@ -44,7 +46,7 @@ const sendNetworkHandle = () => {
</div>
<CustomButton
:text="'Enviar para a rede'"
@buttonClicked="sendNetworkHandle()"
@buttonClicked="emit('sendNetwork')"
/>
</div>
</div>

View File

@@ -14,12 +14,6 @@ const validDecimals = ref(true);
// Emits
const emit = defineEmits(["approveTokens"]);
// Blockchain methods
const approveTokensHandle = async () => {
console.log(offer.value, pixKey.value);
emit("approveTokens");
};
// Debounce methods
const handleInputEvent = (event: any) => {
const { value } = event.target;
@@ -106,7 +100,7 @@ const decimalCount = (num: Number) => {
</div>
<CustomButton
:text="'Aprovar tokens'"
@buttonClicked="approveTokensHandle()"
@buttonClicked="emit('approveTokens', { offer, pixKey })"
/>
</div>
</div>

View File

@@ -170,7 +170,10 @@ const disconnectUser = () => {
<div
class="top-bar-info cursor-pointer"
@click="
[(menuOpenToggle = !menuOpenToggle), (currencyMenuOpenToggle = false)]
[
(menuOpenToggle = !menuOpenToggle),
(currencyMenuOpenToggle = false),
]
"
@mouseover="menuHoverToggle = true"
@mouseout="menuHoverToggle = false"