ShowClassroomInfo.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. <template>
  2. <div class="classroom">
  3. <q-banner v-if="!loading && !defaultOptions.profileMode"
  4. class="banner classroom-banner">
  5. دوره های آموزشی
  6. {{classroom.title}}
  7. </q-banner>
  8. <q-card v-if="!loading"
  9. flat
  10. class="classroom-card">
  11. <q-card-section class="info-box">
  12. <div class="row">
  13. <div class="col-md-4 col-12 classroom-thumbnail">
  14. <q-img :src="classroom.thumbnail" />
  15. </div>
  16. <div class="col-md-4 col-12 classroom-top-attributes">
  17. <div class="title">
  18. دوره آموزشی
  19. {{classroom.title}}:
  20. </div>
  21. <div class="attributes">
  22. <div class="attribute-item">{{getAudienceGenderType(classroom.audience_gender_type)}}</div>
  23. <div class="attribute-item">{{getHoldingType(classroom.holding_type)}}</div>
  24. </div>
  25. </div>
  26. <div class="col-md-4 col-12 classroom-action-col">
  27. <q-btn v-if="!defaultOptions.profileMode && !classroom.is_current_user_registered && classroom.is_enabled_adding"
  28. color="primary"
  29. class="btn-register"
  30. @click="openRulesDialog">
  31. <svg data-name="Add User"
  32. xmlns="http://www.w3.org/2000/svg"
  33. width="20"
  34. height="19.795"
  35. viewBox="0 0 20 19.795"
  36. class="q-mr-md">
  37. <path id="Combined_Shape"
  38. data-name="Combined Shape"
  39. d="M0,16.115c0-3.281,4.5-3.659,7.877-3.659,1.949,0,7.877,0,7.877,3.681,0,3.279-4.5,3.658-7.877,3.658C5.928,19.795,0,19.795,0,16.115Zm1.5,0c0,1.446,2.146,2.18,6.377,2.18s6.377-.726,6.377-2.158c0-1.447-2.146-2.181-6.377-2.181S1.5,14.683,1.5,16.115Zm14.954-5.436V9.424H15.16a.75.75,0,0,1,0-1.5h1.294V6.669a.75.75,0,1,1,1.5,0V7.924h1.3a.75.75,0,0,1,0,1.5h-1.3v1.255a.75.75,0,1,1-1.5,0Zm-8.609-.043a5.334,5.334,0,1,1,.031,0ZM4.06,5.318A3.8,3.8,0,0,0,7.849,9.136l.028.75v-.75A3.818,3.818,0,1,0,4.06,5.318Z"
  40. transform="translate(0)"
  41. fill="#fff" />
  42. </svg>
  43. ثبت نام
  44. </q-btn>
  45. <q-btn v-if="!defaultOptions.profileMode && !classroom.is_current_user_registered && classroom.is_enabled_enrolment"
  46. color="primary"
  47. class="btn-register"
  48. :loading="enrolmentLoading"
  49. @click="onEnrolment">
  50. <svg data-name="Add User"
  51. xmlns="http://www.w3.org/2000/svg"
  52. width="20"
  53. height="19.795"
  54. viewBox="0 0 20 19.795"
  55. class="q-mr-md">
  56. <path id="Combined_Shape"
  57. data-name="Combined Shape"
  58. d="M0,16.115c0-3.281,4.5-3.659,7.877-3.659,1.949,0,7.877,0,7.877,3.681,0,3.279-4.5,3.658-7.877,3.658C5.928,19.795,0,19.795,0,16.115Zm1.5,0c0,1.446,2.146,2.18,6.377,2.18s6.377-.726,6.377-2.158c0-1.447-2.146-2.181-6.377-2.181S1.5,14.683,1.5,16.115Zm14.954-5.436V9.424H15.16a.75.75,0,0,1,0-1.5h1.294V6.669a.75.75,0,1,1,1.5,0V7.924h1.3a.75.75,0,0,1,0,1.5h-1.3v1.255a.75.75,0,1,1-1.5,0Zm-8.609-.043a5.334,5.334,0,1,1,.031,0ZM4.06,5.318A3.8,3.8,0,0,0,7.849,9.136l.028.75v-.75A3.818,3.818,0,1,0,4.06,5.318Z"
  59. transform="translate(0)"
  60. fill="#fff" />
  61. </svg>
  62. پیش ثبت نام
  63. </q-btn>
  64. <q-btn v-if="!defaultOptions.profileMode && classroom.is_current_user_registered"
  65. color="primary"
  66. class="btn-register"
  67. :to="{name: 'UserPanel.Profile.ClassroomInfo', params: {id: classroom.id}}">
  68. مشاهده دوره
  69. </q-btn>
  70. <q-btn v-if="defaultOptions.profileMode"
  71. outline
  72. color="primary"
  73. class="btn-register"
  74. @click="openRulesDialog">
  75. آیین نامه دوره
  76. </q-btn>
  77. <q-btn v-if="defaultOptions.profileMode && classroom.is_enabled_dropping"
  78. outline
  79. color="red"
  80. class="btn-register q-ml-md"
  81. :loading="dropLoading"
  82. @click="onDropping">
  83. انصراف
  84. </q-btn>
  85. </div>
  86. </div>
  87. </q-card-section>
  88. <q-card-section class="info-box">
  89. <div class="row second-section">
  90. <div class="col-md-4 col-sm-6 col-12 attribute-column">
  91. <div class="icon">
  92. <svg xmlns="http://www.w3.org/2000/svg"
  93. width="17.058"
  94. height="21.399"
  95. viewBox="0 0 17.058 21.399">
  96. <path id="Combined_Shape"
  97. data-name="Combined Shape"
  98. d="M0,17.418c0-3.55,4.868-3.96,8.53-3.96,2.109,0,8.528,0,8.528,3.982,0,3.548-4.867,3.959-8.528,3.959C6.42,21.4,0,21.4,0,17.418Zm1.616,0c0,1.57,2.326,2.366,6.914,2.366s6.913-.789,6.913-2.345-2.326-2.366-6.913-2.366S1.616,15.862,1.616,17.418ZM8.5,11.436A5.718,5.718,0,0,1,8.53,0a5.718,5.718,0,0,1,0,11.436ZM4.349,5.718A4.171,4.171,0,0,0,8.5,9.9l.031.77V9.9a4.18,4.18,0,1,0-4.181-4.18Z"
  99. transform="translate(0 0)"
  100. fill="#aaa095" />
  101. </svg>
  102. </div>
  103. <div class="title">
  104. {{ classroom.professor }}
  105. </div>
  106. </div>
  107. <div class="col-md-4 col-sm-6 col-12 attribute-column">
  108. <div class="icon">
  109. <svg id="Calendar"
  110. xmlns="http://www.w3.org/2000/svg"
  111. width="21"
  112. height="23.154"
  113. viewBox="0 0 21 23.154">
  114. <path id="Combined_Shape"
  115. data-name="Combined Shape"
  116. d="M5.945,23.154c-3.668,0-5.945-2.26-5.945-5.9V7.51A5.382,5.382,0,0,1,5.347,1.721V.807a.808.808,0,0,1,1.616,0V1.7h7.084V.807a.807.807,0,1,1,1.615,0v.914a5.8,5.8,0,0,1,3.8,1.572A5.793,5.793,0,0,1,21,7.513v9.824c0,3.588-2.279,5.817-5.946,5.817Zm-4.33-5.9c0,2.762,1.537,4.284,4.33,4.284h9.109c2.792,0,4.331-1.493,4.331-4.2V9.59H1.616ZM19.385,7.974V7.51a4.159,4.159,0,0,0-1.063-3.074,4.164,4.164,0,0,0-2.66-1.094v1.01a.807.807,0,0,1-1.615,0V3.317H6.963V4.352a.808.808,0,0,1-1.616,0V3.341c-2.413.2-3.732,1.664-3.732,4.169v.464Zm-4.9,9.2a.8.8,0,0,1,.8-.807h.01a.807.807,0,1,1-.812.807Zm-4.778,0a.8.8,0,0,1,.8-.807h.01a.807.807,0,1,1-.812.807Zm-4.79,0a.8.8,0,0,1,.8-.807h.01a.807.807,0,1,1-.813.807Zm9.568-4.185a.8.8,0,0,1,.8-.808h.01a.808.808,0,1,1-.812.808Zm-4.778,0a.8.8,0,0,1,.8-.808h.01a.808.808,0,1,1-.812.808Zm-4.79,0a.8.8,0,0,1,.8-.808h.01a.808.808,0,1,1-.813.808Z"
  117. transform="translate(0 0)"
  118. fill="#aaa095" />
  119. </svg>
  120. </div>
  121. <div class="title">
  122. {{ getTerm(classroom) }}
  123. </div>
  124. </div>
  125. <div class="col-md-4 col-sm-6 col-12 attribute-column">
  126. <div class="icon">
  127. <svg data-name="Group 11306"
  128. xmlns="http://www.w3.org/2000/svg"
  129. width="21.539"
  130. height="21.044"
  131. viewBox="0 0 21.539 21.044">
  132. <g id="Buy"
  133. transform="translate(0 0)">
  134. <path id="Combined_Shape"
  135. data-name="Combined Shape"
  136. d="M16.3,19.649A1.395,1.395,0,1,1,17.7,21.044,1.4,1.4,0,0,1,16.3,19.649Zm-12.147,0a1.394,1.394,0,1,1,1.394,1.395A1.4,1.4,0,0,1,4.157,19.649ZM17.77,16.139H6.014A2.76,2.76,0,0,1,3.28,13.615L2.294,1.883.671,1.6A.812.812,0,0,1,.012.668.811.811,0,0,1,.815,0a.829.829,0,0,1,.13.011L3.186.4a.808.808,0,0,1,.666.729L4.1,4.143c15.367.007,15.424.014,15.5.022a2.254,2.254,0,0,1,1.912,2.553l-1.023,7.062a2.76,2.76,0,0,1-2.717,2.358ZM4.89,13.483a1.123,1.123,0,0,0,1.127,1.04H17.771a1.139,1.139,0,0,0,1.122-.972l1.024-7.064a.632.632,0,0,0-.121-.472.625.625,0,0,0-.418-.249c-.052,0-.6,0-1.677,0-1.693,0-4.455,0-7.291,0l-6.17,0ZM13.059,9.74a.808.808,0,0,1,0-1.616h2.985a.808.808,0,0,1,0,1.616Z"
  137. transform="translate(0)"
  138. fill="#aaa095" />
  139. </g>
  140. </svg>
  141. </div>
  142. <div class="title">
  143. {{ classroom.price ? classroom.price.toLocaleString('fa') : 0 }}
  144. تومان
  145. </div>
  146. </div>
  147. </div>
  148. </q-card-section>
  149. <div class="row q-col-gutter-lg four-sections">
  150. <div class="col-md-6 col-12">
  151. <div class="info-box detailes">
  152. <div class="info-box-title">
  153. <svg xmlns="http://www.w3.org/2000/svg"
  154. width="17.054"
  155. height="19.866"
  156. viewBox="0 0 17.054 19.866">
  157. <path id="Combined_Shape"
  158. data-name="Combined Shape"
  159. 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"
  160. transform="translate(0.001)"
  161. fill="#aaa095" />
  162. </svg>
  163. جزییات دوره
  164. </div>
  165. <div class="info-box-body">
  166. <div class="info-item">
  167. نام درس:
  168. {{ classroom.title }}
  169. </div>
  170. <div class="info-item">
  171. گروه آموزشی:
  172. {{ classroom.unit_info.category_info.title }}
  173. </div>
  174. <div class="info-item">
  175. زمان شروع ثبت نام گروه درسی:
  176. {{ getTime(classroom.beginning_registration_period) }}
  177. </div>
  178. <div class="info-item">
  179. زمان اتمام ثبت نام گروه درسی:
  180. {{ getTime(classroom.ending_registration_period) }}
  181. </div>
  182. </div>
  183. </div>
  184. <div class="info-box rules">
  185. <div class="info-box-title">
  186. <svg xmlns="http://www.w3.org/2000/svg"
  187. width="16.968"
  188. height="20.356"
  189. viewBox="0 0 16.968 20.356">
  190. <path id="Combined_Shape"
  191. data-name="Combined Shape"
  192. d="M8.266,20.324c-.335-.1-8.205-2.55-8.205-9.445C.06,9,.036,7.621.019,6.616l0-.058c-.046-2.544-.055-3.074.6-3.73C1.4,2.04,7.349,0,8.483,0s7.078,2.04,7.865,2.828c.656.656.646,1.184.6,3.722l0,.062C16.929,7.619,16.9,9,16.9,10.879c0,6.895-7.87,9.344-8.205,9.445a.711.711,0,0,1-.217.032A.719.719,0,0,1,8.266,20.324ZM1.668,3.9c-.182.184-.189.5-.15,2.63l0,.065c.017,1.011.041,2.395.041,4.286,0,5.217,5.765,7.525,6.921,7.934C9.637,18.4,15.4,16.086,15.4,10.879c0-1.959.027-3.4.044-4.353.038-2.127.031-2.445-.162-2.637A30.988,30.988,0,0,0,8.483,1.5,31.027,31.027,0,0,0,1.668,3.9Zm5.577,8.4L5.353,10.406A.751.751,0,0,1,6.415,9.345l1.361,1.363,3.369-3.368A.75.75,0,0,1,12.2,8.4l-3.9,3.9a.749.749,0,0,1-1.061,0Z"
  193. transform="translate(0.001)"
  194. fill="#aaa095" />
  195. </svg>
  196. قوانین دوره
  197. </div>
  198. <div class="info-box-body">
  199. <div v-html="classroom.rules" />
  200. <div v-if="classroom.unit_info && classroom.unit_info.codes"
  201. v-html="classroom.unit_info.codes" />
  202. </div>
  203. </div>
  204. </div>
  205. <div class="col-md-6 col-12">
  206. <div class="info-box class-time">
  207. <div class="info-box-title">
  208. <svg id="Time_Circle"
  209. data-name="Time Circle"
  210. xmlns="http://www.w3.org/2000/svg"
  211. width="20"
  212. height="20"
  213. viewBox="0 0 20 20">
  214. <path id="Combined_Shape"
  215. data-name="Combined Shape"
  216. d="M0,10A10,10,0,1,1,10,20,10.011,10.011,0,0,1,0,10Zm1.5,0A8.5,8.5,0,1,0,10,1.5,8.51,8.51,0,0,0,1.5,10Zm11.547,3.587-3.77-2.249a.754.754,0,0,1-.366-.644V5.845a.75.75,0,0,1,1.5,0v4.422l3.4,2.03a.751.751,0,0,1-.769,1.29Z"
  217. fill="#aaa095" />
  218. </svg>
  219. زمان برگزاری کلاس
  220. </div>
  221. <div class="info-box-body">
  222. <div v-if="classroom.sessions_info && classroom.sessions_info.length > 0 && classroom.sessions_info[0].starting_time"
  223. class="info-item">
  224. اولین جلسه:
  225. {{ getTitledDateTime(classroom.sessions_info[0].starting_time) }}
  226. </div>
  227. <div v-if="false"
  228. class="info-item">
  229. کلاس‌ها:
  230. روزهای دوشنبه ساعت 20:30 تا 22 به وقت ایران
  231. </div>
  232. <div v-if="classroom.sessions_info"
  233. class="info-item">
  234. طول دوره:
  235. {{ classroom.sessions_info.length }}
  236. جلسه
  237. </div>
  238. <div v-if="false"
  239. class="info-item">
  240. نوع برگزاری :
  241. {{getHoldingType(classroom.holding_type)}}
  242. </div>
  243. </div>
  244. </div>
  245. <div class="info-box books">
  246. <div v-if="false"
  247. class="info-box-title">
  248. <svg xmlns="http://www.w3.org/2000/svg"
  249. width="21.968"
  250. height="15.702"
  251. viewBox="0 0 21.968 15.702">
  252. <path id="import_contacts_FILL0_wght400_GRAD0_opsz48"
  253. d="M7.192,20.482a10.817,10.817,0,0,1,2.609.312,11.579,11.579,0,0,1,2.484.936V11.07A9.5,9.5,0,0,0,9.851,9.91,8.819,8.819,0,0,0,7.192,9.5a7.353,7.353,0,0,0-1.86.237,17.989,17.989,0,0,0-1.835.587h0V21.156h0a7.045,7.045,0,0,1,1.76-.512A11.9,11.9,0,0,1,7.192,20.482Zm6.59,1.248a12.562,12.562,0,0,1,2.446-.936,10.07,10.07,0,0,1,2.546-.312,13.37,13.37,0,0,1,1.96.15,9.769,9.769,0,0,1,1.735.4h0V10.322h0a7.418,7.418,0,0,0-1.8-.624,9.187,9.187,0,0,0-1.9-.2,8.346,8.346,0,0,0-2.609.412,9.727,9.727,0,0,0-2.384,1.161ZM13.034,23.7a1.613,1.613,0,0,1-.362-.037.708.708,0,0,1-.287-.137,10.528,10.528,0,0,0-2.5-1.123,9.28,9.28,0,0,0-2.7-.4,7.188,7.188,0,0,0-1.8.225,17.621,17.621,0,0,0-1.747.549A1.07,1.07,0,0,1,2.537,22.7,1.122,1.122,0,0,1,2,21.7V10.147a1.381,1.381,0,0,1,.175-.686A1.192,1.192,0,0,1,2.7,8.974a9.65,9.65,0,0,1,2.184-.736A11.268,11.268,0,0,1,7.192,8a11.077,11.077,0,0,1,3.058.424,9.758,9.758,0,0,1,2.783,1.3,9.477,9.477,0,0,1,2.733-1.3A10.725,10.725,0,0,1,18.775,8a11.088,11.088,0,0,1,2.3.237,9.691,9.691,0,0,1,2.172.736,1.272,1.272,0,0,1,.537.487,1.309,1.309,0,0,1,.187.686V21.7a1.183,1.183,0,0,1-.562,1.061.956.956,0,0,1-1.111.012,11.887,11.887,0,0,0-1.722-.562,7.589,7.589,0,0,0-1.8-.212,8.949,8.949,0,0,0-2.646.4,10.183,10.183,0,0,0-2.446,1.123.708.708,0,0,1-.287.137A1.613,1.613,0,0,1,13.034,23.7ZM7.891,15.764Z"
  254. transform="translate(-2 -8)"
  255. fill="#aaa095" />
  256. </svg>
  257. کتاب ها
  258. </div>
  259. <div class="info-box-body"
  260. v-html="classroom.description" />
  261. </div>
  262. </div>
  263. </div>
  264. </q-card>
  265. <q-skeleton v-if="loading"
  266. type="circle"
  267. size="100px"
  268. class="q-mt-md" />
  269. <q-skeleton v-if="loading"
  270. width="150px"
  271. class="q-mt-md" />
  272. <q-skeleton v-if="loading"
  273. height="150px"
  274. class="q-mt-md" />
  275. <q-dialog v-model="rulesDialog"
  276. class="rulesDialog"
  277. full-width>
  278. <q-card>
  279. <q-card-section>
  280. <div class="text-h6">آیین نامه</div>
  281. </q-card-section>
  282. <q-separator />
  283. <q-card-section style="max-height: 50vh"
  284. class="scroll">
  285. <div v-html="classroom.rules" />
  286. <div v-if="classroom.unit_info && classroom.unit_info.codes"
  287. v-html="classroom.unit_info.codes" />
  288. </q-card-section>
  289. <q-separator />
  290. <q-card-actions class="rulesDialog-actions">
  291. <div v-if="!defaultOptions.profileMode"
  292. class="rulesDialog-accept-chk">
  293. <q-checkbox v-model="rulesAccept"
  294. label="آیین نامه دوره آموزشی را خواندم و قصد ثبت نام در دوره را دارم" />
  295. </div>
  296. <div class="rulesDialog-btns q-gutter-md">
  297. <q-btn v-if="defaultOptions.profileMode"
  298. v-close-popup
  299. label="بستن"
  300. color="primary"
  301. outline />
  302. <q-btn v-if="!defaultOptions.profileMode"
  303. v-close-popup
  304. label="انصراف"
  305. color="primary"
  306. outline />
  307. <q-btn v-if="!defaultOptions.profileMode"
  308. label="تایید و ادامه"
  309. color="primary"
  310. :disable="!rulesAccept"
  311. @click="acceptAndContinue" />
  312. </div>
  313. </q-card-actions>
  314. </q-card>
  315. </q-dialog>
  316. </div>
  317. </template>
  318. <script>
  319. import Enums from 'src/assets/Enums/Enums.js'
  320. import ShamsiDate from 'src/assets/ShamsiDate.js'
  321. import { mixinWidget } from 'src/mixin/Mixins.js'
  322. import { APIGateway } from 'src/api/APIGateway.js'
  323. import { Classroom } from 'src/models/Classroom.js'
  324. export default {
  325. name: 'ShowClassroomInfo',
  326. mixins: [mixinWidget],
  327. props: {
  328. options: {
  329. type: Object,
  330. default: () => {
  331. return {}
  332. }
  333. }
  334. },
  335. emits: ['onloadn'],
  336. data: () => ({
  337. defaultOptions: {
  338. profileMode: false
  339. },
  340. enrolmentLoading: false,
  341. dropLoading: false,
  342. rulesAccept: false,
  343. rulesDialog: false,
  344. loading: true,
  345. classroom: new Classroom()
  346. }),
  347. mounted () {
  348. this.getClassroom()
  349. },
  350. methods: {
  351. getTitledDateTime (dateTime) {
  352. return ShamsiDate.getTitledDateTime(dateTime)
  353. },
  354. acceptAndContinue () {
  355. this.$store.commit('Shop/updateOnRegisterClassroom', this.classroom)
  356. this.$router.push({ name: 'UserPanel.ShopCompleteInfo' })
  357. },
  358. onEnrolment () {
  359. this.$q.dialog({
  360. title: 'توجه',
  361. message: 'آیا از پیش ثبت نام این دوره اطمینان دارید؟' + '\n' + this.classroom.unit_info.codes,
  362. html: true,
  363. cancel: true,
  364. persistent: true
  365. }).onOk(() => {
  366. this.enrolmentLoading = true
  367. const classroomId = this.$route.params.id
  368. APIGateway.classroom.enrollByUser(classroomId)
  369. .then(() => {
  370. this.enrolmentLoading = false
  371. this.getClassroom()
  372. })
  373. .catch(() => {
  374. this.enrolmentLoading = false
  375. })
  376. })
  377. },
  378. onDropping () {
  379. this.$q.dialog({
  380. title: 'توجه',
  381. message: 'آیا از حذف نام این دوره اطمینان دارید؟',
  382. cancel: true,
  383. persistent: true
  384. }).onOk(() => {
  385. this.dropLoading = true
  386. const classroomId = this.$route.params.id
  387. APIGateway.classroom.dropByUser(classroomId)
  388. .then(() => {
  389. this.dropLoading = false
  390. this.getClassroom()
  391. })
  392. .catch(() => {
  393. this.dropLoading = false
  394. })
  395. })
  396. },
  397. openRulesDialog () {
  398. this.rulesDialog = true
  399. },
  400. getHoldingType (type) {
  401. const target = Enums.classroomHoldingTypes.find(item => item.value === type)
  402. if (target) {
  403. return target.label
  404. }
  405. return '-'
  406. },
  407. getAudienceGenderType (type) {
  408. const target = Enums.genders.find(item => item.value === type)
  409. if (target) {
  410. return target.label
  411. }
  412. return '-'
  413. },
  414. getTime (time) {
  415. return ShamsiDate.getDateTime(time)
  416. },
  417. getTerm (classroom) {
  418. if (!classroom.beginning_registration_period) {
  419. return '-'
  420. }
  421. return ShamsiDate.getTerm(classroom.beginning_registration_period)
  422. },
  423. getClassroom () {
  424. this.loading = true
  425. APIGateway.classroom.get(this.$route.params.id)
  426. .then(classroom => {
  427. this.classroom = new Classroom(classroom)
  428. this.loading = false
  429. this.$emit('onloadn', this.classroom)
  430. })
  431. .catch(() => {
  432. this.loading = false
  433. })
  434. }
  435. }
  436. }
  437. </script>
  438. <style scoped lang="scss">
  439. .classroom {
  440. .classroom-banner {
  441. margin-top: 52px;
  442. margin-bottom: 42px;
  443. }
  444. .classroom-card {
  445. background-color: #F5F5F5;
  446. padding: 20px 30px 40px 30px;
  447. .four-sections {
  448. .info-box {
  449. height: 353px;
  450. overflow: auto;
  451. &.detailes {
  452. //margin-right: 24px;
  453. }
  454. &.rules {
  455. //margin-right: 24px;
  456. }
  457. .info-box-title {
  458. margin-bottom: 29px;
  459. display: flex;
  460. flex-flow: row;
  461. svg {
  462. margin-right: 8px;
  463. }
  464. }
  465. .info-box-body {
  466. .info-item {
  467. margin-bottom: 27px;
  468. }
  469. }
  470. }
  471. }
  472. .info-box {
  473. background-color: #FFFFFF;
  474. border-radius: 8px;
  475. padding: 26px;
  476. margin-bottom: 24px;
  477. .classroom-thumbnail {
  478. padding-right: 42px;
  479. }
  480. .classroom-top-attributes {
  481. .attributes {
  482. padding-top: 27px;
  483. .attribute-item {
  484. margin-bottom: 20px;
  485. position: relative;
  486. padding-left: 15px;
  487. &:before {
  488. content: ' ';
  489. background-color: #EAC38A;
  490. width: 8px;
  491. height: 8px;
  492. border-radius: 100%;
  493. position: absolute;
  494. left: 0;
  495. top: 10px;
  496. }
  497. }
  498. }
  499. }
  500. .classroom-action-col {
  501. display: flex;
  502. justify-content: flex-end;
  503. align-items: flex-end;
  504. flex-wrap: wrap;
  505. .btn-register {
  506. width: 220px;
  507. }
  508. @media screen and (max-width: 700px) {
  509. width: 100%;
  510. .q-btn {
  511. width: 100% !important;
  512. margin-left: 0;
  513. margin-bottom: 8px;
  514. }
  515. }
  516. }
  517. .second-section {
  518. .attribute-column {
  519. display: flex;
  520. flex-flow: row;
  521. .icon {
  522. margin-right: 20px;
  523. }
  524. }
  525. }
  526. }
  527. }
  528. }
  529. </style>
  530. <style lang="scss">
  531. .rulesDialog {
  532. .rulesDialog-actions {
  533. display: flex;
  534. flex-flow: row;
  535. justify-content: space-between;
  536. .rulesDialog-accept-chk {}
  537. .rulesDialog-btns {}
  538. }
  539. }
  540. </style>