Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
csssp-xcx-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
劳广强
csssp-xcx-h5
Commits
8d3caf7e
提交
8d3caf7e
authored
12月 27, 2022
作者:
劳广强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 文章列表页 接入接口
上级
a530a2b0
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
55 行增加
和
24 行删除
+55
-24
index.vue
pages/article-detail/index.vue
+19
-18
index.vue
pages/article-list/index.vue
+36
-6
没有找到文件。
pages/article-detail/index.vue
浏览文件 @
8d3caf7e
...
...
@@ -25,19 +25,20 @@
</view>
<view
class=
"buttom_btn"
>
<view
class=
"btn_box"
>
<view
:class=
"[!follow ? 'btn_box_item' : 'item_active']"
bindtap=
"follow"
>
<image
v-if=
"!follow"
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_guanzhu1@2x.png"
/>
<image
v-else
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_guanzhu3@2x.png"
/>
</view>
<view
:class=
"[!fabulous ? 'btn_box_item' : 'item_active2']"
bindtap=
"fabulous"
>
<image
v-if=
"!fabulous"
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_dianzan1@2x.png"
/>
<image
v-else
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_dianzan3@2x.png"
/>
</view>
<button
class=
"btn_box_item"
bindtap=
"showTip"
>
<image
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_fenxiang@2x.png"
/>
</button>
</view>
<!--
<view
class=
"btn_box"
>
-->
<!--
<view
:class=
"[!follow ? 'btn_box_item' : 'item_active']"
bindtap=
"follow"
>
-->
<!--
<image
v-if=
"!follow"
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_guanzhu1@2x.png"
/>
-->
<!--
<image
v-else
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_guanzhu3@2x.png"
/>
-->
<!--
</view>
-->
<!--
<view
:class=
"[!fabulous ? 'btn_box_item' : 'item_active2']"
bindtap=
"fabulous"
>
-->
<!--
<image
v-if=
"!fabulous"
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_dianzan1@2x.png"
/>
-->
<!--
<image
v-else
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_wz_dianzan3@2x.png"
/>
-->
<!--
</view>
-->
<!--
<button
class=
"btn_box_item"
bindtap=
"showTip"
>
-->
<!--
<image
class=
"btn_icon"
mode=
"aspectFill"
src=
"/static/icon/ic_fenxiang@2x.png"
/>
-->
<!--
</button>
-->
<!--
</view>
-->
<!--
<van-action-sheet
v-show=
"showTip"
cancel-text=
"取消"
bind:close=
"close"
bind:cancel=
"cancelShare"
>
-->
<!--
<view
class=
"share_box"
>
-->
<!--
<button
open-type=
"share"
class=
"share_pyq_btn"
>
分享给好友
</button>
-->
...
...
@@ -46,11 +47,11 @@
<!--
</van-action-sheet>
-->
</view>
<
view
class=
"share_bg"
bindtap=
"closetipPyq"
v-if=
"tipPyq"
>
<view
class=
"share_bg_box"
>
<image
mode=
"aspectFill"
class=
"img_pyq_tip"
src=
"/static/img_pyq_tip@2x.png"
/
>
</view
>
<
/view
>
<
!--
<view
class=
"share_bg"
bindtap=
"closetipPyq"
v-if=
"tipPyq"
>
--
>
<!--
<view
class=
"share_bg_box"
>
--
>
<!--
<image
mode=
"aspectFill"
class=
"img_pyq_tip"
src=
"/static/img_pyq_tip@2x.png"
/>
--
>
<!--
</view>
--
>
<
!--
</view>
--
>
</view>
</
template
>
...
...
pages/article-list/index.vue
浏览文件 @
8d3caf7e
...
...
@@ -2,20 +2,19 @@
<view>
<view
class=
"article_box"
>
<view
class=
"article_list"
>
<view
class=
"article_item"
v-for=
"(item, index) in article
Sor
t"
@
click=
"changeArticle(item, index)"
:key=
"item.name"
>
<view
class=
"article_item"
v-for=
"(item, index) in article
TypeLis
t"
@
click=
"changeArticle(item, index)"
:key=
"item.name"
>
<view
:class=
"[articleIdx === index ? 'article_active' : 'article_item_name']"
>
{{
item
.
name
}}
</view>
<view
:class=
"[articleIdx === index ? 'task_line' : 'task_line_none']"
></view>
</view>
</view>
</view>
<view
class=
"line"
></view>
<view
v-if=
"!articleList.length"
class=
"data_none"
>
<view
v-if=
"!articleL
oading && !articleL
ist.length"
class=
"data_none"
>
<image
mode=
"aspectFill"
class=
"data_img"
src=
"/static/pic_wushuju@2x.png"
/>
<view
class=
"data_title"
>
暂无数据
</view>
</view>
<view
class=
"article_boxs"
>
<view
v-for=
"(item, index) in articleList"
:key=
"item.index"
style=
"width: 100%"
>
<navigator
hover-class=
"none"
url=
"/package-one/article-detail/article-detail?id=item.id"
/>
<view
v-for=
"(item, index) in articleList"
:key=
"item.index"
style=
"width: 100%"
@
click=
"onArticleClick(item, index)"
>
<view
class=
"article_container"
style=
"width: 100%"
>
<view
class=
"article_left"
>
<view
class=
"article_title"
>
{{
item
.
title
}}
</view>
...
...
@@ -49,19 +48,50 @@ import { articleSort, articleList } from '@/pages/article-list/mock';
export
default
{
data
()
{
return
{
articleSort
,
articleList
,
articleTypeList
:
[],
articleTypeId
:
0
,
articleList
:
[],
articleIdx
:
0
,
articleLoading
:
true
,
id
:
null
,
ifShare
:
true
,
is_fabulous
:
null
,
// 点赞
is_follow
:
null
,
// 关注
};
},
onLoad
(
query
)
{
this
.
fetchArticleTypeData
();
},
methods
:
{
async
fetchArticleTypeData
()
{
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/app/articletype/list'
);
this
.
articleTypeList
=
list
;
this
.
articleTypeId
=
list
[
0
]?.
id
??
0
;
this
.
fetchArticleData
();
},
async
fetchArticleData
()
{
this
.
articleLoading
=
true
;
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/article/list'
,
{
params
:
{
article_type_id
:
this
.
articleTypeId
,
},
});
this
.
articleList
=
list
;
this
.
articleLoading
=
false
;
},
async
changeArticle
(
item
,
index
)
{
if
(
this
.
articleIdx
===
index
)
return
;
this
.
articleIdx
=
index
;
this
.
articleTypeId
=
item
.
id
;
this
.
fetchArticleData
();
},
onArticleClick
(
item
,
index
)
{
uni
.
$u
.
route
({
url
:
'pages/article-detail/index'
,
params
:
{
id
:
item
.
id
}
});
},
},
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论