Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
csssp-xcx-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
劳广强
csssp-xcx-h5
Commits
b68103c1
提交
b68103c1
authored
12月 28, 2022
作者:
劳广强
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 优化文章列表和我的随手拍列表 接入接口
上级
b4edfa36
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
67 行增加
和
9 行删除
+67
-9
index.scss
components/LoadMore/index.scss
+0
-0
index.vue
components/LoadMore/index.vue
+27
-0
index.vue
pages/article-list/index.vue
+26
-8
index.vue
pages/index/index.vue
+9
-1
index.vue
pages/mine-picture/index.vue
+5
-0
没有找到文件。
components/LoadMore/index.scss
0 → 100644
浏览文件 @
b68103c1
components/LoadMore/index.vue
0 → 100644
浏览文件 @
b68103c1
<
template
>
<view>
<u-loadmore
:status=
"status"
/>
</view>
</
template
>
<
script
>
export
default
{
name
:
'LoadMore'
,
props
:
{
status
:
{
type
:
String
,
default
:
'loading'
,
},
},
data
()
{
return
{};
},
methods
:
{},
};
</
script
>
<
style
scoped
lang=
"scss"
>
@import
'index.scss'
;
</
style
>
pages/article-list/index.vue
浏览文件 @
b68103c1
...
@@ -9,12 +9,12 @@
...
@@ -9,12 +9,12 @@
</view>
</view>
</view>
</view>
<view
class=
"line"
></view>
<view
class=
"line"
></view>
<view
v-if=
"!articleLoading && !articleList.length"
class=
"data_none"
>
<view
v-if=
"!articleLoading && !articleList.
data.
length"
class=
"data_none"
>
<image
mode=
"aspectFill"
class=
"data_img"
src=
"/static/pic_wushuju@2x.png"
/>
<image
mode=
"aspectFill"
class=
"data_img"
src=
"/static/pic_wushuju@2x.png"
/>
<view
class=
"data_title"
>
暂无数据
</view>
<view
class=
"data_title"
>
暂无数据
</view>
</view>
</view>
<view
class=
"article_boxs"
>
<view
class=
"article_boxs"
>
<view
v-for=
"(item, index) in articleList"
:key=
"item.index"
style=
"width: 100%"
@
click=
"onArticleClick(item, index)"
>
<view
v-for=
"(item, index) in articleList
.data
"
:key=
"item.index"
style=
"width: 100%"
@
click=
"onArticleClick(item, index)"
>
<view
class=
"article_container"
style=
"width: 100%"
>
<view
class=
"article_container"
style=
"width: 100%"
>
<view
class=
"article_left"
>
<view
class=
"article_left"
>
<view
class=
"article_title"
>
{{
item
.
title
}}
</view>
<view
class=
"article_title"
>
{{
item
.
title
}}
</view>
...
@@ -38,19 +38,23 @@
...
@@ -38,19 +38,23 @@
<image
class=
"article_img"
mode=
"aspectFill"
:src=
"item.img"
/>
<image
class=
"article_img"
mode=
"aspectFill"
:src=
"item.img"
/>
</view>
</view>
</view>
</view>
<LoadMore
:status=
"articleList.status"
/>
</view>
</view>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
articleSort
,
articleList
}
from
'@/pages/article-list/mock'
;
import
{
getList
,
createList
}
from
'@/utils/list'
;
import
LoadMore
from
'@/components/LoadMore'
;
export
default
{
export
default
{
components
:
{
LoadMore
},
data
()
{
data
()
{
return
{
return
{
articleTypeList
:
[],
articleTypeList
:
[],
articleTypeId
:
0
,
articleTypeId
:
0
,
articleList
:
[]
,
articleList
:
createList
()
,
articleIdx
:
0
,
articleIdx
:
0
,
articleLoading
:
true
,
articleLoading
:
true
,
id
:
null
,
id
:
null
,
...
@@ -64,6 +68,10 @@ export default {
...
@@ -64,6 +68,10 @@ export default {
this
.
fetchArticleTypeData
();
this
.
fetchArticleTypeData
();
},
},
onReachBottom
()
{
this
.
fetchArticleData
();
},
methods
:
{
methods
:
{
async
fetchArticleTypeData
()
{
async
fetchArticleTypeData
()
{
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/app/articletype/list'
);
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/app/articletype/list'
);
...
@@ -74,12 +82,21 @@ export default {
...
@@ -74,12 +82,21 @@ export default {
async
fetchArticleData
()
{
async
fetchArticleData
()
{
this
.
articleLoading
=
true
;
this
.
articleLoading
=
true
;
const
{
list
}
=
await
uni
.
$u
.
http
.
get
(
'/api/article/list'
,
{
const
articleTypeId
=
this
.
articleTypeId
;
params
:
{
await
getList
(
this
,
'articleList'
,
[
'/api/article/list'
,
{
article_type_id
:
this
.
articleTypeId
,
article_type_id
:
this
.
articleTypeId
,
},
},
});
],
this
.
articleList
=
list
;
{
abandon
:
()
=>
articleTypeId
!==
this
.
articleTypeId
,
}
);
this
.
articleLoading
=
false
;
this
.
articleLoading
=
false
;
},
},
...
@@ -87,6 +104,7 @@ export default {
...
@@ -87,6 +104,7 @@ export default {
if
(
this
.
articleIdx
===
index
)
return
;
if
(
this
.
articleIdx
===
index
)
return
;
this
.
articleIdx
=
index
;
this
.
articleIdx
=
index
;
this
.
articleTypeId
=
item
.
id
;
this
.
articleTypeId
=
item
.
id
;
this
.
articleList
=
createList
();
this
.
fetchArticleData
();
this
.
fetchArticleData
();
},
},
...
...
pages/index/index.vue
浏览文件 @
b68103c1
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<view
style=
"height: 28rpx"
/>
<view
style=
"height: 28rpx"
/>
<view
style=
"display: flex; justify-content: space-between; align-items: center; padding: 0 30rpx"
>
<view
style=
"display: flex; justify-content: space-between; align-items: center; padding: 0 30rpx"
>
<image
class=
"logo"
mode=
"widthFix"
src=
"/static/text_sy_tit@2x.png"
/>
<image
class=
"logo"
mode=
"widthFix"
src=
"/static/text_sy_tit@2x.png"
/>
<view
class=
"address"
>
<view
class=
"address"
@
click=
"onGetAddress"
>
<view
class=
"address-text"
>
{{
address
}}
</view>
<view
class=
"address-text"
>
{{
address
}}
</view>
<image
class=
"address-icon"
mode=
"widthFix"
src=
"/static/icon/ic_dizhi@2x.png"
/>
<image
class=
"address-icon"
mode=
"widthFix"
src=
"/static/icon/ic_dizhi@2x.png"
/>
</view>
</view>
...
@@ -142,6 +142,14 @@ export default {
...
@@ -142,6 +142,14 @@ export default {
onArticleClick
(
item
,
index
)
{
onArticleClick
(
item
,
index
)
{
uni
.
$u
.
route
({
url
:
'pages/article-detail/index'
,
params
:
{
id
:
item
.
id
}
});
uni
.
$u
.
route
({
url
:
'pages/article-detail/index'
,
params
:
{
id
:
item
.
id
}
});
},
},
onGetAddress
()
{
uni
.
chooseLocation
({
success
:
(
result
)
=>
{
this
.
address
=
result
.
address
;
},
});
},
},
},
};
};
</
script
>
</
script
>
...
...
pages/mine-picture/index.vue
浏览文件 @
b68103c1
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<LoadMore
v-if=
"list.status !== 'empty'"
:status=
"list.status"
/>
</
template
>
</
template
>
<
template
v-if=
"ExamineIdx === 1"
>
<
template
v-if=
"ExamineIdx === 1"
>
<view
class=
"detail"
v-for=
"(item, index) in list.data"
:key=
"item.id"
@
click=
"onItemClick(item, index)"
>
<view
class=
"detail"
v-for=
"(item, index) in list.data"
:key=
"item.id"
@
click=
"onItemClick(item, index)"
>
...
@@ -66,6 +67,7 @@
...
@@ -66,6 +67,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<LoadMore
v-if=
"list.status !== 'empty'"
:status=
"list.status"
/>
</
template
>
</
template
>
<
template
v-if=
"ExamineIdx === 2"
>
<
template
v-if=
"ExamineIdx === 2"
>
<view
class=
"detail"
v-for=
"(item, index) in list.data"
:key=
"item.id"
@
click=
"onItemClick(item, index)"
>
<view
class=
"detail"
v-for=
"(item, index) in list.data"
:key=
"item.id"
@
click=
"onItemClick(item, index)"
>
...
@@ -96,6 +98,7 @@
...
@@ -96,6 +98,7 @@
</view>
</view>
</view>
</view>
</view>
</view>
<LoadMore
v-if=
"list.status !== 'empty'"
:status=
"list.status"
/>
</
template
>
</
template
>
<view
class=
"data_none"
v-if=
"list.data.length === 0 && list.status !== 'loading'"
>
<view
class=
"data_none"
v-if=
"list.data.length === 0 && list.status !== 'loading'"
>
...
@@ -109,8 +112,10 @@
...
@@ -109,8 +112,10 @@
<
script
>
<
script
>
import
{
examineItem
,
examineList
}
from
'@/pages/mine-picture/mock'
;
import
{
examineItem
,
examineList
}
from
'@/pages/mine-picture/mock'
;
import
{
getList
,
createList
}
from
'@/utils/list'
;
import
{
getList
,
createList
}
from
'@/utils/list'
;
import
LoadMore
from
'@/components/LoadMore'
;
export
default
{
export
default
{
components
:
{
LoadMore
},
data
()
{
data
()
{
return
{
return
{
examineItem
,
examineItem
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论