Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
0d39e86f
提交
0d39e86f
authored
1月 11, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
入口
上级
c47127be
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
62 行增加
和
34 行删除
+62
-34
mine.dart
lib/models/mine.dart
+3
-0
controller.dart
lib/pages/mine/controller.dart
+3
-3
view.dart
lib/pages/mine/view.dart
+7
-6
account.dart
lib/pages/mine/widgets/account.dart
+26
-17
read.dart
lib/pages/mine/widgets/read.dart
+15
-6
user.dart
lib/pages/mine/widgets/user.dart
+8
-2
没有找到文件。
lib/models/mine.dart
浏览文件 @
0d39e86f
...
...
@@ -5,8 +5,10 @@ class ReadModel {
ReadModel
({
required
this
.
value
,
required
this
.
name
,
this
.
link
,
});
String
value
;
String
name
;
String
?
link
;
}
\ No newline at end of file
lib/pages/mine/controller.dart
浏览文件 @
0d39e86f
...
...
@@ -42,15 +42,15 @@ class MineController extends GetxController {
void
_getInfo
()
async
{
userInfo
=
await
MineAPI
.
userInfo
();
reads
=
[
ReadModel
(
name:
'笔记'
,
value:
userInfo
[
'note_nums'
].
toString
()),
ReadModel
(
name:
'笔记'
,
value:
userInfo
[
'note_nums'
].
toString
()
,
),
ReadModel
(
name:
'讨论'
,
value:
userInfo
[
'comment_nums'
].
toString
()),
ReadModel
(
name:
'错题'
,
value:
userInfo
[
'wrong_nums'
].
toString
()),
ReadModel
(
name:
'收藏'
,
value:
userInfo
[
'collect_nums'
].
toString
())
];
accounts
=
[
ReadModel
(
name:
'优惠券'
,
value:
userInfo
[
'coupon_nums'
].
toString
()),
ReadModel
(
name:
'积分'
,
value:
userInfo
[
'integral_nums'
].
toString
()),
ReadModel
(
name:
'紫金币'
,
value:
userInfo
[
'bean_nums'
].
toString
()),
ReadModel
(
name:
'积分'
,
value:
userInfo
[
'integral_nums'
].
toString
()
,
link:
Routes
.
coin
),
ReadModel
(
name:
'紫金币'
,
value:
userInfo
[
'bean_nums'
].
toString
()
,
link:
Routes
.
coin
),
ReadModel
(
name:
'订单'
,
value:
userInfo
[
'orders_nums'
].
toString
())
];
update
();
...
...
lib/pages/mine/view.dart
浏览文件 @
0d39e86f
...
...
@@ -71,7 +71,7 @@ class _MinePageState extends State<MinePage> {
},),
Gaps
.
vGaps10
,
BuildRead
(
items:
controller
.
reads
),
controller
.
ads
.
isNotEmpty
?
Gaps
.
vGaps10
:
SizedBox
(),
controller
.
ads
.
isNotEmpty
?
Gaps
.
vGaps10
:
const
SizedBox
(),
controller
.
ads
.
isNotEmpty
?
Container
(
color:
Colors
.
transparent
,
...
...
@@ -97,10 +97,10 @@ class _MinePageState extends State<MinePage> {
child:
Column
(
children:
[
_buildItem
(
'账户安全'
,
''
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
height:
1
,),
Container
(
color:
Colours
.
cLine
,
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
15
),
height:
1
,),
_buildItem
(
'意见反馈'
,
''
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
),
height:
1
,),
_buildItem
(
'关于我们'
,
''
),
Container
(
color:
Colours
.
cLine
,
margin:
const
EdgeInsets
.
symmetric
(
horizontal:
15
),
height:
1
,),
_buildItem
(
'关于我们'
,
Routes
.
about
),
],
),
),
...
...
@@ -115,6 +115,7 @@ class _MinePageState extends State<MinePage> {
Widget
_buildItem
(
String
title
,
String
linkTo
,{
VoidCallback
?
onTap
})
{
return
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
(){
if
(
linkTo
.
isNotEmpty
){
context
.
pushNamed
(
linkTo
);
...
...
@@ -122,13 +123,13 @@ class _MinePageState extends State<MinePage> {
}
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
18
,
right:
15
),
padding:
const
EdgeInsets
.
only
(
left:
18
,
right:
15
),
height:
42
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
'
$title
'
,
style:
TextStyle
(
fontSize:
14
,
color:
Colours
.
c3
,),),
Text
(
title
,
style:
const
TextStyle
(
fontSize:
14
,
color:
Colours
.
c3
,),),
Container
(
width:
5
,
height:
8
,
...
...
lib/pages/mine/widgets/account.dart
浏览文件 @
0d39e86f
...
...
@@ -2,9 +2,10 @@ part of mine;
class
BuildAccount
extends
StatelessWidget
{
final
List
<
ReadModel
>
items
;
final
void
Function
()?
onTap
;
const
BuildAccount
({
super
.
key
,
this
.
onTap
,
this
.
items
=
const
[]
});
...
...
@@ -35,22 +36,30 @@ class BuildAccount extends StatelessWidget {
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
items
.
map
((
model
){
return
Column
(
children:
[
Container
(
width:
25
.
w
,
height:
25
.
w
,
color:
Colors
.
green
,
),
Gaps
.
vGaps5
,
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.6
,
color:
Colours
.
c9
),),
items
.
indexOf
(
model
)
==
0
?
Row
(
children:
[
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
16
,
height:
1.6
,
fontWeight:
Fonts
.
medium
,
color:
AppTheme
.
primary
,),),
const
Text
(
'张'
,
style:
TextStyle
(
fontSize:
12
,
height:
1.6
,
color:
Colours
.
c3
),)
],
):
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
16
,
height:
1.6
,
color:
Colours
.
c3
),)
],
return
GestureDetector
(
onTap:
(){
if
(
model
.
link
!=
null
){
context
.
pushNamed
(
model
.
link
!);
if
(
onTap
!=
null
)
onTap
;
}
},
child:
Column
(
children:
[
Container
(
width:
25
.
w
,
height:
25
.
w
,
color:
Colors
.
green
,
),
Gaps
.
vGaps5
,
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.6
,
color:
Colours
.
c9
),),
items
.
indexOf
(
model
)
==
0
?
Row
(
children:
[
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
16
,
height:
1.6
,
fontWeight:
Fonts
.
medium
,
color:
AppTheme
.
primary
,),),
const
Text
(
'张'
,
style:
TextStyle
(
fontSize:
12
,
height:
1.6
,
color:
Colours
.
c3
),)
],
):
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
16
,
height:
1.6
,
color:
Colours
.
c3
),)
],
),
);
}
).
toList
(),
),
...
...
lib/pages/mine/widgets/read.dart
浏览文件 @
0d39e86f
...
...
@@ -31,12 +31,21 @@ class BuildRead extends StatelessWidget {
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
items
.
map
((
model
){
return
Column
(
children:
[
Text
(
model
.
value
,
style:
const
TextStyle
(
fontSize:
18
,
height:
1.6
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Gaps
.
vGaps5
,
Text
(
model
.
name
,
style:
const
TextStyle
(
fontSize:
13
,
height:
1.6
,
color:
Colours
.
c6
))
],
return
GestureDetector
(
behavior:
HitTestBehavior
.
opaque
,
onTap:
(){
if
(
model
.
link
!=
null
){
context
.
pushNamed
(
model
.
link
!);
if
(
onTap
!=
null
)
onTap
;
}
},
child:
Column
(
children:
[
Text
(
model
.
value
,
style:
const
TextStyle
(
fontSize:
18
,
height:
1.6
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Gaps
.
vGaps5
,
Text
(
model
.
name
,
style:
const
TextStyle
(
fontSize:
13
,
height:
1.6
,
color:
Colours
.
c6
))
],
),
);
}).
toList
(),
),
...
...
lib/pages/mine/widgets/user.dart
浏览文件 @
0d39e86f
...
...
@@ -15,13 +15,19 @@ class BuildUser extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
onTap
,
behavior:
HitTestBehavior
.
opaque
,
onTap:
onTap
,
child:
Row
(
children:
[
Container
(
width:
45
.
w
,
height:
45
.
w
,
color:
Colors
.
cyan
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
22.5
),
color:
Colors
.
cyan
,
),
// color: Colors.cyan,
child:
CustomImage
.
network
(
url:
userInfo
.
containsKey
(
'head_img'
)?
userInfo
[
'head_img'
]:
''
),
),
Gaps
.
hGaps10
,
Column
(
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论