From 82ece092768692dd5ea11e609c125edea1ecec45 Mon Sep 17 00:00:00 2001 From: "@fawn-nine" <1271023382@qq.com> Date: Fri, 7 Jun 2024 16:44:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=AA=E6=B9=96=E4=B9=8B=E5=85=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/news/news.vue | 28 ++++++++++++++++++++++++++-- pages/taihu/index.vue | 4 ++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/pages/news/news.vue b/pages/news/news.vue index 517eb46..b7c54df 100644 --- a/pages/news/news.vue +++ b/pages/news/news.vue @@ -32,6 +32,7 @@ content: '', title: '' }, + source:'', urlVisible:false, surl:'', type:null, @@ -49,6 +50,7 @@ this.newsId = e.newsId this.type = e.type this.surl = e.url + this.source = e.source console.log(e, '------') }, computed: { @@ -76,10 +78,31 @@ // musicPlay }, //方法 - methods: { + methods: { getData() { + var _url = "common/message/getMessageById" + if(this.source = 'taihuzhiguang'){ // 太湖之光 + _url = "common/taihuWelfare/getTaihuWelfareArticleDetail" + $http.request({ + url: `${_url}`, + method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 + data: { + id: this.newsId + }, + header: { //默认 无 说明:请求头 + 'Content-Type': 'application/json' + }, + }).then(res => { + if (res.code == 0) { + this.news.content = res.result.content + this.news.title = res.result.title + } + }).catch(e => { + console.log(e, '获取新闻详情报错') + }); + }else{ this.$http - .post('common/message/getMessageById?id=' + this.newsId) + .post(`${_url}?id=${this.newsId}`) .then(res => { if (res.code == 0) { this.news.content = res.result.content @@ -88,6 +111,7 @@ }).catch(e => { console.log(e, '获取新闻详情报错') }); + } }, formatRichText(html) { //控制图片大小 let newContent = html.replace(/]*>/gi, function (match, capture) { diff --git a/pages/taihu/index.vue b/pages/taihu/index.vue index 4afe1d7..d56dd0a 100644 --- a/pages/taihu/index.vue +++ b/pages/taihu/index.vue @@ -164,7 +164,7 @@ newsClick(item) { console.log(454545) uni.navigateTo({ - url: `/pages/news/news?newsId=${item.id}&url=${item.url}&type=${item.type}` + url: `/pages/news/news?newsId=${item.id}&url=${item.url}&type=${item.type}&source='taihuzhiguang'` }) }, getProData() { @@ -213,7 +213,7 @@ method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档 data: { "page": this.nObj.page, - "limit": 14 + "limit":20 }, header: { //默认 无 说明:请求头 'Content-Type': 'application/json'