Quellcode durchsuchen

تغییر پراگرس بار با توجه به پیش ثبت نام یا ثبت نام

hgh vor 1 Jahr
Ursprung
Commit
d8e2b76ba3

+ 21 - 2
src/components/Widgets/Other/Shop/ShopApplyDiscount/ShopApplyDiscount.vue

@@ -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) {

+ 2 - 1
src/components/Widgets/Other/Shop/ShopCompleteInfo/ShopCompleteInfo.vue

@@ -40,7 +40,8 @@
           بازبینی
         </span>
       </div>
-      <div class="complete-info-step">
+      <div v-if="$route.query.type !== 'enrollment'"
+           class="complete-info-step">
         <svg xmlns="http://www.w3.org/2000/svg"
              width="20.639"
              height="19.173"

+ 2 - 6
src/components/Widgets/Other/Shop/ShopPaymentFromWallet/ShopPaymentFromWallet.vue

@@ -57,7 +57,7 @@
           </g>
         </svg>
         <span class="title">
-          تکمیل اطلاعات
+          بازبینی
           <svg xmlns="http://www.w3.org/2000/svg"
                width="15"
                height="15"
@@ -279,11 +279,7 @@ export default {
       }
     },
     step1Title () {
-      if (this.$route.query.source === 'event') {
-        return 'مشاهده جزییات و قوانین رویداد'
-      } else {
-        return 'مشاهده جزییات و قوانین دوره'
-      }
+      return 'تکمیل اطلاعات'
     },
     step2Title () {
       if (this.$route.query.source === 'event') {

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

@@ -33,7 +33,7 @@
       <q-btn color="primary"
              unelevated
              @click="onComplete">
-        به خرید ادامه بده
+        {{ getButtonLabel }}
       </q-btn>
     </div>
   </div>
@@ -59,6 +59,15 @@ export default {
       step: 1
     }
   },
+  computed: {
+    getButtonLabel () {
+      if (this.$route.query.type !== 'enrollment') {
+        return 'به خرید ادامه بده'
+      } else {
+        return 'تایید و پیش ثبت نام'
+      }
+    }
+  },
   methods: {
     onComplete () {
       this.$emit('complete')