EventItem.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <q-card flat
  3. class="event-item"
  4. :class="{'isRegistered' : event.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"
  52. :src="event.thumbnail"
  53. @click="goToPage">
  54. </q-card-section>
  55. <div class="infos">
  56. <div class="title ellipsis-2-lines">
  57. <router-link :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  58. {{event.title}}
  59. </router-link>
  60. </div>
  61. <div class="date">
  62. <q-icon name="calendar_month"
  63. size="20px" />
  64. {{ miladiToShamsi() }}
  65. </div>
  66. </div>
  67. <q-card-actions class="action-section">
  68. <q-btn color="primary"
  69. class="btn-show-event"
  70. :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  71. مشاهده و ثبت نام
  72. <svg xmlns="http://www.w3.org/2000/svg"
  73. width="18.387"
  74. height="11.502"
  75. viewBox="0 0 18.387 11.502">
  76. <path id="Combined_Shape"
  77. data-name="Combined Shape"
  78. 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"
  79. transform="translate(18.387)"
  80. fill="#fff" />
  81. </svg>
  82. </q-btn>
  83. </q-card-actions>
  84. </q-card>
  85. </template>
  86. <script>
  87. import { defineComponent } from 'vue'
  88. // import { Event } from 'src/models/Event.js'
  89. import { Classroom } from 'src/models/Classroom' // using Classroom instead of Event to prevent props warning
  90. import Assist from 'src/assets/js/Assist.js'
  91. export default defineComponent({
  92. name: 'OptionPanel',
  93. props: {
  94. event: {
  95. type: Classroom,
  96. default: new Classroom()
  97. }
  98. },
  99. data() {
  100. return {
  101. size: 'xs',
  102. sizeOptions: ['xs', 'sm', 'md', 'lg', 'xl'],
  103. actionTypes: ['event', 'scroll', 'link'],
  104. defaultOptions: {
  105. imageSource: null,
  106. ratio: null,
  107. hasAction: false,
  108. useAEEEvent: false,
  109. AEEEventBody: {
  110. id: '-',
  111. name: '-',
  112. creative: null,
  113. position: null
  114. },
  115. action: {
  116. name: null,
  117. route: null,
  118. scrollTo: null,
  119. eventName: null,
  120. eventArgs: null
  121. },
  122. xs: {
  123. height: null,
  124. width: null,
  125. src: null
  126. },
  127. sm: {
  128. height: null,
  129. width: null,
  130. src: null
  131. },
  132. md: {
  133. height: null,
  134. width: null,
  135. src: null
  136. },
  137. lg: {
  138. height: null,
  139. width: null,
  140. src: null
  141. },
  142. xl: {
  143. height: null,
  144. width: null,
  145. src: null
  146. }
  147. }
  148. }
  149. },
  150. methods: {
  151. goToPage () {
  152. this.$router.push({ name: 'Public.ShowEventInfo', params: { id: this.event.id } })
  153. },
  154. getHoldingType (event) {
  155. return new Classroom(event).holding_type_info.label
  156. },
  157. miladiToShamsi () {
  158. if (!this.event.publish_time) {
  159. return '-'
  160. }
  161. return Assist.miladiToShamsi(this.event.publish_time, 'jD jMMMM jYYYY ساعت HH:mm')
  162. }
  163. }
  164. })
  165. </script>
  166. <style lang="scss" scoped>
  167. .event-item {
  168. width: 100%;
  169. background-color: #F6F6F6;
  170. border-radius: 8px;
  171. position: relative;
  172. z-index: 1;
  173. &.isRegistered {
  174. .thumbnail {
  175. position: relative;
  176. z-index: 1;
  177. .RegisteredSign {
  178. position: absolute;
  179. right: -13px;
  180. top: -13px;
  181. z-index: 2;
  182. display: block;
  183. }
  184. }
  185. }
  186. .thumbnail {
  187. padding: 0;
  188. .RegisteredSign {
  189. display: none;
  190. }
  191. .thumbnail-img {
  192. width: 100%;
  193. height: auto;
  194. }
  195. }
  196. .infos {
  197. position: absolute;
  198. left: 0;
  199. bottom: 60px;
  200. width: 100%;
  201. z-index: 2;
  202. .title {
  203. padding: 0 15px;
  204. text-align: left;
  205. margin-bottom: 49px;
  206. a {
  207. color: white;
  208. font-size: 16px;
  209. font-weight: bold;
  210. }
  211. }
  212. .date {
  213. padding: 0 15px;
  214. text-align: left;
  215. margin-bottom: 24px;
  216. color: white;
  217. font-size: 16px;
  218. font-weight: normal;
  219. .q-icon {
  220. color: #EAC38A;
  221. margin-right: 12.5px;
  222. }
  223. }
  224. }
  225. .action-section {
  226. padding: 0;
  227. .btn-show-event {
  228. width: 100%;
  229. height: 60px;
  230. border-top-right-radius: 0;
  231. border-top-left-radius: 0;
  232. }
  233. }
  234. }
  235. </style>