|
@@ -1,46 +1,132 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <ui-page-layout title="推荐内容">
|
|
|
|
|
|
|
+ <ui-page-layout title="实时新闻">
|
|
|
<template v-slot:search>
|
|
<template v-slot:search>
|
|
|
<ui-search></ui-search>
|
|
<ui-search></ui-search>
|
|
|
</template>
|
|
</template>
|
|
|
- <ui-mask-picture class="w-full h-136rem"></ui-mask-picture>
|
|
|
|
|
-
|
|
|
|
|
- <UiMainArticle v-for="index in 8"></UiMainArticle>
|
|
|
|
|
|
|
+ <ui-mask-picture flag="实时新闻" bannerClass="w-full h-136rem"></ui-mask-picture>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="pl-22rem pr-22rem">
|
|
|
|
|
+ <UiMainArticle v-for="art in latestArts" :item="art"></UiMainArticle>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </ui-page-layout>
|
|
|
|
|
+</template>
|
|
|
|
|
+
|
|
|
|
|
+<script>
|
|
|
|
|
+ export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ banner1: [
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ latestArts: [],
|
|
|
|
|
+ pageIndex: 1
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async loadLatestArts(pageIndex) {
|
|
|
|
|
+ let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify(Object.assign(this.$route.query,{pageIndex: pageIndex,type:'2'})));
|
|
|
|
|
+ if (resp.data.status === 200) {
|
|
|
|
|
+ if(pageIndex === 1){
|
|
|
|
|
+ this.latestArts = resp.data.data.cmsArticles;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.latestArts.push(...resp.data.data.cmsArticles);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async created() {
|
|
|
|
|
+ this.loadLatestArts(this.pageIndex);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+</script>
|
|
|
|
|
+<style>
|
|
|
|
|
+ .swiper-group {
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(2, 290px);
|
|
|
|
|
+ grid-template-rows: repeat(2, 163px);
|
|
|
|
|
+ grid-gap: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .swiper {
|
|
|
|
|
+ @apply w-290px;
|
|
|
|
|
+
|
|
|
|
|
+ /* align-items: end; */
|
|
|
|
|
+ /* @apply w-290px h-163px; */
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .swiper-title {
|
|
|
|
|
+ @apply bottom-17px left-17px text-size-16px;
|
|
|
|
|
+ }
|
|
|
|
|
+</style>
|
|
|
|
|
+<template>
|
|
|
|
|
+ <ui-page-layout title="推荐新闻">
|
|
|
|
|
+ <template v-slot:search>
|
|
|
|
|
+ <ui-search></ui-search>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <ui-mask-picture flag="推荐" bannerClass="w-full h-136rem"></ui-mask-picture>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="pl-22rem pr-22rem">
|
|
|
|
|
+ <UiMainArticle v-for="art in latestArts" :item="art"></UiMainArticle>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
|
|
|
</ui-page-layout>
|
|
</ui-page-layout>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
-export default {
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- banner1: [
|
|
|
|
|
- { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
- { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
- { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
- { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
- { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
- ],
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ export default {
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ banner1: [
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ { url: "/imgs/banner1.png", title: "這裏是輪播圖推薦內容標題" },
|
|
|
|
|
+ ],
|
|
|
|
|
+ latestArts: [],
|
|
|
|
|
+ pageIndex: 1
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ async loadLatestArts(pageIndex) {
|
|
|
|
|
+ let resp = await this.$http.post(this.$api.cms.articles, this.$qs.stringify(Object.assign(this.$route.query,{pageIndex: pageIndex})));
|
|
|
|
|
+ if (resp.data.status === 200) {
|
|
|
|
|
+ if(pageIndex === 1){
|
|
|
|
|
+ this.latestArts = resp.data.data.cmsArticles;
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.latestArts.push(...resp.data.data.cmsArticles);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ async created() {
|
|
|
|
|
+ this.loadLatestArts(this.pageIndex);
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
</script>
|
|
</script>
|
|
|
<style>
|
|
<style>
|
|
|
-.swiper-group {
|
|
|
|
|
- display: grid;
|
|
|
|
|
- grid-template-columns: repeat(2, 290px);
|
|
|
|
|
- grid-template-rows: repeat(2, 163px);
|
|
|
|
|
- grid-gap: 10px;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.swiper {
|
|
|
|
|
- @apply w-290px;
|
|
|
|
|
-
|
|
|
|
|
- /* align-items: end; */
|
|
|
|
|
- /* @apply w-290px h-163px; */
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.swiper-title {
|
|
|
|
|
- @apply bottom-17px left-17px text-size-16px;
|
|
|
|
|
-}
|
|
|
|
|
|
|
+ .swiper-group {
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(2, 290px);
|
|
|
|
|
+ grid-template-rows: repeat(2, 163px);
|
|
|
|
|
+ grid-gap: 10px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .swiper {
|
|
|
|
|
+ @apply w-290px;
|
|
|
|
|
+
|
|
|
|
|
+ /* align-items: end; */
|
|
|
|
|
+ /* @apply w-290px h-163px; */
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .swiper-title {
|
|
|
|
|
+ @apply bottom-17px left-17px text-size-16px;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|