Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
40411fb9
提交
40411fb9
authored
1月 24, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应付明细
上级
8c715ac0
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
219 行增加
和
85 行删除
+219
-85
pay_up.png
assets/images/2.0x/pay_up.png
+0
-0
pay_up.png
assets/images/3.0x/pay_up.png
+0
-0
pay_up.png
assets/images/pay_up.png
+0
-0
controller.dart
lib/pages/book_pay/controller.dart
+8
-0
view.dart
lib/pages/book_pay/view.dart
+176
-73
pay_count.dart
lib/pages/book_pay/widgets/pay_count.dart
+32
-12
controller.dart
lib/pages/book_shop/controller.dart
+2
-0
index.dart
lib/pages/main/index.dart
+1
-0
没有找到文件。
assets/images/2.0x/pay_up.png
0 → 100644
浏览文件 @
40411fb9
519 Bytes
assets/images/3.0x/pay_up.png
0 → 100644
浏览文件 @
40411fb9
918 Bytes
assets/images/pay_up.png
0 → 100644
浏览文件 @
40411fb9
308 Bytes
lib/pages/book_pay/controller.dart
浏览文件 @
40411fb9
...
...
@@ -13,11 +13,19 @@ class BookPayController extends GetxController {
PayModel
(
type:
3
,
name:
'紫荆币'
,
icon:
'assets/images/pay_coin.png'
,
selected:
false
),
];
// 时候展示底部视图
bool
showDetail
=
false
;
// 支付方式
late
PayModel
_payModel
=
pays
.
first
;
PayModel
get
payModel
=>
_payModel
;
void
show
(){
showDetail
=
!
showDetail
;
update
();
}
void
setPayModel
(
PayModel
payModel
){
for
(
PayModel
model
in
pays
)
{
if
(
model
.
type
==
payModel
.
type
){
...
...
lib/pages/book_pay/view.dart
浏览文件 @
40411fb9
...
...
@@ -17,92 +17,195 @@ class _BookPayPageState extends State<BookPayPage> {
Widget
build
(
BuildContext
context
)
{
return
GetBuilder
<
BookPayController
>(
init:
BookPayController
(
widget
.
buy
),
builder:
(
controller
)
=>
Scaffold
(
backgroundColor:
Colours
.
cF9
,
appBar:
AppBar
(
title:
const
Text
(
'支付'
),),
body:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
buy
[
index
],);
},
itemCount:
controller
.
buy
.
length
,
),
builder:
(
controller
)
=>
Stack
(
children:
[
Scaffold
(
backgroundColor:
Colours
.
cF9
,
appBar:
AppBar
(
title:
const
Text
(
'支付'
),),
body:
SingleChildScrollView
(
child:
Column
(
children:
[
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
){
return
BuildItem
(
model:
controller
.
buy
[
index
],);
},
itemCount:
controller
.
buy
.
length
,
),
SizedBox
(
height:
10
.
w
,),
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:
[
GestureDetector
(
child:
_buildWidget
(
title:
'优惠券'
,
icon:
'assets/images/pay_coupon.png'
,),
onTap:
(){
context
.
pushNamed
(
Routes
.
payCoupon
);
},
SizedBox
(
height:
10
.
w
,),
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
),
]
),
Container
(
height:
0.5
.
w
,
color:
Colours
.
cF0
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
),),
GestureDetector
(
child:
_buildWidget
(
title:
'积分抵扣'
,
icon:
'assets/images/pay_point.png'
,),
onTap:
(){
context
.
pushNamed
(
Routes
.
creditPoints
);
child:
Column
(
children:
[
GestureDetector
(
child:
_buildWidget
(
title:
'优惠券'
,
icon:
'assets/images/pay_coupon.png'
,),
onTap:
(){
context
.
pushNamed
(
Routes
.
payCoupon
);
},
),
Container
(
height:
0.5
.
w
,
color:
Colours
.
cF0
,
margin:
EdgeInsets
.
only
(
left:
10
.
w
),),
GestureDetector
(
child:
_buildWidget
(
title:
'积分抵扣'
,
icon:
'assets/images/pay_point.png'
,),
onTap:
(){
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
,));
},
itemCount:
controller
.
pays
.
length
,
),
]
,
)
,
)
,
]
,
),
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
),
]
),
bottomNavigationBar:
SafeArea
(
child:
BuildPayCount
(
payTap:
(){
Console
.
log
(
'--------------支付------------------'
);
},
showTap:
(){
controller
.
show
();
Console
.
log
(
'--------------展示优惠详情------------------'
);
}
)),
),
controller
.
showDetail
?
Positioned
(
left:
0
.
w
,
bottom:
50
.
w
,
right:
0
.
w
,
top:
0
.
w
,
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:
240
.
w
,
color:
Colors
.
white
,
child:
_buildPayDetail
(
controller
),
),
),
),
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
,));
},
itemCount:
controller
.
pays
.
length
,
),
),
):
const
SizedBox
()
],
)
);
}
Widget
_buildPayDetail
(
BookPayController
controller
){
return
Column
(
children:
[
Stack
(
children:
[
Container
(
// color: Colors.red,
padding:
EdgeInsets
.
all
(
15
.
w
),
child:
const
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
'应付明细'
,
textAlign:
TextAlign
.
center
),
],
),
),
Positioned
(
right:
10
.
w
,
top:
10
.
w
,
child:
GestureDetector
(
onTap:
(){
controller
.
show
();
},
child:
SizedBox
(
width:
20
.
w
,
height:
20
.
w
,
child:
Image
.
asset
(
'assets/images/close.png'
),
),
),
)
],
),
SizedBox
(
height:
50
.
w
,),
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
15
.
w
),
child:
Column
(
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'总价'
,
style:
TextStyle
(
fontSize:
16
.
w
,
height:
1.5
,
color:
Colours
.
c3
,
fontWeight:
Fonts
.
medium
),),
Text
(
'¥199.80'
,
style:
TextStyle
(
fontSize:
15
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
,
fontWeight:
Fonts
.
medium
),)
],
),
Gaps
.
vGaps15
,
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'优惠券抵扣'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c9
,),),
Text
(
'减¥199.80'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),)
],
),
Gaps
.
vGaps10
,
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'积分抵扣'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
Colours
.
c9
,),),
Text
(
'减¥199.80'
,
style:
TextStyle
(
fontSize:
13
.
w
,
height:
1.5
,
color:
AppTheme
.
primary
),)
],
)
],
),
),
bottomNavigationBar:
SafeArea
(
child:
BuildPayCount
()),
),
)
],
);
}
Widget
_buildWidget
({
required
String
title
,
required
String
icon
,
...
...
lib/pages/book_pay/widgets/pay_count.dart
浏览文件 @
40411fb9
part of
book_pay
;
class
BuildPayCount
extends
StatelessWidget
{
const
BuildPayCount
({
Key
?
key
})
:
super
(
key:
key
);
final
void
Function
()?
payTap
;
final
void
Function
()?
showTap
;
const
BuildPayCount
({
Key
?
key
,
required
this
.
payTap
,
required
this
.
showTap
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
...
...
@@ -13,19 +20,32 @@ class BuildPayCount extends StatelessWidget {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Row
(
children:
[
Text
(
'应付:'
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
height:
1.1
),),
Text
(
'¥98.9'
,
style:
TextStyle
(
fontSize:
15
.
w
,
color:
AppTheme
.
primary
,
fontWeight:
Fonts
.
medium
,
height:
1.1
),)
],
GestureDetector
(
onTap:
showTap
,
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
'应付:'
,
style:
TextStyle
(
fontSize:
14
.
w
,
color:
Colours
.
c3
,
height:
1.1
),),
Text
(
'¥98.9'
,
style:
TextStyle
(
fontSize:
15
.
w
,
color:
AppTheme
.
primary
,
fontWeight:
Fonts
.
medium
,
height:
1.1
),),
SizedBox
(
// color: Colors.cyan,
width:
20
.
w
,
height:
20
.
w
,
child:
Image
.
asset
(
'assets/images/pay_up.png'
)
)
],
),
),
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15
.
w
),
color:
AppTheme
.
primary
GestureDetector
(
onTap:
payTap
,
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
15
.
w
),
color:
AppTheme
.
primary
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
13.5
.
w
,
vertical:
8
.
w
),
child:
Text
(
'确认支付'
,
style:
TextStyle
(
fontSize:
14
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colors
.
white
),),
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
13.5
.
w
,
vertical:
8
.
w
),
child:
Text
(
'确认支付'
,
style:
TextStyle
(
fontSize:
14
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colors
.
white
),),
)
],
),
...
...
lib/pages/book_shop/controller.dart
浏览文件 @
40411fb9
...
...
@@ -189,6 +189,8 @@ class BookshopController extends GetxController {
CourseModel
(
bookName:
'哈1'
,
bookId:
111
,
vipPrice:
'12.33'
,
authors:
'John'
,
status:
1
),
CourseModel
(
bookName:
'哈2'
,
bookId:
123
,
vipPrice:
'12.00'
,
authors:
'json'
,
status:
1
),
CourseModel
(
bookName:
'哈3'
,
bookId:
11
,
vipPrice:
'12.43'
,
authors:
'hash'
,
status:
1
),
CourseModel
(
bookName:
'哈3'
,
bookId:
11
,
vipPrice:
'12.43'
,
authors:
'hash'
,
status:
1
),
CourseModel
(
bookName:
'哈3'
,
bookId:
11
,
vipPrice:
'12.43'
,
authors:
'hash'
,
status:
1
),
];
}
...
...
lib/pages/main/index.dart
浏览文件 @
40411fb9
...
...
@@ -11,6 +11,7 @@ import '../../routes/index.dart';
import
'../../store/index.dart'
;
import
'../book_shop/index.dart'
;
import
'../course/index.dart'
;
import
'../web/index.dart'
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论