|
|
@@ -60,7 +60,8 @@
|
|
|
بازبینی
|
|
|
</span>
|
|
|
</div>
|
|
|
- <div class="apply-discount-step">
|
|
|
+ <div v-if="$route.query.type !== 'enrollment'"
|
|
|
+ class="apply-discount-step">
|
|
|
<svg xmlns="http://www.w3.org/2000/svg"
|
|
|
width="20.639"
|
|
|
height="19.173"
|
|
|
@@ -126,7 +127,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <discount :target-id="classroom.id"
|
|
|
+ <discount v-if="$route.query.type !== 'enrollment' && classroom.price !== 0"
|
|
|
+ :target-id="classroom.id"
|
|
|
:target="getTarget"
|
|
|
@set-discount="setDiscount" />
|
|
|
</div>
|
|
|
@@ -228,10 +230,27 @@ export default {
|
|
|
onComplete () {
|
|
|
if (this.$route.query.type === 'register') {
|
|
|
this.createInvoiceForClassroomOrRegisterEvent()
|
|
|
+ } else if (this.$route.query.type === 'enrollment') {
|
|
|
+ this.enrollClassroom()
|
|
|
} else {
|
|
|
this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet', query: this.$route.query })
|
|
|
}
|
|
|
},
|
|
|
+ enrollClassroom () {
|
|
|
+ // this.enrolmentLoading = true
|
|
|
+ APIGateway.classroom.enrollByUser(this.classroom.id)
|
|
|
+ .then(() => {
|
|
|
+ this.$q.notify({
|
|
|
+ message: 'پیش ثبت نام با موفقیت انجام شد.',
|
|
|
+ type: 'positive'
|
|
|
+ })
|
|
|
+ // this.enrolmentLoading = false
|
|
|
+ this.$router.push({ name: 'UserPanel.Profile.ClassroomInfo', params: { id: this.classroom.id } })
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // this.enrolmentLoading = false
|
|
|
+ })
|
|
|
+ },
|
|
|
setDiscount (discount) {
|
|
|
console.log(discount)
|
|
|
if (!discount) {
|