login/registration/reset pages
This commit is contained in:
@ -36,7 +36,6 @@ export const useMenuStore = defineStore("menuStore", () => {
|
||||
const openMenu = ref(false);
|
||||
const openDropDown = ref(false);
|
||||
|
||||
|
||||
const defaultMenu = ref();
|
||||
const menu = ref<UIMenuItem[]>([]);
|
||||
const menuItems = ref<MenuListResponse>();
|
||||
@ -45,6 +44,11 @@ export const useMenuStore = defineStore("menuStore", () => {
|
||||
const countryList = ref<CountryList[]>();
|
||||
const currencies = ref<Currencies[]>();
|
||||
|
||||
// curr/country
|
||||
const selectedCountry = ref();
|
||||
const selectedPhoneCountry = ref();
|
||||
const selectedCurrency = ref<Currencies>();
|
||||
|
||||
const loadMenu = async () => {
|
||||
try {
|
||||
menuItems.value = (await pb
|
||||
@ -98,6 +102,8 @@ export const useMenuStore = defineStore("menuStore", () => {
|
||||
|
||||
const data = await res.json();
|
||||
countryList.value = data.data
|
||||
if (countryList.value)
|
||||
selectedPhoneCountry.value = countryList.value[0]
|
||||
|
||||
} catch (error) {
|
||||
console.error("getList error:", error);
|
||||
@ -121,7 +127,6 @@ export const useMenuStore = defineStore("menuStore", () => {
|
||||
|
||||
const data = await res.json();
|
||||
currencies.value = data.data.items
|
||||
|
||||
} catch (error) {
|
||||
console.error("getList error:", error);
|
||||
}
|
||||
@ -226,6 +231,10 @@ export const useMenuStore = defineStore("menuStore", () => {
|
||||
await loadMenu();
|
||||
await loadFooter();
|
||||
});
|
||||
|
||||
watch(selectedCurrency, () => {
|
||||
store.getCalculator()
|
||||
})
|
||||
return {
|
||||
menu,
|
||||
menuItems,
|
||||
@ -234,6 +243,9 @@ export const useMenuStore = defineStore("menuStore", () => {
|
||||
openDropDown,
|
||||
countryList,
|
||||
currencies,
|
||||
selectedCountry,
|
||||
selectedCurrency,
|
||||
selectedPhoneCountry,
|
||||
loadMenu,
|
||||
loadFooter,
|
||||
getCountryList,
|
||||
|
@ -11,6 +11,7 @@ export const useStore = defineStore("store", () => {
|
||||
const monthlySavings = ref(137);
|
||||
const storagePeriod = ref(10);
|
||||
const totalInvestment = ref()
|
||||
const minValue = ref()
|
||||
|
||||
const components = ref({} as PBPageItem[]);
|
||||
const getSections = async (id: string) => {
|
||||
@ -87,7 +88,31 @@ export const useStore = defineStore("store", () => {
|
||||
}
|
||||
}
|
||||
|
||||
async function getMinValue() {
|
||||
try {
|
||||
const res = await fetch(
|
||||
'http://127.0.0.1:4000/api/public/plan-prediction/free/minimum',
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
if (!res.ok) {
|
||||
throw new Error(`HTTP error: ${res.status}`);
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
minValue.value = data.data
|
||||
|
||||
} catch (error) {
|
||||
console.error("getList error:", error);
|
||||
}
|
||||
}
|
||||
|
||||
getCalculator()
|
||||
getMinValue()
|
||||
|
||||
return {
|
||||
currentPageID,
|
||||
@ -95,6 +120,7 @@ export const useStore = defineStore("store", () => {
|
||||
totalInvestment,
|
||||
monthlySavings,
|
||||
storagePeriod,
|
||||
minValue,
|
||||
getCalculator,
|
||||
getComponents,
|
||||
getSections,
|
||||
|
Reference in New Issue
Block a user