Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1
Commits
9db9a3ee
Commit
9db9a3ee
authored
Apr 19, 2024
by
田爽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资讯中心闪动问题
parent
bda7f078
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
34 deletions
+72
-34
Center.vue
src/views/News/Center.vue
+12
-5
list.vue
src/views/News/comps/list.vue
+27
-2
msg.vue
src/views/News/msg.vue
+33
-27
No files found.
src/views/News/Center.vue
View file @
9db9a3ee
...
...
@@ -9,7 +9,7 @@
<img
:src=
"tmp.picFile"
alt=
""
/>
</div>
<div
class=
"picNews-li-bt"
>
<a
:href=
"tmp.href"
v-html=
"tmp.title"
target=
"_blank"
></a>
<a
:href=
"tmp.href"
@
click
.
prevent=
"InfoFn(tmp.articleId, tmp.href)"
v-html=
"tmp.title"
target=
"_blank"
></a>
</div>
</li>
<li
style=
" height: 0;margin:0"
v-for=
"(i,a) in 4"
:key=
"'a'+a"
></li>
...
...
@@ -115,6 +115,7 @@ export default {
}
];
this
.
setMatche
(
matche
);
// if(directpath&&directpath!==''&& directpath.length>0){
// this.clickDetailSave(id,directpath)
// }else{
...
...
@@ -137,7 +138,7 @@ export default {
// window.open(directpath,'_blank');
}
},
async
InfoFn
(
id
)
{
async
InfoFn
(
id
,
href
)
{
const
params
=
{
id
:
id
,
token
:
this
.
$route
.
query
.
token
||
''
...
...
@@ -145,15 +146,21 @@ export default {
const
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
localStorage
.
setItem
(
"msg"
+
id
,
JSON
.
stringify
(
data
));
localStorage
.
setItem
(
"msg"
+
id
,
JSON
.
stringify
(
listRes
));
localStorage
.
setItem
(
"isList"
+
id
,
1
);
// let link = this.$router.resolve({
// path: `/News/msg?id=${id}`,
// });
// window.open(link.href,'_blank')
if
(
data
.
directpath
&&
data
.
directpath
!==
""
&&
data
.
directpath
.
length
>
0
)
{
window
.
open
(
data
.
directpath
,
"_blank"
);
localStorage
.
removeItem
(
'msg'
+
this
.
id
)
localStorage
.
removeItem
(
'isList'
+
this
.
id
)
}
else
{
window
.
open
(
href
,
'_blank'
)
}
}
else
{
this
.
$message
.
error
(
returnMsg
)
window
.
open
(
href
,
'_blank'
)
}
},
},
...
...
src/views/News/comps/list.vue
View file @
9db9a3ee
...
...
@@ -3,7 +3,7 @@
<div
v-for=
"(tmp, i) in list"
:key=
"i"
class=
"row"
@
click=
"giveId(tmp.id,tmp.directpath)"
>
<div
class=
"col-lg-10 list-left"
>
<span></span>
<span><a
:href=
"tmp.href"
v-html=
"tmp.title"
target=
"_blank"
></a></span>
<span><a
:href=
"tmp.href"
@
click
.
prevent=
"InfoFn(tmp.id, tmp.href)"
v-html=
"tmp.title"
target=
"_blank"
></a></span>
</div>
<div
class=
"col-lg-2 list-right"
>
{{
tmp
.
showtime
}}
</div>
</div>
...
...
@@ -16,7 +16,32 @@ export default {
methods
:{
giveId
(
id
,
directpath
){
this
.
$emit
(
'getInfo'
,
id
,
directpath
)
}
},
async
InfoFn
(
id
,
href
)
{
const
params
=
{
id
:
id
,
token
:
this
.
$route
.
query
.
token
||
''
};
const
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
localStorage
.
setItem
(
"msg"
+
id
,
JSON
.
stringify
(
listRes
));
localStorage
.
setItem
(
"isList"
+
id
,
1
);
// let link = this.$router.resolve({
// path: `/News/msg?id=${id}`,
// });
// window.open(link.href,'_blank')
if
(
data
.
directpath
&&
data
.
directpath
!==
""
&&
data
.
directpath
.
length
>
0
)
{
window
.
open
(
data
.
directpath
,
"_blank"
);
localStorage
.
removeItem
(
'msg'
+
this
.
id
)
localStorage
.
removeItem
(
'isList'
+
this
.
id
)
}
else
{
window
.
open
(
href
,
'_blank'
)
}
}
else
{
window
.
open
(
href
,
'_blank'
)
}
},
}
}
</
script
>
...
...
src/views/News/msg.vue
View file @
9db9a3ee
...
...
@@ -218,26 +218,27 @@ export default {
Loading
.
service
({
customClass
:
'el-loading-custom-class'
});
},
created
()
{
if
(
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
&&
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
==
1
){
let
matche
=
[
{
name
:
"中心活动"
,
path
:
"/News/Center"
,
}
]
this
.
InfoFn
();
// if(JSON.parse(localStorage.getItem('isList'+this.id)) && JSON.parse(localStorage.getItem('isList'+this.id)) == 1){
// let matche=[
// {
// name: "中心活动",
// path: "/News/Center",
// }
// ]
this
.
setMatche
(
matche
);
let
data
=
localStorage
.
getItem
(
'msg'
+
this
.
id
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'msg'
+
this
.
id
))
:
null
this
.
content
=
data
.
content
;
this
.
title
=
data
.
title
;
this
.
showtime
=
data
.
showtime
;
this
.
author
=
data
.
author
;
this
.
source
=
data
.
source
;
this
.
editor
=
data
.
editor
;
this
.
xgljList
(
data
.
keyword
);
}
else
{
this
.
InfoFn
();
}
//
this.setMatche(matche);
//
let data = localStorage.getItem('msg'+this.id) ? JSON.parse(localStorage.getItem('msg'+this.id)) : null
//
this.content = data.content;
//
this.title = data.title;
//
this.showtime = data.showtime;
//
this.author = data.author;
//
this.source = data.source;
//
this.editor = data.editor;
//
this.xgljList(data.keyword);
//
}else{
//
this.InfoFn();
//
}
this
.
newsTop10
();
this
.
announceList
();
...
...
@@ -255,16 +256,21 @@ export default {
}),
async
InfoFn
()
{
this
.
loading
=
true
const
params
=
{
id
:
this
.
id
,
token
:
this
.
$route
.
query
.
token
||
''
};
const
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
let
listRes
=
{}
if
(
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
&&
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
==
1
){
listRes
=
localStorage
.
getItem
(
'msg'
+
this
.
id
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'msg'
+
this
.
id
))
:
null
}
else
{
const
params
=
{
id
:
this
.
id
,
token
:
this
.
$route
.
query
.
token
||
''
};
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
}
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
if
(
data
.
directpath
&&
data
.
directpath
!==
""
&&
data
.
directpath
.
length
>
0
)
{
window
.
open
(
data
.
directpath
,
"_self"
);
}
//
if (data.directpath && data.directpath !== "" && data.directpath.length > 0) {
//
window.open(data.directpath, "_self");
//
}
let
matche
=
this
.
matcheList
.
filter
((
item
)
=>
item
.
classid
===
data
.
classid
)[
0
];
if
(
typeof
(
matche
)
===
'undefined'
){
matche
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment