ClassroomItem.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <q-card flat
  3. class="classroom-item"
  4. :class="{'isRegistered' : classroom.is_current_user_registered }">
  5. <q-card-section class="thumbnail">
  6. <div class="RegisteredSign">
  7. <svg class="ribbon"
  8. xmlns="http://www.w3.org/2000/svg"
  9. width="123.945"
  10. height="123.422"
  11. viewBox="0 0 123.945 123.422">
  12. <g id="Group_11524"
  13. data-name="Group 11524"
  14. transform="translate(-361 -1111)">
  15. <g id="Group_7903"
  16. data-name="Group 7903"
  17. transform="translate(361 1111)">
  18. <g id="Group_7901"
  19. data-name="Group 7901"
  20. transform="translate(0 0)">
  21. <rect id="Rectangle_1771"
  22. data-name="Rectangle 1771"
  23. width="13.986"
  24. height="39.668"
  25. transform="translate(0 83.754)"
  26. fill="#cfb184" />
  27. <rect id="Rectangle_1772"
  28. data-name="Rectangle 1772"
  29. width="39.668"
  30. height="13.986"
  31. transform="translate(84.277 0)"
  32. fill="#cfb184" />
  33. <path id="Path_18668"
  34. data-name="Path 18668"
  35. d="M1938.931,282.651l123.945-123.406-.016-.016h-44a9.041,9.041,0,0,0-6.379,2.631l-70.907,70.6a8.962,8.962,0,0,0-2.642,6.352Z"
  36. transform="translate(-1938.931 -159.229)"
  37. fill="#eac38a" />
  38. </g>
  39. </g>
  40. <text id="دوره_های_من"
  41. data-name="دوره‌های من"
  42. transform="translate(445.063 1135.174) rotate(-45)"
  43. fill="#fff"
  44. font-size="18"
  45. font-family="SegoeUI-Bold, Segoe UI"
  46. font-weight="700"><tspan x="0"
  47. y="0">دوره‌های من</tspan></text>
  48. </g>
  49. </svg>
  50. </div>
  51. <img class="thumbnail-img q-ma-xs"
  52. :src="classroom.thumbnail"
  53. @click="goToPage">
  54. </q-card-section>
  55. <q-card-section class="title">
  56. <router-link :to="{name: 'Public.ShowClassroomInfo', params: {id: classroom.id}}">
  57. {{classroom.title}}
  58. </router-link>
  59. </q-card-section>
  60. <q-card-section class="attribute">
  61. <div class="attribute-item">
  62. <div class="attribute-logo">
  63. <svg id="Profile"
  64. xmlns="http://www.w3.org/2000/svg"
  65. width="17.058"
  66. height="21.399"
  67. viewBox="0 0 17.058 21.399">
  68. <path id="Combined_Shape"
  69. data-name="Combined Shape"
  70. 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"
  71. transform="translate(0 0)"
  72. fill="#aaa095" />
  73. </svg>
  74. </div>
  75. <div class="attribute-value">
  76. {{classroom.professor_info.firstname}}
  77. {{classroom.professor_info.lastname}}
  78. </div>
  79. </div>
  80. <div class="attribute-item">
  81. <div class="attribute-logo">
  82. <q-icon name="cast_for_education"
  83. size="20px"
  84. color="grey" />
  85. </div>
  86. <div class="attribute-value">
  87. {{ getHoldingType(classroom) }}
  88. </div>
  89. </div>
  90. <div class="attribute-item">
  91. <div class="attribute-logo">
  92. <svg id="Group_11306"
  93. data-name="Group 11306"
  94. xmlns="http://www.w3.org/2000/svg"
  95. width="21.539"
  96. height="21.044"
  97. viewBox="0 0 21.539 21.044">
  98. <g id="Buy"
  99. transform="translate(0 0)">
  100. <path id="Combined_Shape"
  101. data-name="Combined Shape"
  102. 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"
  103. transform="translate(0)"
  104. fill="#aaa095" />
  105. </g>
  106. </svg>
  107. </div>
  108. <div class="attribute-value">
  109. {{classroom.price}}
  110. ریال
  111. </div>
  112. </div>
  113. </q-card-section>
  114. <q-card-actions class="action-section">
  115. <q-btn color="primary"
  116. class="btn-show-classroom"
  117. :to="{name: 'Public.ShowClassroomInfo', params: {id: classroom.id}}">
  118. مشاهده و ثبت نام
  119. <svg xmlns="http://www.w3.org/2000/svg"
  120. width="18.387"
  121. height="11.502"
  122. viewBox="0 0 18.387 11.502">
  123. <path id="Combined_Shape"
  124. data-name="Combined Shape"
  125. 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"
  126. transform="translate(18.387)"
  127. fill="#fff" />
  128. </svg>
  129. </q-btn>
  130. </q-card-actions>
  131. </q-card>
  132. </template>
  133. <script>
  134. import { defineComponent } from 'vue'
  135. import { Classroom } from 'src/models/Classroom.js'
  136. export default defineComponent({
  137. name: 'OptionPanel',
  138. props: {
  139. classroom: {
  140. type: Classroom,
  141. default: new Classroom()
  142. }
  143. },
  144. data() {
  145. return {
  146. size: 'xs',
  147. sizeOptions: ['xs', 'sm', 'md', 'lg', 'xl'],
  148. actionTypes: ['event', 'scroll', 'link'],
  149. defaultOptions: {
  150. imageSource: null,
  151. ratio: null,
  152. hasAction: false,
  153. useAEEEvent: false,
  154. AEEEventBody: {
  155. id: '-',
  156. name: '-',
  157. creative: null,
  158. position: null
  159. },
  160. action: {
  161. name: null,
  162. route: null,
  163. scrollTo: null,
  164. eventName: null,
  165. eventArgs: null
  166. },
  167. xs: {
  168. height: null,
  169. width: null,
  170. src: null
  171. },
  172. sm: {
  173. height: null,
  174. width: null,
  175. src: null
  176. },
  177. md: {
  178. height: null,
  179. width: null,
  180. src: null
  181. },
  182. lg: {
  183. height: null,
  184. width: null,
  185. src: null
  186. },
  187. xl: {
  188. height: null,
  189. width: null,
  190. src: null
  191. }
  192. }
  193. }
  194. },
  195. methods: {
  196. goToPage () {
  197. this.$router.push({ name: 'Public.ShowClassroomInfo', params: { id: this.classroom.id } })
  198. },
  199. getHoldingType (classroom) {
  200. return new Classroom(classroom).holding_type_info.label
  201. }
  202. }
  203. })
  204. </script>
  205. <style lang="scss" scoped>
  206. .classroom-item {
  207. width: 100%;
  208. background-color: #F6F6F6;
  209. border-radius: 8px;
  210. &.isRegistered {
  211. .thumbnail {
  212. position: relative;
  213. z-index: 1;
  214. .RegisteredSign {
  215. position: absolute;
  216. right: 5px;
  217. top: 7px;
  218. z-index: 2;
  219. display: block;
  220. }
  221. }
  222. }
  223. .thumbnail {
  224. padding-top: 17px;
  225. padding-left: 22px;
  226. padding-right: 22px;
  227. padding-bottom: 26px;
  228. .RegisteredSign {
  229. display: none;
  230. }
  231. .thumbnail-img {
  232. width: 100%;
  233. height: auto;
  234. border-radius: 10px;
  235. }
  236. }
  237. .title {
  238. text-align: left;
  239. padding-top: 0;
  240. padding-left: 46px;
  241. padding-right: 46px;
  242. padding-bottom: 33px;
  243. }
  244. .attribute {
  245. padding-top: 0;
  246. padding-left: 46px;
  247. padding-right: 46px;
  248. padding-bottom: 44px;
  249. .attribute-item {
  250. margin-bottom: 21px;
  251. display: flex;
  252. flex-flow: row;
  253. .attribute-logo {
  254. margin-right: 15px;
  255. }
  256. &:last-child {
  257. margin-bottom: 0;
  258. }
  259. }
  260. }
  261. .action-section {
  262. padding: 0;
  263. .btn-show-classroom {
  264. width: 100%;
  265. height: 60px;
  266. border-top-right-radius: 0;
  267. border-top-left-radius: 0;
  268. }
  269. }
  270. }
  271. </style>