Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
仟微科技
Link Wechat
提交
70f10702
Link Wechat
项目概览
仟微科技
/
Link Wechat
通知
48
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Link Wechat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
70f10702
编写于
10月 29, 2021
作者:
X
xinla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
移动端关键词列表排序修改
上级
fa5abf3d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
40 deletion
+38
-40
linkwe-mobile/src/views/communityOperating/keywords/index.vue
...we-mobile/src/views/communityOperating/keywords/index.vue
+38
-40
未找到文件。
linkwe-mobile/src/views/communityOperating/keywords/index.vue
浏览文件 @
70f10702
<
template
>
<
template
>
<div>
<div>
<div>
<div>
<van-search
<van-search
v-model=
"keyword"
placeholder=
"搜索活码名或关键词"
shape=
"round"
@
search=
"onSearch"
@
clear=
"clear"
>
v-model=
"keyword"
placeholder=
"搜索活码名或关键词"
shape=
"round"
@
search=
"onSearch"
@
clear=
"clear"
>
</van-search>
</van-search>
</div>
</div>
...
@@ -43,7 +37,7 @@ import { getKeywordTasks } from '@/api/community'
...
@@ -43,7 +37,7 @@ import { getKeywordTasks } from '@/api/community'
export
default
{
export
default
{
components
:
{
KeywordPanel
},
components
:
{
KeywordPanel
},
data
()
{
data
()
{
return
{
return
{
keyword
:
''
,
keyword
:
''
,
storageKey
:
'
keywords
'
,
storageKey
:
'
keywords
'
,
...
@@ -55,19 +49,22 @@ export default {
...
@@ -55,19 +49,22 @@ export default {
},
},
methods
:
{
methods
:
{
getTasks
()
{
getTasks
()
{
this
.
loading
=
true
this
.
loading
=
true
getKeywordTasks
(
this
.
keyword
).
then
((
res
)
=>
{
getKeywordTasks
(
this
.
keyword
)
if
(
res
.
code
===
200
)
{
.
then
((
res
)
=>
{
this
.
tasks
=
res
.
rows
if
(
res
.
code
===
200
)
{
}
let
timeStamp
=
(
dateString
)
=>
(
dateString
?
+
new
Date
(
dateString
.
replace
(
/-/g
,
'
/
'
))
:
0
)
this
.
loading
=
false
this
.
tasks
=
res
.
rows
.
sort
((
a
,
b
)
=>
timeStamp
(
b
.
updateTime
)
-
timeStamp
(
a
.
updateTime
))
}).
catch
(()
=>
{
}
this
.
loading
=
false
this
.
loading
=
false
})
})
.
catch
(()
=>
{
this
.
loading
=
false
})
},
},
setHistory
(
keyword
)
{
setHistory
(
keyword
)
{
if
(
!
keyword
)
return
if
(
!
keyword
)
return
if
(
!
this
.
history
.
includes
(
keyword
))
{
if
(
!
this
.
history
.
includes
(
keyword
))
{
...
@@ -76,41 +73,42 @@ export default {
...
@@ -76,41 +73,42 @@ export default {
}
}
},
},
removeHistory
(
keyword
)
{
removeHistory
(
keyword
)
{
if
(
this
.
history
.
includes
(
keyword
))
{
if
(
this
.
history
.
includes
(
keyword
))
{
this
.
history
.
splice
(
this
.
history
.
indexOf
(
keyword
),
1
)
this
.
history
.
splice
(
this
.
history
.
indexOf
(
keyword
),
1
)
localStorage
.
setItem
(
this
.
storageKey
,
JSON
.
stringify
(
this
.
history
))
localStorage
.
setItem
(
this
.
storageKey
,
JSON
.
stringify
(
this
.
history
))
}
}
},
},
getHistory
()
{
getHistory
()
{
this
.
history
=
JSON
.
parse
(
localStorage
.
getItem
(
this
.
storageKey
))
||
[]
this
.
history
=
JSON
.
parse
(
localStorage
.
getItem
(
this
.
storageKey
))
||
[]
},
},
onSearch
()
{
onSearch
()
{
this
.
setHistory
(
this
.
keyword
)
this
.
setHistory
(
this
.
keyword
)
this
.
getTasks
()
this
.
getTasks
()
},
},
search
(
keyword
)
{
search
(
keyword
)
{
this
.
keyword
=
keyword
this
.
keyword
=
keyword
this
.
getTasks
()
this
.
getTasks
()
},
},
clear
()
{
clear
()
{
this
.
keyword
=
''
this
.
getTasks
()
this
.
getTasks
()
}
}
},
},
computed
:
{
computed
:
{
url
()
{
url
()
{
return
window
.
location
.
href
return
window
.
location
.
href
}
}
},
},
created
()
{
created
()
{
this
.
getHistory
()
this
.
getHistory
()
this
.
getTasks
()
this
.
getTasks
()
...
@@ -119,25 +117,25 @@ export default {
...
@@ -119,25 +117,25 @@ export default {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.history-wrapper {
.history-wrapper {
padding: 0 20px 20px;
padding: 0 20px 20px;
.van-tag {
.van-tag {
margin: 10px 10px 0 0;
margin: 10px 10px 0 0;
}
}
}
}
.bottom-line {
.bottom-line {
background-color: #f2f2f2;
background-color: #f2f2f2;
height: 15px;
height: 15px;
}
}
.overlay {
.overlay {
display: flex;
display: flex;
align-items: center;
align-items: center;
.van-loading {
.van-loading {
margin: auto;
margin: auto;
}
}
}
}
</
style
>
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录