Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
12d23a93
authored
May 28, 2026
by
liangjianmin
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
feat(weather): 更新天气数据获取方式并添加天气图标
将天气数据获取的 API 更改为 wttr.in,并更新天气信息的显示方式。 添加天气图标以增强用户界面体验。
parent
836b7e0e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
js/vis/index.js
vis.html
js/vis/index.js
View file @
12d23a93
...
...
@@ -216,13 +216,15 @@
$
(
"#current_year_3"
).
text
(
year
);
$
(
"#current_year_4"
).
text
(
year
);
$
.
ajax
({
url
:
"http
://wthrcdn.etouch.cn/weather_mini?city=深圳
"
,
url
:
"http
s://wttr.in/深圳?format=j1
"
,
dataType
:
'json'
,
type
:
"get"
,
success
:
function
(
res
)
{
$
(
"#wendu"
).
text
(
res
.
data
.
wendu
+
"℃"
);
var
condition
=
res
.
current_condition
[
0
];
$
(
"#wendu"
).
text
(
condition
.
temp_C
+
"℃"
);
var
iconUrl
=
condition
.
weatherIconUrl
[
0
].
value
;
$
(
"#weatherIcon"
).
attr
(
"src"
,
iconUrl
).
css
(
"display"
,
"inline-block"
);
}
})
setInterval
(
function
()
{
var
myDate
=
new
Date
;
...
...
vis.html
View file @
12d23a93
...
...
@@ -32,6 +32,7 @@
<span>
北京时间
</span>
<span
class=
"color"
id=
"time"
>
00:00:00
</span>
<span
class=
"ml"
>
深圳
</span>
<img
id=
"weatherIcon"
src=
""
alt=
""
style=
"width:20px;height:20px;vertical-align:middle;margin-right:4px;display:none;"
/>
<span
class=
"color"
id=
"wendu"
></span>
</p>
<span
class=
"title"
></span>
...
...
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