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 @@
...
@@ -9,7 +9,7 @@
<img
:src=
"tmp.picFile"
alt=
""
/>
<img
:src=
"tmp.picFile"
alt=
""
/>
</div>
</div>
<div
class=
"picNews-li-bt"
>
<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>
</div>
</li>
</li>
<li
style=
" height: 0;margin:0"
v-for=
"(i,a) in 4"
:key=
"'a'+a"
></li>
<li
style=
" height: 0;margin:0"
v-for=
"(i,a) in 4"
:key=
"'a'+a"
></li>
...
@@ -115,6 +115,7 @@ export default {
...
@@ -115,6 +115,7 @@ export default {
}
}
];
];
this
.
setMatche
(
matche
);
this
.
setMatche
(
matche
);
// if(directpath&&directpath!==''&& directpath.length>0){
// if(directpath&&directpath!==''&& directpath.length>0){
// this.clickDetailSave(id,directpath)
// this.clickDetailSave(id,directpath)
// }else{
// }else{
...
@@ -137,7 +138,7 @@ export default {
...
@@ -137,7 +138,7 @@ export default {
// window.open(directpath,'_blank');
// window.open(directpath,'_blank');
}
}
},
},
async
InfoFn
(
id
)
{
async
InfoFn
(
id
,
href
)
{
const
params
=
{
const
params
=
{
id
:
id
,
id
:
id
,
token
:
this
.
$route
.
query
.
token
||
''
token
:
this
.
$route
.
query
.
token
||
''
...
@@ -145,15 +146,21 @@ export default {
...
@@ -145,15 +146,21 @@ export default {
const
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
const
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
localStorage
.
setItem
(
"msg"
+
id
,
JSON
.
stringify
(
data
));
localStorage
.
setItem
(
"msg"
+
id
,
JSON
.
stringify
(
listRes
));
localStorage
.
setItem
(
"isList"
+
id
,
1
);
localStorage
.
setItem
(
"isList"
+
id
,
1
);
// let link = this.$router.resolve({
// let link = this.$router.resolve({
// path: `/News/msg?id=${id}`,
// path: `/News/msg?id=${id}`,
// });
// });
// window.open(link.href,'_blank')
// 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
{
}
else
{
this
.
$message
.
error
(
returnMsg
)
window
.
open
(
href
,
'_blank'
)
}
}
},
},
},
},
...
...
src/views/News/comps/list.vue
View file @
9db9a3ee
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<div
v-for=
"(tmp, i) in list"
:key=
"i"
class=
"row"
@
click=
"giveId(tmp.id,tmp.directpath)"
>
<div
v-for=
"(tmp, i) in list"
:key=
"i"
class=
"row"
@
click=
"giveId(tmp.id,tmp.directpath)"
>
<div
class=
"col-lg-10 list-left"
>
<div
class=
"col-lg-10 list-left"
>
<span></span>
<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>
<div
class=
"col-lg-2 list-right"
>
{{
tmp
.
showtime
}}
</div>
<div
class=
"col-lg-2 list-right"
>
{{
tmp
.
showtime
}}
</div>
</div>
</div>
...
@@ -16,7 +16,32 @@ export default {
...
@@ -16,7 +16,32 @@ export default {
methods
:{
methods
:{
giveId
(
id
,
directpath
){
giveId
(
id
,
directpath
){
this
.
$emit
(
'getInfo'
,
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
>
</
script
>
...
...
src/views/News/msg.vue
View file @
9db9a3ee
...
@@ -218,26 +218,27 @@ export default {
...
@@ -218,26 +218,27 @@ export default {
Loading
.
service
({
customClass
:
'el-loading-custom-class'
});
Loading
.
service
({
customClass
:
'el-loading-custom-class'
});
},
},
created
()
{
created
()
{
if
(
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
&&
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
==
1
){
this
.
InfoFn
();
let
matche
=
[
// if(JSON.parse(localStorage.getItem('isList'+this.id)) && JSON.parse(localStorage.getItem('isList'+this.id)) == 1){
{
// let matche=[
name
:
"中心活动"
,
// {
path
:
"/News/Center"
,
// name: "中心活动",
}
// path: "/News/Center",
]
// }
// ]
this
.
setMatche
(
matche
);
//
this.setMatche(matche);
let
data
=
localStorage
.
getItem
(
'msg'
+
this
.
id
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'msg'
+
this
.
id
))
:
null
//
let data = localStorage.getItem('msg'+this.id) ? JSON.parse(localStorage.getItem('msg'+this.id)) : null
this
.
content
=
data
.
content
;
//
this.content = data.content;
this
.
title
=
data
.
title
;
//
this.title = data.title;
this
.
showtime
=
data
.
showtime
;
//
this.showtime = data.showtime;
this
.
author
=
data
.
author
;
//
this.author = data.author;
this
.
source
=
data
.
source
;
//
this.source = data.source;
this
.
editor
=
data
.
editor
;
//
this.editor = data.editor;
this
.
xgljList
(
data
.
keyword
);
//
this.xgljList(data.keyword);
}
else
{
//
}else{
this
.
InfoFn
();
//
this.InfoFn();
}
//
}
this
.
newsTop10
();
this
.
newsTop10
();
this
.
announceList
();
this
.
announceList
();
...
@@ -255,16 +256,21 @@ export default {
...
@@ -255,16 +256,21 @@ export default {
}),
}),
async
InfoFn
()
{
async
InfoFn
()
{
this
.
loading
=
true
this
.
loading
=
true
const
params
=
{
let
listRes
=
{}
id
:
this
.
id
,
if
(
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
&&
JSON
.
parse
(
localStorage
.
getItem
(
'isList'
+
this
.
id
))
==
1
){
token
:
this
.
$route
.
query
.
token
||
''
listRes
=
localStorage
.
getItem
(
'msg'
+
this
.
id
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'msg'
+
this
.
id
))
:
null
};
}
else
{
const
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
const
params
=
{
id
:
this
.
id
,
token
:
this
.
$route
.
query
.
token
||
''
};
listRes
=
await
this
.
$api
.
news
.
newsInfo
(
params
);
}
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
const
{
returnCode
,
data
,
returnMsg
}
=
listRes
;
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
if
(
returnCode
===
"0"
&&
data
!=
null
)
{
if
(
data
.
directpath
&&
data
.
directpath
!==
""
&&
data
.
directpath
.
length
>
0
)
{
//
if (data.directpath && data.directpath !== "" && data.directpath.length > 0) {
window
.
open
(
data
.
directpath
,
"_self"
);
//
window.open(data.directpath, "_self");
}
//
}
let
matche
=
this
.
matcheList
.
filter
((
item
)
=>
item
.
classid
===
data
.
classid
)[
0
];
let
matche
=
this
.
matcheList
.
filter
((
item
)
=>
item
.
classid
===
data
.
classid
)[
0
];
if
(
typeof
(
matche
)
===
'undefined'
){
if
(
typeof
(
matche
)
===
'undefined'
){
matche
=
[
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