太湖之光

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: '', content: '',
title: '' title: ''
}, },
source:'',
urlVisible:false, urlVisible:false,
surl:'', surl:'',
type:null, type:null,
@@ -49,6 +50,7 @@
this.newsId = e.newsId this.newsId = e.newsId
this.type = e.type this.type = e.type
this.surl = e.url this.surl = e.url
this.source = e.source
console.log(e, '------') console.log(e, '------')
}, },
computed: { computed: {
@@ -76,10 +78,31 @@
// musicPlay // musicPlay
}, },
//方法 //方法
methods: { methods: {
getData() { 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 this.$http
.post('common/message/getMessageById?id=' + this.newsId) .post(`${_url}?id=${this.newsId}`)
.then(res => { .then(res => {
if (res.code == 0) { if (res.code == 0) {
this.news.content = res.result.content this.news.content = res.result.content
@@ -88,6 +111,7 @@
}).catch(e => { }).catch(e => {
console.log(e, '获取新闻详情报错') console.log(e, '获取新闻详情报错')
}); });
}
}, },
formatRichText(html) { //控制图片大小 formatRichText(html) { //控制图片大小
let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) { let newContent = html.replace(/<img[^>]*>/gi, function (match, capture) {

View File

@@ -164,7 +164,7 @@
newsClick(item) { newsClick(item) {
console.log(454545) console.log(454545)
uni.navigateTo({ 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() { getProData() {
@@ -213,7 +213,7 @@
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档 method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: { data: {
"page": this.nObj.page, "page": this.nObj.page,
"limit": 14 "limit":20
}, },
header: { //默认 无 说明:请求头 header: { //默认 无 说明:请求头
'Content-Type': 'application/json' 'Content-Type': 'application/json'