EventItem.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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. <router-link :to="{name: 'Public.ShowEventInfo', params: {id: event.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. <img class="thumbnail-img"
  53. :src="event.thumbnail">
  54. </router-link>
  55. </q-card-section>
  56. <div class="infos">
  57. <div class="title ellipsis-2-lines">
  58. <router-link :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  59. {{event.title}}
  60. </router-link>
  61. </div>
  62. <div class="date">
  63. <q-icon name="calendar_month"
  64. size="20px" />
  65. {{ miladiToShamsi() }}
  66. </div>
  67. </div>
  68. <q-card-actions class="action-section">
  69. <q-btn color="primary"
  70. class="btn-show-event"
  71. :to="{name: 'Public.ShowEventInfo', params: {id: event.id}}">
  72. مشاهده و ثبت نام
  73. <svg xmlns="http://www.w3.org/2000/svg"
  74. width="18.387"
  75. height="11.502"
  76. viewBox="0 0 18.387 11.502">
  77. <path id="Combined_Shape"
  78. data-name="Combined Shape"
  79. 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"
  80. transform="translate(18.387)"
  81. fill="#fff" />
  82. </svg>
  83. </q-btn>
  84. </q-card-actions>
  85. </q-card>
  86. </template>
  87. <script>
  88. import { defineComponent } from 'vue'
  89. import { Event } from 'src/models/Event.js'
  90. import Assist from 'src/assets/js/Assist.js'
  91. export default defineComponent({
  92. name: 'OptionPanel',
  93. props: {
  94. event: {
  95. type: Event,
  96. default: new Event()
  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. getHoldingType (event) {
  152. return new Event(event).holding_type_info.label
  153. },
  154. miladiToShamsi () {
  155. if (!this.event.publish_time) {
  156. return '-'
  157. }
  158. return Assist.miladiToShamsi(this.event.publish_time, 'jD jMMMM jYYYY ساعت HH:mm')
  159. }
  160. }
  161. })
  162. </script>
  163. <style lang="scss" scoped>
  164. .event-item {
  165. width: 100%;
  166. background-color: #F6F6F6;
  167. border-radius: 8px;
  168. position: relative;
  169. z-index: 1;
  170. &.isRegistered {
  171. .thumbnail {
  172. position: relative;
  173. z-index: 1;
  174. .RegisteredSign {
  175. position: absolute;
  176. right: -13px;
  177. top: -13px;
  178. z-index: 2;
  179. display: block;
  180. }
  181. }
  182. }
  183. .thumbnail {
  184. padding: 0;
  185. .RegisteredSign {
  186. display: none;
  187. }
  188. .thumbnail-img {
  189. width: 100%;
  190. height: auto;
  191. }
  192. }
  193. .infos {
  194. position: absolute;
  195. left: 0;
  196. bottom: 60px;
  197. width: 100%;
  198. z-index: 2;
  199. .title {
  200. padding: 0 15px;
  201. text-align: left;
  202. margin-bottom: 49px;
  203. a {
  204. color: white;
  205. font-size: 16px;
  206. font-weight: bold;
  207. }
  208. }
  209. .date {
  210. padding: 0 15px;
  211. text-align: left;
  212. margin-bottom: 24px;
  213. color: white;
  214. font-size: 16px;
  215. font-weight: normal;
  216. .q-icon {
  217. color: #EAC38A;
  218. margin-right: 12.5px;
  219. }
  220. }
  221. }
  222. .action-section {
  223. padding: 0;
  224. .btn-show-event {
  225. width: 100%;
  226. height: 60px;
  227. border-top-right-radius: 0;
  228. border-top-left-radius: 0;
  229. }
  230. }
  231. }
  232. </style>