Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.portalStaticPage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
818c2409
authored
2020-11-21 10:35:42 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
style:样式
2 parents
8fe1f081
f8a538b7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
8 deletions
index.html
staticCss/global.css
staticJs/common.js
staticJs/staticIndex.js → staticJs/pageHome.js
index.html
View file @
818c240
...
...
@@ -548,6 +548,5 @@
</body>
<script
type=
"text/javascript"
src=
"./staticJs/down.js"
></script>
<script
type=
"text/javascript"
src=
"./staticJs/common.js"
></script>
<script
type=
"text/javascript"
src=
"./staticJs/staticIndex.js"
></script>
<script
type=
"text/javascript"
src=
"./staticJs/pageHome.js"
></script>
</html>
\ No newline at end of file
...
...
staticCss/global.css
View file @
818c240
...
...
@@ -12,6 +12,8 @@ div.banner, div.c_one, div.c_two, div.c_three, div.c_four, div.c_five, div.foote
text-align
:
center
;
}
div
.banner
{
height
:
500px
;
position
:
relative
;
...
...
@@ -361,7 +363,7 @@ div.c_one .news .news-img {
margin-top
:
20px
;
float
:
left
;
width
:
350px
;
height
:
23
6
px
;
height
:
23
7
px
;
}
div
.c_one
.news
.news-img
img
{
height
:
100%
;
...
...
@@ -385,7 +387,7 @@ div.c_one ul li:not(:last-child) {
border-bottom
:
1px
dashed
#DEDEDE
;
}
div
.c_one
ul
li
a
{
div
.c_one
#ulNews
li
a
{
width
:
100%
;
display
:
block
;
text-align
:
left
;
...
...
@@ -405,6 +407,7 @@ div.c_one .news_item .icon {
width
:
16%
;
margin-top
:
7.5px
;
margin-right
:
7px
;
margin-left
:
-3px
;
}
div
.c_one
ul
li
a
:hover
{
color
:
#0091FF
;
...
...
staticJs/common.js
View file @
818c240
//设置当前页面导航栏背景色
function
addTabs
(
id
){
$
(
'.layui-nav-item'
).
removeClass
(
'layui-this'
)
$
(
id
).
addClass
(
'layui-this'
)
}
//设置ajax调取服务接口
function
SetServicesPath
(){
return
"http://192.168.2.108"
}
//设置全局參數
var
portal
=
{
'api_url'
:
"http://192.168.2.108:81/api"
,
//属性名用引号括起来,属性间由逗号隔开
'name'
:
'myName'
};
function
CutDate
(
times
){
var
timearr
=
times
.
replace
(
" "
,
":"
).
replace
(
/
\:
/g
,
"-"
).
split
(
"-"
);
var
timestr
=
""
+
timearr
[
0
]
+
"/"
+
timearr
[
1
]
+
"/"
+
timearr
[
2
]
//var timestr = "" + timearr[1].split("")[1] + "月" + timearr[2] + "日\t" + timearr[3] + ":" + timearr[4] + ""
return
timestr
}
\ No newline at end of file
...
...
staticJs/
staticIndex
.js
→
staticJs/
pageHome
.js
View file @
818c240
...
...
@@ -2,7 +2,7 @@ layui.use('carousel', function () {
var
carousel
=
layui
.
carousel
;
//建造实例
carousel
.
render
({
elem
:
'#
banner_swiper
'
elem
:
'#
'
,
width
:
'100%'
//设置容器宽度
,
arrow
:
'always'
//始终显示箭头
,
autoplay
:
true
...
...
@@ -31,16 +31,31 @@ layui.use('util', function () {
//初始化方法
$
(
function
()
{
//
NewsData();
NewsData
();
addTabs
(
'#index'
)
});
//加载新闻首页数据
function
NewsData
()
{
var
ulNews
=
$
(
"#ulNews"
);
ulNews
.
empty
();
var
str
=
''
;
for
(
var
i
=
0
;
i
<
6
;
i
++
)
{
str
=
'<li><a href="#" title="创新技术体系 引领事业发展"><i>最新</i>创新技术体系 引领事业发展<span>2020-06-19</span></a></li>'
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/Mh/getNewsHotArticleList"
,
//路径
dataType
:
"json"
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
if
(
i
==
6
)
return
;
str
=
'<li><a href="#" title="'
+
result
.
data
[
i
].
headline
+
'">'
+
result
.
data
[
i
].
headline
+
'</a>'
;
str
+=
'<span>'
+
CutDate
(
result
.
data
[
i
].
publishTime
)
+
'</span></li>'
;
ulNews
.
append
(
str
);
}
}
}
});
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment