Fixes: 1) Correct file path imports by removing `.js` extensions in GraphQL fragments; 2) Resolve typo in `usePromocodeStore` composables to ensure consistent store usage; 3) Add missing `:type="submit"` to login form button for proper form submission handling; Extra: 1) Remove unused `.idea` and `README.md` files for repository cleanup; 2) Delete extraneous dependencies from `package-lock.json` for streamlined package management; 3) Refactor category slug handling with improved composable logic for cleaner route parameters and SEO alignment.
78 lines
No EOL
1.6 KiB
Vue
78 lines
No EOL
1.6 KiB
Vue
<template>
|
|
<form @submit.prevent="handleDeposit()" class="form">
|
|
<div class="form__box">
|
|
<ui-input
|
|
:type="'text'"
|
|
:placeholder="''"
|
|
v-model="amount"
|
|
:numberOnly="true"
|
|
:inputMode="'decimal'"
|
|
/>
|
|
<icon name="ic:baseline-compare-arrows" size="30" />
|
|
<ui-input
|
|
:type="'text'"
|
|
:placeholder="''"
|
|
v-model="amount"
|
|
:numberOnly="true"
|
|
:inputMode="'decimal'"
|
|
/>
|
|
</div>
|
|
<ui-button
|
|
:type="'submit'"
|
|
class="form__button"
|
|
:isDisabled="!isFormValid"
|
|
:isLoading="loading"
|
|
>
|
|
{{ t('buttons.topUp') }}
|
|
</ui-button>
|
|
</form>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import {useDeposit} from "~/composables/user";
|
|
|
|
const { t } = useI18n();
|
|
const companyStore = useCompanyStore();
|
|
|
|
const paymentMin = computed(() => companyStore.companyInfo?.paymentGatewayMinimum || 0);
|
|
const paymentMax = computed(() => companyStore.companyInfo?.paymentGatewayMaximum || 500);
|
|
|
|
const amount = ref<string>("0");
|
|
|
|
const isFormValid = computed(() => {
|
|
return (
|
|
amount.value >= paymentMin.value &&
|
|
amount.value <= paymentMax.value
|
|
);
|
|
});
|
|
|
|
const { deposit, loading } = useDeposit();
|
|
|
|
async function handleDeposit() {
|
|
await deposit(amount.value);
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.form {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 20px;
|
|
|
|
&__box {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 20px;
|
|
|
|
& span {
|
|
flex-shrink: 0;
|
|
align-self: center;
|
|
}
|
|
}
|
|
|
|
&__button {
|
|
width: fit-content;
|
|
padding-inline: 20px;
|
|
}
|
|
}
|
|
</style> |