Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
csssp-xcx-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
劳广强
csssp-xcx-h5
Commits
6a9ec7dd
提交
6a9ec7dd
authored
8月 08, 2024
作者:
劳广强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(文章): 文章筛选层级增加一层
上级
269f457a
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
12 行增加
和
13 行删除
+12
-13
index.vue
pages/article-list/index.vue
+6
-6
index.vue
pages/index/index.vue
+6
-7
没有找到文件。
pages/article-list/index.vue
浏览文件 @
6a9ec7dd
...
...
@@ -7,7 +7,7 @@
<view
:class=
"[articleIdx === index ? 'task_line' : 'task_line_none']"
></view>
</view>
</view>
<view
class=
"article_list"
>
<view
v-if=
"articleDeepTypeList.length > 0"
class=
"article_list"
>
<view
class=
"article_item"
v-for=
"(item, index) in articleDeepTypeList"
@
click=
"changeDeepArticle(item, index)"
:key=
"item.name"
>
<view
:class=
"[articleDeepIdx === index ? 'article_active' : 'article_item_name']"
>
{{
item
.
name
}}
</view>
<view
:class=
"[articleDeepIdx === index ? 'task_line' : 'task_line_none']"
></view>
...
...
@@ -98,12 +98,12 @@ export default {
const
url
=
`/api/backend/articletype/list?parent_id=
${
id
}
`
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
url
)
this
.
articleDeepTypeList
=
list
if
(
list
.
length
<=
0
)
return
if
(
list
.
length
<=
0
)
return
this
.
fetchArticleData
(
id
)
this
.
articleDeepTypeId
=
list
[
0
]?.
id
this
.
fetchArticleData
()
this
.
fetchArticleData
(
this
.
articleDeepTypeId
)
},
async
fetchArticleData
()
{
async
fetchArticleData
(
id
)
{
this
.
articleLoading
=
true
const
articleTypeId
=
this
.
articleTypeId
const
articleDeepTypeId
=
this
.
articleDeepTypeId
...
...
@@ -114,7 +114,7 @@ export default {
[
'/api/article/list'
,
{
article_type_id
:
this
.
articleDeepTypeI
d
,
article_type_id
:
i
d
,
},
],
{
...
...
@@ -138,7 +138,7 @@ export default {
this
.
articleDeepIdx
=
index
this
.
articleDeepTypeId
=
item
.
id
this
.
articleList
=
createList
()
this
.
fetchArticleData
()
this
.
fetchArticleData
(
item
.
id
)
},
onArticleClick
(
item
,
index
)
{
...
...
pages/index/index.vue
浏览文件 @
6a9ec7dd
...
...
@@ -44,7 +44,7 @@
<view
:class=
"[articleTypeAction === index ? 'article-task-line--action' : 'article-task-line--none']"
/>
</view>
</view>
<view
class=
"article-list"
>
<view
v-if=
"articleDeepTypeList.length > 0"
class=
"article-list"
>
<view
class=
"article-item"
v-for=
"(item, index) in articleDeepTypeList"
:key=
"item.id"
@
click=
"onArticleDeepTypeClick(item, index)"
>
<view
:class=
"[articleDeepTypeAction === index ? 'article-item-name--action' : 'article-item-name--none']"
>
{{
item
.
name
}}
</view>
<view
:class=
"[articleDeepTypeAction === index ? 'article-task-line--action' : 'article-task-line--none']"
/>
...
...
@@ -134,15 +134,15 @@ export default {
const
url
=
`/api/backend/articletype/list?parent_id=
${
id
}
`
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
url
)
this
.
articleDeepTypeList
=
list
if
(
list
.
length
<=
0
)
return
if
(
list
.
length
<=
0
)
return
this
.
fetchArticleData
(
id
)
this
.
articleDeepTypeId
=
list
[
0
]?.
id
this
.
fetchArticleData
()
this
.
fetchArticleData
(
this
.
articleDeepTypeId
)
},
async
fetchArticleData
()
{
async
fetchArticleData
(
id
)
{
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/article/list'
,
{
params
:
{
article_type_id
:
this
.
articleDeepTypeI
d
,
article_type_id
:
i
d
,
},
})
this
.
articleList
=
list
...
...
@@ -157,7 +157,6 @@ export default {
this
.
articleTypeAction
=
index
this
.
articleTypeId
=
item
.
id
this
.
articleDeepTypeAction
=
0
// this.fetchArticleData()
this
.
fetchArticleDeepTypeData
(
item
.
id
)
},
...
...
@@ -165,7 +164,7 @@ export default {
if
(
this
.
articleDeepTypeAction
===
index
)
return
this
.
articleDeepTypeAction
=
index
this
.
articleDeepTypeId
=
item
.
id
this
.
fetchArticleData
()
this
.
fetchArticleData
(
item
.
id
)
},
articleMore
()
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论