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