Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yma16
myblogVue_django
提交
14e35fcd
M
myblogVue_django
项目概览
yma16
/
myblogVue_django
通知
5
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
myblogVue_django
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
14e35fcd
编写于
9月 14, 2022
作者:
yma16
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf:滚动条出现的逻辑修复和天气标题由后端控制
上级
351da7ac
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
47 addition
and
31 deletion
+47
-31
src/App.vue
src/App.vue
+11
-6
src/components/Article.vue
src/components/Article.vue
+31
-15
src/weather/EchartWeather.vue
src/weather/EchartWeather.vue
+5
-10
未找到文件。
src/App.vue
浏览文件 @
14e35fcd
...
@@ -108,9 +108,8 @@
...
@@ -108,9 +108,8 @@
<div
class=
"footer_font"
>
<div
class=
"footer_font"
>
<div
style=
"float: left"
></div>
<div
style=
"float: left"
></div>
<span>
<span>
Copyright
©
2021-2022 yongma16.xyz
Copyright
©
{{startTime}} yongma16.xyz
个人空间
</span
个人空间
</span>
>
<span>
足迹:{{ readCount }}
</span>
<span>
足迹:{{ readCount }}
</span>
<span
<span
><img
><img
...
@@ -122,9 +121,7 @@
...
@@ -122,9 +121,7 @@
padding-bottom: 0;
padding-bottom: 0;
"
"
/>
<span
style=
"cursor: pointer"
@
click=
"jumpIpDns"
/>
<span
style=
"cursor: pointer"
@
click=
"jumpIpDns"
>
黔ICP备20001426号-1
</span
>
黔ICP备20001426号-1
</span></span>
></span
>
</div>
</div>
<!-- <div></div>-->
<!-- <div></div>-->
</div>
</div>
...
@@ -140,6 +137,8 @@ export default {
...
@@ -140,6 +137,8 @@ export default {
name
:
'
App
'
,
name
:
'
App
'
,
data
()
{
data
()
{
return
{
return
{
// 开始时间
startTime
:
''
,
authSlogan
:
'
yma16
'
,
authSlogan
:
'
yma16
'
,
chat_flag
:
false
,
chat_flag
:
false
,
msg
:
'
yma16
'
,
msg
:
'
yma16
'
,
...
@@ -164,10 +163,16 @@ export default {
...
@@ -164,10 +163,16 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
this
.
initStartTime
()
this
.
addReadCountFun
()
this
.
addReadCountFun
()
this
.
readCountFun
()
this
.
readCountFun
()
},
},
methods
:
{
methods
:
{
initStartTime
()
{
const
now
=
new
Date
()
const
year
=
now
.
getFullYear
()
this
.
startTime
=
`2021-
${
year
}
`
},
jumpIpDns
:
function
()
{
jumpIpDns
:
function
()
{
try
{
try
{
window
.
open
(
'
https://beian.miit.gov.cn
'
)
window
.
open
(
'
https://beian.miit.gov.cn
'
)
...
...
src/components/Article.vue
浏览文件 @
14e35fcd
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<ul
v-for=
"(item, index) in md_title"
:key=
"item"
class=
"ul_style"
>
<ul
v-for=
"(item, index) in md_title"
:key=
"item"
class=
"ul_style"
>
<div
<div
v-bind:class=
"[
v-bind:class=
"[
{ li_active: index == article_loc },
{ li_active: index ==
=
article_loc },
li_errorClass,
li_errorClass,
]"
]"
>
>
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
:current-page=
"currentPage"
:current-page=
"currentPage"
:page-sizes=
"pageArray"
:page-sizes=
"pageArray"
background
background
:page
r-count=
"3
"
:page
-count=
"pageCount
"
:page-size=
"pageSize"
:page-size=
"pageSize"
@
size-change=
"handleSizeChange"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
@
current-change=
"handleCurrentChange"
...
@@ -105,7 +105,7 @@
...
@@ -105,7 +105,7 @@
</div>
</div>
<!-- 中间 markdown-->
<!-- 中间 markdown-->
<div
class=
"midclass"
ref=
"mark-down-ref"
>
<div
class=
"midclass"
ref=
"mark-down-ref"
>
<a
name=
"home"
id=
"home
title
"
style=
"transition: 1s"
></a>
<a
name=
"home"
id=
"home
TitleId
"
style=
"transition: 1s"
></a>
<el-card
shadow=
"hover"
style=
"line-height: 10px"
>
<el-card
shadow=
"hover"
style=
"line-height: 10px"
>
<div
class=
"block"
style=
"line-height: 20px"
>
<div
class=
"block"
style=
"line-height: 20px"
>
<h1>
{{
the_title
}}
</h1>
<h1>
{{
the_title
}}
</h1>
...
@@ -229,6 +229,7 @@ export default {
...
@@ -229,6 +229,7 @@ export default {
name
:
'
Article
'
,
name
:
'
Article
'
,
data
()
{
data
()
{
return
{
return
{
pageCount
:
3
,
msgDrawTitle
:
'
~邮件沟通~
'
,
msgDrawTitle
:
'
~邮件沟通~
'
,
direction
:
'
rtl
'
,
direction
:
'
rtl
'
,
drawObj
:
{
drawObj
:
{
...
@@ -261,7 +262,7 @@ export default {
...
@@ -261,7 +262,7 @@ export default {
toTopIsShow
:
false
,
toTopIsShow
:
false
,
article_loc
:
0
,
article_loc
:
0
,
challenge_loc
:
-
1
,
challenge_loc
:
-
1
,
top
s
how
:
false
,
top
S
how
:
false
,
userImg
:
''
,
userImg
:
''
,
username
:
'
匿名
'
,
username
:
'
匿名
'
,
articleCommit
:
'
评论区
'
,
articleCommit
:
'
评论区
'
,
...
@@ -280,7 +281,7 @@ export default {
...
@@ -280,7 +281,7 @@ export default {
}
}
},
},
watch
:
{
watch
:
{
top
s
how
:
function
(
newvalue
,
oldvalue
)
{
top
S
how
:
function
(
newvalue
,
oldvalue
)
{
if
(
newvalue
===
true
)
{
if
(
newvalue
===
true
)
{
document
.
getElementById
(
'
topiconid
'
).
style
.
display
=
'
none
'
document
.
getElementById
(
'
topiconid
'
).
style
.
display
=
'
none
'
}
else
{
}
else
{
...
@@ -289,13 +290,30 @@ export default {
...
@@ -289,13 +290,30 @@ export default {
}
}
},
},
beforeDestroy
()
{
beforeDestroy
()
{
window
.
removeEventListener
(
'
onload
'
,
this
.
topvisible
())
window
.
removeEventListener
(
'
onload
'
,
this
.
topVisible
())
this
.
articleScrollListen
(
'
remove
'
)
},
},
mounted
()
{
mounted
()
{
this
.
articleScrollListen
(
'
add
'
)
this
.
initPageSpliteFun
()
this
.
initPageSpliteFun
()
window
.
addEventListener
(
'
onload
'
,
this
.
top
v
isible
())
window
.
addEventListener
(
'
onload
'
,
this
.
top
V
isible
())
},
},
methods
:
{
methods
:
{
/**
* dom的滚动事件监听
*/
articleScrollListen
(
key
)
{
const
dom
=
this
.
$refs
[
'
mark-down-ref
'
]
if
(
dom
&&
key
===
'
add
'
)
{
dom
.
addEventListener
(
'
scroll
'
,
function
(
e
)
{
this
.
topShow
=
e
.
scrollTop
>
0
})
}
else
if
(
dom
&&
key
===
'
remove
'
)
{
dom
.
removeEventListener
(
'
scroll
'
,
function
(
e
)
{
this
.
topShow
=
e
.
scrollTop
>
0
})
}
},
initPageSpliteFun
()
{
initPageSpliteFun
()
{
this
.
splitLength
=
this
.
pageArray
[
0
]
this
.
splitLength
=
this
.
pageArray
[
0
]
},
},
...
@@ -314,9 +332,7 @@ export default {
...
@@ -314,9 +332,7 @@ export default {
let
that
=
this
let
that
=
this
that
.
total
=
allTitleArray
.
length
// 总数
that
.
total
=
allTitleArray
.
length
// 总数
let
splitLength
=
that
.
splitLength
let
splitLength
=
that
.
splitLength
if
(
!
selectListLength
)
{
if
(
selectListLength
)
{
that
.
splitLength
=
that
.
splitLength
}
else
{
this
.
currentPage
=
1
this
.
currentPage
=
1
that
.
splitLength
=
selectListLength
// 划分长度
that
.
splitLength
=
selectListLength
// 划分长度
}
}
...
@@ -324,7 +340,7 @@ export default {
...
@@ -324,7 +340,7 @@ export default {
let
splitNum
=
Math
.
ceil
(
that
.
total
/
splitLength
)
// 向上取整
let
splitNum
=
Math
.
ceil
(
that
.
total
/
splitLength
)
// 向上取整
that
.
pageAnalys
.
childNum
=
splitNum
// 子数组个数
that
.
pageAnalys
.
childNum
=
splitNum
// 子数组个数
that
.
pageAnalys
.
allTitle
=
allTitleArray
// 所有标题
that
.
pageAnalys
.
allTitle
=
allTitleArray
// 所有标题
that
.
pageAnalys
.
titleArray
=
new
Array
()
// 子数组个数
that
.
pageAnalys
.
titleArray
=
[]
// 子数组个数
let
locSplit
=
0
let
locSplit
=
0
let
locLength
=
splitLength
// 每一页的条数
let
locLength
=
splitLength
// 每一页的条数
while
(
splitNum
--
)
{
while
(
splitNum
--
)
{
...
@@ -359,10 +375,10 @@ export default {
...
@@ -359,10 +375,10 @@ export default {
increment
:
function
()
{
increment
:
function
()
{
this
.
$store
.
commit
(
'
increment
'
)
this
.
$store
.
commit
(
'
increment
'
)
},
},
top
v
isible
:
function
()
{
top
V
isible
:
function
()
{
let
dom
=
document
.
getElementById
(
'
home
title
'
)
let
dom
=
document
.
getElementById
(
'
home
TitleId
'
)
this
.
top
s
how
=
this
.
elementIsVisibleInViewport
(
dom
)
this
.
top
S
how
=
this
.
elementIsVisibleInViewport
(
dom
)
setTimeout
(
this
.
top
v
isible
)
setTimeout
(
this
.
top
V
isible
)
},
},
elementIsVisibleInViewport
:
function
(
el
,
partiallyVisible
=
false
)
{
elementIsVisibleInViewport
:
function
(
el
,
partiallyVisible
=
false
)
{
try
{
try
{
...
...
src/weather/EchartWeather.vue
浏览文件 @
14e35fcd
...
@@ -44,9 +44,7 @@ export default {
...
@@ -44,9 +44,7 @@ export default {
await
that
.
getWeatherData
()
await
that
.
getWeatherData
()
await
that
.
weatherInint
()
await
that
.
weatherInint
()
}
}
waitGetWeatherData
().
then
((
o
)
=>
{
waitGetWeatherData
()
console
.
log
(
o
)
})
// 同步
},
},
getWeatherData
()
{
getWeatherData
()
{
let
that
=
this
let
that
=
this
...
@@ -55,9 +53,9 @@ export default {
...
@@ -55,9 +53,9 @@ export default {
that
.
$axios
that
.
$axios
.
get
(
that
.
baseurl
+
'
article/weather/
'
)
.
get
(
that
.
baseurl
+
'
article/weather/
'
)
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
'
天气接口返回
'
,
res
)
let
resData
=
res
.
data
let
resdata
=
res
.
data
let
weather
=
resData
.
weather
let
weather
=
resdata
.
weather
that
.
msg
=
weather
.
location
let
title
=
weather
.
title
let
title
=
weather
.
title
let
high
=
weather
.
high
let
high
=
weather
.
high
let
low
=
weather
.
low
let
low
=
weather
.
low
...
@@ -96,10 +94,9 @@ export default {
...
@@ -96,10 +94,9 @@ export default {
discribeText
.
windwl
=
that
.
weather_windwl
[
loc
]
discribeText
.
windwl
=
that
.
weather_windwl
[
loc
]
that
.
tableData
.
push
(
discribeText
)
that
.
tableData
.
push
(
discribeText
)
}
}
console
.
log
(
that
.
tableData
,
'
that.tableData
'
)
})
})
.
catch
((
r
)
=>
{
.
catch
((
r
)
=>
{
console
.
log
(
'
r
'
,
r
)
throw
Error
(
r
)
})
})
},
1000
)
},
1000
)
resolve
(
'
获取后端天气成功的promise
'
)
resolve
(
'
获取后端天气成功的promise
'
)
...
@@ -114,9 +111,7 @@ export default {
...
@@ -114,9 +111,7 @@ export default {
let
highData
=
Array
.
from
(...[
that
.
weather_high
])
let
highData
=
Array
.
from
(...[
that
.
weather_high
])
let
lowData
=
Array
.
from
(...[
that
.
weather_low
])
let
lowData
=
Array
.
from
(...[
that
.
weather_low
])
let
titleData
=
Array
.
from
(...[
that
.
weather_title
])
let
titleData
=
Array
.
from
(...[
that
.
weather_title
])
console
.
log
(
'
绘制折线图数据
'
,
titleData
,
highData
,
lowData
)
let
dom
=
document
.
getElementById
(
'
echart_weather
'
)
let
dom
=
document
.
getElementById
(
'
echart_weather
'
)
// console.log('dom', dom)
let
myChart
=
echarts
.
init
(
dom
)
let
myChart
=
echarts
.
init
(
dom
)
// 绘制图表
// 绘制图表
let
option
=
{
let
option
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录