From 9a3f41cf5f20c3f1d55d5baacb39ef6c19c2e3b9 Mon Sep 17 00:00:00 2001 From: dong_bo0602 <358256383@qq.com> Date: Sun, 7 Jun 2020 16:25:03 +0800 Subject: [PATCH] 0607 --- src/pages/ArtTrain/ArtTrain.vue | 83 ++++- src/pages/ArtTrain/components/Banner.vue | 2 +- src/pages/ArtTrain/components/Character.vue | 33 +- src/pages/ArtTrain/components/Health.vue | 27 +- src/pages/ArtTrain/components/Photography.vue | 27 +- src/pages/ArtTrain/components/Recommend.vue | 18 +- src/pages/ArtTrainList/ArtTrainList.vue | 306 ++++++++++++++++++ src/pages/Exhibition/Exhibition.vue | 136 +++++--- src/router/index.js | 10 + 9 files changed, 534 insertions(+), 108 deletions(-) create mode 100644 src/pages/ArtTrainList/ArtTrainList.vue diff --git a/src/pages/ArtTrain/ArtTrain.vue b/src/pages/ArtTrain/ArtTrain.vue index 3ac0e45..fa87421 100644 --- a/src/pages/ArtTrain/ArtTrain.vue +++ b/src/pages/ArtTrain/ArtTrain.vue @@ -39,28 +39,83 @@ export default { return { classList: [], recommend: [], - character: {}, - health: {}, - photography: {} + character: [], + health: [], + photography: [], + page: { + page: 1, + rows: 8, + totalPage: 1, + newsDirectoriesId: '', + newsDirectoriesParentId: 'd9d8c7ea-32e0-43ed-ad17-7c99a3c389b9' + } } }, methods: { - getArtData () { + getType: function () { var self = this - axios.get('/api/artTrain.json').then(function (res) { - res = res.data - const data = res.data - console.log(data) - self.classList = data.classList - self.recommend = data.recommend - self.character = data.character - self.health = data.health - self.photography = data.photography + axios.get('http://192.168.0.104:8082/news/app/newsdirectories/listnewsdirectoriesrelease', { + params: { + directoriesParentId: 'd9d8c7ea-32e0-43ed-ad17-7c99a3c389b9' + } + }).then(function (res) { + console.log(res) + self.classList = res.data + }) + }, + getCharacter: function () { + var self = this + axios.get('http://192.168.0.104:8082/news/app/newscontent/listpagenewscontentrelease', { + params: { + page: 1, + rows: 8, + newsDirectoriesId: 'af9229f6-6e32-4594-808d-74955362427d' + } + }).then(function (res) { + for (var i = 0; i < res.data.rows.length; i++) { + res.data.rows[i].newsContentCoverList = res.data.rows[i].newsContentCoverList[0].contentCoverId + } + self.recommend = res.data.rows + self.character = res.data.rows + }) + }, + getHealth: function () { + var self = this + axios.get('http://192.168.0.104:8082/news/app/newscontent/listpagenewscontentrelease', { + params: { + page: 1, + rows: 8, + newsDirectoriesId: 'ef97b165-ce82-47e4-8e3b-98ead4f6c1cc' + } + }).then(function (res) { + for (var i = 0; i < res.data.rows.length; i++) { + res.data.rows[i].newsContentCoverList = res.data.rows[i].newsContentCoverList[0].contentCoverId + } + self.health = res.data.rows + }) + }, + getPhotography: function () { + var self = this + axios.get('http://192.168.0.104:8082/news/app/newscontent/listpagenewscontentrelease', { + params: { + page: 1, + rows: 8, + newsDirectoriesId: '3b6f83b5-bcb4-4545-98d3-64e8cf596157' + } + }).then(function (res) { + for (var i = 0; i < res.data.rows.length; i++) { + res.data.rows[i].newsContentCoverList = res.data.rows[i].newsContentCoverList[0].contentCoverId + } + self.photography = res.data.rows + console.log(self.photography) }) } }, mounted () { - this.getArtData() + this.getType() + this.getCharacter() + this.getHealth() + this.getPhotography() } } diff --git a/src/pages/ArtTrain/components/Banner.vue b/src/pages/ArtTrain/components/Banner.vue index b80f713..a608257 100644 --- a/src/pages/ArtTrain/components/Banner.vue +++ b/src/pages/ArtTrain/components/Banner.vue @@ -2,7 +2,7 @@
diff --git a/src/pages/ArtTrain/components/Character.vue b/src/pages/ArtTrain/components/Character.vue index 4f4fd0f..a037198 100644 --- a/src/pages/ArtTrain/components/Character.vue +++ b/src/pages/ArtTrain/components/Character.vue @@ -1,35 +1,31 @@ @@ -24,6 +24,12 @@ export default { name: 'Recommend', props: { recommend: Array + }, + methods: { + goDetail: function (url) { + console.log(url) + window.location.href = 'http://192.168.0.104/' + url + } } } diff --git a/src/pages/ArtTrainList/ArtTrainList.vue b/src/pages/ArtTrainList/ArtTrainList.vue new file mode 100644 index 0000000..71d8cd2 --- /dev/null +++ b/src/pages/ArtTrainList/ArtTrainList.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/src/pages/Exhibition/Exhibition.vue b/src/pages/Exhibition/Exhibition.vue index 528e92b..917c969 100644 --- a/src/pages/Exhibition/Exhibition.vue +++ b/src/pages/Exhibition/Exhibition.vue @@ -6,46 +6,52 @@ 您的位置:首页 > 展览展示 -
-
-
- 展览分类> - - -
-
-
+ + + + + + + + +
-
- 首页 - 上一页 -
@@ -63,25 +69,53 @@ export default { }, data () { return { - selectedType: '00', - typeList: [], - exhibition: [] + changePage: 1, + exhibition: [], + page: { + page: 1, + rows: 8, + totalPage: 1, + newsDirectoriesId: 'f1d5d313-f728-4dda-9843-1116d97e17b0' + } + } + }, + computed: { + showJumpBtn () { + return this.page.totalPage > 1 + }, + hasData () { + return this.exhibition.length > 0 } }, methods: { - getExhibitionData () { + goDetail: function (url) { + window.location.href = 'http://192.168.0.104/' + url + }, + doJumpPage: function () { + this.page.page = this.changePage + this.getList() + }, + paging: function (page) { + this.page.page = page + this.getList() + }, + getList: function () { var self = this - axios.get('/api/exhibition.json').then(function (res) { - res = res.data - const data = res.data - console.log(data) - self.typeList = data.typeList - self.exhibition = data.exhibition + axios.get('http://192.168.0.104:8082/news/app/newscontent/listpagenewscontentrelease', { + params: self.page + }).then(function (res) { + console.log(res.data) + for (var i = 0; i < res.data.rows.length; i++) { + res.data.rows[i].newsContentCoverList = res.data.rows[i].newsContentCoverList[0].contentCoverId + } + self.exhibition = res.data.rows + self.page.page = res.data.page + self.page.totalPage = Math.ceil(res.data.total / self.page.rows) }) } }, - mounted () { - this.getExhibitionData() + mounted: function () { + this.getList() } } @@ -157,6 +191,13 @@ export default { overflow hidden text-overflow: ellipsis margin-bottom 5px + p + font-size 14px + color #565656 + text-align center + white-space nowrap + overflow hidden + text-overflow ellipsis .exhibition-info-bottom span font-size 14px @@ -165,7 +206,7 @@ export default { float right .pager width 1200px - margin 0 auto 20px + margin 20px auto text-align center font-size 0 span @@ -177,6 +218,7 @@ export default { font-size 14px margin 0 5px vertical-align middle + cursor pointer ul display inline-block overflow hidden @@ -191,6 +233,12 @@ export default { text-align center font-size 14px color #676767 + &.active + background #01a9f8 + color #fff + border 1px solid #01a9f8 + &:last-child + margin 0 input width 50px height 25px diff --git a/src/router/index.js b/src/router/index.js index 3f9b07e..a447493 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -26,6 +26,7 @@ import Register from '@/pages/Register/Register' import IntangibleHeritage from '@/pages/IntangibleHeritage/IntangibleHeritage' import IntangibleHeritageDetail from '@/pages/IntangibleHeritageDetail/IntangibleHeritageDetail' import SearchResult from '@/pages/SearchResult/SearchResult' +import ArtTrainList from '@/pages/ArtTrainList/ArtTrainList' Vue.use(Router) export default new Router({ @@ -263,6 +264,15 @@ export default new Router({ title: '搜索结果', keepAlive: false } + }, + { + path: '/artTrainList/:type', + name: 'ArtTrainList', + component: ArtTrainList, + meta: { + title: '艺术培训', + keepAlive: false + } } ] })