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 @@
<div
class=
"footer_font"
>
<div
style=
"float: left"
></div>
<span>
Copyright
©
2021-2022 yongma16.xyz
个人空间
</span
>
Copyright
©
{{startTime}} yongma16.xyz
个人空间
</span>
<span>
足迹:{{ readCount }}
</span>
<span
><img
...
...
@@ -122,9 +121,7 @@
padding-bottom: 0;
"
/>
<span
style=
"cursor: pointer"
@
click=
"jumpIpDns"
>
黔ICP备20001426号-1
</span
></span
>
>
黔ICP备20001426号-1
</span></span>
</div>
<!-- <div></div>-->
</div>
...
...
@@ -140,6 +137,8 @@ export default {
name
:
'
App
'
,
data
()
{
return
{
// 开始时间
startTime
:
''
,
authSlogan
:
'
yma16
'
,
chat_flag
:
false
,
msg
:
'
yma16
'
,
...
...
@@ -164,10 +163,16 @@ export default {
}
},
mounted
()
{
this
.
initStartTime
()
this
.
addReadCountFun
()
this
.
readCountFun
()
},
methods
:
{
initStartTime
()
{
const
now
=
new
Date
()
const
year
=
now
.
getFullYear
()
this
.
startTime
=
`2021-
${
year
}
`
},
jumpIpDns
:
function
()
{
try
{
window
.
open
(
'
https://beian.miit.gov.cn
'
)
...
...
src/components/Article.vue
浏览文件 @
14e35fcd
...
...
@@ -13,7 +13,7 @@
<ul
v-for=
"(item, index) in md_title"
:key=
"item"
class=
"ul_style"
>
<div
v-bind:class=
"[
{ li_active: index == article_loc },
{ li_active: index ==
=
article_loc },
li_errorClass,
]"
>
...
...
@@ -28,7 +28,7 @@
:current-page=
"currentPage"
:page-sizes=
"pageArray"
background
:page
r-count=
"3
"
:page
-count=
"pageCount
"
:page-size=
"pageSize"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
...
...
@@ -105,7 +105,7 @@
</div>
<!-- 中间 markdown-->
<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"
>
<div
class=
"block"
style=
"line-height: 20px"
>
<h1>
{{
the_title
}}
</h1>
...
...
@@ -229,6 +229,7 @@ export default {
name
:
'
Article
'
,
data
()
{
return
{
pageCount
:
3
,
msgDrawTitle
:
'
~邮件沟通~
'
,
direction
:
'
rtl
'
,
drawObj
:
{
...
...
@@ -261,7 +262,7 @@ export default {
toTopIsShow
:
false
,
article_loc
:
0
,
challenge_loc
:
-
1
,
top
s
how
:
false
,
top
S
how
:
false
,
userImg
:
''
,
username
:
'
匿名
'
,
articleCommit
:
'
评论区
'
,
...
...
@@ -280,7 +281,7 @@ export default {
}
},
watch
:
{
top
s
how
:
function
(
newvalue
,
oldvalue
)
{
top
S
how
:
function
(
newvalue
,
oldvalue
)
{
if
(
newvalue
===
true
)
{
document
.
getElementById
(
'
topiconid
'
).
style
.
display
=
'
none
'
}
else
{
...
...
@@ -289,13 +290,30 @@ export default {
}
},
beforeDestroy
()
{
window
.
removeEventListener
(
'
onload
'
,
this
.
topvisible
())
window
.
removeEventListener
(
'
onload
'
,
this
.
topVisible
())
this
.
articleScrollListen
(
'
remove
'
)
},
mounted
()
{
this
.
articleScrollListen
(
'
add
'
)
this
.
initPageSpliteFun
()
window
.
addEventListener
(
'
onload
'
,
this
.
top
v
isible
())
window
.
addEventListener
(
'
onload
'
,
this
.
top
V
isible
())
},
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
()
{
this
.
splitLength
=
this
.
pageArray
[
0
]
},
...
...
@@ -314,9 +332,7 @@ export default {
let
that
=
this
that
.
total
=
allTitleArray
.
length
// 总数
let
splitLength
=
that
.
splitLength
if
(
!
selectListLength
)
{
that
.
splitLength
=
that
.
splitLength
}
else
{
if
(
selectListLength
)
{
this
.
currentPage
=
1
that
.
splitLength
=
selectListLength
// 划分长度
}
...
...
@@ -324,7 +340,7 @@ export default {
let
splitNum
=
Math
.
ceil
(
that
.
total
/
splitLength
)
// 向上取整
that
.
pageAnalys
.
childNum
=
splitNum
// 子数组个数
that
.
pageAnalys
.
allTitle
=
allTitleArray
// 所有标题
that
.
pageAnalys
.
titleArray
=
new
Array
()
// 子数组个数
that
.
pageAnalys
.
titleArray
=
[]
// 子数组个数
let
locSplit
=
0
let
locLength
=
splitLength
// 每一页的条数
while
(
splitNum
--
)
{
...
...
@@ -359,10 +375,10 @@ export default {
increment
:
function
()
{
this
.
$store
.
commit
(
'
increment
'
)
},
top
v
isible
:
function
()
{
let
dom
=
document
.
getElementById
(
'
home
title
'
)
this
.
top
s
how
=
this
.
elementIsVisibleInViewport
(
dom
)
setTimeout
(
this
.
top
v
isible
)
top
V
isible
:
function
()
{
let
dom
=
document
.
getElementById
(
'
home
TitleId
'
)
this
.
top
S
how
=
this
.
elementIsVisibleInViewport
(
dom
)
setTimeout
(
this
.
top
V
isible
)
},
elementIsVisibleInViewport
:
function
(
el
,
partiallyVisible
=
false
)
{
try
{
...
...
src/weather/EchartWeather.vue
浏览文件 @
14e35fcd
...
...
@@ -44,9 +44,7 @@ export default {
await
that
.
getWeatherData
()
await
that
.
weatherInint
()
}
waitGetWeatherData
().
then
((
o
)
=>
{
console
.
log
(
o
)
})
// 同步
waitGetWeatherData
()
},
getWeatherData
()
{
let
that
=
this
...
...
@@ -55,9 +53,9 @@ export default {
that
.
$axios
.
get
(
that
.
baseurl
+
'
article/weather/
'
)
.
then
((
res
)
=>
{
console
.
log
(
'
天气接口返回
'
,
res
)
let
resdata
=
res
.
data
let
weather
=
resdata
.
weather
let
resData
=
res
.
data
let
weather
=
resData
.
weather
that
.
msg
=
weather
.
location
let
title
=
weather
.
title
let
high
=
weather
.
high
let
low
=
weather
.
low
...
...
@@ -96,10 +94,9 @@ export default {
discribeText
.
windwl
=
that
.
weather_windwl
[
loc
]
that
.
tableData
.
push
(
discribeText
)
}
console
.
log
(
that
.
tableData
,
'
that.tableData
'
)
})
.
catch
((
r
)
=>
{
console
.
log
(
'
r
'
,
r
)
throw
Error
(
r
)
})
},
1000
)
resolve
(
'
获取后端天气成功的promise
'
)
...
...
@@ -114,9 +111,7 @@ export default {
let
highData
=
Array
.
from
(...[
that
.
weather_high
])
let
lowData
=
Array
.
from
(...[
that
.
weather_low
])
let
titleData
=
Array
.
from
(...[
that
.
weather_title
])
console
.
log
(
'
绘制折线图数据
'
,
titleData
,
highData
,
lowData
)
let
dom
=
document
.
getElementById
(
'
echart_weather
'
)
// console.log('dom', dom)
let
myChart
=
echarts
.
init
(
dom
)
// 绘制图表
let
option
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录