ShopCompleteInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <div class="complete-info">
  3. <q-banner class="banner complete-info-top-banner">
  4. ثبت نام در دوره آموزشی
  5. </q-banner>
  6. <q-card class="complete-info-steps-card">
  7. <div class="complete-info-step">
  8. <svg xmlns="http://www.w3.org/2000/svg"
  9. width="17.053"
  10. height="19.866"
  11. viewBox="0 0 17.053 19.866">
  12. <g id="Paper"
  13. transform="translate(0 0)">
  14. <path id="Combined_Shape"
  15. data-name="Combined Shape"
  16. 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"
  17. transform="translate(0.001 0)"
  18. fill="#5b7a5f" />
  19. </g>
  20. </svg>
  21. <span class="title">
  22. مشاهده جزییات و قوانین دوره
  23. <svg xmlns="http://www.w3.org/2000/svg"
  24. width="15"
  25. height="15"
  26. viewBox="0 0 15 15">
  27. <g id="Group_11510"
  28. data-name="Group 11510"
  29. transform="translate(-1215 -335)">
  30. <circle id="Ellipse_819"
  31. data-name="Ellipse 819"
  32. cx="7.5"
  33. cy="7.5"
  34. r="7.5"
  35. transform="translate(1215 335)"
  36. fill="#19cb99" />
  37. <path id="Path"
  38. 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"
  39. transform="translate(1218 339)"
  40. fill="#f6f6f6" />
  41. </g>
  42. </svg>
  43. </span>
  44. </div>
  45. <div class="complete-info-step">
  46. <svg xmlns="http://www.w3.org/2000/svg"
  47. width="15.84"
  48. height="19.87"
  49. viewBox="0 0 15.84 19.87">
  50. <g id="Profile"
  51. transform="translate(0 0)">
  52. <path id="Combined_Shape"
  53. data-name="Combined Shape"
  54. 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"
  55. transform="translate(0 0)"
  56. fill="#212121" />
  57. </g>
  58. </svg>
  59. <span class="title">
  60. تکمیل اطلاعات
  61. </span>
  62. </div>
  63. <div class="complete-info-step">
  64. <svg xmlns="http://www.w3.org/2000/svg"
  65. width="20.639"
  66. height="19.173"
  67. viewBox="0 0 20.639 19.173">
  68. <g id="Wallet"
  69. transform="translate(0)">
  70. <path id="Combined_Shape"
  71. data-name="Combined Shape"
  72. 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"
  73. transform="translate(0 0)"
  74. fill="#bcbcbc" />
  75. </g>
  76. </svg>
  77. <span class="title">
  78. پرداخت
  79. </span>
  80. </div>
  81. </q-card>
  82. <q-banner class="banner complete-info-form-banner">
  83. تکمیل اطلاعات
  84. </q-banner>
  85. <q-card class="complete-info-form-card">
  86. <entity-edit v-if="mounted"
  87. ref="entityEdit"
  88. v-model:value="inputs"
  89. title="اطلاعات کاربری"
  90. :api="api"
  91. :entity-id-key="entityIdKey"
  92. :entity-param-key="entityParamKey"
  93. :show-route-name="showRouteName"
  94. :show-close-button="false"
  95. :show-edit-button="false"
  96. :show-expand-button="false"
  97. :show-save-button="false"
  98. :show-reload-button="false"
  99. :redirect-after-edit="false" />
  100. </q-card>
  101. <div class="flex justify-end section-edit-btn">
  102. <q-btn color="primary"
  103. @click="editEntity">
  104. تایید و ادامه
  105. <svg xmlns="http://www.w3.org/2000/svg"
  106. width="18.387"
  107. height="11.502"
  108. viewBox="0 0 18.387 11.502">
  109. <path id="Combined_Shape"
  110. data-name="Combined Shape"
  111. 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"
  112. transform="translate(18.387)"
  113. fill="#fff" />
  114. </svg>
  115. </q-btn>
  116. </div>
  117. </div>
  118. </template>
  119. <script>
  120. import { EntityEdit } from 'quasar-crud'
  121. import Enums from 'src/assets/Enums/Enums.js'
  122. import ShamsiDate from 'src/assets/ShamsiDate.js'
  123. import { APIGateway } from 'src/api/APIGateway.js'
  124. import { Classroom } from 'src/models/Classroom.js'
  125. export default {
  126. name: 'ShopCompleteInfo',
  127. components: { EntityEdit },
  128. data: () => ({
  129. mounted: false,
  130. step: false,
  131. rulesAccept: false,
  132. rulesDialog: false,
  133. loading: true,
  134. classroom: new Classroom(),
  135. api: APIGateway.user.APIAdresses.current,
  136. entityIdKey: 'id',
  137. entityParamKey: 'id',
  138. showRouteName: 'UserPanel.ShopPaymentFromWallet',
  139. inputs: [
  140. { type: 'separator', name: 'space', label: 'اطلاعات ضروری', col: 'col-md-12' },
  141. { type: 'input', name: 'email', label: 'ایمیل', responseKey: 'email', placeholder: ' ', col: 'col-md-3' },
  142. { type: 'input', name: 'mobile_number', label: 'تلفن همراه', responseKey: 'mobile_number', placeholder: ' ', col: 'col-md-3' },
  143. { type: 'input', name: 'national_code', label: 'کدملی/کد اتباع غیر ایرانی', responseKey: 'national_code', placeholder: ' ', col: 'col-md-3' },
  144. { type: 'separator', name: 'space', label: 'اطلاعات پروفایل', col: 'col-md-12' },
  145. { type: 'file', name: 'picture', label: 'عکس پروفایل', responseKey: 'picture', placeholder: ' ', col: 'col-md-3' },
  146. { type: 'separator', name: 'space', size: '0', col: 'col-md-12' },
  147. { type: 'input', name: 'firstname', label: 'نام', responseKey: 'firstname', placeholder: ' ', col: 'col-md-3' },
  148. { type: 'input', name: 'lastname', label: 'نام خانوادگی', responseKey: 'lastname', placeholder: ' ', col: 'col-md-3' },
  149. {
  150. type: 'select',
  151. name: 'gender',
  152. responseKey: 'gender',
  153. placeholder: ' ',
  154. options: Enums.genders,
  155. value: null,
  156. label: 'جنسیت',
  157. col: 'col-md-3'
  158. },
  159. { type: 'date', name: 'birthdate', label: 'تولد', responseKey: 'birthdate', placeholder: ' ', col: 'col-md-3' },
  160. {
  161. type: 'select',
  162. name: 'marital_status',
  163. responseKey: 'marital_status',
  164. placeholder: ' ',
  165. options: Enums.maritalStatuses,
  166. value: null,
  167. label: 'وضعیت تاهل',
  168. col: 'col-md-3'
  169. },
  170. { type: 'input', name: 'on_call_mobile_number', label: 'تلفن همراه جهت تماس', responseKey: 'mobile_number', placeholder: ' ', col: 'col-md-3' },
  171. { type: 'input', name: 'on_social_network_mobile_number', label: 'تلفن همراه جهت شبکه های اجتماعی', responseKey: 'on_social_network_mobile_number', placeholder: ' ', col: 'col-md-3' },
  172. { type: 'input', name: 'phone_number', label: 'تلفن منزل', responseKey: 'phone_number', placeholder: ' ', col: 'col-md-3' },
  173. {
  174. type: 'select',
  175. name: 'last_academic_degree',
  176. responseKey: 'last_academic_degree',
  177. placeholder: ' ',
  178. options: Enums.academicDegree,
  179. value: null,
  180. label: 'آخرین مقطع تحصیلی',
  181. col: 'col-md-3'
  182. },
  183. { type: 'input', name: 'last_academic_degree_field', label: 'رشته تحصیلی', responseKey: 'last_academic_degree_field', placeholder: ' ', col: 'col-md-3' },
  184. { type: 'input', name: 'last_academy_name', label: 'نام دانشگاه یا حوزه تحصیلی', responseKey: 'last_academy_name', placeholder: ' ', col: 'col-md-3' },
  185. {
  186. type: 'select',
  187. name: 'educational_status',
  188. responseKey: 'educational_status',
  189. placeholder: ' ',
  190. options: Enums.educationalStatus,
  191. value: null,
  192. label: 'وضعیت تحصیلی',
  193. col: 'col-md-3'
  194. },
  195. { type: 'input', name: 'birth_country', label: 'کشور محل تولد', responseKey: 'birth_country', placeholder: ' ', col: 'col-md-4' },
  196. { type: 'input', name: 'birth_province', label: 'استان محل تولد', responseKey: 'birth_province', placeholder: ' ', col: 'col-md-4' },
  197. { type: 'input', name: 'birth_city', label: 'شهر محل تولد', responseKey: 'birth_city', placeholder: ' ', col: 'col-md-4' },
  198. { type: 'input', name: 'living_country', label: 'کشور محل زندگی فعلی', responseKey: 'living_country', placeholder: ' ', col: 'col-md-4' },
  199. { type: 'input', name: 'living_abroad_province', label: 'استان محل زندگی فعلی', responseKey: 'living_province', placeholder: ' ', col: 'col-md-4' },
  200. { type: 'input', name: 'living_abroad_city', label: 'شهر محل زندگی فعلی', responseKey: 'living_city', placeholder: ' ', col: 'col-md-4' },
  201. { type: 'input', name: 'living_postal_code', label: 'کد پستی محل زندگی', responseKey: 'living_postal_code', placeholder: ' ', col: 'col-md-3' },
  202. { type: 'input', name: 'living_address', label: 'آدرس پستی محل زندگی', responseKey: 'living_address', placeholder: ' ', col: 'col-md-9' },
  203. { type: 'hidden', name: 'id', responseKey: 'id' }
  204. ]
  205. }),
  206. mounted () {
  207. this.mounted = true
  208. },
  209. methods: {
  210. editEntity () {
  211. this.$refs.entityEdit.editEntity(false)
  212. .then(() => {
  213. this.$router.push({ name: 'UserPanel.ShopPaymentFromWallet' })
  214. })
  215. .catch(() => {})
  216. },
  217. openRulesDialog () {
  218. this.rulesDialog = true
  219. },
  220. getHoldingType (type) {
  221. const target = Enums.classroomHoldingTypes.find(item => item.value === type)
  222. if (target) {
  223. return target.label
  224. }
  225. return '-'
  226. },
  227. getAudienceGenderType (type) {
  228. const target = Enums.genders.find(item => item.value === type)
  229. if (target) {
  230. return target.label
  231. }
  232. return '-'
  233. },
  234. getTime (time) {
  235. return ShamsiDate.getDateTime(time)
  236. },
  237. getTerm (classroom) {
  238. if (!classroom.beginning_registration_period) {
  239. return '-'
  240. }
  241. return ShamsiDate.getTerm(classroom.beginning_registration_period)
  242. },
  243. getClassrooms () {
  244. this.loading = true
  245. APIGateway.classroom.get(this.$route.params.id)
  246. .then(classroom => {
  247. this.classroom = new Classroom(classroom)
  248. this.loading = false
  249. })
  250. .catch(() => {
  251. this.loading = false
  252. })
  253. }
  254. }
  255. }
  256. </script>
  257. <style scoped lang="scss">
  258. .complete-info {
  259. .complete-info-top-banner {
  260. margin-top: 50px;
  261. margin-bottom: 42px;
  262. }
  263. .complete-info-steps-card {
  264. background-color: #F5F5F5;
  265. padding: 35px 0;
  266. border-radius: 8px;
  267. display: flex;
  268. flex-flow: row;
  269. justify-content: center;
  270. margin-bottom: 44px;
  271. .complete-info-step {
  272. display: flex;
  273. flex-flow: row;
  274. position: relative;
  275. width: 20%;
  276. &:first-child {
  277. .title {
  278. color: #5B7A5F;
  279. }
  280. }
  281. &:after {
  282. content: ' ';
  283. position: absolute;
  284. left: 0;
  285. top: 10px;
  286. width: 95%;
  287. border-top: dotted 2px #5B7A5F;
  288. z-index: 1;
  289. }
  290. &:last-child {
  291. &:after {
  292. width: 0;
  293. }
  294. .title {
  295. color: #BCBCBC;
  296. }
  297. }
  298. .title {
  299. position: relative;
  300. background-color: #F5F5F5;
  301. z-index: 2;
  302. padding-right: 24px;
  303. }
  304. svg {
  305. width: 17px;
  306. position: relative;
  307. background-color: #F5F5F5;
  308. z-index: 2;
  309. padding-right: 8px;
  310. }
  311. }
  312. }
  313. .complete-info-form-banner {
  314. margin-bottom: 26px;
  315. }
  316. .complete-info-form-card {
  317. background-color: #F5F5F5;
  318. padding: 50px 30px;
  319. border-radius: 8px;
  320. &:deep {
  321. .q-card.entity-edit {
  322. background: transparent;
  323. .q-toolbar,
  324. & > .q-separator {
  325. display: none;
  326. }
  327. }
  328. }
  329. }
  330. .section-edit-btn {
  331. margin-top: 50px;
  332. margin-bottom: 77px;
  333. }
  334. }
  335. </style>