bug修复

This commit is contained in:
Hokin 2024-07-27 18:12:55 +08:00
parent 2f8199108c
commit d4f7079908
2 changed files with 18 additions and 17 deletions

View File

@ -54,21 +54,21 @@ changeto(){
}, },
mounted(){ mounted(){
if(this.$route.query.type=='1'){ // if(this.$route.query.type=='1'){
msgdetail({id:this.$route.query.id}).then((res)=>{ msgdetail({id:this.$route.query.id,articleType:this.$route.query.type}).then((res)=>{
this.content=res.data.content this.content=res.data.content
this.name=res.data.name this.name=res.data.name
this.time=res.data.releaseTime this.time=res.data.releaseTime
}) })
}else{ // }else{
newsdetail({id:this.$route.query.id}).then((res)=>{ // newsdetail({id:this.$route.query.id}).then((res)=>{
this.content=res.data.content // this.content=res.data.content
this.name=res.data.name // this.name=res.data.name
this.time=res.data.releaseTime // this.time=res.data.releaseTime
}) // })
} // }
}, },
} }

View File

@ -115,6 +115,7 @@ export default{
methods:{ methods:{
handleClick(){ handleClick(){
this.page = 0;
console.log(1111) console.log(1111)
this.rest=[] this.rest=[]
let loadingInstance = Loading.service('loading'); let loadingInstance = Loading.service('loading');
@ -155,7 +156,7 @@ export default{
addnews(){ addnews(){
this.page=this.page+1 this.page=this.page+1
// if(this.activeName==''){ // if(this.activeName==''){
getmsg({'page':this.page}).then((res)=>{ getmsg({'page':this.page,'articleType':this.activeName}).then((res)=>{
// console.log(res) // console.log(res)
for(let i=0;i<res.data.content.length;i++){ for(let i=0;i<res.data.content.length;i++){
res.data.content[i].content= res.data.content[i].content?.replace(/<[^>]+>/g, '').trim(); res.data.content[i].content= res.data.content[i].content?.replace(/<[^>]+>/g, '').trim();
@ -182,15 +183,15 @@ export default{
}, },
changeto(id){ changeto(id){
if(this.activeName=='新闻资讯'){ // if(this.activeName==''){
this.$router.push({ this.$router.push({
path:'/detail?type=1&&id='+id path:'/detail?type='+this.activeName+'&&id='+id
}) })
}else if(this.activeName=='企业新闻'){ // }else if(this.activeName==''){
this.$router.push({ // this.$router.push({
path:'/detail?type=2&&id='+id // path:'/detail?type=2&&id='+id
}) // })
} // }
} }
} }