CardThematique.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <article class="card card-thematique search-card">
  3. <header
  4. @click="openThematique"
  5. >
  6. <h1>{{ item.title }}</h1>
  7. <h4>{{ item.short_description }}</h4>
  8. </header>
  9. <section class="images" v-switcher>
  10. <figure
  11. v-for="(img, index) in item.visuels"
  12. :key="img.url"
  13. >
  14. <img
  15. class="lazy"
  16. v-lazy="index"
  17. :data-src="img.style_cardmedium.url"
  18. :title="img.title"
  19. />
  20. <img
  21. class="blank"
  22. :src="blanksrc"
  23. @click="lightbox_index = index"
  24. >
  25. </figure>
  26. </section>
  27. <CoolLightBox
  28. :items="item.visuels"
  29. :index="lightbox_index"
  30. srcName="url"
  31. :loop="true"
  32. @close="lightbox_index = null">
  33. </CoolLightBox>
  34. </article>
  35. </template>
  36. <script>
  37. import { mapState, mapActions } from 'vuex'
  38. import cardMixins from 'vuejs/components/cardMixins'
  39. // import ModalCard from 'vuejs/components/Content/ModalCard'
  40. export default {
  41. name: "Card",
  42. props: ['item'],
  43. mixins: [cardMixins],
  44. // components: {
  45. // ModalCard
  46. // },
  47. data() {
  48. return {
  49. blanksrc:`${drupalSettings.path.themePath}/assets/img/blank.gif`,
  50. // loadingFlag: false,
  51. lightbox_index: null
  52. }
  53. },
  54. // computed: {
  55. // ...mapState({
  56. // flagcolls: state => state.User.flagcolls
  57. // })
  58. // },
  59. methods: {
  60. // ...mapActions({
  61. // flagUnflag: 'User/flagUnflag'
  62. // }),
  63. // flagIsActive(collid) {
  64. // // console.log("Card flagIsActive",
  65. // // this.item.id,
  66. // // this.flagcolls[collid].items,
  67. // // this.flagcolls[collid].items.indexOf(this.item.id)
  68. // // );
  69. // // console.log(this.flagcolls[collid].items_uuids);
  70. // // return this.flagcolls[collid].items_uuids.indexOf(this.item.uuid) !== -1;
  71. // return this.flagcolls[collid].items.indexOf(this.item.id) !== -1;
  72. // },
  73. // flagIsLoading(collid) {
  74. // // console.log(this.item.uuid);
  75. // // console.log(this.flagcolls[collid].items_uuids);
  76. // return collid === this.loadingFlag;
  77. // },
  78. // onFlagActionCard (e) {
  79. // console.log("Card onFlagActionCard", e, this.item);
  80. // if (!this.loadingFlag) {
  81. // let collid = e.target.getAttribute('collid');
  82. // let isActive = this.flagIsActive(collid);
  83. // let action = isActive ? 'unflag' : 'flag';
  84. // // console.log('collid', collid);
  85. // // console.log("this.item", this.item);
  86. // this.loadingFlag = collid;
  87. // this.flagUnflag({ action: action, id: this.item.id, collid: collid})
  88. // .then(data => {
  89. // console.log("onFlagActionCard then", data);
  90. // this.loadingFlag = false;
  91. // })
  92. // }
  93. // },
  94. openThematique (e) {
  95. console.log('openThematique', e);
  96. // this.$modal.show(
  97. // ModalCard,
  98. // { item: this.item },
  99. // {
  100. // draggable: true,
  101. // width: '850px',
  102. // height: '610px'
  103. // }
  104. // )
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. </style>