hgh 1 год назад
Родитель
Сommit
6038eebe4b

+ 12 - 12
src/components/Widgets/Other/Shop/ShopApplyDiscount/ShopApplyDiscount.vue

@@ -179,7 +179,7 @@ export default {
   }),
   computed: {
     mainTitle () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'ثبت نام در رویداد'
       } else {
         return 'ثبت نام در دوره آموزشی'
@@ -189,18 +189,18 @@ export default {
       return 'تکمیل اطلاعات'
     },
     step2Title () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'مشاهده جزییات و قوانین رویداد'
       } else {
         return 'مشاهده جزییات و قوانین دوره'
       }
     },
     getTarget () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'EVENT'
-      } else if (this.$route.query.source === 'classroom') {
+      } else if (this.$route.query?.source === 'classroom') {
         return 'TRAINING'
-      } else if (this.$route.query.source === 'store') {
+      } else if (this.$route.query?.source === 'store') {
         return 'STORE'
       } else {
         return 'NAV'
@@ -210,10 +210,10 @@ export default {
       return 'inventory_2'
     },
     showDiscountSection () {
-      return this.$route.query.type !== 'enrollment' && this.classroom.price !== 0
+      return this.$route.query?.type !== 'enrollment' && this.classroom.price !== 0
     },
     showPayStage () {
-      return this.$route.query.type !== 'enrollment'
+      return this.$route.query?.type !== 'enrollment'
     }
   },
   watch: {
@@ -221,7 +221,7 @@ export default {
   mounted () {
     this.loadClassroomFromStore()
     this.orderPrice = this.classroom.price
-    if (this.$route.query.source === 'event') {
+    if (this.$route.query?.source === 'event') {
       this.getEventTest()
     }
     this.mounted = true
@@ -237,9 +237,9 @@ export default {
   },
   methods: {
     onComplete () {
-      if (this.$route.query.type === 'register') {
+      if (this.$route.query?.type === 'register') {
         this.createInvoiceForClassroomOrRegisterEvent()
-      } else if (this.$route.query.type === 'enrollment') {
+      } else if (this.$route.query?.type === 'enrollment') {
         this.enrollClassroom()
       } else {
         this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet', query: this.$route.query })
@@ -305,7 +305,7 @@ export default {
       this.$nextTick(() => {
         this.$refs.entityEdit.editEntity(false)
           .then(() => {
-            if (this.$route.query.type === 'register') {
+            if (this.$route.query?.type === 'register') {
               this.createInvoiceForClassroomOrRegisterEvent()
             } else {
               this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet', query: this.$route.query })
@@ -343,7 +343,7 @@ export default {
                 type: 'positive'
               })
               const eventRegistrationId = data.model.classroom_info.id
-              if (this.$route.query.source === 'event') {
+              if (this.$route.query?.source === 'event') {
                 this.$router.push({ name: 'UserPanel.Profile.EventInfo', params: { id: eventRegistrationId } })
               } else {
                 this.$router.push({ name: 'UserPanel.Profile.ClassroomInfo', params: { id: eventRegistrationId } })

+ 5 - 5
src/components/Widgets/Other/Shop/ShopCompleteInfo/ShopCompleteInfo.vue

@@ -287,7 +287,7 @@ export default {
       return FormBuilderAssist.getInputsByName(this.inputs, 'is_abroad_living_address').value
     },
     mainTitle () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'ثبت نام در رویداد'
       } else {
         return 'ثبت نام در دوره آموزشی'
@@ -297,7 +297,7 @@ export default {
       return 'تکمیل اطلاعات'
     },
     step2Title () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'مشاهده جزییات و قوانین رویداد'
       } else {
         return 'مشاهده جزییات و قوانین دوره'
@@ -310,7 +310,7 @@ export default {
       return FormBuilderAssist.getInputsByName(this.inputs, 'living_province').value
     },
     showPayStage () {
-      return this.$route.query.type !== 'enrollment'
+      return this.$route.query?.type !== 'enrollment'
     }
   },
   watch: {
@@ -439,7 +439,7 @@ export default {
   },
   mounted () {
     this.loadClassroomFromStore()
-    if (this.$route.query.source === 'event') {
+    if (this.$route.query?.source === 'event') {
       this.getEventTest()
     }
     this.mounted = true
@@ -523,7 +523,7 @@ export default {
                 type: 'positive'
               })
               const eventRegistrationId = data.model.classroom_info.id
-              if (this.$route.query.source === 'event') {
+              if (this.$route.query?.source === 'event') {
                 this.$router.push({ name: 'UserPanel.Profile.EventInfo', params: { id: eventRegistrationId } })
               } else {
                 this.$router.push({ name: 'UserPanel.Profile.ClassroomInfo', params: { id: eventRegistrationId } })

+ 5 - 5
src/components/Widgets/Other/Shop/ShopPaymentFromWallet/ShopPaymentFromWallet.vue

@@ -272,7 +272,7 @@ export default {
   }),
   computed: {
     mainTitle () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'ثبت نام در رویداد'
       } else {
         return 'ثبت نام در دوره آموزشی'
@@ -282,17 +282,17 @@ export default {
       return 'تکمیل اطلاعات'
     },
     step2Title () {
-      if (this.$route.query.source === 'event') {
+      if (this.$route.query?.source === 'event') {
         return 'مشاهده جزییات و قوانین رویداد'
       } else {
         return 'مشاهده جزییات و قوانین دوره'
       }
     },
     isRegisterPage () {
-      return this.$route.query.type === 'register'
+      return this.$route.query?.type === 'register'
     },
     isEnrollmentPage () {
-      return this.$route.query.type === 'enrollment'
+      return this.$route.query?.type === 'enrollment'
     }
   },
   mounted () {
@@ -349,7 +349,7 @@ export default {
         .then((message) => {
           this.payMessage = message
           this.invoice.loading = false
-          if (this.$route.query.source === 'event') {
+          if (this.$route.query?.source === 'event') {
             this.$router.push({ name: 'UserPanel.Profile.EventInfo', params: { id: this.classroom.id } })
           } else {
             this.$router.push({ name: 'UserPanel.Profile.ClassroomInfo', params: { id: this.classroom.id } })

+ 1 - 1
src/components/Widgets/Store/Cart/components/step1/sidebar.vue

@@ -61,7 +61,7 @@ export default {
   },
   computed: {
     getButtonLabel () {
-      if (this.$route.query.type !== 'enrollment') {
+      if (this.$route.query?.type !== 'enrollment') {
         return 'به خرید ادامه بده'
       } else {
         return 'تایید و پیش ثبت نام'