mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-01 07:20:20 +00:00
weather
This commit is contained in:
@@ -6,7 +6,7 @@ function Weather(props) {
|
||||
const {city, icon, dateTime, temperature, name} = props
|
||||
return <div className={styles.weather}>
|
||||
<div className={styles.left}>
|
||||
<div style={styles.icon} style={{
|
||||
<div className={styles.icon} style={{
|
||||
backgroundImage: `url(${icon})`
|
||||
}}></div>
|
||||
<p style={styles.name}>{name}</p>
|
||||
|
||||
@@ -1,20 +1,41 @@
|
||||
@import "../vars.less";
|
||||
.weather{
|
||||
|
||||
.weather {
|
||||
color: #fff;
|
||||
.left{
|
||||
.icon{
|
||||
height: 204px;
|
||||
padding: 24px;
|
||||
justify-content: space-between;
|
||||
display: flex;
|
||||
|
||||
}
|
||||
.name{
|
||||
.left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 50%;
|
||||
|
||||
.icon {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.name {}
|
||||
}
|
||||
.right{
|
||||
.temperature{
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 50%;
|
||||
.temperature {
|
||||
font-size: 36px;
|
||||
text-align: right;
|
||||
}
|
||||
.description{
|
||||
|
||||
.description {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>Ant Design Admin</title>
|
||||
<link rel="stylesheet" href="index.css" />
|
||||
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ let zuimei = {
|
||||
icon: 'http://www.zuimeitianqi.com/res/icon/' + zuimei.GetIconName(actual.wea, "big"),
|
||||
name: zuimei.GetWeatherName(actual.wea),
|
||||
temperature: actual.tmp,
|
||||
dateTime: new Date(actual.PTm).format('hh:mm')
|
||||
dateTime: new Date(actual.PTm).format('MM-dd hh:mm')
|
||||
}
|
||||
return weather
|
||||
},
|
||||
@@ -170,8 +170,8 @@ export default {
|
||||
city: '成都',
|
||||
temperature: '5',
|
||||
name: '晴',
|
||||
icon: 'http://www.zuimeitianqi.com/res/icon/res/icon/0_big.png',
|
||||
dateTime: new Date().format('hh:mm')
|
||||
icon: 'http://www.zuimeitianqi.com/res/icon/0_big.png',
|
||||
dateTime: new Date().format('MM-dd hh:mm')
|
||||
}
|
||||
},
|
||||
subscriptions : {
|
||||
|
||||
Reference in New Issue
Block a user