ClassroomItem.vue 8.7 KB

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