You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
2.2 KiB
100 lines
2.2 KiB
import axios from 'axios';
|
|
import 'alpinejs';
|
|
import wNumb from 'wnumb';
|
|
|
|
var units = window.units = {
|
|
currency: wNumb({
|
|
mark: ',',
|
|
thousand: '.',
|
|
prefix: '',
|
|
suffix: '',
|
|
decimals: 0
|
|
}),
|
|
decimalCurrency: wNumb({
|
|
mark: ',',
|
|
thousand: '.',
|
|
prefix: '',
|
|
suffix: '',
|
|
decimals: 2
|
|
}),
|
|
percent: wNumb({
|
|
mark: ',',
|
|
thousand: '',
|
|
prefix: '',
|
|
suffix: '',
|
|
decimals: 2
|
|
})
|
|
};
|
|
|
|
|
|
window.stepper = {
|
|
parts: {
|
|
notar: 0.02,
|
|
grundsteuer: 0.065,
|
|
makler: 0.0357
|
|
},
|
|
units: units,
|
|
step: 0,
|
|
greetings: [
|
|
{ value: 'frau', label: 'Frau' },
|
|
{ value: 'herr', label: 'Herr' },
|
|
{ value: 'divers', label: 'Divers' },
|
|
],
|
|
jobs: [
|
|
{ value: 'angestellt', label: 'Angestellte*r' },
|
|
],
|
|
titles: [
|
|
{ value: 'prof', label: 'Prof' },
|
|
{ value: 'dr', label: 'Dr' },
|
|
],
|
|
value: {
|
|
kind: null,
|
|
kauf: {
|
|
kaufpreis: 300000,
|
|
modernisierung: 0,
|
|
baukosten: 0,
|
|
eigenkapital: 0,
|
|
},
|
|
bau: {
|
|
grundstueckspreis: 300000,
|
|
bezahlt: '0',
|
|
baukosten: 0,
|
|
eigenkapital: 0,
|
|
},
|
|
anschluss: {
|
|
objektwert: 300000,
|
|
umschuldung: 50000,
|
|
zuskap: 50000
|
|
},
|
|
wert: 300000,
|
|
umschuldung: 0,
|
|
kapital_zus: 0,
|
|
greeting: null,
|
|
title: null,
|
|
firstname: '',
|
|
lastname: '',
|
|
zip: '',
|
|
location: '',
|
|
phone: '',
|
|
email: '',
|
|
job: '',
|
|
haushalt: '',
|
|
einnahme: ''
|
|
},
|
|
kinds: [
|
|
{label: 'Kauf einer Immobilie', value: 'kauf', icon: 'home'},
|
|
{label: 'Eigenes Bauvorhaben', value: 'bau', icon: 'home'},
|
|
{label: 'Anschlussfinanzierung', value: 'anschluss', icon: 'home'}
|
|
],
|
|
|
|
/* Methods */
|
|
svg(icon) {
|
|
return `<svg><use xlink:href="${this.sprite}#${icon}"></use></svg>`;
|
|
},
|
|
|
|
submit() {
|
|
axios.post('/wp-admin/admin-ajax.php?action=stepper_submit', {
|
|
...this.value
|
|
});
|
|
}
|
|
};
|