Browse Source

vs_test 0228bug修改

master
aBin 3 years ago
parent
commit
dfd502d0db
  1. 15
      src/components/Carousel/Carousel.vue
  2. 1
      src/components/HeadNav/HeadNav.vue
  3. 16
      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>
<a-carousel autoplay :dots="false">
<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>
</a-carousel>
<div class="slogan">
<div class="slogan" v-if="route === '/'">
<div class="slogan-content content-1180 d-flex flex-column">
<div style="text-align-last: justify">
高举中国特色社会主义伟大旗帜紧密团结在以习近平同志
@ -27,9 +27,13 @@ export default {
imgList: [],
str: '',
code: '0000',
route: '/',
};
},
watch: {
'$route.path'(val) {
this.route = val;
},
'$route.query.code'(val) {
console.log('val: ', val);
if (val) {
@ -42,6 +46,7 @@ export default {
},
created() {
this.code = this.$route.query.code || '0000';
this.route = this.$route.path;
this.getImg();
},
methods: {
@ -72,8 +77,10 @@ export default {
.ant-carousel >>> .slick-slide {
/* text-align: center; */
height: 380px;
line-height: 380px;
height: 300px;
width: 100%;
line-height: 300px;
width: 100%;
/* background: #364d79; */
overflow: hidden;
}

1
src/components/HeadNav/HeadNav.vue

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

16
src/components/ListPage/ListPage.vue

@ -6,8 +6,8 @@
v-for="item in yearList"
:key="item.year"
@click="changeYear(item.year)"
>{{ item.year }}</span
>
>{{ item.year }}
</span>
</div>
<template v-if="code !== '0204' && code !== '0207'">
<ul v-if="content.total - 0" style="max-width: 892px">
@ -34,8 +34,10 @@
<!-- <div> -->
<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" />
<div class="mt-2"><span class="mr-2">发表时间: </span> {{ $moment(item.publishTime).format('YYYY-MM-DD') }}</div>
<div><span class="mr-2">作者: </span> {{ item.author }}</div>
<div class="mt-2 one-text" style="width:210px">
<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>
@ -62,11 +64,7 @@ export default {
},
data() {
return {
yearList: [
{
year: 2022,
},
],
yearList: [{ year: 2022 }],
year: '2022',
};
},

18
src/components/RichText/RichText.vue

@ -3,15 +3,15 @@
<template v-if="richObj && richObj.title">
<div class="title">{{ richObj.title }}</div>
<div class="source-time d-flex justify-center">
<div class="mr-4">来源: {{ richObj.source }}</div>
<div class="mr-4">作者: {{ richObj.author }}</div>
<div>发表日期: {{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}</div>
<div v-if="richObj.source" class="mr-4">来源: {{ richObj.source }}</div>
<div v-if="richObj.author" class="mr-4">作者: {{ richObj.author }}</div>
<div v-if="richObj.publishTime">发表日期: {{ $moment(richObj.publishTime).format('YYYY-MM-DD') }}</div>
</div>
</template>
<div class="mt-4 content-size" v-if="richObj.content" v-dompurify-html="richObj.content"></div>
<a-empty v-else />
<template v-if="richObj && richObj.title">
<div class="mt-5" style="text-align: right">[责编: {{ richObj.editor }}]</div>
<div v-if="richObj.publishTime" class="mt-5" style="text-align: right">[责编: {{ richObj.editor }}]</div>
</template>
</div>
</template>
@ -30,8 +30,16 @@ export default {
</script>
<style scoped>
.content-size {
font-family: '宋体';
/* font-family: '宋体'; */
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 {
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 =>
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 =>
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']),
// showType
getType(code) {
if (code === '0201' || code === '0202' || code === '0203') {
this.showType = '0';
if (code === '0204' || code === '0209' || code === '0210') {
this.showType = '1';
} else if (code === '0207') {
this.showType = '2';
} else {
this.showType = '1';
this.showType = '0';
}
},
//

5
src/views/OtherPages/Search.vue

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

Loading…
Cancel
Save