Skip to content

Commit

Permalink
requests(webinar and consultation) now working
Browse files Browse the repository at this point in the history
  • Loading branch information
ksydex committed Feb 16, 2020
1 parent e7ed799 commit 1ee3544
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pages/edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<VH3 mb="var(--space-half)">email: {{ email }}</VH3>
<VInput required caption="Имя" v-model="first_name"></VInput>
<VInput required caption="Фамилия" v-model="last_name"></VInput>
<VInput caption="Отчество" v-model="patronymic"></VInput>
<VInput caption="Отчество(если есть)" v-model="patronymic"></VInput>
<VInput
required
step="0.01"
Expand Down
20 changes: 14 additions & 6 deletions pages/special/consultation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
<VPageHeading>
Онлайн консультация
<template v-slot:info>
Онлайн консультация ыы. Текст
<br />
Заполните форму ниже и оплатите участие, укажите удобный диапазон дат
когда вам будет удобно
когда вам будет удобно. Беседа проходит в онлайн формате через любой
удобный для вас сервис.
</template>
</VPageHeading>

Expand Down Expand Up @@ -57,9 +56,18 @@ export default {
}
},
methods: {
proceedToPay() {
this.SUCCESS('Ваша заявка успешно отправлена')
this.$router.push('/')
async proceedToPay() {
const info = {
tutor: this.tutor,
date_from: this.date_from,
date_to: this.date_to,
type: 1
}
try {
const result = await this.$api.Request.add(info)
window.open(result.data.url)
this.SUCCESS('Ваша заявка успешно отправлена!')
} catch (e) {}
},
...mapActions({
SUCCESS: 'popup/SET_SUCCESS'
Expand Down
26 changes: 19 additions & 7 deletions pages/special/webinar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
<VPageHeading level="3">
Вебинар с Мариной Богомоловой
<template v-slot:info>
Описание. Сверх крутая штука крч! Состоится 20.11 в 19:00 через Skype
Бесплатный вебинар, проводится в форме онлайн конференции.
<br />
Заполните форму ниже и оплатите участие
В форме ниже укажите диапазон дат, в которые вам было бы удобно посетить
вебинар.
</template>
</VPageHeading>

Expand All @@ -24,8 +25,8 @@
caption="Дата до"
v-model="date_to"
></VInput>
<VButton type="submit" form="buy-form" value="submit" w100>
Перейти к оплате
<VButton type="submit" form="webinar__form" value="submit" w100>
Отправить
</VButton>
</form>
</div>
Expand All @@ -45,9 +46,20 @@ export default {
}
},
methods: {
proceedToPay() {
this.SUCCESS('Ваша заявка успешно отправлена!')
this.$router.push('/')
async proceedToPay() {
console.log('sadasd')
const info = {
tutor: 'Богомолова',
date_from: this.date_from,
date_to: this.date_to,
type: 0
}
try {
console.log('trya')
const result = await this.$api.Request.add(info)
this.SUCCESS('Ваша заявка успешно отправлена!')
this.$router.push('/')
} catch (e) {}
},
...mapActions({
SUCCESS: 'popup/SET_SUCCESS'
Expand Down
4 changes: 4 additions & 0 deletions services/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ export default function(ctx) {
getUserById: id => axios.$get('/public/user/' + id)
}

this.Request = {
add: data => axios.$post('/request', data)
}

this.Exercise = {
getById: id => axios.$get('/exercise/' + id),
getAll: () => axios.$get('/exercise')
Expand Down

0 comments on commit 1ee3544

Please sign in to comment.