Browse Source

Merge branch 'master' of ssh://101.201.226.163:50022/binbin0314/datang-ui

master
song 3 years ago
parent
commit
49c9b915ba
  1. 15
      src/components/Carousel/Carousel.vue
  2. 1
      src/components/HeadNav/HeadNav.vue
  3. 18
      src/components/ListPage/ListPage.vue
  4. 18
      src/components/RichText/RichText.vue
  5. 6
      src/config/api.js
  6. 6
      src/views/NewPages/NewPages.vue
  7. 5
      src/views/OtherPages/Search.vue

15
src/components/Carousel/Carousel.vue

@ -2,10 +2,10 @@
<div> <div>
<a-carousel autoplay :dots="false"> <a-carousel autoplay :dots="false">
<div v-for="item in imgList" :key="item.id"> <div v-for="item in imgList" :key="item.id">
<img style="height: 380px;cursor: pointer" :src="item.url" @click="openImg(item.url)" /> <img style="height: 300px;width:100%;cursor: pointer" :src="item.url" @click="openImg(item.url)" />
</div> </div>
</a-carousel> </a-carousel>
<div class="slogan"> <div class="slogan" v-if="route === '/'">
<div class="slogan-content content-1180 d-flex flex-column"> <div class="slogan-content content-1180 d-flex flex-column">
<div style="text-align-last: justify"> <div style="text-align-last: justify">
高举中国特色社会主义伟大旗帜紧密团结在以习近平同志 高举中国特色社会主义伟大旗帜紧密团结在以习近平同志
@ -27,9 +27,13 @@ export default {
imgList: [], imgList: [],
str: '', str: '',
code: '0000', code: '0000',
route: '/',
}; };
}, },
watch: { watch: {
'$route.path'(val) {
this.route = val;
},
'$route.query.code'(val) { '$route.query.code'(val) {
console.log('val: ', val); console.log('val: ', val);
if (val) { if (val) {
@ -42,6 +46,7 @@ export default {
}, },
created() { created() {
this.code = this.$route.query.code || '0000'; this.code = this.$route.query.code || '0000';
this.route = this.$route.path;
this.getImg(); this.getImg();
}, },
methods: { methods: {
@ -72,8 +77,10 @@ export default {
.ant-carousel >>> .slick-slide { .ant-carousel >>> .slick-slide {
/* text-align: center; */ /* text-align: center; */
height: 380px; height: 300px;
line-height: 380px; width: 100%;
line-height: 300px;
width: 100%;
/* background: #364d79; */ /* background: #364d79; */
overflow: hidden; overflow: hidden;
} }

1
src/components/HeadNav/HeadNav.vue

@ -988,7 +988,6 @@ export default {
watch: { watch: {
'$route.path'(val) { '$route.path'(val) {
if (this.$route.query.text) { if (this.$route.query.text) {
console.log('this.$route.query.text: ', this.$route.query.text);
this.text = this.$route.query.text; this.text = this.$route.query.text;
} }
for (let i = 0; i < this.tabList.length; i++) { for (let i = 0; i < this.tabList.length; i++) {

18
src/components/ListPage/ListPage.vue

@ -6,14 +6,14 @@
v-for="item in yearList" v-for="item in yearList"
:key="item.year" :key="item.year"
@click="changeYear(item.year)" @click="changeYear(item.year)"
>{{ item.year }}</span >{{ item.year }}
> </span>
</div> </div>
<template v-if="code !== '0204' && code !== '0207'"> <template v-if="code !== '0204' && code !== '0207'">
<ul v-if="content.total - 0" style="max-width: 892px"> <ul v-if="content.total - 0" style="max-width: 892px">
<li v-for="item in content.list" :key="item.introId" class="mb-5" @click="openPage(item.introId)"> <li v-for="item in content.list" :key="item.introId" class="mb-5" @click="openPage(item.introId)">
<div class="d-flex justify-space-between align-center"> <div class="d-flex justify-space-between align-center">
<div style="max-width: 680px" class="one-text">{{ item.title }}</div> <div style="cursor: pointer;max-width: 680px" class="one-text">{{ item.title }}</div>
<div style="width: 110px">[{{ $moment(item.publishTime).format('YYYY - MM - DD') }}]</div> <div style="width: 110px">[{{ $moment(item.publishTime).format('YYYY - MM - DD') }}]</div>
</div> </div>
</li> </li>
@ -34,8 +34,10 @@
<!-- <div> --> <!-- <div> -->
<img v-if="code === '0204'" :src="item.titleUrl" style="width:210px;height:140px" /> <img v-if="code === '0204'" :src="item.titleUrl" style="width:210px;height:140px" />
<video v-if="code === '0207'" :src="item.titleUrl" style="width:210px;height:140px" /> <video v-if="code === '0207'" :src="item.titleUrl" style="width:210px;height:140px" />
<div class="mt-2"><span class="mr-2">发表时间: </span> {{ $moment(item.publishTime).format('YYYY-MM-DD') }}</div> <div class="mt-2 one-text" style="width:210px">
<div><span class="mr-2">作者: </span> {{ item.author }}</div> <span class="mr-2 one-text">标题: {{ item.title }}</span>
</div>
<div><span class="mr-2">发表时间: </span> {{ $moment(item.publishTime).format('YYYY-MM-DD') }}</div>
<!-- </div> --> <!-- </div> -->
</div> </div>
</div> </div>
@ -62,11 +64,7 @@ export default {
}, },
data() { data() {
return { return {
yearList: [ yearList: [{ year: 2022 }],
{
year: 2022,
},
],
year: '2022', year: '2022',
}; };
}, },

18
src/components/RichText/RichText.vue

@ -3,15 +3,15 @@
<template v-if="richObj && richObj.title"> <template v-if="richObj && richObj.title">
<div class="title">{{ richObj.title }}</div> <div class="title">{{ richObj.title }}</div>
<div class="source-time d-flex justify-center"> <div class="source-time d-flex justify-center">
<div class="mr-4">来源: {{ richObj.source }}</div> <div v-if="richObj.source" class="mr-4">来源: {{ richObj.source }}</div>
<div class="mr-4">作者: {{ richObj.author }}</div> <div v-if="richObj.author" class="mr-4">作者: {{ richObj.author }}</div>
<div>发表日期: {{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}</div> <div v-if="richObj.publishTime">发表日期: {{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}</div>
</div> </div>
</template> </template>
<div class="mt-4 content-size" v-if="richObj.content" v-dompurify-html="richObj.content"></div> <div class="mt-4 content-size" v-if="richObj.content" v-dompurify-html="richObj.content"></div>
<a-empty v-else /> <a-empty v-else />
<template v-if="richObj && richObj.title"> <template v-if="richObj && richObj.title">
<div class="mt-5" style="text-align: right">[责编: {{ richObj.editor }}]</div> <div v-if="richObj.editor" class="mt-5" style="text-align: right">[责编: {{ richObj.editor }}]</div>
</template> </template>
</div> </div>
</template> </template>
@ -30,8 +30,16 @@ export default {
</script> </script>
<style scoped> <style scoped>
.content-size { .content-size {
font-family: '宋体'; /* font-family: '宋体'; */
font-size: 16px; font-size: 16px;
color: #555 !important;
}
.content-size >>> img {
width: 700px;
margin-left: calc(50% - 350px);
margin-top: 20px;
margin-bottom: 20px;
/* text-align: center; */
} }
.title { .title {
font-size: 22px; font-size: 22px;

6
src/config/api.js

@ -15,13 +15,15 @@ export const carouselQuery = params => axios.post(`${carousel}/query`, params);
// 官网首页列表查询 // 官网首页列表查询
export const getContent = params => export const getContent = params =>
axios.get( axios.get(
`${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`, `${content}/list?showPage=${params.showPage}&year=${params.year}&showType=${params.showType}
&pageNum=${params.pageNum}&pageSize=${params.pageSize}&title=${params.title || ''}`,
); );
// 查询图片新闻列表 // 查询图片新闻列表
export const getContentImg = params => export const getContentImg = params =>
axios.get( axios.get(
`${content}/list?showPage=0201&showPage=0202&showPage=0203&year=${params.year}&showType=${params.showType}&pageNum=${params.pageNum}&pageSize=${params.pageSize}`, `${content}/list?showPage=0201&showPage=0202&showPage=0203&year=${params.year}&showType=${params.showType}
&pageNum=${params.pageNum}&pageSize=${params.pageSize}`,
); );
// 官网内容详情查询 // 官网内容详情查询

6
src/views/NewPages/NewPages.vue

@ -112,12 +112,12 @@ export default {
...mapActions('home', ['getContent', 'getDetail', 'getContentImg']), ...mapActions('home', ['getContent', 'getDetail', 'getContentImg']),
// showType // showType
getType(code) { getType(code) {
if (code === '0201' || code === '0202' || code === '0203') { if (code === '0204' || code === '0209' || code === '0210') {
this.showType = '0'; this.showType = '1';
} else if (code === '0207') { } else if (code === '0207') {
this.showType = '2'; this.showType = '2';
} else { } else {
this.showType = '1'; this.showType = '0';
} }
}, },
// //

5
src/views/OtherPages/Search.vue

@ -88,7 +88,7 @@ export default {
introContent: {}, introContent: {},
}; };
}, },
created() { mounted() {
this.title = this.$route.query.text; this.title = this.$route.query.text;
if (this.$route.query.introId) { if (this.$route.query.introId) {
this.introId = this.$route.query.introId; this.introId = this.$route.query.introId;
@ -106,9 +106,8 @@ export default {
showType: '', showType: '',
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
title: this.title, title: this.title || '',
}; };
console.log('param: ', param);
const res = await this.getContent(param); const res = await this.getContent(param);
this.content = res; this.content = res;
} catch (error) {} } catch (error) {}

Loading…
Cancel
Save