Prechádzať zdrojové kódy

تغییر مراحل ثبت نام دوره به منظور اعمال کد تخفیف

hgh 1 rok pred
rodič
commit
c5b875dd37

+ 164 - 0
src/components/Widgets/Other/Shop/ShopApplyDiscount/OptionPanel.vue

@@ -0,0 +1,164 @@
+<template>
+  <option-panel-tabs v-model:options="localOptions">
+    <template #main-tab>
+      <div class="option-panel-container">
+        <div class="row q-col-gutter-md">
+          <div class="input-container col-12 q-mt-md">
+
+            <div class="outsideLabel">آدرس فایل عکس</div>
+            <q-input v-model="localOptions.imageSource"
+                     label="image" />
+          </div>
+          <!--          <div class="input-container q-py-md">-->
+          <!--            <div class="outsideLabel">height</div>-->
+          <!--            <q-input v-model="localOptions.height"-->
+          <!--                     label="image" />-->
+          <!--          </div>-->
+          <div class="input-container col-4">
+            <div class="outsideLabel">size</div>
+            <q-select v-model="size"
+                      :options="sizeOptions"
+                      label="page size" />
+          </div>
+          <div class="input-container col-4">
+
+            <div class="outsideLabel">عرض در سایز {{size}}</div>
+            <q-input v-model="localOptions[size].width"
+                     label="width" />
+          </div>
+          <div class="input-container col-4">
+
+            <div class="outsideLabel">ارتفاع در سایز {{size}}</div>
+            <q-input v-model="localOptions[size].height"
+                     label="height" />
+          </div>
+          <div class="input-container col-12">
+            <div class="outsideLabel">لینک عکس در سایز {{size}}</div>
+            <q-input v-model="localOptions[size].src"
+                     label="image link" />
+          </div>
+          <div class="action col-md-12">
+            <div class="cehckBox">
+              <q-checkbox v-model="localOptions.useAEEEvent"
+                          label="استفاده از ایونت GTM"
+                          right-label />
+            </div>
+            <div v-if="localOptions.useAEEEvent"
+                 class="action-container q-gutter-lg-md">
+              <div>فیلد های مورد نظر ایونت GTM :</div>
+              <div class="col-9">
+                <div class="outsideLabel">id</div>
+                <q-input v-model="localOptions.AEEEventBody.id"
+                         label="id" />
+              </div>
+              <div class="col-6">
+                <div class="outsideLabel">name</div>
+                <q-input v-model="localOptions.AEEEventBody.name"
+                         label="name" />
+              </div>
+              <div class="col-6">
+                <div class="outsideLabel">creative</div>
+                <q-input v-model="localOptions.AEEEventBody.creative"
+                         label="creative" />
+              </div>
+              <div class="col-6">
+                <div class="outsideLabel">position</div>
+                <q-input v-model="localOptions.AEEEventBody.position"
+                         label="position" />
+              </div>
+            </div>
+            <div class="cehckBox">
+              <q-checkbox v-model="localOptions.hasAction"
+                          label="hasAction"
+                          right-label />
+            </div>
+            <div v-if="localOptions.hasAction"
+                 class="action-container">
+              <div>
+                <q-select v-model="localOptions.action.name"
+                          :options="actionTypes" />
+              </div>
+              <div v-if="localOptions.action.name === 'link'">
+                <q-input v-model="localOptions.action.route"
+                         label="route" />
+              </div>
+              <div v-if="localOptions.action.name === 'event'">
+                <q-input v-model="localOptions.action.eventName"
+                         label="event name" />
+                <q-input v-model="localOptions.action.eventArgs"
+                         label="event args" />
+              </div>
+              <div v-if="localOptions.action.name === 'scroll'">
+                <q-input v-model="localOptions.action.scrollTo"
+                         label="scrollTo class" />
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </template>
+  </option-panel-tabs>
+</template>
+
+<script>
+import { defineComponent } from 'vue'
+import { mixinOptionPanel } from 'quasar-ui-q-page-builder'
+import OptionPanelTabs from 'quasar-ui-q-page-builder/src/components/OptionPanelComponents/OptionPanelTabs.vue'
+
+export default defineComponent({
+  name: 'OptionPanel',
+  components: { OptionPanelTabs },
+  mixins: [mixinOptionPanel],
+  data() {
+    return {
+      size: 'xs',
+      sizeOptions: ['xs', 'sm', 'md', 'lg', 'xl'],
+      actionTypes: ['event', 'scroll', 'link'],
+      defaultOptions: {
+        imageSource: null,
+        ratio: null,
+        hasAction: false,
+        useAEEEvent: false,
+        AEEEventBody: {
+          id: '-',
+          name: '-',
+          creative: null,
+          position: null
+        },
+        action: {
+          name: null,
+          route: null,
+          scrollTo: null,
+          eventName: null,
+          eventArgs: null
+        },
+        xs: {
+          height: null,
+          width: null,
+          src: null
+        },
+        sm: {
+          height: null,
+          width: null,
+          src: null
+        },
+        md: {
+          height: null,
+          width: null,
+          src: null
+        },
+        lg: {
+          height: null,
+          width: null,
+          src: null
+        },
+        xl: {
+          height: null,
+          width: null,
+          src: null
+        }
+      }
+    }
+  }
+})
+</script>

