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