提交 f6c9e6bf authored 作者: lihuihui's avatar lihuihui

对接接口

上级 42b8be78
...@@ -2,12 +2,11 @@ import { wrapFunctional } from './utils' ...@@ -2,12 +2,11 @@ import { wrapFunctional } from './utils'
export { default as Foot } from '../../components/Foot.vue' export { default as Foot } from '../../components/Foot.vue'
export { default as Head } from '../../components/Head.vue' export { default as Head } from '../../components/Head.vue'
export { default as Link } from '../../components/Link.vue'
export { default as RightAside } from '../../components/RightAside.vue' export { default as RightAside } from '../../components/RightAside.vue'
export { default as AboutContact } from '../../components/about/contact.vue' export { default as AboutContact } from '../../components/about/contact.vue'
export { default as AboutCulture } from '../../components/about/culture.vue' export { default as AboutCulture } from '../../components/about/culture.vue'
export { default as AboutDetail } from '../../components/about/detail.vue'
export { default as AboutIntroduce } from '../../components/about/introduce.vue' export { default as AboutIntroduce } from '../../components/about/introduce.vue'
export { default as AboutNews } from '../../components/about/news.vue'
export { default as AboutTabNav } from '../../components/about/tabNav.vue' export { default as AboutTabNav } from '../../components/about/tabNav.vue'
export { default as AlumnusParty } from '../../components/alumnus/party.vue' export { default as AlumnusParty } from '../../components/alumnus/party.vue'
export { default as AlumnusTabNav } from '../../components/alumnus/tabNav.vue' export { default as AlumnusTabNav } from '../../components/alumnus/tabNav.vue'
...@@ -23,12 +22,11 @@ export { default as ServicesTab } from '../../components/services/tab.vue' ...@@ -23,12 +22,11 @@ export { default as ServicesTab } from '../../components/services/tab.vue'
export const LazyFoot = import('../../components/Foot.vue' /* webpackChunkName: "components/foot" */).then(c => wrapFunctional(c.default || c)) export const LazyFoot = import('../../components/Foot.vue' /* webpackChunkName: "components/foot" */).then(c => wrapFunctional(c.default || c))
export const LazyHead = import('../../components/Head.vue' /* webpackChunkName: "components/head" */).then(c => wrapFunctional(c.default || c)) export const LazyHead = import('../../components/Head.vue' /* webpackChunkName: "components/head" */).then(c => wrapFunctional(c.default || c))
export const LazyLink = import('../../components/Link.vue' /* webpackChunkName: "components/link" */).then(c => wrapFunctional(c.default || c))
export const LazyRightAside = import('../../components/RightAside.vue' /* webpackChunkName: "components/right-aside" */).then(c => wrapFunctional(c.default || c)) export const LazyRightAside = import('../../components/RightAside.vue' /* webpackChunkName: "components/right-aside" */).then(c => wrapFunctional(c.default || c))
export const LazyAboutContact = import('../../components/about/contact.vue' /* webpackChunkName: "components/about-contact" */).then(c => wrapFunctional(c.default || c)) export const LazyAboutContact = import('../../components/about/contact.vue' /* webpackChunkName: "components/about-contact" */).then(c => wrapFunctional(c.default || c))
export const LazyAboutCulture = import('../../components/about/culture.vue' /* webpackChunkName: "components/about-culture" */).then(c => wrapFunctional(c.default || c)) export const LazyAboutCulture = import('../../components/about/culture.vue' /* webpackChunkName: "components/about-culture" */).then(c => wrapFunctional(c.default || c))
export const LazyAboutDetail = import('../../components/about/detail.vue' /* webpackChunkName: "components/about-detail" */).then(c => wrapFunctional(c.default || c))
export const LazyAboutIntroduce = import('../../components/about/introduce.vue' /* webpackChunkName: "components/about-introduce" */).then(c => wrapFunctional(c.default || c)) export const LazyAboutIntroduce = import('../../components/about/introduce.vue' /* webpackChunkName: "components/about-introduce" */).then(c => wrapFunctional(c.default || c))
export const LazyAboutNews = import('../../components/about/news.vue' /* webpackChunkName: "components/about-news" */).then(c => wrapFunctional(c.default || c))
export const LazyAboutTabNav = import('../../components/about/tabNav.vue' /* webpackChunkName: "components/about-tab-nav" */).then(c => wrapFunctional(c.default || c)) export const LazyAboutTabNav = import('../../components/about/tabNav.vue' /* webpackChunkName: "components/about-tab-nav" */).then(c => wrapFunctional(c.default || c))
export const LazyAlumnusParty = import('../../components/alumnus/party.vue' /* webpackChunkName: "components/alumnus-party" */).then(c => wrapFunctional(c.default || c)) export const LazyAlumnusParty = import('../../components/alumnus/party.vue' /* webpackChunkName: "components/alumnus-party" */).then(c => wrapFunctional(c.default || c))
export const LazyAlumnusTabNav = import('../../components/alumnus/tabNav.vue' /* webpackChunkName: "components/alumnus-tab-nav" */).then(c => wrapFunctional(c.default || c)) export const LazyAlumnusTabNav = import('../../components/alumnus/tabNav.vue' /* webpackChunkName: "components/alumnus-tab-nav" */).then(c => wrapFunctional(c.default || c))
......
...@@ -4,12 +4,11 @@ import { wrapFunctional } from './utils' ...@@ -4,12 +4,11 @@ import { wrapFunctional } from './utils'
const components = { const components = {
Foot: () => import('../../components/Foot.vue' /* webpackChunkName: "components/foot" */).then(c => wrapFunctional(c.default || c)), Foot: () => import('../../components/Foot.vue' /* webpackChunkName: "components/foot" */).then(c => wrapFunctional(c.default || c)),
Head: () => import('../../components/Head.vue' /* webpackChunkName: "components/head" */).then(c => wrapFunctional(c.default || c)), Head: () => import('../../components/Head.vue' /* webpackChunkName: "components/head" */).then(c => wrapFunctional(c.default || c)),
Link: () => import('../../components/Link.vue' /* webpackChunkName: "components/link" */).then(c => wrapFunctional(c.default || c)),
RightAside: () => import('../../components/RightAside.vue' /* webpackChunkName: "components/right-aside" */).then(c => wrapFunctional(c.default || c)), RightAside: () => import('../../components/RightAside.vue' /* webpackChunkName: "components/right-aside" */).then(c => wrapFunctional(c.default || c)),
AboutContact: () => import('../../components/about/contact.vue' /* webpackChunkName: "components/about-contact" */).then(c => wrapFunctional(c.default || c)), AboutContact: () => import('../../components/about/contact.vue' /* webpackChunkName: "components/about-contact" */).then(c => wrapFunctional(c.default || c)),
AboutCulture: () => import('../../components/about/culture.vue' /* webpackChunkName: "components/about-culture" */).then(c => wrapFunctional(c.default || c)), AboutCulture: () => import('../../components/about/culture.vue' /* webpackChunkName: "components/about-culture" */).then(c => wrapFunctional(c.default || c)),
AboutDetail: () => import('../../components/about/detail.vue' /* webpackChunkName: "components/about-detail" */).then(c => wrapFunctional(c.default || c)),
AboutIntroduce: () => import('../../components/about/introduce.vue' /* webpackChunkName: "components/about-introduce" */).then(c => wrapFunctional(c.default || c)), AboutIntroduce: () => import('../../components/about/introduce.vue' /* webpackChunkName: "components/about-introduce" */).then(c => wrapFunctional(c.default || c)),
AboutNews: () => import('../../components/about/news.vue' /* webpackChunkName: "components/about-news" */).then(c => wrapFunctional(c.default || c)),
AboutTabNav: () => import('../../components/about/tabNav.vue' /* webpackChunkName: "components/about-tab-nav" */).then(c => wrapFunctional(c.default || c)), AboutTabNav: () => import('../../components/about/tabNav.vue' /* webpackChunkName: "components/about-tab-nav" */).then(c => wrapFunctional(c.default || c)),
AlumnusParty: () => import('../../components/alumnus/party.vue' /* webpackChunkName: "components/alumnus-party" */).then(c => wrapFunctional(c.default || c)), AlumnusParty: () => import('../../components/alumnus/party.vue' /* webpackChunkName: "components/alumnus-party" */).then(c => wrapFunctional(c.default || c)),
AlumnusTabNav: () => import('../../components/alumnus/tabNav.vue' /* webpackChunkName: "components/alumnus-tab-nav" */).then(c => wrapFunctional(c.default || c)), AlumnusTabNav: () => import('../../components/alumnus/tabNav.vue' /* webpackChunkName: "components/alumnus-tab-nav" */).then(c => wrapFunctional(c.default || c)),
......
...@@ -8,12 +8,11 @@ You can directly use them in pages and other components without the need to impo ...@@ -8,12 +8,11 @@ You can directly use them in pages and other components without the need to impo
- `<Foot>` | `<foot>` (components/Foot.vue) - `<Foot>` | `<foot>` (components/Foot.vue)
- `<Head>` | `<head>` (components/Head.vue) - `<Head>` | `<head>` (components/Head.vue)
- `<Link>` | `<link>` (components/Link.vue)
- `<RightAside>` | `<right-aside>` (components/RightAside.vue) - `<RightAside>` | `<right-aside>` (components/RightAside.vue)
- `<AboutContact>` | `<about-contact>` (components/about/contact.vue) - `<AboutContact>` | `<about-contact>` (components/about/contact.vue)
- `<AboutCulture>` | `<about-culture>` (components/about/culture.vue) - `<AboutCulture>` | `<about-culture>` (components/about/culture.vue)
- `<AboutDetail>` | `<about-detail>` (components/about/detail.vue)
- `<AboutIntroduce>` | `<about-introduce>` (components/about/introduce.vue) - `<AboutIntroduce>` | `<about-introduce>` (components/about/introduce.vue)
- `<AboutNews>` | `<about-news>` (components/about/news.vue)
- `<AboutTabNav>` | `<about-tab-nav>` (components/about/tabNav.vue) - `<AboutTabNav>` | `<about-tab-nav>` (components/about/tabNav.vue)
- `<AlumnusParty>` | `<alumnus-party>` (components/alumnus/party.vue) - `<AlumnusParty>` | `<alumnus-party>` (components/alumnus/party.vue)
- `<AlumnusTabNav>` | `<alumnus-tab-nav>` (components/alumnus/tabNav.vue) - `<AlumnusTabNav>` | `<alumnus-tab-nav>` (components/alumnus/tabNav.vue)
......
...@@ -8,12 +8,12 @@ const _2dc5f64c = () => interopDefault(import('../pages/alumnus/index.vue' /* we ...@@ -8,12 +8,12 @@ const _2dc5f64c = () => interopDefault(import('../pages/alumnus/index.vue' /* we
const _44b59cfe = () => interopDefault(import('../pages/about/contact.vue' /* webpackChunkName: "pages/about/contact" */)) const _44b59cfe = () => interopDefault(import('../pages/about/contact.vue' /* webpackChunkName: "pages/about/contact" */))
const _10a7578c = () => interopDefault(import('../pages/about/culture.vue' /* webpackChunkName: "pages/about/culture" */)) const _10a7578c = () => interopDefault(import('../pages/about/culture.vue' /* webpackChunkName: "pages/about/culture" */))
const _23d2f0fd = () => interopDefault(import('../pages/about/introduce.vue' /* webpackChunkName: "pages/about/introduce" */)) const _23d2f0fd = () => interopDefault(import('../pages/about/introduce.vue' /* webpackChunkName: "pages/about/introduce" */))
const _7f16db65 = () => interopDefault(import('../pages/about/news.vue' /* webpackChunkName: "pages/about/news" */)) const _3de88228 = () => interopDefault(import('../pages/about/news/index.vue' /* webpackChunkName: "pages/about/news/index" */))
const _249d262e = () => interopDefault(import('../pages/about/news-detail.vue' /* webpackChunkName: "pages/about/news-detail" */))
const _12856c94 = () => interopDefault(import('../pages/services/college.vue' /* webpackChunkName: "pages/services/college" */)) const _12856c94 = () => interopDefault(import('../pages/services/college.vue' /* webpackChunkName: "pages/services/college" */))
const _3cf993c6 = () => interopDefault(import('../pages/services/employment.vue' /* webpackChunkName: "pages/services/employment" */)) const _3cf993c6 = () => interopDefault(import('../pages/services/employment.vue' /* webpackChunkName: "pages/services/employment" */))
const _5bfd9c5c = () => interopDefault(import('../pages/services/job.vue' /* webpackChunkName: "pages/services/job" */)) const _5bfd9c5c = () => interopDefault(import('../pages/services/job.vue' /* webpackChunkName: "pages/services/job" */))
const _77495298 = () => interopDefault(import('../pages/services/major.vue' /* webpackChunkName: "pages/services/major" */)) const _77495298 = () => interopDefault(import('../pages/services/major.vue' /* webpackChunkName: "pages/services/major" */))
const _aafe22e0 = () => interopDefault(import('../pages/about/news/_id.vue' /* webpackChunkName: "pages/about/news/_id" */))
const _4d95ac32 = () => interopDefault(import('../pages/index.vue' /* webpackChunkName: "pages/index" */)) const _4d95ac32 = () => interopDefault(import('../pages/index.vue' /* webpackChunkName: "pages/index" */))
const emptyFn = () => {} const emptyFn = () => {}
...@@ -45,12 +45,8 @@ export const routerOptions = { ...@@ -45,12 +45,8 @@ export const routerOptions = {
name: "about-introduce" name: "about-introduce"
}, { }, {
path: "/about/news", path: "/about/news",
component: _7f16db65, component: _3de88228,
name: "about-news" name: "about-news"
}, {
path: "/about/news-detail",
component: _249d262e,
name: "about-news-detail"
}, { }, {
path: "/services/college", path: "/services/college",
component: _12856c94, component: _12856c94,
...@@ -67,6 +63,10 @@ export const routerOptions = { ...@@ -67,6 +63,10 @@ export const routerOptions = {
path: "/services/major", path: "/services/major",
component: _77495298, component: _77495298,
name: "services-major" name: "services-major"
}, {
path: "/about/news/:id",
component: _aafe22e0,
name: "about-news-id"
}, { }, {
path: "/", path: "/",
component: _4d95ac32, component: _4d95ac32,
......
...@@ -30,16 +30,9 @@ ...@@ -30,16 +30,9 @@
{ {
"name": "about-news", "name": "about-news",
"path": "/about/news", "path": "/about/news",
"component": "/Users/lihui/Desktop/H/ezijing/guangwangAndXiangmuzhan/ezijing-www-pc/pages/about/news.vue", "component": "/Users/lihui/Desktop/H/ezijing/guangwangAndXiangmuzhan/ezijing-www-pc/pages/about/news/index.vue",
"chunkName": "pages/about/news", "chunkName": "pages/about/news/index",
"_name": "_7f16db65" "_name": "_3de88228"
},
{
"name": "about-news-detail",
"path": "/about/news-detail",
"component": "/Users/lihui/Desktop/H/ezijing/guangwangAndXiangmuzhan/ezijing-www-pc/pages/about/news-detail.vue",
"chunkName": "pages/about/news-detail",
"_name": "_249d262e"
}, },
{ {
"name": "services-college", "name": "services-college",
...@@ -69,6 +62,13 @@ ...@@ -69,6 +62,13 @@
"chunkName": "pages/services/major", "chunkName": "pages/services/major",
"_name": "_77495298" "_name": "_77495298"
}, },
{
"name": "about-news-id",
"path": "/about/news/:id",
"component": "/Users/lihui/Desktop/H/ezijing/guangwangAndXiangmuzhan/ezijing-www-pc/pages/about/news/_id.vue",
"chunkName": "pages/about/news/_id",
"_name": "_aafe22e0"
},
{ {
"name": "index", "name": "index",
"path": "/", "path": "/",
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
"Head": { "Head": {
"description": "Auto imported from components/Head.vue" "description": "Auto imported from components/Head.vue"
}, },
"Link": {
"description": "Auto imported from components/Link.vue"
},
"RightAside": { "RightAside": {
"description": "Auto imported from components/RightAside.vue" "description": "Auto imported from components/RightAside.vue"
}, },
...@@ -14,15 +17,9 @@ ...@@ -14,15 +17,9 @@
"AboutCulture": { "AboutCulture": {
"description": "Auto imported from components/about/culture.vue" "description": "Auto imported from components/about/culture.vue"
}, },
"AboutDetail": {
"description": "Auto imported from components/about/detail.vue"
},
"AboutIntroduce": { "AboutIntroduce": {
"description": "Auto imported from components/about/introduce.vue" "description": "Auto imported from components/about/introduce.vue"
}, },
"AboutNews": {
"description": "Auto imported from components/about/news.vue"
},
"AboutTabNav": { "AboutTabNav": {
"description": "Auto imported from components/about/tabNav.vue" "description": "Auto imported from components/about/tabNav.vue"
}, },
......
<template>
<div>
<template v-if="item.news">
<a
:target="item.news.data.uri !== '' ? '_blank' : '_self'"
:href="item.news.data.uri !== '' ? item.news.data.uri : `${item.news.path}/${item.news.data.id}`">
<slot />
</a>
</template>
<template v-else>
<nuxt-link
:to="item.path">
<slot />
</nuxt-link>
</template>
</div>
</template>
<script>
export default {
props: { item: { type: Object } }
}
</script>
...@@ -10,9 +10,16 @@ ...@@ -10,9 +10,16 @@
<div class="swiper-content" @mouseenter="swiperStop" @mouseleave="swiperStart"> <div class="swiper-content" @mouseenter="swiperStop" @mouseleave="swiperStart">
<div v-swiper:mySwiper="swiperOption" ref="mySwiper"> <div v-swiper:mySwiper="swiperOption" ref="mySwiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item, index) in listData" :key="index" @click="goPage(item)"> <div class="swiper-slide" v-for="(item, index) in listData" :key="index">
<img :src="item.photo_uri"> <app-link :item="{
<div class="text">{{ item.title }}</div> news: {
data: item,
path: '/about/news'
}
}">
<img :src="item.web_img_uri">
<div class="text">{{ item.title }}</div>
</app-link>
</div> </div>
</div> </div>
</div> </div>
...@@ -20,13 +27,16 @@ ...@@ -20,13 +27,16 @@
</div> </div>
</template> </template>
<script> <script>
import appLink from '@/components/Link'
export default { export default {
components: {
appLink
},
data () { data () {
const _this = this const _this = this
return { return {
isScale: false, isScale: false,
listData: [], listData: [],
// 轮播图配置信息, 更多请参考 swiper.js 中文网,上面很详细。
swiperOption: { swiperOption: {
observer: true, observer: true,
observeParents: true, observeParents: true,
...@@ -47,13 +57,11 @@ export default { ...@@ -47,13 +57,11 @@ export default {
}, },
async fetch() { async fetch() {
const params = { const params = {
page: 1, project_id: process.env.projectId,
per_page: 100, type_tag: 'article_alumni'
type: 71,
project_id: 1013
} }
this.listData = await this.$axios.get('/api/zws/v1/cms/news', { params }).then(res => { this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
return res return res.data.data
}) })
}, },
computed: { computed: {
...@@ -61,13 +69,6 @@ export default { ...@@ -61,13 +69,6 @@ export default {
return this.$refs.mySwiper.swiper; return this.$refs.mySwiper.swiper;
} }
}, },
created() {
},
mounted() {
if (document.documentElement.clientWidth < 1400) {
// this.isScale = true
}
},
methods: { methods: {
swiperStop() { swiperStop() {
this.swiper.autoplay.stop() this.swiper.autoplay.stop()
......
...@@ -3,10 +3,16 @@ ...@@ -3,10 +3,16 @@
<div v-swiper:mySwiper="swiperOption" ref="mySwiper"> <div v-swiper:mySwiper="swiperOption" ref="mySwiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item, index) in listData" :key="index"> <div class="swiper-slide" v-for="(item, index) in listData" :key="index">
<img :src="item.photo_uri" @click="goPage(item)"> <template v-if="item.uri">
<a :href="item.uri" target="_blank">
<img :src="item.web_img_uri" @click="goPage(item)">
</a>
</template>
<template v-else>
<img :src="item.web_img_uri">
</template>
</div> </div>
</div> </div>
<!-- <div class="swiper-pagination swiper-pagination-bullets"></div> -->
</div> </div>
<div class="prev-button"></div> <div class="prev-button"></div>
<div class="next-button"></div> <div class="next-button"></div>
...@@ -18,7 +24,6 @@ ...@@ -18,7 +24,6 @@
data () { data () {
return { return {
listData: [], listData: [],
// 轮播图配置信息, 更多请参考 swiper.js 中文网,上面很详细。
swiperOption: { swiperOption: {
speed: 400, speed: 400,
autoplay: true, autoplay: true,
...@@ -33,26 +38,13 @@ ...@@ -33,26 +38,13 @@
} }
} }
}, },
// async fetch() {
// const params = {
// terminal_type: 'WWW',
// ad_position_uri: 'www.ezijing.com'
// }
// this.bannerData = await this.$axios.$get('/api/zws/v1/marketing/advertisements', { params }).then(res => {
// return res.filter((item, index) => {
// return index < 4
// })
// })
// },
async fetch() { async fetch() {
const params = { const params = {
page: 1, project_id: process.env.projectId,
per_page: 100, type_tag: 'ad_banner'
type: 69,
project_id: 1013
} }
this.listData = await this.$axios.get('/api/zws/v1/cms/news', { params }).then(res => { this.listData = await this.$axios.get('/api/cms/api/v1/advertisements', { params }).then(res => {
return res return res.data.data
}) })
}, },
computed: { computed: {
...@@ -63,9 +55,6 @@ ...@@ -63,9 +55,6 @@
mounted() { mounted() {
}, },
methods: { methods: {
// openPage(path) {
// path !== '' && window.open(path)
// }
swiperStop() { swiperStop() {
this.swiper.autoplay.stop() this.swiper.autoplay.stop()
}, },
...@@ -97,7 +86,6 @@ ...@@ -97,7 +86,6 @@
display: flex; display: flex;
.swiper-slide{ .swiper-slide{
width: 100%; width: 100%;
// float: left;
img{ img{
width: 100%; width: 100%;
display: block; display: block;
......
...@@ -5,15 +5,22 @@ ...@@ -5,15 +5,22 @@
<div class="line"></div> <div class="line"></div>
<div class="text">校长寄语</div> <div class="text">校长寄语</div>
</div> </div>
<div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 70 } })"> <div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 'img_text_school' } })">
查看更多+ 查看更多+
</div> </div>
</div> </div>
<div class="swiper-content" @mouseenter="swiperStop" @mouseleave="swiperStart"> <div class="swiper-content" @mouseenter="swiperStop" @mouseleave="swiperStart">
<div v-swiper:mySwiper="swiperOption" ref="mySwiper"> <div v-swiper:mySwiper="swiperOption" ref="mySwiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item, index) in listData" :key="index" @click="goPage(item)"> <div class="swiper-slide" v-for="(item, index) in listData" :key="index">
<img :src="item.photo_uri"> <app-link :item="{
news: {
data: item,
path: '/about/news'
}
}">
<img :src="item.web_img_uri">
</app-link>
</div> </div>
</div> </div>
<div class="swiper-pagination swiper-pagination-bullets"></div> <div class="swiper-pagination swiper-pagination-bullets"></div>
...@@ -22,7 +29,11 @@ ...@@ -22,7 +29,11 @@
</div> </div>
</template> </template>
<script> <script>
import appLink from '@/components/Link'
export default { export default {
components: {
appLink
},
data() { data() {
return { return {
listData: [], listData: [],
...@@ -43,14 +54,11 @@ export default { ...@@ -43,14 +54,11 @@ export default {
}, },
async fetch() { async fetch() {
const params = { const params = {
page: 1, project_id: process.env.projectId,
per_page: 100, type_tag: 'img_text_school'
type: 70,
project_id: 1013
} }
this.listData = await this.$axios.get('/api/zws/v1/cms/news', { params }).then(res => { this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
console.log(params) return res.data.data
return res
}) })
}, },
computed: { computed: {
...@@ -66,19 +74,6 @@ export default { ...@@ -66,19 +74,6 @@ export default {
}, },
swiperStart() { swiperStart() {
this.swiper.autoplay.start() this.swiper.autoplay.start()
},
goPage(item) {
console.log(1123)
if (item.source === '') {
this.$router.push({
path: '/about/news-detail',
query: {
id: item.id
}
})
} else {
window.open(item.source)
}
} }
} }
} }
......
...@@ -5,24 +5,38 @@ ...@@ -5,24 +5,38 @@
<div class="line"></div> <div class="line"></div>
<div class="text">公开课</div> <div class="text">公开课</div>
</div> </div>
<div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 72 } })"> <div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 'article_publish_class' } })">
查看更多+ 查看更多+
</div> </div>
</div> </div>
<div class="content-box"> <div class="content-box">
<img src="https://zws-imgs-pub.ezijing.com/static/public/c04caada9ed0f473c786e21eff83c4b9.png" alt="" class="banner"> <app-link :item="{
news: {
data: listData.first,
path: '/about/news'
}
}">
<img :src="listData.first.web_img_uri" alt="" class="banner">
</app-link>
<ul> <ul>
<li v-for="(item, index) in listData" :key="index" @click="goPage(item)"> <li v-for="(item, index) in listData.list" :key="index">
<div class="title">{{ item.title }}</div> <app-link :item="{
<div class="con-txt">{{ item.summary }}</div> news: {
<div class="info-box"> data: item,
<div class="time">{{ item.updated_time.slice(0, item.updated_time.indexOf(' ')) }}</div> path: '/about/news'
<div class="look-num"> }
<div class="icon"></div> }">
<div class="num">36023</div> <div class="title">{{ item.title }}</div>
<div class="con-txt">{{ item.abstract }}</div>
<div class="info-box">
<div class="time">{{ item.updated_at.slice(0, item.updated_at.indexOf(' ')) }}</div>
<div class="look-num">
<div class="icon"></div>
<div class="num">{{ item.remarks }}</div>
</div>
<div class="btn">免费学习</div>
</div> </div>
<div class="btn">免费学习</div> </app-link>
</div>
</li> </li>
<li> <li>
<img src="https://zws-imgs-pub.ezijing.com/static/public/5a92e49bf43a7c7a7fb75cd1415ffc2b.png" alt="" class="logo"> <img src="https://zws-imgs-pub.ezijing.com/static/public/5a92e49bf43a7c7a7fb75cd1415ffc2b.png" alt="" class="logo">
...@@ -35,38 +49,33 @@ ...@@ -35,38 +49,33 @@
</div> </div>
</template> </template>
<script> <script>
import appLink from '@/components/Link'
export default { export default {
components: {
appLink
},
data() { data() {
return { return {
listData: [] data: []
} }
}, },
async fetch() { async fetch() {
const params = { const params = {
page: 1, project_id: process.env.projectId,
per_page: 100, type_tag: 'article_publish_class'
type: 72,
project_id: 1013
} }
this.listData = await this.$axios.get('/api/zws/v1/cms/news', { params }).then(res => { await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
return res.filter((item, index) => { this.data = res.data.data || []
return index < 3
})
}) })
}, },
computed: {
// s
listData() {
const [first = {}, ...list] = this.data
return { first, list: list || [] }
}
},
methods: { methods: {
goPage(item) {
if (item.source === '') {
this.$router.push({
path: '/about/news-detail',
query: {
id: item.id
}
})
} else {
window.open(item.source)
}
},
showEnroll() { showEnroll() {
const dom = document.getElementById('show-enroll') const dom = document.getElementById('show-enroll')
const dom2 = document.getElementById('show-enroll-content') const dom2 = document.getElementById('show-enroll-content')
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<div class="line"></div> <div class="line"></div>
<div class="text">项目公告</div> <div class="text">项目公告</div>
</div> </div>
<div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 75 } })"> <div class="right-text" @click="$router.push({ path: '/about/news' })">
查看更多+ 查看更多+
</div> </div>
</div> </div>
...@@ -25,20 +25,33 @@ ...@@ -25,20 +25,33 @@
</div> </div>
<div class="right-content"> <div class="right-content">
<ul> <ul>
<li v-for="(item, index) in listData" :key="index" @click="goPage(item)"> <template v-for="(item, index) in listData">
<div class="time-block"> <app-link :key="index" :item="{
<div class="m-time">{{ item.dateMonth }}</div> news: {
<div class="t-time">{{ item.dateYear }}</div> data: item,
</div> path: '/about/news'
<div class="text">{{ item.title }}</div> }
</li> }">
<li>
<div class="time-block">
<div class="m-time">{{ item.dateMonth }}</div>
<div class="t-time">{{ item.dateYear }}</div>
</div>
<div class="text">{{ item.title }}</div>
</li>
</app-link>
</template>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import appLink from '@/components/Link'
export default { export default {
components: {
appLink
},
data() { data() {
return { return {
listData: [] listData: []
...@@ -46,38 +59,21 @@ export default { ...@@ -46,38 +59,21 @@ export default {
}, },
async fetch() { async fetch() {
const params = { const params = {
page: 1, project_id: process.env.projectId,
per_page: 100, type_tag: 'article_news'
type: 75,
project_id: 1013
} }
this.listData = await this.$axios.get('/api/zws/v1/cms/news', { params }).then(res => { this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
const data = [] const data = []
console.log(res) console.log(res)
res.map((item, index) => { res.data.data.map((item, index) => {
if (index < 3) { if (index < 3) {
item.dateYear = item.created_time.slice(0, 4) item.dateYear = item.created_at.slice(0, 4)
item.dateMonth = item.created_time.slice(5, 10).replace('-', '/') item.dateMonth = item.created_at.slice(5, 10).replace('-', '/')
data.push(item) data.push(item)
} }
}) })
return data return data
}) })
},
methods: {
goPage(item) {
if (item.source === '') {
this.$router.push({
path: '/about/news-detail',
query: {
id: item.id
}
})
} else {
window.open(item.source)
}
}
} }
} }
</script> </script>
......
...@@ -5,19 +5,25 @@ ...@@ -5,19 +5,25 @@
<div class="line"></div> <div class="line"></div>
<div class="text">教育服务案例</div> <div class="text">教育服务案例</div>
</div> </div>
<div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 73 } })"> <div class="right-text" @click="$router.push({ path: '/about/news', query: { type: 'service_case' } })">
查看更多+ 查看更多+
</div> </div>
</div> </div>
<div class="swiper-content" @mouseenter="swiperStop" @mouseleave="swiperStart"> <div class="swiper-content" @mouseenter="swiperStop" @mouseleave="swiperStart">
<div v-swiper:mySwiper="swiperOption" ref="mySwiper"> <div v-swiper:mySwiper="swiperOption" ref="mySwiper">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item, index) in listData" :key="index" @click="goPage(item)"> <div class="swiper-slide" v-for="(item, index) in listData" :key="index">
<img :src="item.photo_uri"> <app-link :item="{
<div class="pop-txt-box">{{ item.title }}</div> news: {
data: item,
path: '/about/news'
}
}">
<img :src="item.web_img_uri">
<div class="pop-txt-box">{{ item.title }}</div>
</app-link>
</div> </div>
</div> </div>
<!-- <div class="swiper-pagination swiper-pagination-bullets"></div> -->
</div> </div>
<div class="prev-button"></div> <div class="prev-button"></div>
<div class="next-button"></div> <div class="next-button"></div>
...@@ -25,7 +31,11 @@ ...@@ -25,7 +31,11 @@
</div> </div>
</template> </template>
<script> <script>
import appLink from '@/components/Link'
export default { export default {
components: {
appLink
},
data () { data () {
return { return {
listData: [], listData: [],
...@@ -46,13 +56,11 @@ export default { ...@@ -46,13 +56,11 @@ export default {
}, },
async fetch() { async fetch() {
const params = { const params = {
page: 1, project_id: process.env.projectId,
per_page: 100, type_tag: 'service_case'
type: 73,
project_id: 1013
} }
this.listData = await this.$axios.get('/api/zws/v1/cms/news', { params }).then(res => { this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
return res return res.data.data
}) })
}, },
computed: { computed: {
...@@ -65,19 +73,7 @@ export default { ...@@ -65,19 +73,7 @@ export default {
this.swiper.autoplay.stop() this.swiper.autoplay.stop()
}, },
swiperStart() { swiperStart() {
// this.swiper.autoplay.start() this.swiper.autoplay.start()
},
goPage(item) {
if (item.source === '') {
this.$router.push({
path: '/about/news-detail',
query: {
id: item.id
}
})
} else {
window.open(item.source)
}
} }
} }
} }
......
<template>
<div class="news-content">
<tab />
<detail-content />
</div>
</template>
<script>
import tab from '../../components/about/tabNav'
import detailContent from '../../components/about/detail'
export default {
components: {
tab,
detailContent
}
}
</script>
<style lang="scss" scoped>
.news-content{
width: 1200px;
margin: 0 auto;
padding-top: 63px;
display: flex;
justify-content: space-between;
}
</style>
<template>
<div class="news-content">
<tab />
<news-content />
</div>
</template>
<script>
import tab from '../../components/about/tabNav'
import newsContent from '../../components/about/news'
export default {
components: {
tab,
newsContent
}
}
</script>
<style lang="scss" scoped>
.news-content{
width: 1200px;
margin: 0 auto;
padding-top: 63px;
display: flex;
justify-content: space-between;
}
</style>
<template> <template>
<div class="detail-content-box"> <div class="news-content">
<div class="back-btn" @click="$router.go(-1)"> <tab />
<div class="el-icon-arrow-left"></div> <div class="detail-content-box">
<div class="text">返回</div> <div class="back-btn" @click="$router.go(-1)">
</div> <div class="el-icon-arrow-left"></div>
<div class="times">{{ data.created_at }}</div> <div class="text">返回</div>
<div class="titles">{{ data.title }}</div> </div>
<div class="article-content" v-html="data.content"></div> <div class="times">{{ data.created_at }}</div>
<div class="recommend-content"> <div class="titles">{{ data.title }}</div>
<div class="titles"> <div class="article-content" v-html="data.content"></div>
<div class="line"></div> <div class="recommend-content">
<div class="text">相关推荐</div> <div class="titles">
<div class="line"></div>
<div class="text">相关推荐</div>
</div>
<ul class="list-box">
<li v-for="(item, index) in listData" :key="index">
<a
:target="item.uri !== '' ? '_blank' : '_self'"
:href="item.uri ? item.uri : `/about/news/${item.id}`"
>
<img :src="item.web_img_uri" alt="">
<div class="dec">{{ item.title }}</div>
</a>
</li>
</ul>
</div> </div>
<ul class="list-box"> <div class="more-btn" @click="$router.push({ path: '/about/news' })">查看更多</div>
<li v-for="(item, index) in listData" :key="index" @click="goPage(item)">
<img :src="item.web_img_uri" alt="">
<div class="dec">{{ item.title }}</div>
</li>
</ul>
</div> </div>
<!-- 、、 -->
<div class="more-btn" @click="$router.push({ path: '/about/news' })">查看更多</div>
</div> </div>
</template> </template>
<script> <script>
import tab from '@/components/about/tabNav'
export default { export default {
components: {
tab
},
data () { data () {
return { return {
data: {}, data: {},
...@@ -32,7 +43,7 @@ export default { ...@@ -32,7 +43,7 @@ export default {
} }
}, },
async fetch() { async fetch() {
this.data = await this.$axios.get(`/api/cms/api/v1/article/${this.$route.query.id}/detail`).then(res => { this.data = await this.$axios.get(`/api/cms/api/v1/article/${this.$route.params.id}/detail`).then(res => {
return res.data return res.data
}) })
const params = { const params = {
...@@ -66,6 +77,13 @@ export default { ...@@ -66,6 +77,13 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.news-content{
width: 1200px;
margin: 0 auto;
padding-top: 63px;
display: flex;
justify-content: space-between;
}
.detail-content-box{ .detail-content-box{
width: 1000px; width: 1000px;
background: #fff; background: #fff;
......
<template> <template>
<div class="news-content-box"> <div class="news-content">
<img src="https://zws-imgs-pub.ezijing.com/static/public/a72ef577c9bae694c6bfc33e5bfc93af.png" alt="" class="banner"> <tab />
<ul class="list-content"> <div class="news-content-box">
<template v-for="(item, index) in listData"> <img src="https://zws-imgs-pub.ezijing.com/static/public/a72ef577c9bae694c6bfc33e5bfc93af.png" alt="" class="banner">
<li :key="index"> <ul class="list-content">
<a v-if="item.uri" :href="item.uri" target="_blank"> <template v-for="(item, index) in listData">
<img :src="item.web_img_uri" alt=""> <li :key="index">
<div class="right-con"> <app-link :item="{
<div class="time">{{ item.created_at }}</div> news: {
<div class="title">{{ item.title }}</div> data: item,
<div class="text">{{ item.abstract }}</div> path: '/about/news'
</div> }
</a> }">
<a v-else :href="`/about/news-detail?id=${item.id}`"> <img :src="item.web_img_uri" alt="">
<img :src="item.web_img_uri" alt=""> <div class="right-con">
<div class="right-con"> <div class="time">{{ item.created_at }}</div>
<div class="time">{{ item.created_at }}</div> <div class="title">{{ item.title }}</div>
<div class="title">{{ item.title }}</div> <div class="text">{{ item.abstract }}</div>
<div class="text">{{ item.abstract }}</div> </div>
</div> </app-link>
</a> </li>
</li> </template>
</template> </ul>
</ul> </div>
</div> </div>
</template> </template>
<script> <script>
import appLink from '@/components/Link'
import tab from '@/components/about/tabNav'
export default { export default {
components: {
tab,
appLink
},
data() { data() {
return { return {
listData: [] listData: []
} }
}, },
async fetch() { async fetch() {
// sss
const params = { const params = {
project_id: process.env.projectId, project_id: process.env.projectId,
type_tag: 'article_news' type_tag: this.$route.query.type || 'article_news'
} }
this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => { this.listData = await this.$axios.get('/api/cms/api/v1/articles', { params }).then(res => {
return res.data.data return res.data.data
...@@ -47,6 +52,13 @@ export default { ...@@ -47,6 +52,13 @@ export default {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.news-content{
width: 1200px;
margin: 0 auto;
padding-top: 63px;
display: flex;
justify-content: space-between;
}
.news-content-box{ .news-content-box{
width: 1000px; width: 1000px;
padding-bottom: 100px; padding-bottom: 100px;
...@@ -64,7 +76,7 @@ export default { ...@@ -64,7 +76,7 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
padding-bottom: 36px; padding-bottom: 36px;
cursor: pointer; cursor: pointer;
a{ ::v-deep a{
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
......
...@@ -3,19 +3,19 @@ ...@@ -3,19 +3,19 @@
<!-- 轮播图 --> <!-- 轮播图 -->
<banner /> <banner />
<!-- 学位教育 --> <!-- 学位教育 -->
<degree-education :class="isScale && 'scale space1'"/> <degree-education/>
<!-- 教育服务 --> <!-- 教育服务 -->
<education-services :class="isScale && 'scale space2'"/> <education-services/>
<!-- 项目公告 --> <!-- 项目公告 -->
<project-notice :class="isScale && 'scale space3'"/> <project-notice/>
<!-- 校长寄语 --> <!-- 校长寄语 -->
<headmaster-msg :class="isScale && 'scale space4'"/> <headmaster-msg/>
<!-- 校友故事 --> <!-- 校友故事 -->
<alumni-stories :class="isScale && 'space5'"/> <alumni-stories/>
<!-- 公开课 --> <!-- 公开课 -->
<open-class :class="isScale && 'scale space6'" /> <open-class/>
<!-- 教育服务案例 --> <!-- 教育服务案例 -->
<service-case :class="isScale && 'scale space7'"/> <service-case/>
</div> </div>
</template> </template>
...@@ -57,28 +57,4 @@ export default { ...@@ -57,28 +57,4 @@ export default {
.container{ .container{
padding-bottom: 100px; padding-bottom: 100px;
} }
.scale{
transform: scale(0.85);
}
.space1{
transform: translateY(-30px) scale(0.85);
}
.space2{
transform: translateY(-60px) scale(0.85);
}
.space3{
transform: translateY(-90px) scale(0.85);
}
.space4{
transform: translateY(-110px) scale(0.85);
}
.space5{
transform: translateY(-140px);
}
.space6{
transform: translateY(-170px) scale(0.85);
}
.space7{
transform: translateY(-230px) scale(0.85);
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论