+ 407 - 0
src/components/Widgets/Other/Shop/ShopApplyDiscount/ShopApplyDiscount.vue

@@ -0,0 +1,407 @@
+<template>
+  <div class="apply-discount">
+    <q-banner class="banner apply-discount-top-banner">
+      {{ mainTitle }}
+    </q-banner>
+    <q-card class="apply-discount-steps-card">
+      <div class="apply-discount-step">
+        <svg xmlns="http://www.w3.org/2000/svg"
+             width="17.053"
+             height="19.866"
+             viewBox="0 0 17.053 19.866">
+          <g id="Paper"
+             transform="translate(0 0)">
+            <path id="Combined_Shape"
+                  data-name="Combined Shape"
+                  d="M4.475,19.866A4.585,4.585,0,0,1,0,15.188V4.491A4.606,4.606,0,0,1,4.57.012h6.271a.758.758,0,0,1,.265,0h.131a.755.755,0,0,1,.541.23l5.065,5.277a.753.753,0,0,1,.209.519V15.2A4.615,4.615,0,0,1,12.6,19.865H4.475ZM1.5,4.509V15.2a3.091,3.091,0,0,0,3.009,3.162h8.064a3.109,3.109,0,0,0,2.979-3.155V6.984h-2.01a3.332,3.332,0,0,1-3.318-3.325V1.512H4.572A3.089,3.089,0,0,0,1.5,4.509Zm10.224-.85a1.828,1.828,0,0,0,1.82,1.824H14.73L11.724,2.353ZM5.387,14.108a.75.75,0,0,1,0-1.5h5.4a.75.75,0,0,1,0,1.5Zm0-3.752a.75.75,0,0,1,0-1.5H8.743a.75.75,0,0,1,0,1.5Z"
+                  transform="translate(0.001 0)"
+                  fill="#5b7a5f" />
+          </g>
+        </svg>
+        <span class="title">
+          {{ step1Title }}
+          <svg xmlns="http://www.w3.org/2000/svg"
+               width="15"
+               height="15"
+               viewBox="0 0 15 15">
+            <g id="Group_11510"
+               data-name="Group 11510"
+               transform="translate(-1215 -335)">
+              <circle id="Ellipse_819"
+                      data-name="Ellipse 819"
+                      cx="7.5"
+                      cy="7.5"
+                      r="7.5"
+                      transform="translate(1215 335)"
+                      fill="#19cb99" />
+              <path id="Path"
+                    d="M8.615,1.5l-4.75,4.75a.881.881,0,0,1-1.23,0L.255,3.875A.877.877,0,0,1,1.5,2.635l1.75,1.75L7.375.255A.877.877,0,0,1,8.615,1.5"
+                    transform="translate(1218 339)"
+                    fill="#f6f6f6" />
+            </g>
+          </svg>
+        </span>
+      </div>
+      <div class="apply-discount-step">
+        <svg xmlns="http://www.w3.org/2000/svg"
+             width="15.84"
+             height="19.87"
+             viewBox="0 0 15.84 19.87">
+          <g id="Profile"
+             transform="translate(0 0)">
+            <path id="Combined_Shape"
+                  data-name="Combined Shape"
+                  d="M0,16.174c0-3.3,4.521-3.677,7.921-3.677,1.958,0,7.919,0,7.919,3.7,0,3.295-4.52,3.677-7.919,3.677C5.962,19.87,0,19.87,0,16.174Zm1.5,0c0,1.458,2.16,2.2,6.421,2.2s6.419-.733,6.419-2.177S12.18,14,7.921,14,1.5,14.729,1.5,16.174Zm6.389-5.555A5.31,5.31,0,0,1,7.921,0a5.31,5.31,0,0,1,0,10.619ZM4.038,5.31A3.873,3.873,0,0,0,7.892,9.192l.029.715V9.192A3.882,3.882,0,1,0,4.038,5.31Z"
+                  transform="translate(0 0)"
+                  fill="#bcbcbc" />
+          </g>
+        </svg>
+        <span class="title">
+          بازبینی
+        </span>
+      </div>
+      <div class="apply-discount-step">
+        <svg xmlns="http://www.w3.org/2000/svg"
+             width="20.639"
+             height="19.173"
+             viewBox="0 0 20.639 19.173">
+          <g id="Wallet"
+             transform="translate(0)">
+            <path id="Combined_Shape"
+                  data-name="Combined Shape"
+                  d="M6,19.173a6,6,0,0,1-6-6V6A6,6,0,0,1,6,0h8.645a6,6,0,0,1,6,6v7.178a6,6,0,0,1-6,6ZM1.5,6v7.178a4.5,4.5,0,0,0,4.5,4.5h8.645a4.5,4.5,0,0,0,4.5-4.5V12.9h-3.3a3.441,3.441,0,1,1,0-6.881h3.3V6a4.5,4.5,0,0,0-4.5-4.5H6A4.5,4.5,0,0,0,1.5,6ZM13.9,9.455a1.945,1.945,0,0,0,1.942,1.94h3.3V7.513h-3.3A1.946,1.946,0,0,0,13.9,9.455Zm2.088.688a.75.75,0,0,1,0-1.5H16.3a.75.75,0,0,1,0,1.5ZM5.286,6.038a.75.75,0,0,1,0-1.5h5.4a.75.75,0,1,1,0,1.5Z"
+                  transform="translate(0 0)"
+                  fill="#bcbcbc" />
+          </g>
+        </svg>
+        <span class="title">
+          پرداخت
+        </span>
+      </div>
+    </q-card>
+
+    <q-tab-panels v-model="panel"
+                  animated
+                  class="panels">
+      <q-tab-panel name="userInfo">
+        <q-banner class="banner apply-discount-form-banner">
+          بازبینی
+        </q-banner>
+        <q-card class="apply-discount-form-card">
+          <q-separator />
+        </q-card>
+
+        <div class="flex justify-end section-edit-btn">
+          <q-btn color="primary"
+                 @click="editEntity">
+            تایید و ادامه
+            <svg xmlns="http://www.w3.org/2000/svg"
+                 width="18.387"
+                 height="11.502"
+                 viewBox="0 0 18.387 11.502">
+              <path id="Combined_Shape"
+                    data-name="Combined Shape"
+                    d="M-9.338,11.408a.748.748,0,0,0,.388-.656V6.5h8.2A.751.751,0,0,0,0,5.75.75.75,0,0,0-.75,5h-8.2V.75A.751.751,0,0,0-9.338.093.769.769,0,0,0-9.7,0a.735.735,0,0,0-.4.115l-7.938,5a.747.747,0,0,0-.35.635.742.742,0,0,0,.35.634l7.938,5a.751.751,0,0,0,.4.116A.746.746,0,0,0-9.338,11.408ZM-10.45,9.392l-5.78-3.641,5.78-3.642Z"
+                    transform="translate(18.387)"
+                    fill="#fff" />
+            </svg>
+          </q-btn>
+        </div>
+      </q-tab-panel>
+
+    </q-tab-panels>
+
+  </div>
+</template>
+
+<script>
+import { Invoice } from 'src/models/Invoice.js'
+import { mixinAuth } from 'src/mixin/Mixins.js'
+import ShamsiDate from 'src/assets/ShamsiDate.js'
+import { APIGateway } from 'src/api/APIGateway.js'
+import { Classroom } from 'src/models/Classroom.js'
+import { AnswerBook } from 'src/models/AnswerBook.js'
+import { FormBuilderAssist } from 'quasar-form-builder'
+
+export default {
+  name: 'ShopCompleteInfo',
+  components: { },
+  mixins: [mixinAuth],
+  data: () => ({
+    mounted: false,
+    inputDataLoaded: false,
+    panel: 'userInfo',
+    step: false,
+    rulesAccept: false,
+    rulesDialog: false,
+    loading: true,
+    classroom: new Classroom(),
+    invoice: new Invoice(),
+    eventTestAnswerBook: new AnswerBook(),
+
+    api: APIGateway.user.APIAdresses.current,
+    entityIdKey: 'id',
+    entityParamKey: 'id',
+    showRouteName: 'UserPanel.ShopPaymentFromWallet',
+    inputs: []
+  }),
+  computed: {
+    mainTitle () {
+      if (this.$route.query.source === 'event') {
+        return 'ثبت نام در رویداد'
+      } else {
+        return 'ثبت نام در دوره آموزشی'
+      }
+    },
+    step1Title () {
+      return 'تکمیل اطلاعات'
+    },
+    step2Title () {
+      if (this.$route.query.source === 'event') {
+        return 'مشاهده جزییات و قوانین رویداد'
+      } else {
+        return 'مشاهده جزییات و قوانین دوره'
+      }
+    }
+  },
+  watch: {
+  },
+  mounted () {
+    this.loadClassroomFromStore()
+    if (this.$route.query.source === 'event') {
+      this.getEventTest()
+    }
+    this.mounted = true
+
+    this.$bus.on('event-confirmation-step-test-sent-answer-sending', () => {
+    })
+    this.$bus.on('event-confirmation-step-test-sent-answer-success', () => {
+      this.successSentTest()
+    })
+    this.$bus.on('event-confirmation-step-test-sent-answer-failed', () => {
+      this.sentTestFailed()
+    })
+  },
+  methods: {
+    getEventTest () {
+      if (this.classroom.tests && this.classroom.tests.length === 0) {
+        return
+      }
+      this.getEventTestAnswerBook(this.classroom.tests[0])
+    },
+    getEventTestAnswerBook (eventTestId) {
+      this.eventTestAnswerBook.loading = true
+      APIGateway.answerBook.getOrCreate(this.user.id, eventTestId)
+        .then((answerBook) => {
+          this.eventTestAnswerBook = new AnswerBook(answerBook)
+          this.eventTestAnswerBook.loading = false
+        })
+        .catch(() => {
+          this.eventTestAnswerBook.loading = false
+        })
+    },
+    loadClassroomFromStore () {
+      this.classroom = this.$store.getters['Shop/onRegisterClassroom']
+    },
+    sentTestFailed () {
+      this.panel = 'userInfo'
+    },
+    successSentTest () {
+      this.editEntity()
+    },
+    editEntity () {
+      if (this.eventTestAnswerBook.id && this.panel !== 'eventTest') {
+        this.panel = 'eventTest'
+        return
+      }
+      this.panel = 'userInfo'
+      this.$nextTick(() => {
+        this.$refs.entityEdit.editEntity(false)
+          .then(() => {
+            if (this.$route.query.type === 'register') {
+              this.createInvoiceForClassroomOrRegisterEvent()
+            } else {
+              this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet', query: this.$route.query })
+            }
+          })
+          .catch(() => {})
+      })
+    },
+    createInvoiceForClassroomOrRegisterEvent () {
+      this.register()
+        .then((data) => {
+          if (data === 'Invoice') {
+            this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet', query: this.$route.query })
+          }
+        })
+        .catch(() => {})
+    },
+    register () {
+      return new Promise((resolve, reject) => {
+        this.invoice.loading = true
+        APIGateway.classroom.register(this.classroom.id)
+          .then((data) => {
+            if (data.type === 'Invoice') {
+              this.invoice = new Invoice(data.model)
+              this.invoice.loading = false
+              this.$store.commit('Shop/updateRegisterClassroomInvoice', this.invoice)
+              this.$q.notify({
+                message: 'صورت حساب شما ایجاد شد، برای ثبت نام اقدام فرمایید.',
+                type: 'info'
+              })
+              resolve('Invoice')
+            } else if (data.type === 'Registration') {
+              this.$q.notify({
+                message: 'ثبت نام شما با موفقیت انجام شد.',
+                type: 'positive'
+              })
+              const eventRegistrationId = data.model.classroom_info.id
+              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 } })
+              }
+            }
+          })
+          .catch(() => {
+            this.invoice.loading = false
+            reject()
+          })
+      })
+    },
+    createInvoice () {
+      return new Promise((resolve, reject) => {
+        this.invoice.loading = true
+        APIGateway.classroom.createInvoice(this.classroom.id)
+          .then((invoice) => {
+            this.invoice = new Invoice(invoice)
+            this.invoice.loading = false
+            this.$store.commit('Shop/updateRegisterClassroomInvoice', this.invoice)
+            this.$q.notify({
+              message: 'صورت حساب شما ایجاد شد، برای ثبت نام اقدام فرمایید.',
+              type: 'info'
+            })
+            resolve(this.invoice)
+          })
+          .catch(() => {
+            this.invoice.loading = false
+            reject()
+          })
+      })
+    },
+    afterLoadInputData () {
+      this.checkNationalCode()
+      this.$nextTick(() => {
+        this.inputDataLoaded = true
+      })
+    },
+    checkNationalCode () {
+      if (FormBuilderAssist.getInputsByName(this.inputs, 'national_code')?.value) {
+        FormBuilderAssist.setAttributeByName(this.inputs, 'national_code', 'readonly', true)
+      }
+    },
+    openRulesDialog () {
+      this.rulesDialog = true
+    },
+    getHoldingType (type) {
+      const target = (new Classroom()).holding_typeEnums.find(item => item.value === type)
+      if (target) {
+        return target.label
+      }
+      return '-'
+    },
+    getTime (time) {
+      return ShamsiDate.getDateTime(time)
+    },
+    getTerm (classroom) {
+      if (!classroom.beginning_registration_period) {
+        return '-'
+      }
+      return ShamsiDate.getTerm(classroom.beginning_registration_period)
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.apply-discount {
+  .apply-discount-top-banner {
+    margin-top: 50px;
+    margin-bottom: 42px;
+  }
+  .apply-discount-steps-card {
+    background-color: #F5F5F5;
+    padding: 35px 0;
+    border-radius: 8px;
+    display: flex;
+    flex-flow: row;
+    justify-content: center;
+    margin-bottom: 44px;
+    .apply-discount-step {
+      display: flex;
+      flex-flow: row;
+      position: relative;
+      width: 20%;
+      &:first-child {
+        .title {
+          color: #5B7A5F;
+        }
+      }
+      &:after {
+        content: ' ';
+        position: absolute;
+        left: 0;
+        top: 10px;
+        width: 95%;
+        border-top: dotted 2px #5B7A5F;
+        z-index: 1;
+      }
+      &:last-child {
+        &:after {
+          width: 0;
+        }
+        .title {
+          color: #BCBCBC;
+        }
+      }
+      .title {
+        position: relative;
+        background-color: #F5F5F5;
+        z-index: 2;
+        padding-right: 20px;
+      }
+      svg {
+        width: 17px;
+        position: relative;
+        background-color: #F5F5F5;
+        z-index: 2;
+        padding-right: 8px;
+      }
+    }
+  }
+  .apply-discount-form-banner {
+    margin-bottom: 26px;
+  }
+  .apply-discount-form-card {
+    background-color: #F5F5F5;
+    padding: 50px 30px;
+    border-radius: 8px;
+    &:deep {
+      .q-card.entity-edit {
+        background: transparent;
+        .q-toolbar,
+        & > .q-separator {
+          display: none;
+        }
+      }
+    }
+  }
+  :deep(.panels) {
+    background: transparent;
+  }
+  .section-edit-btn {
+    margin-top: 50px;
+    margin-bottom: 77px;
+  }
+}
+</style>

+ 117 - 0
src/components/Widgets/Other/Shop/ShopApplyDiscount/discount.vue

@@ -0,0 +1,117 @@
+<template>
+  <div class="cart-discount">
+    <div class="cart-discount__title">
+      <q-icon name="percent" />
+      کد تخفیف:
+    </div>
+    <div v-if="mounted"
+         class="cart-discount__info">
+      <div class="cart-discount__selected-discount">
+        <q-input v-model="discountCode"
+                 :disable="!!basket.discount"
+                 placeholder="کدتخفیف" />
+      </div>
+      <div class="cart-discount__edit-btn">
+        <q-btn v-if="!basket.discount"
+               color="info"
+               unelevated
+               :loading="discountLoading"
+               @click="setDiscount">
+          اعمال تخفیف
+        </q-btn>
+        <q-btn v-else
+               color="info"
+               unelevated
+               :loading="discountLoading"
+               @click="removeDiscountCode">
+          حذف کد تخفیف
+        </q-btn>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import { Basket } from 'src/models/Basket.js'
+import { APIGateway } from 'src/api/APIGateway.js'
+
+export default {
+  name: 'CartDiscount',
+  props: {
+    basket: {
+      type: Basket,
+      default: new Basket()
+    }
+  },
+  emits: ['set-discount'],
+  data () {
+    return {
+      discountCode: null,
+      discountLoading: false,
+      mounted: false
+    }
+  },
+  mounted() {
+    this.mounted = true
+    this.discountCode = this.basket.discount_info.code
+  },
+  methods: {
+    openDialog () {
+      this.dialog = true
+    },
+    closeDialog () {
+      this.dialog = false
+    },
+    setDiscount () {
+      this.discountLoading = true
+      APIGateway.basket.submitDiscountCode(this.basket.id, this.discountCode)
+        .finally(() => {
+          this.discountLoading = false
+          this.$emit('set-discount')
+        })
+    },
+    removeDiscountCode () {
+      this.discountLoading = true
+      APIGateway.basket.removeDiscountCode(this.basket.id)
+        .then(() => {
+          this.discountCode = null
+        })
+        .finally(() => {
+          this.discountLoading = false
+          this.$emit('set-discount')
+        })
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.cart-discount {
+  border-radius: 8px;
+  background: #F9F9FB;
+  border: 1px solid #DFE1EC;
+  padding: 20px 30px 46px 38px;
+  .cart-discount__title {
+    color: #727272;
+    font-size: 16px;
+    margin-bottom: 22px;
+  }
+  .cart-discount__info {
+    display: flex;
+    flex-flow: row;
+    gap: 16px;
+    justify-content: flex-start;
+    align-items: center;
+    .cart-discount__selected-discount {
+
+    }
+    .cart-discount__edit-btn {
+
+    }
+  }
+  :global(.cart-discount__dialog-cart) {
+    width: 700px;
+    max-width: 90vw;
+  }
+}
+</style>

+ 163 - 0
src/components/Widgets/Other/Shop/ShopApplyDiscount/sidebar.vue

@@ -0,0 +1,163 @@
+<template>
+  <div class="step1__sidebar">
+    <div class="step1__sidebar-total-price">
+      <div class="step1__sidebar-total-price-label">
+        قیمت کالاها
+      </div>
+      <div class="step1__sidebar-total-price-value">
+        {{ basket.price.toLocaleString('fa') }}
+        ریال
+      </div>
+    </div>
+    <div v-if="basket.margin_amount"
+         class="step1__sidebar-total-discount">
+      <div class="step1__sidebar-total-discount-label">
+        تخفیف ها
+      </div>
+      <div class="step1__sidebar-total-discount-value">
+        {{ basket.margin_amount.toLocaleString('fa') }}
+        ریال
+      </div>
+    </div>
+    <div v-if="basket.margin_amount"
+         class="step1__sidebar-separator" />
+    <div v-if="basket.margin_amount"
+         class="step1__sidebar-total-price">
+      <div class="step1__sidebar-total-price-label">
+        قابل سفارش
+      </div>
+      <div class="step1__sidebar-total-price-value">
+        {{ basket.sellable_price.toLocaleString('fa') }}
+        ریال
+      </div>
+    </div>
+    <div v-if="basket.discount"
+         class="step1__sidebar-discount-code">
+      <div class="step1__sidebar-discount-code-label">
+        کد تخفیف
+      </div>
+      <div class="step1__sidebar-discount-code-value">
+        {{ basket.discount_amount.toLocaleString('fa') }}
+        ریال
+      </div>
+    </div>
+    <div class="step1__sidebar-separator" />
+    <div class="step1__sidebar-final-price">
+      <div class="step1__sidebar-final-price-label">
+        مجموع
+      </div>
+      <div class="step1__sidebar-final-price-value">
+        {{ basket.order_price.toLocaleString('fa') }}
+        ریال
+      </div>
+    </div>
+    <div class="step1__sidebar-continue-action">
+      <q-btn color="primary"
+             unelevated
+             @click="onComplete">
+        به خرید ادامه بده
+      </q-btn>
+    </div>
+  </div>
+</template>
+
+<script>
+import { Basket } from 'src/models/Basket.js'
+
+export default {
+  name: 'cartItem',
+  props: {
+    basket: {
+      type: Basket,
+      default: new Basket()
+    }
+  },
+  emits: ['complete'],
+  data () {
+    return {
+      step: 1
+    }
+  },
+  methods: {
+    onComplete () {
+      this.$emit('complete')
+    }
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.step1__sidebar {
+  width: 100%;
+  background: #F9F9FB;
+  border: 1px solid #DFE1EC;
+  border-radius: 8px;
+  padding: 34px 16px 30px 16px;
+  .step1__sidebar-total-price {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 26px;
+    letter-spacing: 0;
+    .step1__sidebar-total-price-label {
+      color: #212121;
+      font-size: 18px;
+    }
+    .step1__sidebar-total-price-value {
+      color: $primary;
+      font-size: 18px;
+    }
+  }
+  .step1__sidebar-total-discount {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 26px;
+    letter-spacing: 0;
+    color: #FF3D3D;
+    .step1__sidebar-total-discount-label {
+      font-size: 18px;
+    }
+    .step1__sidebar-total-discount-value {
+      font-size: 18px;
+    }
+  }
+  .step1__sidebar-discount-code {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 22px;
+    letter-spacing: 0;
+    color: #FF3D3D;
+    .step1__sidebar-discount-code-label {
+      font-size: 18px;
+    }
+    .step1__sidebar-discount-code-value {
+      font-size: 18px;
+    }
+  }
+  .step1__sidebar-separator {
+    width: 100%;
+    background: #F9F9FB;
+    border: 1px dashed $primary;
+    margin-bottom: 19px;
+  }
+  .step1__sidebar-final-price {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 40px;
+    letter-spacing: 0;
+    .step1__sidebar-final-price-label {
+      color: #212121;
+      font-size: 18px;
+    }
+    .step1__sidebar-final-price-value {
+      font-size: 20px;
+      color: $primary;
+    }
+  }
+  .step1__sidebar-continue-action {
+    padding: 0 16px;
+    .q-btn {
+      width: 100%;
+    }
+  }
+}
+</style>

+ 13 - 28
src/components/Widgets/Other/Shop/ShopCompleteInfo/ShopCompleteInfo.vue

@@ -20,26 +20,6 @@
         </svg>
         <span class="title">
           {{ step1Title }}
-          <svg xmlns="http://www.w3.org/2000/svg"
-               width="15"
-               height="15"
-               viewBox="0 0 15 15">
-            <g id="Group_11510"
-               data-name="Group 11510"
-               transform="translate(-1215 -335)">
-              <circle id="Ellipse_819"
-                      data-name="Ellipse 819"
-                      cx="7.5"
-                      cy="7.5"
-                      r="7.5"
-                      transform="translate(1215 335)"
-                      fill="#19cb99" />
-              <path id="Path"
-                    d="M8.615,1.5l-4.75,4.75a.881.881,0,0,1-1.23,0L.255,3.875A.877.877,0,0,1,1.5,2.635l1.75,1.75L7.375.255A.877.877,0,0,1,8.615,1.5"
-                    transform="translate(1218 339)"
-                    fill="#f6f6f6" />
-            </g>
-          </svg>
         </span>
       </div>
       <div class="complete-info-step">
@@ -53,11 +33,11 @@
                   data-name="Combined Shape"
                   d="M0,16.174c0-3.3,4.521-3.677,7.921-3.677,1.958,0,7.919,0,7.919,3.7,0,3.295-4.52,3.677-7.919,3.677C5.962,19.87,0,19.87,0,16.174Zm1.5,0c0,1.458,2.16,2.2,6.421,2.2s6.419-.733,6.419-2.177S12.18,14,7.921,14,1.5,14.729,1.5,16.174Zm6.389-5.555A5.31,5.31,0,0,1,7.921,0a5.31,5.31,0,0,1,0,10.619ZM4.038,5.31A3.873,3.873,0,0,0,7.892,9.192l.029.715V9.192A3.882,3.882,0,1,0,4.038,5.31Z"
                   transform="translate(0 0)"
-                  fill="#212121" />
+                  fill="#bcbcbc" />
           </g>
         </svg>
         <span class="title">
-          تکمیل اطلاعات
+          بازبینی
         </span>
       </div>
       <div class="complete-info-step">
@@ -313,6 +293,9 @@ export default {
       }
     },
     step1Title () {
+      return 'تکمیل اطلاعات'
+    },
+    step2Title () {
       if (this.$route.query.source === 'event') {
         return 'مشاهده جزییات و قوانین رویداد'
       } else {
@@ -502,11 +485,7 @@ export default {
       this.$nextTick(() => {
         this.$refs.entityEdit.editEntity(false)
           .then(() => {
-            if (this.$route.query.type === 'register') {
-              this.createInvoiceForClassroomOrRegisterEvent()
-            } else {
-              this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet', query: this.$route.query })
-            }
+            this.$router.push({ name: 'UserPanel.ShopApplyDiscount', query: this.$route.query })
           })
           .catch(() => {})
       })
@@ -627,8 +606,11 @@ export default {
       position: relative;
       width: 20%;
       &:first-child {
+      }
+
+      &:not(:first-child) {
         .title {
-          color: #5B7A5F;
+          color: #BCBCBC;
         }
       }
       &:after {
@@ -639,6 +621,9 @@ export default {
         width: 95%;
         border-top: dotted 2px #5B7A5F;
         z-index: 1;
+        .title {
+          color: #BCBCBC;
+        }
       }
       &:last-child {
         &:after {

+ 7 - 0
src/components/Widgets/Other/Shop/ShopPaymentFromWallet/ShopPaymentFromWallet.vue

@@ -285,6 +285,13 @@ export default {
         return 'مشاهده جزییات و قوانین دوره'
       }
     },
+    step2Title () {
+      if (this.$route.query.source === 'event') {
+        return 'مشاهده جزییات و قوانین رویداد'
+      } else {
+        return 'مشاهده جزییات و قوانین دوره'
+      }
+    },
     isRegisterPage () {
       return this.$route.query.type === 'register'
     },

+ 41 - 0
src/pages/User/Shop/applyDiscount.vue

@@ -0,0 +1,41 @@
+<template>
+  <q-page-builder v-model:sections="currenSections"
+                  v-model:options="pageConfig"
+                  :editable="pageBuilderEditable"
+                  :loading="pageBuilderLoading" />
+</template>
+
+<script>
+export default {
+  name: 'applyDiscount',
+  data () {
+    return {
+      pageConfig: {},
+      pageBuilderEditable: false,
+      pageBuilderLoading: false,
+      currenSections: [
+        {
+          data: {
+            rows: [
+              {
+                cols: [
+                  {
+                    widgets: [
+                      {
+                        name: 'ShopApplyDiscount'
+                      }
+                    ]
+                  }
+                ],
+                options: {
+                  boxed: true
+                }
+              }
+            ]
+          }
+        }
+      ]
+    }
+  }
+}
+</script>

+ 13 - 0
src/router/routes/UserPanel.js

@@ -31,6 +31,19 @@ export default {
       },
       component: () => import('src/pages/User/Shop/completeInfo.vue')
     },
+    {
+      name: 'UserPanel.ShopApplyDiscount',
+      path: 'shop/applyDiscount',
+      layoutConfig: {
+        layoutView: 'hHh LpR fff',
+        layoutHeaderType: 'main',
+        layoutHeaderBordered: true,
+        layoutLeftDrawer: false,
+        layoutLeftDrawerVisible: false,
+        layoutFooter: true
+      },
+      component: () => import('src/pages/User/Shop/applyDiscount.vue')
+    },
     {
       name: 'UserPanel.ShopPaymentFromWallet',
       path: 'shop/payment-from-wallet',