Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Nei_Meng_An_Jian_4
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Kimber
Nei_Meng_An_Jian_4
Commits
c55c8d8f
Commit
c55c8d8f
authored
Apr 13, 2021
by
张浩然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'SwitchWeatherDataSource'
parent
1fed3570
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
4 deletions
+27
-4
BaseRight.vue
src/components/base/BaseRight.vue
+26
-4
Home.vue
src/views/Home.vue
+1
-0
No files found.
src/components/base/BaseRight.vue
View file @
c55c8d8f
...
...
@@ -12,11 +12,17 @@
<div
class=
"tian_qi"
>
<div
class=
"tian_qi_title"
>
实时气象数据
</div>
<div
class=
"tian_qi_body"
>
<span
style=
"font-size: 2vw"
>
<img
src=
"@/assets/images/tian_qi2.png"
alt=
""
/>
{{
tian_qi_data
.
tem
}}
°C
</span>
<
!--
<
span
style=
"font-size: 2vw"
>
<img
src=
"@/assets/images/tian_qi2.png"
alt=
""
/>
{{
tian_qi_data
.
tem
}}
°C
</span>
<span>
{{
tian_qi_data
.
tem1
}}
°C /
{{
tian_qi_data
.
tem2
}}
°C
</span>
<span>
空气
{{
tian_qi_data
.
air_level
}}
</span>
<span>
{{
tian_qi_data
.
wea
}}
</span>
<span>
{{
tian_qi_data
.
win
+
tian_qi_data
.
win_speed
}}
</span>
<span>
{{
tian_qi_data
.
win
+
tian_qi_data
.
win_speed
}}
</span>
-->
<div
style=
"font-size: 2vw"
>
<img
src=
"@/assets/images/tian_qi2.png"
alt=
""
/>
</div>
<span>
{{
tian_qi_data
.
air_level
}}
</span>
<span>
{{
tian_qi_data
.
temp
}}
</span>
<span>
{{
tian_qi_data
.
wea
}}
</span>
</div>
</div>
</div>
...
...
@@ -46,9 +52,25 @@ export default {
}).then(res => {
this.tian_qi_data = res.data
}) */
var
that
=
this
;
weather
({}).
then
(
function
(
res
){
console
.
log
(
'
weather ________________
'
,
res
);
if
(
res
.
replace
(
/
\s
+/g
,
''
)){
var
str
=
res
.
replace
(
/
(\r\n)
|
(\n)
/g
,
'
&
'
).
split
(
/&&|&/g
);
var
todayStr
=
str
[
1
];
if
(
todayStr
){
var
items
=
todayStr
.
split
(
/。/g
);
var
tempStr
=
items
[
1
];
var
temp
=
tempStr
&&
tempStr
.
match
(
"
:
"
)
?
tempStr
.
split
(
/:/g
)[
1
]
:
tempStr
;
var
item3Str
=
items
[
2
];
var
item3
=
item3Str
&&
item3Str
.
match
(
"
:
"
)
?
item3Str
.
split
(
/:/g
)[
1
]
:
item3Str
;
var
data
=
{
temp
:
temp
,
air_level
:
items
[
0
],
wea
:
item3
};
that
.
tian_qi_data
=
data
;
};
};
})
this
.
dept
()
...
...
src/views/Home.vue
View file @
c55c8d8f
...
...
@@ -318,6 +318,7 @@ export default {
bottom
:
0
;
right
:
0
;
width
:
12%
;
min-width
:
188px
;
background-color
:
#030c2a
;
}
...
...
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