太湖之光

This commit is contained in:
@fawn-nine
2024-06-07 16:44:24 +08:00
parent 9befb5c111
commit 82ece09276
2 changed files with 28 additions and 4 deletions

View File

@@ -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(/<img[^>]*>/gi, function (match, capture) {