Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
a9a48cfe
提交
a9a48cfe
authored
3月 21, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更改 返回刷新方式
上级
0d02b31f
隐藏空白字符变更
内嵌
并排
正在显示
29 个修改的文件
包含
2657 行增加
和
2860 行删除
+2657
-2860
view.dart
lib/pages/book_detail/view.dart
+234
-240
view.dart
lib/pages/book_pay/view.dart
+109
-115
count.dart
lib/pages/book_shop/widgets/count.dart
+2
-3
view.dart
lib/pages/course/view.dart
+4
-6
view.dart
lib/pages/credit_points/view.dart
+125
-131
view.dart
lib/pages/mine/view.dart
+10
-16
view.dart
lib/pages/user_coin/view.dart
+57
-63
view.dart
lib/pages/user_coupon/view.dart
+43
-49
view.dart
lib/pages/user_discuss/view.dart
+32
-38
view.dart
lib/pages/user_gender/view.dart
+176
-182
view.dart
lib/pages/user_love/view.dart
+41
-47
view.dart
lib/pages/user_msg/view.dart
+111
-146
view.dart
lib/pages/user_notes/view.dart
+37
-43
view.dart
lib/pages/user_notes_des/view.dart
+43
-49
view.dart
lib/pages/user_order/view.dart
+14
-20
awaiting.dart
lib/pages/user_order/widgets/awaiting.dart
+4
-4
coin.dart
lib/pages/user_order/widgets/coin.dart
+9
-12
completed.dart
lib/pages/user_order/widgets/completed.dart
+12
-13
view.dart
lib/pages/user_order_awaiting/view.dart
+257
-269
view.dart
lib/pages/user_order_cancel_detail/view.dart
+207
-213
view.dart
lib/pages/user_order_coin_awaiting/view.dart
+241
-253
view.dart
lib/pages/user_order_coin_cancel/view.dart
+128
-140
view.dart
lib/pages/user_order_coin_completed/view.dart
+128
-140
view.dart
lib/pages/user_order_completed/view.dart
+203
-209
view.dart
lib/pages/user_order_evaluate/view.dart
+2
-7
view.dart
lib/pages/user_order_refunded/view.dart
+204
-210
view.dart
lib/pages/user_point/view.dart
+40
-46
view.dart
lib/pages/user_security/view.dart
+152
-158
view.dart
lib/pages/user_wrong/view.dart
+32
-38
没有找到文件。
lib/pages/book_detail/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -20,200 +20,243 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
BookDetailController
>(
init:
BookDetailController
(
widget
.
bookId
),
builder:
(
controller
)=>
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
CustomAppBar
(
backgroundColor:
const
Color
(
0xFFAB1941
).
withOpacity
(
0.02
),
title:
const
Text
(
'详情'
,
style:
TextStyle
(
fontSize:
17
),),
actions:
[
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
backgroundColor:
Colors
.
transparent
,
icon:
Image
.
asset
(
'assets/images/shop.png'
),
onPressed:
()
=>
context
.
pushNamed
(
Routes
.
shop
),
),
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
backgroundColor:
Colors
.
transparent
,
icon:
Image
.
asset
(
controller
.
bookDetails
.
isCollection
==
0
?
'assets/images/unlove.png'
:
'assets/images/love.png'
,
),
onPressed:
()
{
controller
.
love
(
bookId:
controller
.
bookDetails
.
bookId
.
toString
(),
isCollection:
controller
.
bookDetails
.
isCollection
!);
},
),
],
),
body:
Column
(
children:
[
BuildBook
(
model:
controller
.
bookDetails
,),
Container
(
height:
10
.
w
,
color:
const
Color
(
0xFFF9F9F9
),
),
BuildStudy
(
model:
controller
.
bookDetails
,),
Container
(
height:
2
,
color:
const
Color
(
0xFFF9F9F9
),
),
Container
(
color:
Colors
.
white
,
child:
TabBar
(
labelColor:
AppTheme
.
primary
,
// isScrollable: true,
labelStyle:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
boldSemi
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
),
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorColor:
AppTheme
.
primary
,
tabs:
controller
.
tabs
,
physics:
const
NeverScrollableScrollPhysics
(),
controller:
controller
.
tabController
,
),
),
Container
(
height:
1
.
w
,
color:
const
Color
(
0xFFF9F9F9
),
builder:
(
controller
)=>
Scaffold
(
appBar:
CustomAppBar
(
backgroundColor:
const
Color
(
0xFFAB1941
).
withOpacity
(
0.02
),
title:
const
Text
(
'详情'
,
style:
TextStyle
(
fontSize:
17
),),
actions:
[
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
backgroundColor:
Colors
.
transparent
,
icon:
Image
.
asset
(
'assets/images/shop.png'
),
onPressed:
()
=>
context
.
pushNamed
(
Routes
.
shop
),
),
CustomButton
.
icon
(
padding:
EdgeInsets
.
zero
,
backgroundColor:
Colors
.
transparent
,
icon:
Image
.
asset
(
controller
.
bookDetails
.
isCollection
==
0
?
'assets/images/unlove.png'
:
'assets/images/love.png'
,
),
Container
(
height:
8
.
w
,
color:
Colors
.
transparent
,
onPressed:
()
{
controller
.
love
(
bookId:
controller
.
bookDetails
.
bookId
.
toString
(),
isCollection:
controller
.
bookDetails
.
isCollection
!);
},
),
],
),
body:
Column
(
children:
[
BuildBook
(
model:
controller
.
bookDetails
,),
Container
(
height:
10
.
w
,
color:
const
Color
(
0xFFF9F9F9
),
),
BuildStudy
(
model:
controller
.
bookDetails
,),
Container
(
height:
2
,
color:
const
Color
(
0xFFF9F9F9
),
),
Container
(
color:
Colors
.
white
,
child:
TabBar
(
labelColor:
AppTheme
.
primary
,
// isScrollable: true,
labelStyle:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
boldSemi
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
TextStyle
(
fontSize:
15
.
w
,
height:
1.4
),
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorColor:
AppTheme
.
primary
,
tabs:
controller
.
tabs
,
physics:
const
NeverScrollableScrollPhysics
(),
controller:
controller
.
tabController
,
),
Expanded
(
child:
TabBarView
(
controller:
controller
.
tabController
,
physics:
const
NeverScrollableScrollPhysics
(),
children:
[
BookCategoryPage
(
chapters:
controller
.
chapters
,
bookId:
controller
.
bookId
,
bookDetails:
controller
.
bookDetails
,
onTap:
(
ChapterModel
chapterModel
)
async
{
if
(
controller
.
bookDetails
.
isFree
==
0
&&
controller
.
bookDetails
.
isHave
==
0
&&
chapterModel
.
isReading
==
0
){
List
<
CourseModel
>
buy
=
[];
CourseModel
model
=
CourseModel
(
bookId:
controller
.
bookDetails
.
bookId
,
price:
controller
.
bookDetails
.
price
,
vipPrice:
controller
.
bookDetails
.
vipPrice
,
img:
controller
.
bookDetails
.
img
,
bookName:
controller
.
bookDetails
.
bookName
,
cartId:
0
,
status:
1
,
selected:
true
);
buy
.
add
(
model
);
),
Container
(
height:
1
.
w
,
color:
const
Color
(
0xFFF9F9F9
),
),
Container
(
height:
8
.
w
,
color:
Colors
.
transparent
,
),
Expanded
(
child:
TabBarView
(
controller:
controller
.
tabController
,
physics:
const
NeverScrollableScrollPhysics
(),
children:
[
BookCategoryPage
(
chapters:
controller
.
chapters
,
bookId:
controller
.
bookId
,
bookDetails:
controller
.
bookDetails
,
onTap:
(
ChapterModel
chapterModel
)
async
{
if
(
controller
.
bookDetails
.
isFree
==
0
&&
controller
.
bookDetails
.
isHave
==
0
&&
chapterModel
.
isReading
==
0
){
List
<
CourseModel
>
buy
=
[];
CourseModel
model
=
CourseModel
(
bookId:
controller
.
bookDetails
.
bookId
,
price:
controller
.
bookDetails
.
price
,
vipPrice:
controller
.
bookDetails
.
vipPrice
,
img:
controller
.
bookDetails
.
img
,
bookName:
controller
.
bookDetails
.
bookName
,
cartId:
0
,
status:
1
,
selected:
true
);
buy
.
add
(
model
);
final
result
=
await
context
.
pushNamed
(
Routes
.
bookPay
,
extra:
buy
);
if
(
result
==
true
)
{
controller
.
getBookDetails
();
}
}
else
{
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterModel
.
id
.
toString
(),
'chapter_name'
:
chapterModel
.
name
.
toString
(),
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
}
context
.
pushNamed
(
Routes
.
bookPay
,
extra:
buy
).
then
((
value
)
{
controller
.
getBookDetails
();
});
}
else
{
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterModel
.
id
.
toString
(),
'chapter_name'
:
chapterModel
.
name
.
toString
(),
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
}
},
}
},
),
SingleChildScrollView
(
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
,
top:
12
.
w
),
color:
Colors
.
white
,
child:
Text
(
controller
.
bookDetails
.
introduction
??
''
,
style:
const
TextStyle
(
fontSize:
15
,
height:
2.1
,
color:
Colours
.
c9
),),
),
SingleChildScrollView
(
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
,
top:
12
.
w
),
color:
Colors
.
white
,
child:
Text
(
controller
.
bookDetails
.
introduction
??
''
,
style:
const
TextStyle
(
fontSize:
15
,
height:
2.1
,
color:
Colours
.
c9
),),
),
),
InAppWebView
(
contextMenu:
ContextMenu
(
options:
ContextMenuOptions
(
hideDefaultSystemContextMenuItems:
true
),
),
InAppWebView
(
contextMenu:
ContextMenu
(
options:
ContextMenuOptions
(
hideDefaultSystemContextMenuItems:
true
),
),
onWebViewCreated:
(
InAppWebViewController
wcontroller
){
onWebViewCreated:
(
InAppWebViewController
wcontroller
){
wcontroller
.
loadData
(
data:
"""
<!DOCTYPE html>
<html lang="
zh
-
CN
">
<head>
<meta charset="
utf
-
8
" />
<meta http-equiv="
X
-
UA
-
Compatible
" content="
IE
=
edge
,
chrome
=
1
" />
<meta name="
viewport
" content="
width
=
device
-
width
,
initial
-
scale
=
1.0
,
user
-
scalable
=
no
" />
<meta http-equiv="
Cache
-
Control
" content="
no
-
transform
" />
<meta http-equiv="
Cache
-
Control
" content="
no
-
siteapp
" />
<style>
*{ margin: 0px; padding: 5px; font-size:16px}
html{ font-size: 10px;}
body{ padding:0px;color: #999}
body p{ font-size: 1.5rem; line-height:2.4rem;color: #999}
img,video,pre,code{ max-width:100%}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all}
hr{background-color: var(--w-e-textarea-border-color); border: 0; display: block; height: 1px}
table, td {border: 1px solid #ccc;border-collapse: collapse;}
ol, ol li{margin:10px}
ul, ul li{margin:10px}
</style>
</head>
<body>
${controller.bookDetails.content}
</body>
</html>
"""
,);
},
),
BookInfoPage
(
model:
controller
.
bookDetails
,)
],
),
wcontroller
.
loadData
(
data:
"""
<!DOCTYPE html>
<html lang="
zh
-
CN
">
<head>
<meta charset="
utf
-
8
" />
<meta http-equiv="
X
-
UA
-
Compatible
" content="
IE
=
edge
,
chrome
=
1
" />
<meta name="
viewport
" content="
width
=
device
-
width
,
initial
-
scale
=
1.0
,
user
-
scalable
=
no
" />
<meta http-equiv="
Cache
-
Control
" content="
no
-
transform
" />
<meta http-equiv="
Cache
-
Control
" content="
no
-
siteapp
" />
<style>
*{ margin: 0px; padding: 5px; font-size:16px}
html{ font-size: 10px;}
body{ padding:0px;color: #999}
body p{ font-size: 1.5rem; line-height:2.4rem;color: #999}
img,video,pre,code{ max-width:100%}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all}
hr{background-color: var(--w-e-textarea-border-color); border: 0; display: block; height: 1px}
table, td {border: 1px solid #ccc;border-collapse: collapse;}
ol, ol li{margin:10px}
ul, ul li{margin:10px}
</style>
</head>
<body>
${controller.bookDetails.content}
</body>
</html>
"""
,);
},
),
BookInfoPage
(
model:
controller
.
bookDetails
,)
],
),
),
],
),
bottomNavigationBar:
SafeArea
(
child:
Container
(
color:
Colors
.
white
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
,
vertical:
10
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Expanded
(
child:
GestureDetector
(
onTap:
(){
if
(
controller
.
bookDetails
.
isHave
==
1
||
controller
.
bookDetails
.
isFree
==
1
){
context
.
pushNamed
(
Routes
.
studyReport
,
queryParameters:
{
'book_id'
:
widget
.
bookId
});
}
else
{
controller
.
addCart
(
widget
.
bookId
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
35
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
17.5
.
w
),
border:
Border
.
all
(
width:
0.5
,
color:
Colours
.
c9
),
// color: Colours.cE0.withOpacity(0.5),
],
),
bottomNavigationBar:
SafeArea
(
child:
Container
(
color:
Colors
.
white
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
,
vertical:
10
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Expanded
(
child:
GestureDetector
(
onTap:
(){
if
(
controller
.
bookDetails
.
isHave
==
1
||
controller
.
bookDetails
.
isFree
==
1
){
context
.
pushNamed
(
Routes
.
studyReport
,
queryParameters:
{
'book_id'
:
widget
.
bookId
});
}
else
{
controller
.
addCart
(
widget
.
bookId
);
}
},
child:
Container
(
alignment:
Alignment
.
center
,
height:
35
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
17.5
.
w
),
border:
Border
.
all
(
width:
0.5
,
color:
Colours
.
c9
),
// padding: EdgeInsets.symmetric(vertical: 8),
child:
controller
.
bookDetails
.
isHave
==
1
||
controller
.
bookDetails
.
isFree
==
1
?
Text
(
'学习报告'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
Colours
.
c9
,
height:
1.5
),):
Text
(
'加入书架'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
AppTheme
.
primary
,
height:
1.5
),),
// color: Colours.cE0.withOpacity(0.5),
),
// padding: EdgeInsets.symmetric(vertical: 8),
child:
controller
.
bookDetails
.
isHave
==
1
||
controller
.
bookDetails
.
isFree
==
1
?
Text
(
'学习报告'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
Colours
.
c9
,
height:
1.5
),):
Text
(
'加入书架'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
AppTheme
.
primary
,
height:
1.5
),),
),
),
Gaps
.
hGaps10
,
Expanded
(
child:
GestureDetector
(
onTap:
()
async
{
),
Gaps
.
hGaps10
,
Expanded
(
child:
GestureDetector
(
onTap:
()
async
{
// 1免费 0 不免费
if
(
controller
.
bookDetails
.
isFree
==
1
){
final
String
chapterId
=
await
controller
.
getCurrentChapterId
();
final
String
chapterName
=
await
controller
.
getCurrentChapterName
();
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterId
,
'chapter_name'
:
chapterName
,
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
else
{
// 没有购买
if
(
controller
.
bookDetails
.
isHave
==
0
){
// 没有试读
if
(
controller
.
bookDetails
.
readChapterId
==
0
){
List
<
CourseModel
>
buy
=
[];
CourseModel
model
=
CourseModel
(
bookId:
controller
.
bookDetails
.
bookId
,
price:
controller
.
bookDetails
.
price
,
vipPrice:
controller
.
bookDetails
.
vipPrice
,
img:
controller
.
bookDetails
.
img
,
bookName:
controller
.
bookDetails
.
bookName
,
cartId:
0
,
status:
1
,
selected:
true
);
buy
.
add
(
model
);
context
.
pushNamed
(
Routes
.
bookPay
,
extra:
buy
).
then
((
value
){
controller
.
getBookDetails
();
});
}
else
{
final
String
chapterId
=
await
controller
.
getCurrentChapterId
();
final
String
chapterName
=
await
controller
.
getCurrentChapterName
();
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterId
,
'chapter_name'
:
chapterName
,
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
getBookDetails
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
}
else
{
// 1免费 0 不免费
if
(
controller
.
bookDetails
.
isFree
==
1
){
final
String
chapterId
=
await
controller
.
getCurrentChapterId
();
final
String
chapterName
=
await
controller
.
getCurrentChapterName
();
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterId
,
'chapter_name'
:
chapterName
,
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
...
...
@@ -221,72 +264,23 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
controller
.
getBookDetails
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
else
{
// 没有购买
if
(
controller
.
bookDetails
.
isHave
==
0
){
// 没有试读
if
(
controller
.
bookDetails
.
readChapterId
==
0
){
List
<
CourseModel
>
buy
=
[];
CourseModel
model
=
CourseModel
(
bookId:
controller
.
bookDetails
.
bookId
,
price:
controller
.
bookDetails
.
price
,
vipPrice:
controller
.
bookDetails
.
vipPrice
,
img:
controller
.
bookDetails
.
img
,
bookName:
controller
.
bookDetails
.
bookName
,
cartId:
0
,
status:
1
,
selected:
true
);
buy
.
add
(
model
);
final
result
=
await
context
.
pushNamed
(
Routes
.
bookPay
,
extra:
buy
);
if
(
result
==
true
)
{
controller
.
getBookDetails
();
}
}
else
{
final
String
chapterId
=
await
controller
.
getCurrentChapterId
();
final
String
chapterName
=
await
controller
.
getCurrentChapterName
();
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterId
,
'chapter_name'
:
chapterName
,
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
getBookDetails
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
}
else
{
final
String
chapterId
=
await
controller
.
getCurrentChapterId
();
final
String
chapterName
=
await
controller
.
getCurrentChapterName
();
final
PopBackModel
?
backModel
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
controller
.
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
chapterId
,
'chapter_name'
:
chapterName
,
'note_id'
:
'0'
},
extra:
controller
.
bookDetails
);
if
(
backModel
!.
back
==
true
){
controller
.
getChapters
();
controller
.
currentChapterId
=
int
.
parse
(
backModel
!.
chapterId
);
controller
.
getBookDetails
();
// controller.setCurrentReadChapterId(backModel!.chapterId);
}
}
}
},
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
17.5
.
w
),
color:
AppTheme
.
primary
.
withOpacity
(
0.1
)
),
height:
35
.
w
,
alignment:
Alignment
.
center
,
padding:
EdgeInsets
.
symmetric
(
vertical:
8
.
w
),
child:
Text
(
'阅读'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
AppTheme
.
primary
,
height:
1.5
,
fontWeight:
Fonts
.
boldSemi
),),
}
},
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
17.5
.
w
),
color:
AppTheme
.
primary
.
withOpacity
(
0.1
)
),
height:
35
.
w
,
alignment:
Alignment
.
center
,
padding:
EdgeInsets
.
symmetric
(
vertical:
8
.
w
),
child:
Text
(
'阅读'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
AppTheme
.
primary
,
height:
1.5
,
fontWeight:
Fonts
.
boldSemi
),),
),
)
],
)
,
)
,
)
]
,
),
),
),
...
...
lib/pages/book_pay/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -15,69 +15,29 @@ class _BookPayPageState extends State<BookPayPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
BookPayController
>(
init:
BookPayController
(
buy:
widget
.
buy
,
context:
context
),
builder:
(
controller
)
=>
Stack
(
children:
[
Scaffold
(
backgroundColor:
Colours
.
cF9
,
appBar:
AppBar
(
title:
const
Text
(
'支付'
),),
body:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
buy
![
index
],);
},
itemCount:
controller
.
buy
!.
length
,
),
controller
.
showModel
.
couponSwitch
==
'0'
&&
controller
.
showModel
.
integralSwitch
==
'0'
?
const
SizedBox
():
SizedBox
(
height:
10
.
w
,),
Visibility
(
visible:
controller
.
showModel
.
couponSwitch
==
'0'
&&
controller
.
showModel
.
integralSwitch
==
'0'
?
false
:
true
,
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
spreadRadius:
2
.
w
,
blurRadius:
5
.
w
,
offset:
Offset
(
3
.
w
,
0
),
// changes the position of the shadow
),
]
),
child:
Column
(
children:
[
controller
.
showModel
.
couponSwitch
==
'0'
?
const
SizedBox
():
GestureDetector
(
child:
_buildCouponWidget
(
controller
,
title:
'优惠券'
,
icon:
'assets/images/pay_coupon.png'
,),
onTap:
(){
context
.
pushNamed
(
Routes
.
payCoupon
,
extra:
controller
);
},
),
Container
(
height:
0.5
.
w
,
color:
Colours
.
cF0
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
),),
controller
.
showModel
.
integralSwitch
==
'0'
?
const
SizedBox
():
GestureDetector
(
child:
_buildPointWidget
(
controller
,
title:
'积分抵扣'
,
icon:
'assets/images/pay_point.png'
,),
onTap:
(){
if
(
controller
.
creditPointModel
.
deductibleIntegral
!=
0
){
context
.
pushNamed
(
Routes
.
creditPoints
);
}
},
),
],
),
),
),
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
10
.
w
),
return
GetBuilder
<
BookPayController
>(
init:
BookPayController
(
buy:
widget
.
buy
,
context:
context
),
builder:
(
controller
)
=>
Stack
(
children:
[
Scaffold
(
backgroundColor:
Colours
.
cF9
,
appBar:
AppBar
(
title:
const
Text
(
'支付'
),),
body:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
buy
![
index
],);
},
itemCount:
controller
.
buy
!.
length
,
),
controller
.
showModel
.
couponSwitch
==
'0'
&&
controller
.
showModel
.
integralSwitch
==
'0'
?
const
SizedBox
():
SizedBox
(
height:
10
.
w
,),
Visibility
(
visible:
controller
.
showModel
.
couponSwitch
==
'0'
&&
controller
.
showModel
.
integralSwitch
==
'0'
?
false
:
true
,
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
...
...
@@ -86,71 +46,105 @@ class _BookPayPageState extends State<BookPayPage> {
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
spreadRadius:
2
.
w
,
blurRadius:
5
.
w
,
offset:
const
Offset
(
3
,
0
),
// changes the position of the shadow
offset:
Offset
(
3
.
w
,
0
),
// changes the position of the shadow
),
]
),
child:
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
PayModel
model
=
controller
.
pays
[
index
];
return
GestureDetector
(
onTap:
(){
controller
.
setPayModel
(
model
);
},
child:
BuildPayWay
(
model:
model
,
controller:
controller
,));
},
itemCount:
controller
.
pays
.
length
,
child:
Column
(
children:
[
controller
.
showModel
.
couponSwitch
==
'0'
?
const
SizedBox
():
GestureDetector
(
child:
_buildCouponWidget
(
controller
,
title:
'优惠券'
,
icon:
'assets/images/pay_coupon.png'
,),
onTap:
(){
context
.
pushNamed
(
Routes
.
payCoupon
,
extra:
controller
);
},
),
Container
(
height:
0.5
.
w
,
color:
Colours
.
cF0
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
),),
controller
.
showModel
.
integralSwitch
==
'0'
?
const
SizedBox
():
GestureDetector
(
child:
_buildPointWidget
(
controller
,
title:
'积分抵扣'
,
icon:
'assets/images/pay_point.png'
,),
onTap:
(){
if
(
controller
.
creditPointModel
.
deductibleIntegral
!=
0
){
context
.
pushNamed
(
Routes
.
creditPoints
);
}
},
),
],
),
),
],
),
),
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
spreadRadius:
2
.
w
,
blurRadius:
5
.
w
,
offset:
const
Offset
(
3
,
0
),
// changes the position of the shadow
),
]
),
child:
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
PayModel
model
=
controller
.
pays
[
index
];
return
GestureDetector
(
onTap:
(){
controller
.
setPayModel
(
model
);
},
child:
BuildPayWay
(
model:
model
,
controller:
controller
,));
},
itemCount:
controller
.
pays
.
length
,
),
),
],
),
bottomNavigationBar:
SafeArea
(
bottom:
false
,
child:
BuildPayCount
(
payTap:
(){
Console
.
log
(
'--------------支付------------------'
);
controller
.
createOrder
();
},
showTap:
(){
controller
.
show
();
Console
.
log
(
'--------------展示优惠详情------------------'
);
},
controller:
controller
,
)),
),
controller
.
showDetail
?
Positioned
(
left:
0
.
w
,
bottom:
50
.
w
,
right:
0
.
w
,
top:
0
.
w
,
child:
SafeArea
(
child:
GestureDetector
(
onTap:
(){
controller
.
show
();
bottomNavigationBar:
SafeArea
(
bottom:
false
,
child:
BuildPayCount
(
payTap:
(){
Console
.
log
(
'--------------支付------------------'
);
controller
.
createOrder
();
},
child:
Container
(
color:
const
Color
(
0xFF000000
).
withOpacity
(
0.5
),
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
8
.
w
),
topLeft:
Radius
.
circular
(
8
.
w
)),
child:
Container
(
height:
210
.
w
,
color:
Colors
.
white
,
child:
_buildPayDetail
(
controller
),
),
showTap:
(){
controller
.
show
();
Console
.
log
(
'--------------展示优惠详情------------------'
);
},
controller:
controller
,
)),
),
controller
.
showDetail
?
Positioned
(
left:
0
.
w
,
bottom:
50
.
w
,
right:
0
.
w
,
top:
0
.
w
,
child:
SafeArea
(
child:
GestureDetector
(
onTap:
(){
controller
.
show
();
},
child:
Container
(
color:
const
Color
(
0xFF000000
).
withOpacity
(
0.5
),
child:
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
only
(
topRight:
Radius
.
circular
(
8
.
w
),
topLeft:
Radius
.
circular
(
8
.
w
)),
child:
Container
(
height:
210
.
w
,
color:
Colors
.
white
,
child:
_buildPayDetail
(
controller
),
),
),
),
),
),
)
:
const
SizedBox
()
],
)
)
,
)
,
):
const
SizedBox
()
],
)
);
}
...
...
lib/pages/book_shop/widgets/count.dart
浏览文件 @
a9a48cfe
...
...
@@ -52,10 +52,9 @@ class BuildCounter extends StatelessWidget {
GestureDetector
(
onTap:
()
async
{
if
(
controller
.
num
>
0
){
final
result
=
await
context
.
pushNamed
(
Routes
.
bookPay
,
extra:
controller
.
buy
);
if
(
result
==
true
)
{
context
.
pushNamed
(
Routes
.
bookPay
,
extra:
controller
.
buy
).
then
((
value
){
controller
.
onRefresh
();
}
}
);
}
},
child:
Container
(
...
...
lib/pages/course/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -38,10 +38,9 @@ class _CoursePageState extends State<CoursePage> {
),
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
msgs
);
if
(
result
==
true
)
{
context
.
pushNamed
(
Routes
.
msgs
).
then
((
value
){
controller
.
getNums
();
}
}
);
},
child:
badges
.
Badge
(
position:
badges
.
BadgePosition
.
topEnd
(
top:
-
5
.
w
,
end:
0
),
...
...
@@ -112,10 +111,9 @@ class _CoursePageState extends State<CoursePage> {
onTapContinue:
()
async
{
BookDetailModel
bookDetails
=
await
controller
.
getBookDetails
(
model
.
bookId
.
toString
());
if
(
context
.
mounted
){
final
result
=
await
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
bookDetails
.
chapterId
.
toString
(),
'chapter_name'
:
bookDetails
.
chapterName
.
toString
()},
extra:
bookDetails
);
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
web
,
queryParameters:
{
'book_id'
:
bookDetails
.
bookId
.
toString
(),
'chapter_id'
:
bookDetails
.
chapterId
.
toString
(),
'chapter_name'
:
bookDetails
.
chapterName
.
toString
()},
extra:
bookDetails
).
then
((
value
){
controller
.
getNums
();
}
}
);
}
},
),
...
...
lib/pages/credit_points/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -7,148 +7,142 @@ class CreditPointsPage extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
'111111'
);
return
false
;
},
child:
GetBuilder
<
BookPayController
>(
init:
BookPayController
(
buy:
[],
context:
context
),
builder:
(
controller
)=>
Scaffold
(
extendBodyBehindAppBar:
true
,
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'积分'
),
backgroundColor:
Colors
.
transparent
,
),
body:
Stack
(
children:
[
Image
.
asset
(
'assets/images/point_bg.png'
,
fit:
BoxFit
.
contain
,
width:
double
.
infinity
,
),
SafeArea
(
top:
true
,
child:
Column
(
children:
[
// 积分卡片
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
17
.
w
,
top:
18
.
w
,
bottom:
24
.
w
,
right:
17
.
w
),
decoration:
BoxDecoration
(
color:
Colors
.
white
.
withOpacity
(
0.58
),
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
border:
Border
.
all
(
width:
2
.
w
,
color:
Colors
.
white
)
),
height:
175
.
w
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'可用积分'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Gaps
.
vGaps13
,
Text
(
controller
.
creditPointModel
.
integral
.
toString
(),
style:
TextStyle
(
fontSize:
25
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
],
),
Row
(
children:
[
Expanded
(
child:
Container
(
height:
0.5
.
w
,
color:
Colours
.
cE7
,
),
),
Gaps
.
hGaps15
,
Text
(
'积分支付不能超过每笔订单的
${controller.creditPointModel.integralUseLimit}
%'
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.4
,
color:
Colours
.
c9
),),
Gaps
.
hGaps15
,
Expanded
(
child:
Container
(
height:
0.5
.
w
,
color:
Colours
.
cE7
,
),
),
],
)
],
),
),
),
// 使用积分
Container
(
// height: 105,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
padding:
EdgeInsets
.
only
(
left:
20
.
w
,
right:
20
.
w
,
top:
20
.
w
),
return
GetBuilder
<
BookPayController
>(
init:
BookPayController
(
buy:
[],
context:
context
),
builder:
(
controller
)=>
Scaffold
(
extendBodyBehindAppBar:
true
,
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'积分'
),
backgroundColor:
Colors
.
transparent
,
),
body:
Stack
(
children:
[
Image
.
asset
(
'assets/images/point_bg.png'
,
fit:
BoxFit
.
contain
,
width:
double
.
infinity
,
),
SafeArea
(
top:
true
,
child:
Column
(
children:
[
// 积分卡片
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
17
.
w
,
top:
18
.
w
,
bottom:
24
.
w
,
right:
17
.
w
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
.
w
),
blurRadius:
4
.
w
,
spreadRadius:
0
,
),
],
borderRadius:
BorderRadius
.
circular
(
8
.
w
)
color:
Colors
.
white
.
withOpacity
(
0.58
),
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
border:
Border
.
all
(
width:
2
.
w
,
color:
Colors
.
white
)
),
height:
175
.
w
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'积分抵扣'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Gaps
.
vGaps10
,
Container
(
height:
0.5
.
w
,
color:
Colours
.
cE7
,
// color: Colors.red,
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'可用积分'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Gaps
.
vGaps13
,
Text
(
controller
.
creditPointModel
.
integral
.
toString
(),
style:
TextStyle
(
fontSize:
25
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
],
),
Visibility
(
visible:
controller
.
creditPointModel
.
deductibleIntegral
==
0
?
false
:
true
,
child:
GestureDetector
(
onTap:
(){
controller
.
setUse
();
if
(
controller
.
useCreditPoint
)
{
context
.
pop
();
}
},
child:
Container
(
color:
Colors
.
white
,
height:
54
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
'抵扣'
,
style:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
13
.
w
,
height:
1.4
)),
TextSpan
(
text:
'¥
${controller.creditPointModel.deductibleAmount}
'
,
style:
TextStyle
(
color:
AppTheme
.
primary
,
fontSize:
13
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
)),
TextSpan
(
text:
'使用
${controller.creditPointModel.deductibleIntegral}
积分'
,
style:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
13
.
w
,
height:
1.4
)),
]
)),
SizedBox
(
width:
15
.
w
,
height:
15
.
w
,
child:
Image
.
asset
(
controller
.
useCreditPoint
?
'assets/images/check.png'
:
'assets/images/uncheck.png'
,
),
)
],
Row
(
children:
[
Expanded
(
child:
Container
(
height:
0.5
.
w
,
color:
Colours
.
cE7
,
),
),
),
Gaps
.
hGaps15
,
Text
(
'积分支付不能超过每笔订单的
${controller.creditPointModel.integralUseLimit}
%'
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.4
,
color:
Colours
.
c9
),),
Gaps
.
hGaps15
,
Expanded
(
child:
Container
(
height:
0.5
.
w
,
color:
Colours
.
cE7
,
),
),
],
)
],
),
)
],
),
),
),
// 使用积分
Container
(
// height: 105,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
padding:
EdgeInsets
.
only
(
left:
20
.
w
,
right:
20
.
w
,
top:
20
.
w
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
.
w
),
blurRadius:
4
.
w
,
spreadRadius:
0
,
),
],
borderRadius:
BorderRadius
.
circular
(
8
.
w
)
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'积分抵扣'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
),),
Gaps
.
vGaps10
,
Container
(
height:
0.5
.
w
,
color:
Colours
.
cE7
,
// color: Colors.red,
),
Visibility
(
visible:
controller
.
creditPointModel
.
deductibleIntegral
==
0
?
false
:
true
,
child:
GestureDetector
(
onTap:
(){
controller
.
setUse
();
if
(
controller
.
useCreditPoint
)
{
context
.
pop
();
}
},
child:
Container
(
color:
Colors
.
white
,
height:
54
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
RichText
(
text:
TextSpan
(
children:
[
TextSpan
(
text:
'抵扣'
,
style:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
13
.
w
,
height:
1.4
)),
TextSpan
(
text:
'¥
${controller.creditPointModel.deductibleAmount}
'
,
style:
TextStyle
(
color:
AppTheme
.
primary
,
fontSize:
13
.
w
,
height:
1.4
,
fontWeight:
Fonts
.
medium
)),
TextSpan
(
text:
'使用
${controller.creditPointModel.deductibleIntegral}
积分'
,
style:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
13
.
w
,
height:
1.4
)),
]
)),
SizedBox
(
width:
15
.
w
,
height:
15
.
w
,
child:
Image
.
asset
(
controller
.
useCreditPoint
?
'assets/images/check.png'
:
'assets/images/uncheck.png'
,
),
)
],
),
),
),
)
],
),
)
],
),
]
,
)
)
,
),
);
)
,
],
)
),
);
}
}
lib/pages/mine/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -43,11 +43,9 @@ class _MinePageState extends State<MinePage> {
),
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
msgs
);
print
(
'---------------------------------1111
$result
'
);
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
msgs
).
then
((
value
)
{
controller
.
getNums
();
}
}
);
},
child:
badges
.
Badge
(
position:
badges
.
BadgePosition
.
topEnd
(
top:
-
5
.
w
,
end:
0
),
...
...
@@ -78,20 +76,18 @@ class _MinePageState extends State<MinePage> {
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
child:
BuildUser
(
userInfo:
controller
.
userInfo
,
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
userInfo
,
extra:
controller
.
userInfo
);
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
userInfo
,
extra:
controller
.
userInfo
).
then
((
value
){
controller
.
getInfo
();
}
}
);
},),
),
Gaps
.
vGaps10
,
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
2.2
.
w
),
child:
BuildRead
(
items:
controller
.
reads
,
onTap:
(
ReadModel
model
)
async
{
final
result
=
await
context
.
pushNamed
(
model
.
link
??
''
);
if
(
result
==
true
){
context
.
pushNamed
(
model
.
link
??
''
).
then
((
value
){
controller
.
getInfo
();
}
}
);
}),
),
controller
.
ads
.
isNotEmpty
?
Gaps
.
vGaps5
:
const
SizedBox
(),
...
...
@@ -108,10 +104,9 @@ class _MinePageState extends State<MinePage> {
):
const
SizedBox
(),
Gaps
.
vGaps15
,
BuildAccount
(
items:
controller
.
accounts
,
onTap:
(
ReadModel
model
)
async
{
final
result
=
await
context
.
pushNamed
(
model
.
link
??
''
);
if
(
result
==
true
){
context
.
pushNamed
(
model
.
link
??
''
).
then
((
value
){
controller
.
getInfo
();
}
}
);
},),
Gaps
.
vGaps10
,
Container
(
...
...
@@ -134,10 +129,9 @@ class _MinePageState extends State<MinePage> {
children:
[
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
security
,
extra:
controller
.
userInfo
);
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
security
,
extra:
controller
.
userInfo
).
then
((
value
){
controller
.
getInfo
();
}
}
);
},
child:
_buildItem
(
'账户安全'
)
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
height:
1
.
w
,),
...
...
lib/pages/user_coin/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -10,70 +10,64 @@ class UserCoinPage extends StatefulWidget {
class
_UserCoinPageState
extends
State
<
UserCoinPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserCoinController
>(
init:
UserCoinController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'紫荆币'
),
actions:
[
GestureDetector
(
onTap:
(){
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
const
CoinRechargePage
();
},
).
then
((
value
)
{
controller
.
onRefresh
();
});
},
child:
Text
(
'充值'
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontSize:
14
.
w
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),)
)
],
),
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
coins
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
Container
(
margin:
EdgeInsets
.
all
(
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
return
GetBuilder
<
UserCoinController
>(
init:
UserCoinController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'紫荆币'
),
actions:
[
GestureDetector
(
onTap:
(){
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
],
),
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildCell
(
model:
controller
.
coins
[
index
],);
},
itemCount:
controller
.
coins
.
length
,
),
builder:
(
BuildContext
context
)
{
return
const
CoinRechargePage
();
},
).
then
((
value
)
{
controller
.
onRefresh
();
});
},
child:
Text
(
'充值'
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontSize:
14
.
w
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),)
)
],
),
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
coins
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
Container
(
margin:
EdgeInsets
.
all
(
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildCell
(
model:
controller
.
coins
[
index
],);
},
itemCount:
controller
.
coins
.
length
,
),
),
),
...
...
lib/pages/user_coupon/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -11,56 +11,50 @@ class UserCouponPage extends StatefulWidget {
class
_UserCouponPageState
extends
State
<
UserCouponPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserCouponController
>(
init:
UserCouponController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'优惠券'
),
),
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
coupons
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
coupons
[
index
],);
// if (index == controller.coupons.length){
// return GestureDetector(
// onTap: (){
// // controller.getOverCoupons();
// },
// child: Container(
// alignment: Alignment.center,
// height: 40.w,
// // color: Colors.cyan,
// child: Text('过期优惠券'),
// ),
// );
// }
// else {
// return BuildItem(model: controller.coupons[index],);
// }
},
// itemCount: controller.coupons.length +1,
itemCount:
controller
.
coupons
.
length
,
return
GetBuilder
<
UserCouponController
>(
init:
UserCouponController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'优惠券'
),
),
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
coupons
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
coupons
[
index
],);
// if (index == controller.coupons.length){
// return GestureDetector(
// onTap: (){
// // controller.getOverCoupons();
// },
// child: Container(
// alignment: Alignment.center,
// height: 40.w,
// // color: Colors.cyan,
// child: Text('过期优惠券'),
// ),
// );
// }
// else {
// return BuildItem(model: controller.coupons[index],);
// }
},
// itemCount: controller.coupons.length +1,
itemCount:
controller
.
coupons
.
length
,
),
),
),
...
...
lib/pages/user_discuss/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -10,45 +10,39 @@ class UserDiscussPage extends StatefulWidget {
class
_UserDiscussPageState
extends
State
<
UserDiscussPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserDiscussController
>(
init:
UserDiscussController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'讨论'
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
left:
22.5
.
w
,
top:
16
.
w
),
child:
Text
(
'共
${controller.discuss.length}
本书'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c6
,
fontWeight:
Fonts
.
medium
),)
),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
discussDes
,
extra:
controller
.
discuss
[
index
]);
},
child:
BuildItem
(
model:
controller
.
discuss
[
index
],
index:
index
,
num
:
controller
.
discuss
.
length
,)
);
},
itemCount:
controller
.
discuss
.
length
,
)
),
return
GetBuilder
<
UserDiscussController
>(
init:
UserDiscussController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'讨论'
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
left:
22.5
.
w
,
top:
16
.
w
),
child:
Text
(
'共
${controller.discuss.length}
本书'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c6
,
fontWeight:
Fonts
.
medium
),)
),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
discussDes
,
extra:
controller
.
discuss
[
index
]);
},
child:
BuildItem
(
model:
controller
.
discuss
[
index
],
index:
index
,
num
:
controller
.
discuss
.
length
,)
);
},
itemCount:
controller
.
discuss
.
length
,
)
),
]
,
)
,
)
,
]
,
),
),
);
...
...
lib/pages/user_gender/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -20,200 +20,194 @@ class _UserGenderPageState extends State<UserGenderPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserGenderController
>(
init:
UserGenderController
(
widget
.
userInfo
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'设置性别'
),
actions:
[],
return
GetBuilder
<
UserGenderController
>(
init:
UserGenderController
(
widget
.
userInfo
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'设置性别'
),
actions:
[],
),
body:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
body:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
/// 男
GestureDetector
(
onTap:
()
{
// print("点击了男");
setState
(()
{
controller
.
_changeInfo
(
1
);
selectedGender
=
1
;
});
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
transparent
,
height:
35
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"男"
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
/// 男
GestureDetector
(
onTap:
()
{
// print("点击了男");
setState
(()
{
controller
.
_changeInfo
(
1
);
selectedGender
=
1
;
});
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
transparent
,
height:
35
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"男"
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
),
Visibility
(
visible:
selectedGender
==
1
,
// child: Image.asset('assets/images/check.png'))
child:
Image
(
image:
const
AssetImage
(
"assets/images/check.png"
),
height:
15
.
w
,
width
:
15
.
w
,
))
,
]
,
)
,
),
Visibility
(
visible:
selectedGender
==
1
,
// child: Image.asset('assets/images/check.png'))
child:
Image
(
image:
const
AssetImage
(
"assets/images/check.png"
)
,
height
:
15
.
w
,
width:
15
.
w
,
))
,
]
,
),
/* Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildItem(
'男',
),
Padding(
padding: const EdgeInsets.only(right: 18),
child: Visibility(
visible: selectedGender == 1,
child: Image.asset('assets/images/check.png'))),
],
)*/
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
1
.
w
,
),
GestureDetector
(
onTap:
()
{
setState
(()
{
controller
.
_changeInfo
(
2
);
selectedGender
=
2
;
});
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
transparent
,
height:
35
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"女"
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
),
/* Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildItem(
'男',
),
Padding(
padding: const EdgeInsets.only(right: 18),
child: Visibility(
visible: selectedGender == 1,
child: Image.asset('assets/images/check.png'))),
],
)*/
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
1
.
w
,
),
GestureDetector
(
onTap:
()
{
setState
(()
{
controller
.
_changeInfo
(
2
);
selectedGender
=
2
;
});
},
child:
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
transparent
,
height:
35
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"女"
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
),
Visibility
(
visible:
selectedGender
==
2
,
child:
Image
(
image:
const
AssetImage
(
"assets/images/check.png"
),
height:
15
.
w
,
width
:
15
.
w
,
))
],
)
,
),
Visibility
(
visible:
selectedGender
==
2
,
child:
Image
(
image:
const
AssetImage
(
"assets/images/check.png"
)
,
height
:
15
.
w
,
width:
15
.
w
,
))
]
,
),
/*Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildItem(
'女',
),
Padding(
padding: const EdgeInsets.only(right: 18),
child: Visibility(
visible: selectedGender == 2,
child: Image.asset('assets/images/check.png'))),
],
)*/
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
1
,
),
GestureDetector
(
onTap:
()
{
setState
(()
{
controller
.
_changeInfo
(
3
);
selectedGender
=
3
;
});
},
child:
/*Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildItem(
'保密',
),
Padding(
padding: const EdgeInsets.only(right: 18),
child: Visibility(
visible: selectedGender == 3,
child: Image.asset('assets/images/check.png'))),
],
)*/
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
transparent
,
height:
35
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"保密"
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
),
/*Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildItem(
'女',
),
Padding(
padding: const EdgeInsets.only(right: 18),
child: Visibility(
visible: selectedGender == 2,
child: Image.asset('assets/images/check.png'))),
],
)*/
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
1
,
),
GestureDetector
(
onTap:
()
{
setState
(()
{
controller
.
_changeInfo
(
3
);
selectedGender
=
3
;
});
},
child:
/*Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
_buildItem(
'保密',
),
Padding(
padding: const EdgeInsets.only(right: 18),
child: Visibility(
visible: selectedGender == 3,
child: Image.asset('assets/images/check.png'))),
],
)*/
Container
(
padding:
EdgeInsets
.
only
(
left:
15
.
w
,
right:
15
.
w
),
color:
Colors
.
transparent
,
height:
35
.
w
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"保密"
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
),
Visibility
(
visible:
selectedGender
==
3
,
child:
Image
(
image:
const
AssetImage
(
"assets/images/check.png"
),
height:
15
.
w
,
width
:
15
.
w
,
))
],
)
,
),
Visibility
(
visible:
selectedGender
==
3
,
child:
Image
(
image:
const
AssetImage
(
"assets/images/check.png"
)
,
height
:
15
.
w
,
width:
15
.
w
,
))
]
,
),
),
]
,
)
,
)
,
]
,
),
)
)
),
)
,
))
);
}
...
...
lib/pages/user_love/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -10,54 +10,48 @@ class UserLovePage extends StatefulWidget {
class
_UserLovePageState
extends
State
<
UserLovePage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserLoveController
>(
init:
UserLoveController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'我的收藏'
),
),
body:
Container
(
color:
Colours
.
cF9
,
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
loves
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
CourseModel
model
=
controller
.
loves
[
index
];
return
GestureDetector
(
onTap:
(){
if
(
model
.
status
==
0
&&
model
.
isHave
==
0
){
Toast
.
show
(
'书籍已下架'
);
}
else
{
context
.
pushNamed
(
Routes
.
bookDetail
,
queryParameters:
{
'book_id'
:
model
.
bookId
.
toString
()});
}
},
child:
BuildItem
(
model:
model
,
onTap:
(){
controller
.
unLoved
(
bookId:
model
.
bookId
.
toString
());
},),
);
},
itemCount:
controller
.
loves
.
length
,
return
GetBuilder
<
UserLoveController
>(
init:
UserLoveController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'我的收藏'
),
),
body:
Container
(
color:
Colours
.
cF9
,
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
loves
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
CourseModel
model
=
controller
.
loves
[
index
];
return
GestureDetector
(
onTap:
(){
if
(
model
.
status
==
0
&&
model
.
isHave
==
0
){
Toast
.
show
(
'书籍已下架'
);
}
else
{
context
.
pushNamed
(
Routes
.
bookDetail
,
queryParameters:
{
'book_id'
:
model
.
bookId
.
toString
()});
}
},
child:
BuildItem
(
model:
model
,
onTap:
(){
controller
.
unLoved
(
bookId:
model
.
bookId
.
toString
());
},),
);
},
itemCount:
controller
.
loves
.
length
,
),
),
),
...
...
lib/pages/user_msg/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -7,162 +7,127 @@ class MsgPage extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
MsgController
>(
init:
MsgController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'消息中心'
),
centerTitle:
true
,
),
body:
Container
(
color:
Colours
.
cF9
,
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
msgs
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
MsgModel
model
=
controller
.
msgs
[
index
];
return
GestureDetector
(
child:
BuildItem
(
model:
model
,),
onTap:
()
async
{
controller
.
read
(
model
);
if
(
model
.
type
==
1
){
// final result = await context.pushNamed(Routes.order);
// if (result == true){
// controller.onRefresh();
// }
final
orderInfo
=
await
controller
.
getOrderInfo
(
model
.
urlId
?.
orderNum
??
''
);
// 待支付
if
(
orderInfo
.
status
==
1
){
// 书籍订单
if
(
orderInfo
.
types
==
1
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
// 充值订单
else
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
return
GetBuilder
<
MsgController
>(
init:
MsgController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'消息中心'
),
centerTitle:
true
,
),
body:
Container
(
color:
Colours
.
cF9
,
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
msgs
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
MsgModel
model
=
controller
.
msgs
[
index
];
return
GestureDetector
(
child:
BuildItem
(
model:
model
,),
onTap:
()
async
{
controller
.
read
(
model
);
if
(
model
.
type
==
1
){
// final result = await context.pushNamed(Routes.order);
// if (result == true){
// controller.onRefresh();
// }
final
orderInfo
=
await
controller
.
getOrderInfo
(
model
.
urlId
?.
orderNum
??
''
);
// 待支付
if
(
orderInfo
.
status
==
1
){
// 书籍订单
if
(
orderInfo
.
types
==
1
){
context
.
pushNamed
(
Routes
.
orderAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
}
// 已取消
else
if
(
orderInfo
.
status
==
2
){
if
(
orderInfo
.
types
==
1
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCancel
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
else
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinCancel
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
// 充值订单
else
{
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
}
// 已完成
else
if
(
orderInfo
.
status
==
3
){
if
(
orderInfo
.
types
==
1
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCompleted
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
else
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinCompleted
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
}
// 已取消
else
if
(
orderInfo
.
status
==
2
){
if
(
orderInfo
.
types
==
1
){
context
.
pushNamed
(
Routes
.
orderCancel
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
}
// 已退款
else
if
(
orderInfo
.
status
==
4
){
if
(
orderInfo
.
types
==
1
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderRefunded
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
if
(
result
==
true
){
// controller.onRefresh();
}
}
else
{
context
.
pushNamed
(
Routes
.
orderCoinCancel
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
}
///TODO:
}
else
if
(
model
.
type
==
2
){
// 2 购买完成三天未评价(跳转订单列表--已完成)
final
orderInfo
=
await
controller
.
getOrderInfo
(
model
.
urlId
?.
orderNum
??
''
);
final
result
=
await
context
.
pushNamed
(
Routes
.
orderEvaluate
,
extra:
orderInfo
,
queryParameters:
{
'orderNum'
:
orderInfo
.
ordersnum
});
// final result = await context.pushNamed(Routes.order);
// if (result == true){
// // controller.onRefresh();
// }
///TODO:
}
else
if
(
model
.
type
==
3
){
// 3 讨论有人回复的时候 (跳转我的讨论详情也)
String
bookId
=
model
.
urlId
?.
bookId
.
toString
()??
''
;
BookDetailModel
bookDetails
=
await
LibraryAPI
.
details
(
bookId:
bookId
);
CourseModel
courseModel
=
CourseModel
(
img:
bookDetails
.
img
,
bookId:
bookDetails
.
bookId
,
bookName:
bookDetails
.
bookName
,
commentNum:
bookDetails
.
commentNum
);
context
.
pushNamed
(
Routes
.
discussDes
,
extra:
courseModel
);
}
else
if
(
model
.
type
==
4
){
// 4 订单完成后有新的积分增加(跳转用户积分记录页)
final
result
=
await
context
.
pushNamed
(
Routes
.
point
);
if
(
result
==
true
){
// controller.onRefresh(
);
// 已完成
else
if
(
orderInfo
.
status
==
3
){
if
(
orderInfo
.
types
==
1
){
context
.
pushNamed
(
Routes
.
orderCompleted
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()}
);
}
}
else
if
(
model
.
type
==
5
){
// 5后台直接发放给指定用户优惠券(跳转到用户优惠券页)
final
result
=
await
context
.
pushNamed
(
Routes
.
coupon
);
if
(
result
==
true
){
// controller.onRefresh();
else
{
context
.
pushNamed
(
Routes
.
orderCoinCompleted
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
}
}
// 已退款
else
if
(
orderInfo
.
status
==
4
){
if
(
orderInfo
.
types
==
1
){
context
.
pushNamed
(
Routes
.
orderRefunded
,
queryParameters:
{
'orderNum'
:
model
.
urlId
?.
orderNum
.
toString
()});
}
}
},
);
},
itemCount:
controller
.
msgs
.
length
,
),
///TODO:
}
else
if
(
model
.
type
==
2
){
// 2 购买完成三天未评价(跳转订单列表--已完成)
final
orderInfo
=
await
controller
.
getOrderInfo
(
model
.
urlId
?.
orderNum
??
''
);
context
.
pushNamed
(
Routes
.
orderEvaluate
,
extra:
orderInfo
,
queryParameters:
{
'orderNum'
:
orderInfo
.
ordersnum
});
///TODO:
}
else
if
(
model
.
type
==
3
){
// 3 讨论有人回复的时候 (跳转我的讨论详情也)
String
bookId
=
model
.
urlId
?.
bookId
.
toString
()??
''
;
BookDetailModel
bookDetails
=
await
LibraryAPI
.
details
(
bookId:
bookId
);
CourseModel
courseModel
=
CourseModel
(
img:
bookDetails
.
img
,
bookId:
bookDetails
.
bookId
,
bookName:
bookDetails
.
bookName
,
commentNum:
bookDetails
.
commentNum
);
context
.
pushNamed
(
Routes
.
discussDes
,
extra:
courseModel
);
}
else
if
(
model
.
type
==
4
){
// 4 订单完成后有新的积分增加(跳转用户积分记录页)
context
.
pushNamed
(
Routes
.
point
);
}
else
if
(
model
.
type
==
5
){
// 5后台直接发放给指定用户优惠券(跳转到用户优惠券页)
context
.
pushNamed
(
Routes
.
coupon
);
}
},
);
},
itemCount:
controller
.
msgs
.
length
,
),
),
),
...
...
lib/pages/user_notes/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -10,50 +10,44 @@ class UserNotePage extends StatefulWidget {
class
_UserNotePageState
extends
State
<
UserNotePage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserNoteController
>(
init:
UserNoteController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'笔记'
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
left:
22.5
.
w
,
top:
16
.
w
),
child:
Text
(
'共
${controller.notes.length}
本书'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c6
,
fontWeight:
Fonts
.
medium
),)
),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
// physics: const NeverScrollableScrollPhysics(),
// shrinkWrap: true,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
noteDes
,
extra:
controller
.
notes
[
index
]);
if
(
result
==
true
){
controller
.
onRefresh
;
}
},
child:
BuildItem
(
model:
controller
.
notes
[
index
],)
);
},
itemCount:
controller
.
notes
.
length
,
)
),
return
GetBuilder
<
UserNoteController
>(
init:
UserNoteController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'笔记'
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
left:
22.5
.
w
,
top:
16
.
w
),
child:
Text
(
'共
${controller.notes.length}
本书'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c6
,
fontWeight:
Fonts
.
medium
),)
),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
// physics: const NeverScrollableScrollPhysics(),
// shrinkWrap: true,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
noteDes
,
extra:
controller
.
notes
[
index
]);
if
(
result
==
true
){
controller
.
onRefresh
;
}
},
child:
BuildItem
(
model:
controller
.
notes
[
index
],)
);
},
itemCount:
controller
.
notes
.
length
,
)
),
]
,
)
,
)
,
]
,
),
),
);
...
...
lib/pages/user_notes_des/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -22,57 +22,51 @@ class _UserNotesDesPageState extends State<UserNotesDesPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'笔记详情'
),
),
body:
DefaultTabController
(
length:
tabs
.
length
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
BuildItem
(
model:
widget
.
model
),
ClipRRect
(
borderRadius:
const
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
5
),
topRight:
Radius
.
circular
(
5
)),
child:
Container
(
width:
double
.
infinity
,
color:
Colors
.
white
,
height:
35
.
w
,
child:
TabBar
(
indicator:
UnderlineTabIndicator
(
borderRadius:
BorderRadius
.
circular
(
0.75
),
borderSide:
BorderSide
(
width:
1.5
.
w
,
color:
AppTheme
.
primary
),
insets:
EdgeInsets
.
symmetric
(
horizontal:
22
.
w
),
// 设置标签下面指示器的水平内边距
),
labelPadding:
EdgeInsets
.
symmetric
(
horizontal:
20
.
w
),
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorColor:
AppTheme
.
primary
,
indicatorWeight:
1.5
,
labelStyle:
TextStyle
(
color:
AppTheme
.
primary
,
fontSize:
15
.
w
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
15
.
w
,
height:
1.5
),
isScrollable:
true
,
tabs:
tabs
),
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'笔记详情'
),
),
body:
DefaultTabController
(
length:
tabs
.
length
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
BuildItem
(
model:
widget
.
model
),
ClipRRect
(
borderRadius:
const
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
5
),
topRight:
Radius
.
circular
(
5
)),
child:
Container
(
width:
double
.
infinity
,
color:
Colors
.
white
,
height:
35
.
w
,
child:
TabBar
(
indicator:
UnderlineTabIndicator
(
borderRadius:
BorderRadius
.
circular
(
0.75
),
borderSide:
BorderSide
(
width:
1.5
.
w
,
color:
AppTheme
.
primary
),
insets:
EdgeInsets
.
symmetric
(
horizontal:
22
.
w
),
// 设置标签下面指示器的水平内边距
),
labelPadding:
EdgeInsets
.
symmetric
(
horizontal:
20
.
w
),
indicatorSize:
TabBarIndicatorSize
.
label
,
indicatorColor:
AppTheme
.
primary
,
indicatorWeight:
1.5
,
labelStyle:
TextStyle
(
color:
AppTheme
.
primary
,
fontSize:
15
.
w
,
height:
1.5
,
fontWeight:
Fonts
.
medium
),
unselectedLabelColor:
Colours
.
c9
,
unselectedLabelStyle:
TextStyle
(
color:
Colours
.
c9
,
fontSize:
15
.
w
,
height:
1.5
),
isScrollable:
true
,
tabs:
tabs
),
),
Expanded
(
child:
TabBarView
(
children:
List
.
generate
(
tabs
.
length
,
(
index
){
return
BuildListPage
(
tag:
'
$index
'
,
model:
widget
.
model
);
})
),
)
],
)
),
),
Expanded
(
child:
TabBarView
(
children:
List
.
generate
(
tabs
.
length
,
(
index
){
return
BuildListPage
(
tag:
'
$index
'
,
model:
widget
.
model
);
})
)
,
)
],
)
),
);
);
}
}
lib/pages/user_order/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -43,29 +43,23 @@ class _UserOrderState extends State<UserOrderPage>
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
AppBar
(
title:
Container
(
padding:
EdgeInsets
.
only
(
right:
10
.
w
),
child:
CustomInputSearch
(
controller:
searchController
,
readOnly:
true
,
hintText:
'搜索我的订单'
,
onTap:
()
{
context
.
pushNamed
(
Routes
.
orderSearch
);
},
),
return
Scaffold
(
appBar:
AppBar
(
title:
Container
(
padding:
EdgeInsets
.
only
(
right:
10
.
w
),
child:
CustomInputSearch
(
controller:
searchController
,
readOnly:
true
,
hintText:
'搜索我的订单'
,
onTap:
()
{
context
.
pushNamed
(
Routes
.
orderSearch
);
},
),
titleSpacing:
0
,
),
body:
_buildBody
(),
titleSpacing:
0
,
),
body:
_buildBody
(),
);
}
...
...
lib/pages/user_order/widgets/awaiting.dart
浏览文件 @
a9a48cfe
...
...
@@ -12,10 +12,10 @@ class BuiltAwaiting extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
return
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
})
;
if
(
result
==
true
)
{
controller
.
onRefresh
();
}
context
.
pushNamed
(
Routes
.
orderAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
})
.
then
((
value
){
controller
.
onRefresh
();
});
},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
10
.
w
),
...
...
lib/pages/user_order/widgets/coin.dart
浏览文件 @
a9a48cfe
...
...
@@ -18,25 +18,22 @@ class BuiltCoin extends StatelessWidget {
return
GestureDetector
(
onTap:
()
async
{
if
(
model
.
status
==
1
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
}).
then
((
value
){
controller
.
onRefresh
();
}
}
);
}
else
if
(
model
.
status
==
2
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinCancel
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
orderCoinCancel
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
}).
then
((
value
){
controller
.
onRefresh
();
}
}
);
}
else
if
(
model
.
status
==
3
){
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCoinCompleted
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
if
(
result
==
true
){
context
.
pushNamed
(
Routes
.
orderCoinCompleted
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
}).
then
((
value
){
controller
.
onRefresh
();
}
}
);
}
},
child:
Container
(
...
...
lib/pages/user_order/widgets/completed.dart
浏览文件 @
a9a48cfe
...
...
@@ -15,10 +15,10 @@ class BuiltCompleted extends StatelessWidget {
return
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderCompleted
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
})
;
if
(
result
==
true
)
{
controller
.
onRefresh
();
}
context
.
pushNamed
(
Routes
.
orderCompleted
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
})
.
then
((
value
){
controller
.
onRefresh
();
});
},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
10
.
w
),
...
...
@@ -165,14 +165,13 @@ class BuiltCompleted extends StatelessWidget {
child:
Center
(
child:
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderEvaluate
,
context
.
pushNamed
(
Routes
.
orderEvaluate
,
extra:
OrderInfoModel
(),
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
if
(
result
==
true
)
{
}).
then
((
value
){
controller
.
onRefresh
();
}
}
);
},
child:
Text
(
judgeComments
()
==
1
?
'去评价'
:
"继续评价"
,
...
...
@@ -307,14 +306,14 @@ class BuiltCompleted extends StatelessWidget {
child:
Center
(
child:
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderEvaluate
,
context
.
pushNamed
(
Routes
.
orderEvaluate
,
extra:
OrderInfoModel
(),
queryParameters:
{
'orderNum'
:
model
.
ordersnum
})
;
if
(
result
==
true
)
{
controller
.
onRefresh
(
);
}
})
.
then
((
value
){
controller
.
onRefresh
();
}
);
},
child:
Text
(
judgeComments
()
==
1
?
'去评价'
:
"继续评价"
,
...
...
lib/pages/user_order_awaiting/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -21,299 +21,287 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'等待付款'
),
),
);
}
else
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'等待付款'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
return
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'等待付款'
),
),
);
}
else
{
return
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'等待付款'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
myController
.
model
?.
bookList
?[
0
].
img
??
''
,
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
myController
.
model
.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
25.5
.
w
),
Text
(
"需付款 ¥
${myController.model.finalTotalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
bold
,
fontSize:
14
.
w
,
),
),
],
),
),
),
],
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
myController
.
model
?.
bookList
?[
0
].
img
??
''
,
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
myController
.
model
.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
25.5
.
w
),
Text
(
"需付款 ¥
${myController.model.finalTotalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
bold
,
fontSize:
14
.
w
,
),
]
,
)
,
)
;
}).
toList
(
),
)
,
]
,
)
,
),
),
),
SizedBox
(
height:
13.5
.
w
,
),
],
],
),
),
),
),
SizedBox
(
height:
39
.
w
,
),
GestureDetector
(
onTap:
()
{
myController
.
payOrder
();
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
height:
40
.
w
,
decoration:
BoxDecoration
(
color:
AppTheme
.
primary
,
borderRadius:
BorderRadius
.
circular
(
180
.
w
),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
Text
(
'立即支付 ¥
${myController.model.finalTotalPrice}
'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
color:
Colours
.
cFF
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
),
],
),
);
}).
toList
(),
),
),
),
SizedBox
(
height:
13.5
.
w
,
),
],
),
SizedBox
(
height:
11.5
.
w
,
),
),
SizedBox
(
height:
39
.
w
,
),
GestureDetector
(
onTap:
()
{
myController
.
payOrder
();
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
height:
40
.
w
,
decoration:
BoxDecoration
(
color:
AppTheme
.
primary
,
borderRadius:
BorderRadius
.
circular
(
180
.
w
),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
Text
(
'立即支付 ¥
${myController.model.finalTotalPrice}
'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
color:
Colours
.
cFF
),
),
),
GestureDetector
(
onTap:
()
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定取消订单吗'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
),
),
),
),
SizedBox
(
height:
11.5
.
w
,
),
GestureDetector
(
onTap:
()
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定取消订单吗'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c6
,
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c6
,
),
),
Container
(
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
async
{
Future
<
bool
>
result
=
myController
.
cancelPay
();
if
(
await
result
)
{
Navigator
.
of
(
context
).
pop
();
context
.
pop
(
true
);
}
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
boldSemi
,
color:
Colours
.
cAB1941
,
)
,
)
,
),
),
Container
(
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
async
{
Future
<
bool
>
result
=
myController
.
cancelPay
();
if
(
await
result
){
Navigator
.
of
(
context
).
pop
();
context
.
pop
(
true
);
}
}
,
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
boldSemi
,
color:
Colours
.
cAB1941
,
),
),
]
,
)
,
),
],
)
;
}
,
)
,
]
,
);
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消订单'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
15
,
color:
Colours
.
c9
,
)
,
)
,
);
}
,
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消订单'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
15
,
color:
Colours
.
c9
,
),
),
]
,
)
,
),
)
,
)
;
}
}
,
)
,
]
,
)
,
);
}
}
,
);
}
}
lib/pages/user_order_cancel_detail/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -12,233 +12,227 @@ class UserOrderCancelDetailPage extends StatefulWidget {
class
_UserOrderRefundedState
extends
State
<
UserOrderCancelDetailPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserOrderCancelDetailController
>(
init:
UserOrderCancelDetailController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已取消'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
controller
.
model
?.
bookList
==
null
?
'http://zxts-book-file.zijingebook.com/2024-01/29/b91194564969b9151fa382807977282acdffa22d.jpg'
:
controller
.
model
.
bookList
![
0
].
img
??
''
,
// 用实际图片链接替换
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// 下面的Text靠左
children:
[
Container
(
height:
62.5
.
w
,
child:
Text
(
controller
.
model
?.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
return
GetBuilder
<
UserOrderCancelDetailController
>(
init:
UserOrderCancelDetailController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已取消'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
controller
.
model
?.
bookList
==
null
?
'http://zxts-book-file.zijingebook.com/2024-01/29/b91194564969b9151fa382807977282acdffa22d.jpg'
:
controller
.
model
.
bookList
![
0
].
img
??
''
,
// 用实际图片链接替换
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// 下面的Text靠左
children:
[
Container
(
height:
62.5
.
w
,
child:
Text
(
controller
.
model
?.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
Container
(
alignment:
Alignment
.
topRight
,
child:
Text
(
"¥
${controller.model.totalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
)
,
),
Container
(
alignment:
Alignment
.
topRight
,
child:
Text
(
"¥
${controller.model.totalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
),
)
),
)
],
),
],
),
),
],
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
],
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
controller
.
orderCompleteds
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
controller
.
orderCompleteds
.
indexOf
(
model
)
==
0
?
GestureDetector
(
onTap:
()
{
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
RefundedDetailsPage
(
totalPrice:
controller
.
model
.
totalPrice
.
toString
(),
couponPrice:
controller
.
model
.
couponPrice
.
toString
(),
integralPrice:
controller
.
model
.
integralPrice
.
toString
(),);
},
).
then
((
value
)
{
print
(
'点击了应付款后面'
);
});
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
controller
.
orderCompleteds
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
controller
.
orderCompleteds
.
indexOf
(
model
)
==
0
?
GestureDetector
(
onTap:
()
{
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
RefundedDetailsPage
(
totalPrice:
controller
.
model
.
totalPrice
.
toString
(),
couponPrice:
controller
.
model
.
couponPrice
.
toString
(),
integralPrice:
controller
.
model
.
integralPrice
.
toString
(),);
},
).
then
((
value
)
{
print
(
'点击了应付款后面'
);
});
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'共减 ¥
${model.other.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
AppTheme
.
primary
,
),
),
SizedBox
(
width:
8
.
w
,
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'共减 ¥
${model.other.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
AppTheme
.
primary
,
),
Text
(
'合计
${model.value.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
Colours
.
c9
,
),
),
SizedBox
(
width:
8
.
w
,
),
Text
(
'合计
${model.value.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
Colours
.
c9
,
),
Gaps
.
hGaps8
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Image
.
asset
(
'assets/images/right_arrow.png'
,
)
,
)
,
Gaps
.
hGaps8
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Image
.
asset
(
'assets/images/right_arrow.png'
,
),
]
,
))
:
Padding
(
padding:
EdgeInsets
.
only
(
right:
12.5
.
w
),
child:
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
)
,
),
)
,
],
))
:
Padding
(
padding:
EdgeInsets
.
only
(
right:
12.5
.
w
),
child:
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
],
),
);
}).
toList
(),
),
),
SizedBox
(
height:
14.5
.
w
,
),
],
),
);
}).
toList
(),
),
],
),
),
SizedBox
(
height:
14.5
.
w
,
),
],
),
),
// SizedBox(height: 4.w,
),
// Container(
// width: double.infinity,
// margin: EdgeInsets.symmetric(
// horizontal: AppTheme.margin),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8.w),
// color: Colors.white
,
// boxShadow: [
// BoxShadow(
// color: Colours.cC7.withOpacity(0.5),
// offset: Offset(3.w, 0
),
// blurRadius: 10.w
,
// spreadRadius:
0.w,
// )
,
// ]
,
// )
,
// child: ClipRRect(
// borderRadius: BorderRadius.circular(8.w),
// child: Container(margin: EdgeInsets.only(top:24.w,left:11.5.w,right: 23.5.w,bottom: 24
.w),
// child: Column(
// mainAxisAlignment: MainAxisAlignment.start,
// crossAxisAlignment: Cross
AxisAlignment.start,
// children: [
// Text('退款原因',style: TextStyle(fontSize: 13.w,color: Colours.c9),),
// SizedBox(height: 8.w
,),
// Text(controller.model.refundReason.toString(),style: TextStyle(fontSize: 13.w,color: Colours.c3),)
// ],
// )
,
// ),
//
),
// )
],),
)
),
);
),
// SizedBox(height: 4.w,),
// Container(
// width: double.infinity,
// margin: EdgeInsets.symmetric(
// horizontal: AppTheme.margin),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(8.w)
,
// color: Colors.white,
// boxShadow: [
// BoxShadow(
// color: Colours.cC7.withOpacity(0.5
),
// offset: Offset(3.w, 0)
,
// blurRadius: 1
0.w,
// spreadRadius: 0.w
,
// )
,
// ]
,
// ),
// child: ClipRRect(
// borderRadius: BorderRadius.circular(8
.w),
// child: Container(margin: EdgeInsets.only(top:24.w,left:11.5.w,right: 23.5.w,bottom: 24.w),
// child: Column(
// mainAxisAlignment: Main
AxisAlignment.start,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Text('退款原因',style: TextStyle(fontSize: 13.w,color: Colours.c9)
,),
// SizedBox(height: 8.w,),
// Text(controller.model.refundReason.toString(),style: TextStyle(fontSize: 13.w,color: Colours.c3),)
// ]
,
// ),
//
),
// ),
// )
],
),
)
);
}
}
lib/pages/user_order_coin_awaiting/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
FutureBuilder
(
return
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
...
...
@@ -39,290 +34,283 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
),
);
}
else
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'待支付'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
'充值
${myController.model.bean}
紫荆币'
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
Text
(
"需付款 ¥
${myController.model.finalTotalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
bold
,
fontSize:
14
.
w
,
),
),
],
),
),
),
],
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
return
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'待支付'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
model
.
name
,
'充值
${myController.model.bean}
紫荆币'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
Text
(
model
.
value
.
toString
()
,
"需付款 ¥
${myController.model.finalTotalPrice}
"
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
bold
,
fontSize:
14
.
w
,
),
),
],
),
)
;
}).
toList
(
),
)
,
)
,
),
]
,
),
SizedBox
(
height:
13.5
.
w
,
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
),
],
),
);
}).
toList
(),
),
],
),
),
SizedBox
(
height:
13.5
.
w
,
),
],
),
),
SizedBox
(
height:
11.5
.
w
,
)
,
GestureDetector
(
onTap:
(){
myController
.
payOrder
();
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
height:
40
.
w
,
decoration:
BoxDecoration
(
color:
AppTheme
.
primary
,
borderRadius:
BorderRadius
.
circular
(
180
.
w
)
,
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
Text
(
'立即支付 ¥
${myController.model.finalTotalPrice}
'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
color:
Colours
.
cFF
)
,
),
),
SizedBox
(
height:
11.5
.
w
,
),
GestureDetector
(
onTap:
(){
myController
.
payOrder
();
},
child:
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
)
,
height:
40
.
w
,
decoration:
BoxDecoration
(
color:
AppTheme
.
primary
,
borderRadius:
BorderRadius
.
circular
(
180
.
w
),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
Text
(
'立即支付 ¥
${myController.model.finalTotalPrice}
'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
color:
Colours
.
cFF
),
),
),
),
SizedBox
(
height:
11.5
.
w
,
),
GestureDetector
(
onTap:
()
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
),
SizedBox
(
height:
11.5
.
w
,
),
GestureDetector
(
onTap:
()
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定取消订单吗'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
),
),
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定取消订单吗'
,
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
1
5
.
w
,
fontSize:
1
4
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c
3
,
color:
Colours
.
c
6
,
),
),
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c6
,
),
),
),
),
Container
(
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
async
{
Future
<
bool
>
result
=
myController
.
cancelPay
();
if
(
await
result
){
Navigator
.
of
(
context
).
pop
();
context
.
pop
(
true
);
}
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
boldSemi
,
color:
Colours
.
cAB1941
,
),
GestureDetector
(
onTap:
()
async
{
Future
<
bool
>
result
=
myController
.
cancelPay
();
if
(
await
result
){
Navigator
.
of
(
context
).
pop
();
context
.
pop
(
true
);
}
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
14
,
fontWeight:
Fonts
.
boldSemi
,
color:
Colours
.
cAB1941
,
),
),
),
]
,
)
,
]
,
);
},
);
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消订单'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
15
,
color:
Colours
.
c9
,
)
,
)
,
]
,
)
,
],
);
},
);
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消订单'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
15
,
color:
Colours
.
c9
,
),
),
),
]
,
)
,
)
,
]
,
),
);
}
},
),
);
}
}
lib/pages/user_order_coin_cancel/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
FutureBuilder
(
return
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
...
...
@@ -39,155 +34,148 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCancelPage> {
),
);
}
else
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已取消'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
'充值
${myController.model.bean}
紫荆币'
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
// Text(
// "需付款 ¥${myController.model.finalTotalPrice}",
// style: TextStyle(
// color: Colours.cAB1941,
// fontWeight: Fonts.bold,
// fontSize: 14.w,
// ),
// ),
],
),
),
),
],
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
return
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已取消'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
model
.
name
,
'充值
${myController.model.bean}
紫荆币'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
// Text(
// "需付款 ¥${myController.model.finalTotalPrice}",
// style: TextStyle(
// color: Colours.cAB1941,
// fontWeight: Fonts.bold,
// fontSize: 14.w,
// ),
// ),
],
),
)
;
}).
toList
(
),
)
,
)
,
),
]
,
),
SizedBox
(
height:
13.5
.
w
,
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
),
],
),
);
}).
toList
(),
),
],
),
),
SizedBox
(
height:
13.5
.
w
,
),
],
),
),
SizedBox
(
height:
11.5
.
w
,
)
,
]
,
)
,
),
SizedBox
(
height:
11.5
.
w
,
)
,
]
,
),
);
}
},
),
);
}
}
lib/pages/user_order_coin_completed/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -23,12 +23,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
FutureBuilder
(
return
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
...
...
@@ -39,155 +34,148 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinCompletedPage> {
),
);
}
else
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已完成'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
'充值
${myController.model.bean}
紫荆币'
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
// Text(
// "需付款 ¥${myController.model.finalTotalPrice}",
// style: TextStyle(
// color: Colours.cAB1941,
// fontWeight: Fonts.bold,
// fontSize: 14.w,
// ),
// ),
],
),
),
),
],
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
return
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已完成'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
model
.
name
,
'充值
${myController.model.bean}
紫荆币'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
// Text(
// "需付款 ¥${myController.model.finalTotalPrice}",
// style: TextStyle(
// color: Colours.cAB1941,
// fontWeight: Fonts.bold,
// fontSize: 14.w,
// ),
// ),
],
),
)
;
}).
toList
(
),
)
,
)
,
),
]
,
),
SizedBox
(
height:
13.5
.
w
,
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
myController
.
orderAwaitings
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
),
],
),
);
}).
toList
(),
),
],
),
),
SizedBox
(
height:
13.5
.
w
,
),
],
),
),
SizedBox
(
height:
11.5
.
w
,
)
,
]
,
)
,
),
SizedBox
(
height:
11.5
.
w
,
)
,
]
,
),
);
}
},
),
);
}
}
lib/pages/user_order_completed/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -19,232 +19,226 @@ class _UserOrderCompletedState extends State<UserOrderCompletedPage> {
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserOrderCompletedController
>(
init:
UserOrderCompletedController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已完成'
),
actions:
[],
return
GetBuilder
<
UserOrderCompletedController
>(
init:
UserOrderCompletedController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已完成'
),
actions:
[],
),
body:
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
body:
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
controller
.
model
.
bookList
==
null
?
'http://zxts-book-file.zijingebook.com/2024-01/29/b91194564969b9151fa382807977282acdffa22d.jpg'
:
controller
.
model
.
bookList
![
0
].
img
??
''
,
// 用实际图片链接替换
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
45
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// 下面的Text靠左
children:
[
Container
(
height:
47.5
.
w
,
child:
Text
(
controller
.
model
.
bookList
==
null
?
''
:
controller
.
model
.
bookList
![
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
),
Text
(
"¥
${controller.model.totalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
),
),
],
),
),
),
],
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
controller
.
orderCompleteds
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
controller
.
model
.
bookList
==
null
?
'http://zxts-book-file.zijingebook.com/2024-01/29/b91194564969b9151fa382807977282acdffa22d.jpg'
:
controller
.
model
.
bookList
![
0
].
img
??
''
,
// 用实际图片链接替换
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
45
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// 下面的Text靠左
children:
[
Container
(
height:
47.5
.
w
,
child:
Text
(
controller
.
model
.
bookList
==
null
?
''
:
controller
.
model
.
bookList
![
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
),
Text
(
model
.
name
,
"¥
${controller.model.totalPrice}
"
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
),
),
controller
.
orderCompleteds
.
indexOf
(
model
)
==
0
?
GestureDetector
(
onTap:
()
{
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
RefundedDetailsPage
(
totalPrice:
controller
.
model
.
totalPrice
.
toString
(),
couponPrice:
controller
.
model
.
couponPrice
.
toString
(),
integralPrice:
controller
.
model
.
integralPrice
.
toString
(),);
},
).
then
((
value
)
{
print
(
'点击了应付款后面'
);
});
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'共减 ¥
${model.other.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
AppTheme
.
primary
,
),
),
SizedBox
(
width:
8
.
w
,
],
),
),
),
],
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
controller
.
orderCompleteds
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
top:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
controller
.
orderCompleteds
.
indexOf
(
model
)
==
0
?
GestureDetector
(
onTap:
()
{
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
RefundedDetailsPage
(
totalPrice:
controller
.
model
.
totalPrice
.
toString
(),
couponPrice:
controller
.
model
.
couponPrice
.
toString
(),
integralPrice:
controller
.
model
.
integralPrice
.
toString
(),);
},
).
then
((
value
)
{
print
(
'点击了应付款后面'
);
});
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'共减 ¥
${model.other.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
AppTheme
.
primary
,
),
Text
(
'合计
${model.value.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
Colours
.
c3
,
),
),
SizedBox
(
width:
8
.
w
,
),
Text
(
'合计
${model.value.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
Colours
.
c3
,
),
Gaps
.
hGaps8
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Image
.
asset
(
'assets/images/right_arrow.png'
,
)
,
)
,
Gaps
.
hGaps8
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Image
.
asset
(
'assets/images/right_arrow.png'
,
),
]
,
))
:
Padding
(
padding:
EdgeInsets
.
only
(
right:
12.5
.
w
),
child:
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
)
,
),
)
,
],
))
:
Padding
(
padding:
EdgeInsets
.
only
(
right:
12.5
.
w
),
child:
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c3
),
),
],
),
);
}).
toList
(),
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
6
.
w
,
bottom:
13
.
w
),
height:
1
.
w
,
),
],
),
);
}).
toList
(),
),
Visibility
(
visible:
controller
.
judgeComments
()
==
0
?
false
:
true
,
// visible: true,
child:
Align
(
alignment:
Alignment
.
centerRight
,
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
15.2
),
child:
Container
(
height:
23
.
w
,
width:
60
.
w
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
.
w
),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderEvaluate
,
extra:
controller
.
model
,
queryParameters:
{
'orderNum'
:
controller
.
model
.
ordersnum
});
if
(
result
==
true
)
{
controller
.
getOrderInfo
();
}
},
child:
Text
(
controller
.
judgeComments
()
==
1
?
'去评价'
:
"继续评价"
,
style:
TextStyle
(
fontSize:
12
.
w
,
color:
Colours
.
cC31F4C
),
)),
),
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
6
.
w
,
bottom:
13
.
w
),
height:
1
.
w
,
),
Visibility
(
visible:
controller
.
judgeComments
()
==
0
?
false
:
true
,
// visible: true,
child:
Align
(
alignment:
Alignment
.
centerRight
,
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
15.2
),
child:
Container
(
height:
23
.
w
,
width:
60
.
w
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
.
w
),
border:
Border
.
all
(
color:
Colours
.
cC31F4C
,
width:
0.5
.
w
)),
child:
Center
(
child:
GestureDetector
(
onTap:
()
async
{
final
result
=
await
context
.
pushNamed
(
Routes
.
orderEvaluate
,
extra:
controller
.
model
,
queryParameters:
{
'orderNum'
:
controller
.
model
.
ordersnum
}).
then
((
value
){
controller
.
getOrderInfo
();
});
},
child:
Text
(
controller
.
judgeComments
()
==
1
?
'去评价'
:
"继续评价"
,
style:
TextStyle
(
fontSize:
12
.
w
,
color:
Colours
.
cC31F4C
),
)),
),
),
),
),
),
SizedBox
(
height:
14.5
.
w
,
),
],
),
SizedBox
(
height:
14.5
.
w
,
),
],
),
)
))
,
);
),
))
);
}
}
lib/pages/user_order_evaluate/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -29,12 +29,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto
@override
Widget
build
(
BuildContext
context
)
{
// super.build(context);
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserOrderEvaluateController
>(
return
GetBuilder
<
UserOrderEvaluateController
>(
init:
UserOrderEvaluateController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
...
...
@@ -95,7 +90,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> with Auto
],
),
),
),)
,)
;
),);
}
Widget
listItem
(
BookListModel
bookListModel
,
int
index
,
UserOrderEvaluateController
myController
)
{
...
...
lib/pages/user_order_refunded/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -12,233 +12,227 @@ class UserOrderRefundedPage extends StatefulWidget {
class
_UserOrderRefundedState
extends
State
<
UserOrderRefundedPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserOrderCRefundedController
>(
init:
UserOrderCRefundedController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已退款'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
8.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
controller
.
model
?.
bookList
==
null
?
'http://zxts-book-file.zijingebook.com/2024-01/29/b91194564969b9151fa382807977282acdffa22d.jpg'
:
controller
.
model
.
bookList
![
0
].
img
??
''
,
// 用实际图片链接替换
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// 下面的Text靠左
children:
[
Container
(
height:
62.5
.
w
,
child:
Text
(
controller
.
model
?.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
return
GetBuilder
<
UserOrderCRefundedController
>(
init:
UserOrderCRefundedController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'已退款'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
8.0
.
w
,
top:
12.0
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
network
(
controller
.
model
?.
bookList
==
null
?
'http://zxts-book-file.zijingebook.com/2024-01/29/b91194564969b9151fa382807977282acdffa22d.jpg'
:
controller
.
model
.
bookList
![
0
].
img
??
''
,
// 用实际图片链接替换
fit:
BoxFit
.
cover
,
// 设置适应方式为充满
width:
72.0
.
w
,
height:
86.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
5.5
.
w
,
right:
23.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// 下面的Text靠左
children:
[
Container
(
height:
62.5
.
w
,
child:
Text
(
controller
.
model
?.
bookList
?[
0
].
name
??
''
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
Container
(
alignment:
Alignment
.
topRight
,
child:
Text
(
"¥
${controller.model.totalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
)
,
),
Container
(
alignment:
Alignment
.
topRight
,
child:
Text
(
"¥
${controller.model.totalPrice}
"
,
style:
TextStyle
(
color:
Colours
.
cAB1941
,
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
),
)
),
)
],
),
],
),
),
]
,
)
,
)
,
]
,
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
controller
.
orderCompleteds
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
controller
.
orderCompleteds
.
indexOf
(
model
)
==
0
?
GestureDetector
(
onTap:
()
{
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
RefundedDetailsPage
(
totalPrice:
controller
.
model
.
totalPrice
.
toString
(),
couponPrice:
controller
.
model
.
couponPrice
.
toString
(),
integralPrice:
controller
.
model
.
integralPrice
.
toString
(),);
},
).
then
((
value
)
{
print
(
'点击了应付款后面'
);
});
),
Container
(
color:
Colours
.
cLine
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
bottom:
12
.
w
),
height:
1
.
w
,
),
Container
(
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
,
bottom:
8
.
w
,
right:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
controller
.
orderCompleteds
.
map
((
model
)
{
return
Padding
(
padding:
EdgeInsets
.
only
(
bottom:
12
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
model
.
name
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
controller
.
orderCompleteds
.
indexOf
(
model
)
==
0
?
GestureDetector
(
onTap:
()
{
showModalBottomSheet
(
context:
context
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
vertical
(
top:
Radius
.
circular
(
8
.
w
)),
),
builder:
(
BuildContext
context
)
{
return
RefundedDetailsPage
(
totalPrice:
controller
.
model
.
totalPrice
.
toString
(),
couponPrice:
controller
.
model
.
couponPrice
.
toString
(),
integralPrice:
controller
.
model
.
integralPrice
.
toString
(),);
},
).
then
((
value
)
{
print
(
'点击了应付款后面'
);
});
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'共减 ¥
${model.other.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
AppTheme
.
primary
,
),
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'共减 ¥
${model.other.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
AppTheme
.
primary
,
),
SizedBox
(
width:
8
.
w
,
)
,
Text
(
'合计
${model.value.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
Colours
.
c9
,
)
,
),
SizedBox
(
width:
8
.
w
,
),
Text
(
'合计
${model.value.toString()}
'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
,
color:
Colours
.
c9
,
),
Gaps
.
hGaps8
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Image
.
asset
(
'assets/images/right_arrow.png'
,
)
,
)
,
Gaps
.
hGaps8
,
Padding
(
padding:
EdgeInsets
.
only
(
top:
4
.
w
),
child:
Image
.
asset
(
'assets/images/right_arrow.png'
,
),
]
,
))
:
Padding
(
padding:
EdgeInsets
.
only
(
right:
12.5
.
w
),
child:
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
)
,
),
)
,
],
))
:
Padding
(
padding:
EdgeInsets
.
only
(
right:
12.5
.
w
),
child:
Text
(
model
.
value
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.6
.
w
,
color:
Colours
.
c9
),
),
]
,
)
,
)
;
}).
toList
(),
),
)
,
]
,
)
,
);
}).
toList
(
),
),
// SizedBox(
// height: 2.5.w,
// ),
],
),
),
),
SizedBox
(
height:
4
.
w
,),
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
// SizedBox(
// height: 2.5.w,
// ),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Container
(
margin:
EdgeInsets
.
only
(
top:
13
.
w
,
left:
11.5
.
w
,
right:
23.5
.
w
,
bottom:
24
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'退款原因'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
Colours
.
c9
),),
SizedBox
(
height:
8
.
w
,),
Text
(
controller
.
model
.
refundReason
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
color:
Colours
.
c3
),)
],
),
),
),
SizedBox
(
height:
4
.
w
,),
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Container
(
margin:
EdgeInsets
.
only
(
top:
13
.
w
,
left:
11.5
.
w
,
right:
23.5
.
w
,
bottom:
24
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'退款原因'
,
style:
TextStyle
(
fontSize:
13
.
w
,
color:
Colours
.
c9
),),
SizedBox
(
height:
8
.
w
,),
Text
(
controller
.
model
.
refundReason
.
toString
(),
style:
TextStyle
(
fontSize:
13
.
w
,
color:
Colours
.
c3
),)
],
),
),
)
],),
)
),
);
)
,
)
],
),
)
);
}
}
lib/pages/user_point/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -10,52 +10,46 @@ class UserPointPage extends StatefulWidget {
class
_UserPointPageState
extends
State
<
UserPointPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserPointController
>(
init:
UserPointController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'积分'
),
),
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
points
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
Container
(
margin:
EdgeInsets
.
all
(
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildCell
(
model:
controller
.
points
[
index
],);
},
itemCount:
controller
.
points
.
length
,
),
return
GetBuilder
<
UserPointController
>(
init:
UserPointController
(),
builder:
(
controller
)
=>
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'积分'
),
),
body:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
controller
.
points
.
isEmpty
?
Container
(
padding:
EdgeInsets
.
only
(
top:
110
.
w
),
alignment:
Alignment
.
center
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
height:
152
.
w
,
width:
195
.
w
,
child:
Image
.
asset
(
'assets/images/none.png'
,),),
SizedBox
(
height:
13
.
w
,),
],
),
):
Container
(
margin:
EdgeInsets
.
all
(
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildCell
(
model:
controller
.
points
[
index
],);
},
itemCount:
controller
.
points
.
length
,
),
),
),
...
...
lib/pages/user_security/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -12,179 +12,173 @@ class UserSecurityPage extends StatefulWidget {
class
_UserSecurityPageState
extends
State
<
UserSecurityPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'账号安全'
),
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
.
w
,
horizontal:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
Column
(
children:
[
GestureDetector
(
onTap:
()
{
context
.
pushNamed
(
Routes
.
changePhone
);
},
child:
_buildItem
(
title:
'修改手机号码'
,
value:
widget
.
model
.
phone
??
''
)),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
0.5
.
w
,
color:
Colours
.
cF0
,
),
GestureDetector
(
onTap:
()
{
String
type
=
'1'
;
if
(
widget
.
model
.
password
.
toString
().
isEmpty
){
type
=
'0'
;
}
context
.
pushNamed
(
Routes
.
changePwd
,
extra:
widget
.
model
,
queryParameters:
{
'type'
:
type
});
},
child:
_buildItem
(
title:
'修改密码'
,
value:
widget
.
model
.
password
.
toString
().
isEmpty
?
'未设置'
:
''
)),
],
),
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'账号安全'
),
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
vertical:
10
.
w
,
horizontal:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
Column
(
children:
[
GestureDetector
(
child:
_buildItem
(
title:
'账号注销'
,
value:
''
),
onTap:
()
async
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
child:
Column
(
children:
[
GestureDetector
(
onTap:
()
{
context
.
pushNamed
(
Routes
.
changePhone
);
},
child:
_buildItem
(
title:
'修改手机号码'
,
value:
widget
.
model
.
phone
??
''
)),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
height:
0.5
.
w
,
color:
Colours
.
cF0
,
),
GestureDetector
(
onTap:
()
{
String
type
=
'1'
;
if
(
widget
.
model
.
password
.
toString
().
isEmpty
){
type
=
'0'
;
}
context
.
pushNamed
(
Routes
.
changePwd
,
extra:
widget
.
model
,
queryParameters:
{
'type'
:
type
});
},
child:
_buildItem
(
title:
'修改密码'
,
value:
widget
.
model
.
password
.
toString
().
isEmpty
?
'未设置'
:
''
)),
],
),
),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
10
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
const
Color
(
0xFFC7C7C7
).
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
Column
(
children:
[
GestureDetector
(
child:
_buildItem
(
title:
'账号注销'
,
value:
''
),
onTap:
()
async
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定注销账号吗'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
),
),
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定注销账号吗'
,
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontSize:
15
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c
3
,
color:
Colours
.
c
6
,
),
),
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
15
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c6
,
),
),
),
),
Container
(
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
async
{
final
result
=
await
AccountAPI
.
delete
();
if
(
result
)
{
CustomToast
.
loading
();
await
UserStore
.
to
.
logout
();
CustomToast
.
dismiss
();
if
(
context
.
mounted
)
{
context
.
goNamed
(
Routes
.
splash
);
}
GestureDetector
(
onTap:
()
async
{
final
result
=
await
AccountAPI
.
delete
();
if
(
result
)
{
CustomToast
.
loading
();
await
UserStore
.
to
.
logout
();
CustomToast
.
dismiss
();
if
(
context
.
mounted
)
{
context
.
goNamed
(
Routes
.
splash
);
}
}
,
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
15
,
fontWeight:
Fonts
.
boldSemi
,
color:
Colours
.
cAB1941
,
)
,
}
},
child:
Container
(
width:
105
.
w
,
color:
Colours
.
cFF
,
alignment:
Alignment
.
center
,
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
15
,
fontWeight:
Fonts
.
boldSemi
,
color:
Colours
.
cAB1941
,
),
),
),
]
,
)
,
]
,
);
},
);
},
)
,
]
,
)
,
)
],
)
,
)
,
]
,
)
,
],
);
},
);
}
,
)
,
]
,
)
,
)
]
,
),
);
}
...
...
lib/pages/user_wrong/view.dart
浏览文件 @
a9a48cfe
...
...
@@ -10,45 +10,39 @@ class UserWrongPage extends StatefulWidget {
class
_UserWrongPageState
extends
State
<
UserWrongPage
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserWrongController
>(
init:
UserWrongController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'错题'
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
left:
22.5
.
w
,
top:
16
.
w
),
child:
Text
(
'共
${controller.wrongs.length}
本书'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c6
,
fontWeight:
Fonts
.
medium
),)
),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
wrongDes
,
extra:
controller
.
wrongs
[
index
]);
},
child:
BuildItem
(
model:
controller
.
wrongs
[
index
],
index:
index
,
num
:
controller
.
wrongs
.
length
,)
);
},
itemCount:
controller
.
wrongs
.
length
,
)
),
return
GetBuilder
<
UserWrongController
>(
init:
UserWrongController
(),
builder:
(
controller
)=>
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'错题'
),
),
body:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
left:
22.5
.
w
,
top:
16
.
w
),
child:
Text
(
'共
${controller.wrongs.length}
本书'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c6
,
fontWeight:
Fonts
.
medium
),)
),
Expanded
(
child:
CustomPullScrollView
(
controller:
controller
.
refreshController
,
onRefresh:
controller
.
onRefresh
,
onLoading:
controller
.
onLoading
,
child:
ListView
.
builder
(
itemBuilder:
(
BuildContext
context
,
int
index
){
return
GestureDetector
(
onTap:
(){
context
.
pushNamed
(
Routes
.
wrongDes
,
extra:
controller
.
wrongs
[
index
]);
},
child:
BuildItem
(
model:
controller
.
wrongs
[
index
],
index:
index
,
num
:
controller
.
wrongs
.
length
,)
);
},
itemCount:
controller
.
wrongs
.
length
,
)
),
]
,
)
,
)
,
]
,
),
),
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论