From 3085c124e4481690173f20675a040cb99fa6a645 Mon Sep 17 00:00:00 2001 From: TS-QD1 Date: Thu, 27 Jul 2023 16:53:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=86=85=E5=AE=B9=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/components/Header.vue | 36 ++-- src/common/components/common.js | 2 +- src/component/GzhQr.vue | 43 +++++ src/pages/Index/components/NewsView1.vue | 3 + src/pages/NewsView/NewsViewUtil.js | 164 ++++++++++++++---- .../NewsViewDetail/NewsViewDetailAudio.vue | 67 ++++--- .../NewsViewDetail/NewsViewDetailImage.vue | 25 ++- .../NewsViewDetail/NewsViewDetailPdf.vue | 27 ++- .../NewsViewDetail/NewsViewDetailText.vue | 28 ++- .../NewsViewDetail/NewsViewDetailVideo.vue | 27 ++- 10 files changed, 311 insertions(+), 111 deletions(-) create mode 100644 src/component/GzhQr.vue diff --git a/src/common/components/Header.vue b/src/common/components/Header.vue index bcceb30..c666c8c 100644 --- a/src/common/components/Header.vue +++ b/src/common/components/Header.vue @@ -2,7 +2,7 @@
- 欢迎访问{{area.areaName}}公共文化云! + 欢迎访问{{ area.areaName }}公共文化云! @@ -28,6 +29,8 @@ import Footer from '@/common/components/Footer' import common from '@/common/components/common.js' import Loading from '../../component/Loading' import Nav from '../../component/Nav' +import GzhQr from '../../component/GzhQr' +import {conetntAuth} from '../NewsView/NewsViewUtil' import axios from 'axios' export default { @@ -36,7 +39,8 @@ export default { Header, Footer, Loading, - Nav + Nav, + GzhQr }, data () { let vueSelf = this; @@ -54,7 +58,10 @@ export default { author: '', summary: '', coverImage: '', - fileList: [] + fileList: [], + userData: null, + qrCodeImage: '', + isQrCodeShow: false } }, methods: { @@ -66,13 +73,15 @@ export default { vueSelf.isLoading = true axios.get(`${common.url}app/newscontent/getnewscontentbyidrelease/${this.$route.params.newsContentId}`).then(resp => { let data = resp.data - vueSelf.title = data.newsContentTitle - vueSelf.author = data.newsContentAuthor - vueSelf.summary = data.newsContentSummary - if(data.newsContentCoverList.length > 0) { - vueSelf.coverImage = `${common.url}route/file/download/true/${data.newsContentCoverList[0].contentCoverId}` - } - vueSelf.fileList = data.fileList + conetntAuth(vueSelf, data, function () { + vueSelf.title = data.newsContentTitle + vueSelf.author = data.newsContentAuthor + vueSelf.summary = data.newsContentSummary + if(data.newsContentCoverList.length > 0) { + vueSelf.coverImage = `${common.url}route/file/download/true/${data.newsContentCoverList[0].contentCoverId}` + } + vueSelf.fileList = data.fileList + }); }).catch(resp => { console.error(resp) }).finally(() => { diff --git a/src/pages/NewsViewDetail/NewsViewDetailText.vue b/src/pages/NewsViewDetail/NewsViewDetailText.vue index 7b7d1db..b8ea1df 100644 --- a/src/pages/NewsViewDetail/NewsViewDetailText.vue +++ b/src/pages/NewsViewDetail/NewsViewDetailText.vue @@ -1,7 +1,7 @@ @@ -27,19 +28,23 @@ import Footer from '@/common/components/Footer' import common from '@/common/components/common.js' import Loading from '../../component/Loading' import Nav from '../../component/Nav' +import GzhQr from '../../component/GzhQr' +import { conetntAuth } from '../NewsView/NewsViewUtil' import axios from 'axios' + export default { name: 'NewsViewDetailText', components: { Header, Footer, Loading, - Nav + Nav, + GzhQr }, data() { - let navs = [{name: '详情'}]; - if(this.$route.query.navTitle && this.$route.query.navTitle) { + let navs = [{ name: '详情' }]; + if (this.$route.query.navTitle && this.$route.query.navTitle) { navs.splice(0, 0, { to: this.$route.query.navPath, name: this.$route.query.navTitle @@ -52,6 +57,9 @@ export default { author: '', publishDate: '', content: '', + userData: null, + qrCodeImage: '', + isQrCodeShow: false } }, methods: { @@ -60,10 +68,12 @@ export default { vueSelf.isLoading = true; axios.get(`${common.url}app/newscontent/getnewscontentbyidrelease/${this.$route.params.newsContentId}`).then(resp => { let data = resp.data; - vueSelf.title = data.newsContentTitle; - vueSelf.author = data.newsContentAuthor; - vueSelf.publishDate = data.newsContentPublishTime; - vueSelf.content = data.newsContentContent; + conetntAuth(vueSelf, data, function () { + vueSelf.title = data.newsContentTitle; + vueSelf.author = data.newsContentAuthor; + vueSelf.publishDate = data.newsContentPublishTime; + vueSelf.content = data.newsContentContent; + }); }).catch(resp => { console.error(resp) }).finally(() => { diff --git a/src/pages/NewsViewDetail/NewsViewDetailVideo.vue b/src/pages/NewsViewDetail/NewsViewDetailVideo.vue index 7acf368..8ae3ab8 100644 --- a/src/pages/NewsViewDetail/NewsViewDetailVideo.vue +++ b/src/pages/NewsViewDetail/NewsViewDetailVideo.vue @@ -18,6 +18,7 @@
@@ -27,6 +28,8 @@ import Footer from '@/common/components/Footer' import common from '@/common/components/common.js' import Loading from '../../component/Loading' import Nav from '../../component/Nav' +import GzhQr from '../../component/GzhQr' +import {conetntAuth} from '../NewsView/NewsViewUtil' import axios from 'axios' export default { @@ -35,7 +38,8 @@ export default { Header, Footer, Loading, - Nav + Nav, + GzhQr }, data () { let navs = [{name: '详情'}]; @@ -51,7 +55,10 @@ export default { title: '', playFileId: '', coverFileId: '', - fileList: [] + fileList: [], + userData: null, + qrCodeImage: '', + isQrCodeShow: false } }, methods: { @@ -63,13 +70,15 @@ export default { vueSelf.isLoading = true axios.get(`${common.url}app/newscontent/getnewscontentbyidrelease/${this.$route.params.newsContentId}`).then(resp => { let data = resp.data - vueSelf.title = data.newsContentTitle - vueSelf.playFileId = data.fileList[0].contentFileFileId - if (data.newsContentCoverList.length > 0 && - data.newsContentCoverList[0].contentCoverId) { - vueSelf.coverFileId = data.newsContentCoverList[0].contentCoverId - } - vueSelf.fileList = data.fileList + conetntAuth(vueSelf, data, function () { + vueSelf.title = data.newsContentTitle + vueSelf.playFileId = data.fileList[0].contentFileFileId + if (data.newsContentCoverList.length > 0 && + data.newsContentCoverList[0].contentCoverId) { + vueSelf.coverFileId = data.newsContentCoverList[0].contentCoverId + } + vueSelf.fileList = data.fileList + }) }).catch(resp => { console.error(resp) }).finally(() => {