Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
3b9e556c
提交
3b9e556c
authored
1月 11, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
学习历史接口调试与界面修正
上级
b2ebbece
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
37 行增加
和
30 行删除
+37
-30
course.dart
lib/models/course.dart
+2
-2
study_history.dart
lib/models/study_history.dart
+4
-3
book.dart
lib/pages/course/widgets/book.dart
+2
-7
controller.dart
lib/pages/study_history/controller.dart
+5
-1
view.dart
lib/pages/study_history/view.dart
+2
-2
item.dart
lib/pages/study_history/widgets/item.dart
+21
-14
image.dart
lib/widgets/image.dart
+1
-1
没有找到文件。
lib/models/course.dart
浏览文件 @
3b9e556c
...
...
@@ -26,7 +26,7 @@ class CourseModel {
authors
=
json
[
'authors'
];
img
=
json
[
'img'
];
progress
=
json
[
'progress'
];
lastChapter
=
json
[
'last
C
hapter'
];
lastChapter
=
json
[
'last
_c
hapter'
];
createTime
=
json
[
'create_time'
];
days
=
json
[
'days'
];
readNum
=
json
[
'read_num'
];
...
...
@@ -96,7 +96,7 @@ class CourseModel {
map
[
'authors'
]
=
authors
;
map
[
'img'
]
=
img
;
map
[
'progress'
]
=
progress
;
map
[
'last
C
hapter'
]
=
lastChapter
;
map
[
'last
_c
hapter'
]
=
lastChapter
;
map
[
'create_time'
]
=
createTime
;
map
[
'days'
]
=
days
;
map
[
'read_num'
]
=
readNum
;
...
...
lib/models/study_history.dart
浏览文件 @
3b9e556c
...
...
@@ -2,15 +2,15 @@ part of models;
class
StudyHistoryModel
{
StudyHistoryModel
({
this
.
time
,
this
.
courses
,
required
this
.
courses
,
});
StudyHistoryModel
.
fromJson
(
dynamic
json
)
{
time
=
json
[
'time'
];
courses
=
List
.
generate
(
json
[
'list'
].
length
,
(
index
)
=>
CourseModel
.
fromJson
(
index
));
courses
=
List
.
generate
(
json
[
'list'
].
length
,
(
index
)
=>
CourseModel
.
fromJson
(
json
[
'list'
][
index
]
));
}
String
?
time
;
List
<
CourseModel
>
?
courses
;
List
<
CourseModel
>
courses
=
[]
;
}
\ No newline at end of file
lib/pages/course/widgets/book.dart
浏览文件 @
3b9e556c
...
...
@@ -43,13 +43,8 @@ class Book extends StatelessWidget {
),
],
),
padding:
EdgeInsets
.
all
(
1
),
child:
Container
(
// margin: const EdgeInsets.only(top: 16,bottom: 10),
// color: Colors.red,
child:
Image
.
network
(
model
.
img
.
toString
()),
// width: 85,
),
padding:
const
EdgeInsets
.
all
(
1
),
child:
CustomImage
.
network
(
url:
model
.
img
??
''
),
),
),
),
...
...
lib/pages/study_history/controller.dart
浏览文件 @
3b9e556c
...
...
@@ -13,6 +13,11 @@ class HistoryController extends GetxController {
int
_page
=
1
;
bool
_noMore
=
false
;
@override
void
onReady
()
{
onRefresh
();
super
.
onReady
();
}
@override
void
onClose
()
{
...
...
@@ -30,7 +35,6 @@ class HistoryController extends GetxController {
limit:
_limit
);
print
(
'11111111111111111111111111
$result
'
);
// 如果是刷新 清理数据
if
(
isRefresh
)
histories
.
clear
();
histories
.
addAll
(
result
);
...
...
lib/pages/study_history/view.dart
浏览文件 @
3b9e556c
...
...
@@ -23,9 +23,9 @@ class _StudyHistoryPageState extends State<StudyHistoryPage> {
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
BuildDayItem
();
return
BuildDayItem
(
historyModel:
controller
.
histories
[
index
],
);
},
itemCount:
4
,
itemCount:
controller
.
histories
.
length
,
),
),
),
...
...
lib/pages/study_history/widgets/item.dart
浏览文件 @
3b9e556c
part of
study_history
;
class
BuildDayItem
extends
StatelessWidget
{
const
BuildDayItem
({
Key
?
key
})
:
super
(
key:
key
);
final
StudyHistoryModel
historyModel
;
const
BuildDayItem
({
Key
?
key
,
required
this
.
historyModel
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -23,38 +27,39 @@ class BuildDayItem extends StatelessWidget {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
const
EdgeInsets
.
only
(
left:
10
),
decoration:
const
BoxDecoration
(
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
8.0
),
topRight:
Radius
.
circular
(
8.0
),
),
color:
Colors
.
cyan
,
//
color: Colors.cyan,
),
height:
32
,
alignment:
Alignment
.
centerLeft
,
child:
Text
(
'今天'
,
style:
TextStyle
(
fontSize:
13
,
height:
1.4
,
color:
Colours
.
c6
),),
child:
Text
(
historyModel
.
time
??
''
,
style:
const
TextStyle
(
fontSize:
13
,
height:
1.4
,
color:
Colours
.
c6
),),
),
ListView
.
builder
(
shrinkWrap:
true
,
physics:
NeverScrollableScrollPhysics
(),
physics:
const
NeverScrollableScrollPhysics
(),
itemBuilder:
(
BuildContext
context
,
int
index
){
return
_buildItem
();
return
_buildItem
(
historyModel
.
courses
[
index
]
);
},
itemCount:
2
,
itemCount:
historyModel
.
courses
.
length
,
)
],
),
);
}
Widget
_buildItem
(){
Widget
_buildItem
(
CourseModel
courseModel
){
return
Container
(
margin:
const
EdgeInsets
.
only
(
left:
10
,
right:
10
),
child:
Column
(
children:
[
Container
(
color:
Colours
.
cF0
,
height:
2
,
height:
0.5
,
),
Container
(
margin:
const
EdgeInsets
.
only
(
top:
11.5
,
bottom:
14.5
),
...
...
@@ -65,7 +70,9 @@ class BuildDayItem extends StatelessWidget {
Container
(
width:
72
,
height:
87
,
color:
Colors
.
red
,
// color: Colors.red,
child:
CustomImage
.
network
(
url:
courseModel
.
img
??
''
)
// Image.network(courseModel.img??''),
),
Expanded
(
child:
Container
(
...
...
@@ -78,9 +85,9 @@ class BuildDayItem extends StatelessWidget {
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'从现在开始,为精彩活过一百'
,
style:
TextStyle
(
fontSize:
14
,
height:
1.5
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Text
(
courseModel
.
bookName
??
''
,
style:
const
TextStyle
(
fontSize:
14
,
height:
1.5
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Gaps
.
vGaps5
,
Text
(
'李白'
,
style:
TextStyle
(
fontSize:
12
,
height:
1.4
,
color:
Colours
.
c6
),),
Text
(
courseModel
.
authors
??
''
,
style:
const
TextStyle
(
fontSize:
12
,
height:
1.4
,
color:
Colours
.
c6
),),
],
),
Gaps
.
vGaps25
,
...
...
@@ -88,12 +95,12 @@ class BuildDayItem extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
color:
Colors
.
cyan
,
color:
AppTheme
.
primary
.
withOpacity
(
0.1
)
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
3.5
),
child:
const
Text
(
'未学习'
,
style:
TextStyle
(
fontSize:
11
,
height:
1.3
,
color:
Colours
.
c9
),),
child:
Text
(
courseModel
.
typeName
,
style:
const
TextStyle
(
fontSize:
11
,
height:
1.3
,
color:
AppTheme
.
primary
),),
),
// Spacer(),
const
Text
(
'继续学习'
,
style:
TextStyle
(
fontSize:
11
,
height:
1.3
,
color:
AppTheme
.
primary
),)
Text
(
'上次读到:
${courseModel.lastChapter}
'
,
style:
const
TextStyle
(
fontSize:
11
,
height:
1.3
,
color:
Colours
.
c6
),)
],
)
],
...
...
lib/widgets/image.dart
浏览文件 @
3b9e556c
...
...
@@ -109,7 +109,7 @@ class CustomImage extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
final
borderRadius
=
BorderRadius
.
all
(
Radius
.
circular
(
radius
??
10
));
final
borderRadius
=
BorderRadius
.
all
(
Radius
.
circular
(
radius
??
3
));
final
Widget
errorChild
=
error
??
const
Icon
(
Icons
.
image_not_supported_outlined
);
final
Widget
placeholderChild
=
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论