index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <template>
  2. <section class="catalog section">
  3. <div class="catalog__wrapper section-wrapper">
  4. <div class="catalog__container">
  5. <CatalogMenu />
  6. <main class="catalog__main">
  7. <div class="catalog-main">
  8. <div class="catalog-main__wrapper">
  9. <div class="catalog-main__topic">
  10. <ul class="catalog-main__topic-list">
  11. <li class="catalog-main__topic-item">
  12. <a
  13. class="catalog-main__topic-link"
  14. href="javascript:void(0)"
  15. >Видео</a
  16. >
  17. </li>
  18. <!-- <li class="catalog-main__topic-item">
  19. <nuxt-link :to="{ name: 'news-category', params: { category: categoryNewsList.category ? categoryNewsList.category.alias : ''}}"
  20. class="catalog-main__topic-link"
  21. href="javascript:void(0)"
  22. >{{ categoryNewsList.category ? categoryNewsList.category.name : "" }}</nuxt-link
  23. >
  24. </li> -->
  25. </ul>
  26. </div>
  27. <div class="catalog-main__header">
  28. <h1 class="catalog-main__title"> Видео</h1>
  29. <a
  30. class="catalog-main__subscribe button button_grey-dark button_grey-dark-short"
  31. ><span class="button__text">Подписаться</span></a
  32. >
  33. </div>
  34. <div class="catalog-main__list">
  35. <div class="catalog-list">
  36. <CatalogList :categoryNewsList="categoryNewsList.news" :pages="categoryNewsList.total_pages"/>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </main>
  42. </div>
  43. </div>
  44. </section>
  45. </template>
  46. <script>
  47. import { mapGetters } from "vuex";
  48. export default {
  49. watchQuery: ['page'],
  50. computed: {
  51. ...mapGetters({
  52. newsItem : "modules/news/newsItem",
  53. categoryNewsList: "modules/news/categoryNewsList"
  54. })
  55. },
  56. props: {
  57. category: {
  58. type: Object
  59. }
  60. },
  61. head() {
  62. return {
  63. title: 'Амик - Видео',
  64. meta: [
  65. {
  66. name: "description",
  67. content:
  68. this.categoryNewsList.category,
  69. },
  70. {
  71. name: "keys",
  72. content:
  73. this.categoryNewsList.category
  74. },
  75. ],
  76. };
  77. },
  78. async fetch({ store, route }) {
  79. await store.dispatch("modules/news/setCategoryNewsList", {category: 'video', page: route.query.page})
  80. await store.dispatch("modules/news/setCategoriesList");
  81. },
  82. async asyncData({store}) {
  83. await store.dispatch("modules/ads/getAds")
  84. }
  85. };
  86. </script>
  87. <style>
  88. </style>