Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
0bbfc72e
提交
0bbfc72e
authored
1月 24, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
图书馆界面优化
上级
62702350
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
96 行增加
和
21 行删除
+96
-21
library.dart
lib/apis/library.dart
+2
-1
item.dart
lib/pages/book_category/widgets/item.dart
+2
-2
item.dart
lib/pages/book_score/widgets/item.dart
+14
-14
controller.dart
lib/pages/library/controller.dart
+11
-1
view.dart
lib/pages/library/view.dart
+67
-3
没有找到文件。
lib/apis/library.dart
浏览文件 @
0bbfc72e
...
...
@@ -64,7 +64,8 @@ abstract class LibraryAPI {
final
result
=
await
HttpService
.
to
.
post
(
'/v1/book/category/getBookList'
,
params:
params
params:
params
,
showLoading:
true
);
if
(
result
.
data
is
!
Map
&&
result
.
data
[
'list'
]
is
!
List
)
return
[];
return
List
.
generate
(
result
.
data
[
'list'
].
length
,
(
index
){
...
...
lib/pages/book_category/widgets/item.dart
浏览文件 @
0bbfc72e
...
...
@@ -33,7 +33,7 @@ class _BuildItemState extends State<BuildItem> {
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
widget
.
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
widget
.
model
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
1.4
),),
Text
(
widget
.
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
widget
.
model
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
fontWeight:
Fonts
.
medium
,
height:
2
),),
Gaps
.
hGaps5
,
widget
.
model
.
isReading
==
1
?
Container
(
height:
17
,
...
...
@@ -76,7 +76,7 @@ class _BuildItemState extends State<BuildItem> {
return
Container
(
color:
Colors
.
white
,
padding:
const
EdgeInsets
.
only
(
left:
60
),
child:
Text
(
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
12
,
color:
model
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
height:
1.6
),),
child:
Text
(
model
.
name
??
''
,
style:
TextStyle
(
fontSize:
12
,
color:
model
.
seen
==
0
?
Colours
.
c3
:
Colours
.
c9
,
height:
2
),),
);
}
}
lib/pages/book_score/widgets/item.dart
浏览文件 @
0bbfc72e
...
...
@@ -15,15 +15,15 @@ class BuildItem extends StatelessWidget {
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
top:
15
.
w
,
right:
10
.
w
,
bottom:
15
.
w
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
boxShadow:
const
[
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
,
offset:
Offset
(
0
,
3
),
blurRadius:
4
,
color:
Colours
.
cC7
.
withOpacity
(
0.5
)
,
offset:
Offset
(
3
.
w
,
0
.
w
),
blurRadius:
4
.
w
,
spreadRadius:
0
,
),
],
borderRadius:
BorderRadius
.
circular
(
8
)
borderRadius:
BorderRadius
.
circular
(
8
.
w
)
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
...
...
@@ -31,13 +31,13 @@ class BuildItem extends StatelessWidget {
Row
(
children:
[
Container
(
width:
35
,
height:
35
,
width:
35
.
w
,
height:
35
.
w
,
decoration:
BoxDecoration
(
color:
Colors
.
cyan
,
borderRadius:
BorderRadius
.
circular
(
17.5
)
borderRadius:
BorderRadius
.
circular
(
17.5
.
w
)
),
child:
CustomImage
.
network
(
url:
model
.
usersImg
??
''
),
child:
CustomImage
.
network
(
url:
model
.
usersImg
??
''
,
radius:
17.5
.
w
,
),
),
Gaps
.
hGaps10
,
Expanded
(
...
...
@@ -47,9 +47,9 @@ class BuildItem extends StatelessWidget {
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
users
??
''
,
style:
const
TextStyle
(
fontSize:
12
,
height:
1.3
,
color:
Colours
.
c9
),),
Text
(
model
.
users
??
''
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.3
,
color:
Colours
.
c9
),),
// Spacer(),
Text
(
model
.
createTime
??
''
,
style:
const
TextStyle
(
fontSize:
12
,
height:
1.3
,
color:
Colours
.
c9
),)
Text
(
model
.
createTime
??
''
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.3
,
color:
Colours
.
c9
),)
],
),
AbsorbPointer
(
...
...
@@ -57,10 +57,10 @@ class BuildItem extends StatelessWidget {
child:
CustomRating
(
max:
5
,
score:
model
.
rating
!.
toDouble
()
,
star:
const
Star
(
star:
Star
(
progress:
7
,
fillColor:
AppTheme
.
primary
,
size:
12
,
size:
12
.
w
,
emptyColor:
Colours
.
cE2
,
),
onRating:
(
double
)
{},
),
...
...
@@ -71,7 +71,7 @@ class BuildItem extends StatelessWidget {
],
),
Gaps
.
vGaps15
,
Text
(
model
.
comments
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
height:
1.5
,
color:
Colours
.
c3
),)
Text
(
model
.
comments
??
''
,
style:
TextStyle
(
fontSize:
14
.
w
,
height:
1.5
,
color:
Colours
.
c3
),)
],
),
),
...
...
lib/pages/library/controller.dart
浏览文件 @
0bbfc72e
...
...
@@ -82,6 +82,7 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
// 获取标签数据
_getLabels
();
_getAds
();
onRefresh
();
super
.
onReady
();
}
...
...
@@ -154,7 +155,16 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
}
model
.
selected
=
true
;
selectedLabel
=
model
;
update
();
onRefresh
();
}
void
selectCategory
(
FilterModel
model
){
for
(
FilterModel
m
in
filterCategories
){
m
.
selected
=
false
;
}
model
.
selected
=
true
;
selectedCategory
=
model
;
onRefresh
();
}
/// 获取广告数据
...
...
lib/pages/library/view.dart
浏览文件 @
0bbfc72e
...
...
@@ -35,16 +35,52 @@ class _LibraryPageState extends State<LibraryPage> {
return
Stack
(
children:
[
Column
(
mainAxisSize:
MainAxisSize
.
max
,
children:
[
_buildTab
(
controller
),
// _buildTab(controller),
Row
(
children:
[
Expanded
(
child:
_buildCategory
()),
GestureDetector
(
onTap:
(){
controller
.
setShow
(
controller
.
show
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
alignment:
Alignment
.
center
,
height:
38
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
width:
12
.
w
,
height:
12
.
w
,
// color: Colors.red,
alignment:
Alignment
.
center
,
child:
Image
.
asset
(
'assets/images/filter.png'
,
),
),
Gaps
.
hGaps5
,
Text
(
'筛选'
,
style:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
14
.
w
,
height:
1.5
),)
],
),
// width: 75,
),
)
],
),
_buildLabel
(),
Expanded
(
Container
(
// color: Colors.red,
child:
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
//
onRefresh: controller.onRefresh,
onLoading:
controller
.
onLoading
,
child:
SingleChildScrollView
(
child:
Column
(
mainAxisSize:
MainAxisSize
.
max
,
children:
[
controller
.
ads
.
isNotEmpty
?
Container
(
color:
Colors
.
cyan
,
...
...
@@ -56,6 +92,7 @@ class _LibraryPageState extends State<LibraryPage> {
),
),
),
),
)
],
),
...
...
@@ -97,6 +134,33 @@ class _LibraryPageState extends State<LibraryPage> {
);
}
Widget
_buildCategory
(){
return
Container
(
height:
38
,
child:
GetBuilder
<
LibraryController
>(
init:
LibraryController
(),
builder:
(
controller
)
=>
ListView
.
builder
(
scrollDirection:
Axis
.
horizontal
,
itemBuilder:
(
BuildContext
context
,
int
index
){
FilterModel
model
=
controller
.
filterCategories
[
index
];
return
GestureDetector
(
onTap:
(){
controller
.
selectCategory
(
model
);
},
child:
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
10
.
w
,
horizontal:
10
.
w
),
color:
model
.
selected
?
const
Color
(
0xFFC02D55
).
withOpacity
(
0.08
):
Colors
.
white
,
alignment:
Alignment
.
center
,
child:
Text
(
model
.
name
??
''
,
style:
model
.
selected
?
TextStyle
(
fontSize:
14
.
w
,
color:
AppTheme
.
primary
,
fontWeight:
Fonts
.
medium
,):
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c9
,),),
),
);
},
itemCount:
controller
.
filterCategories
.
length
)
),
);
}
PreferredSizeWidget
_buildTab
(
LibraryController
controller
){
return
PreferredSize
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论