Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
book-app
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
book-app
Commits
40c03017
提交
40c03017
authored
2月 22, 2024
作者:
yueweilu
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/test' into test
上级
15b53996
e9bf922f
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
655 行增加
和
58 行删除
+655
-58
coupon_bg_expired.png
assets/images/2.0x/coupon_bg_expired.png
+0
-0
coupon_expired.png
assets/images/2.0x/coupon_expired.png
+0
-0
coupon_bg_expired.png
assets/images/3.0x/coupon_bg_expired.png
+0
-0
coupon_expired.png
assets/images/3.0x/coupon_expired.png
+0
-0
coupon_bg_expired.png
assets/images/coupon_bg_expired.png
+0
-0
coupon_expired.png
assets/images/coupon_expired.png
+0
-0
order.dart
lib/models/order.dart
+12
-0
controller.dart
lib/pages/user_coupon/controller.dart
+5
-1
item.dart
lib/pages/user_coupon/widgets/item.dart
+146
-53
coin.dart
lib/pages/user_order/widgets/coin.dart
+9
-1
controller.dart
lib/pages/user_order_coin_awaiting/controller.dart
+139
-0
index.dart
lib/pages/user_order_coin_awaiting/index.dart
+20
-0
view.dart
lib/pages/user_order_coin_awaiting/view.dart
+306
-0
view.dart
lib/pages/user_order_evaluate/view.dart
+4
-1
index.dart
lib/routes/index.dart
+1
-0
routes.dart
lib/routes/routes.dart
+13
-2
没有找到文件。
assets/images/2.0x/coupon_bg_expired.png
0 → 100644
浏览文件 @
40c03017
7.4 KB
assets/images/2.0x/coupon_expired.png
0 → 100644
浏览文件 @
40c03017
4.0 KB
assets/images/3.0x/coupon_bg_expired.png
0 → 100644
浏览文件 @
40c03017
14.8 KB
assets/images/3.0x/coupon_expired.png
0 → 100644
浏览文件 @
40c03017
8.0 KB
assets/images/coupon_bg_expired.png
0 → 100644
浏览文件 @
40c03017
2.6 KB
assets/images/coupon_expired.png
0 → 100644
浏览文件 @
40c03017
1.9 KB
lib/models/order.dart
浏览文件 @
40c03017
...
...
@@ -264,6 +264,8 @@ class OrderInfoModel {
OrderInfoModel
({
this
.
id
,
this
.
ordersnum
,
this
.
goodsId
,
this
.
goodsName
,
this
.
totalPrice
,
this
.
finalTotalPrice
,
this
.
nums
,
...
...
@@ -282,6 +284,8 @@ class OrderInfoModel {
OrderInfoModel
.
fromJson
(
dynamic
json
)
{
id
=
json
[
'id'
];
ordersnum
=
json
[
'ordersnum'
];
goodsId
=
json
[
'goods_id'
];
goodsName
=
json
[
'goods_name'
];
totalPrice
=
json
[
'total_price'
];
finalTotalPrice
=
json
[
'final_total_price'
];
nums
=
json
[
'num'
];
...
...
@@ -304,6 +308,8 @@ class OrderInfoModel {
}
num
?
id
;
String
?
ordersnum
;
String
?
goodsId
;
//充值的凭证
String
?
goodsName
;
//充值名称
String
?
totalPrice
;
String
?
finalTotalPrice
;
num
?
nums
;
...
...
@@ -320,6 +326,8 @@ class OrderInfoModel {
List
<
BookListModel
>?
bookList
;
OrderInfoModel
copyWith
({
num
?
id
,
String
?
ordersnum
,
String
?
goodsId
,
String
?
goodsName
,
String
?
totalPrice
,
String
?
finalTotalPrice
,
num
?
nums
,
...
...
@@ -336,6 +344,8 @@ class OrderInfoModel {
List
<
BookListModel
>?
bookList
,
})
=>
OrderInfoModel
(
id:
id
??
this
.
id
,
ordersnum:
ordersnum
??
this
.
ordersnum
,
goodsId:
ordersnum
??
this
.
goodsId
,
goodsName:
ordersnum
??
this
.
goodsName
,
totalPrice:
totalPrice
??
this
.
totalPrice
,
finalTotalPrice:
finalTotalPrice
??
this
.
finalTotalPrice
,
nums:
nums
??
this
.
nums
,
...
...
@@ -355,6 +365,8 @@ class OrderInfoModel {
final
map
=
<
String
,
dynamic
>{};
map
[
'id'
]
=
id
;
map
[
'ordersnum'
]
=
ordersnum
;
map
[
'goods_id'
]
=
goodsId
;
map
[
'goods_name'
]
=
goodsName
;
map
[
'total_price'
]
=
totalPrice
;
map
[
'final_total_price'
]
=
finalTotalPrice
;
map
[
'num'
]
=
nums
;
...
...
lib/pages/user_coupon/controller.dart
浏览文件 @
40c03017
...
...
@@ -42,7 +42,11 @@ class UserCouponController extends GetxController {
);
// 如果是刷新 清理数据
if
(
isRefresh
)
coupons
.
clear
();
coupons
.
addAll
(
result
);
for
(
CouponModel
model
in
result
){
model
.
type
=
type
;
coupons
.
add
(
model
);
}
// coupons.addAll(result);
_page
++;
_noMore
=
result
.
length
<
_limit
;
update
();
...
...
lib/pages/user_coupon/widgets/item.dart
浏览文件 @
40c03017
...
...
@@ -2,60 +2,76 @@ part of user_coupon;
class
BuildItem
extends
StatelessWidget
{
final
CouponModel
model
;
const
BuildItem
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
const
BuildItem
({
Key
?
key
,
required
this
.
model
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
ColorFiltered
(
colorFilter:
ColorFilter
.
mode
(
Colors
.
transparent
,
BlendMode
.
saturation
),
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
top:
10
.
w
,
right:
5
.
w
),
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
top:
10
.
w
,
right:
5
.
w
),
child:
Stack
(
children:
[
// Image.asset(model.type ==1?'assets/images/coupon_yes.png':'assets/images/coupon_no.png',
// fit: BoxFit.contain,
// width: double.infinity,),
Image
.
asset
(
'assets/images/coupon_bg.png'
,
model
.
type
==
2
?
'assets/images/coupon_bg.png'
:
'assets/images/coupon_bg_expired.png'
,
fit:
BoxFit
.
contain
,
width:
double
.
infinity
,
),
// Image.asset(
// 'assets/images/coupon_bg.png',
// fit: BoxFit.contain,
// width: double.infinity,
// ),
SizedBox
(
height:
105
.
w
,
child:
Row
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
SizedBox
(
width:
120
.
w
,
width:
120
.
w
,
height:
100
.
w
,
child:
Column
(
children:
[
RichText
(
overflow:
TextOverflow
.
ellipsis
,
// 设置省略号
text:
TextSpan
(
children:
<
TextSpan
>[
text:
TextSpan
(
children:
<
TextSpan
>[
TextSpan
(
text:
'¥'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
boldSemi
,
height:
1.5
,
color:
Colors
.
white
)
),
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
boldSemi
,
height:
1.5
,
color:
model
.
type
==
2
?
Colors
.
white
:
Colours
.
cC8
)),
TextSpan
(
text:
model
.
reducedPrice
.
toString
(),
style:
TextStyle
(
fontSize:
40
.
w
,
fontWeight:
Fonts
.
boldSemi
,
height:
1.5
,
color:
Colors
.
white
)
),
]
),
style:
TextStyle
(
fontSize:
40
.
w
,
fontWeight:
Fonts
.
boldSemi
,
height:
1.5
,
color:
model
.
type
==
2
?
Colors
.
white
:
Colours
.
cC8
)),
]),
),
Text
(
'满
${model.normPrice}
可用'
,
style:
TextStyle
(
fontSize:
11
.
w
,
height:
1.5
,
color:
Colors
.
white
),)
Text
(
'满
${model.normPrice}
可用'
,
style:
TextStyle
(
fontSize:
11
.
w
,
height:
1.5
,
color:
model
.
type
==
2
?
Colors
.
white
:
Colours
.
cC8
),
)
],
),
// color: Colors.cyan,
),
Expanded
(
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
11
.
w
,
right:
10
.
w
),
margin:
EdgeInsets
.
only
(
left:
11
.
w
,
right:
10
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
...
...
@@ -65,18 +81,43 @@ class BuildItem extends StatelessWidget {
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
model
.
couponName
??
''
,
style:
TextStyle
(
fontSize:
16
.
w
,
fontWeight:
Fonts
.
medium
,
height:
1.5
,
color:
Colours
.
c3
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Text
(
model
.
couponName
??
''
,
style:
TextStyle
(
fontSize:
16
.
w
,
fontWeight:
Fonts
.
medium
,
height:
1.5
,
color:
model
.
type
==
2
?
Colours
.
c3
:
Colours
.
c9
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
Gaps
.
vGaps5
,
Text
(
'满
${model.normPrice}
减
${model.reducedPrice}
元'
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.5
,
color:
Colours
.
c9
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Text
(
'满
${model.normPrice}
减
${model.reducedPrice}
元'
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.5
,
color:
Colours
.
c9
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
Gaps
.
vGaps5
,
Text
(
'有效至:
${model.endTime}
'
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.5
,
color:
Colours
.
c9
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,),
Text
(
'有效至:
${model.endTime}
'
,
style:
TextStyle
(
fontSize:
12
.
w
,
height:
1.5
,
color:
Colours
.
c9
),
maxLines:
1
,
overflow:
TextOverflow
.
ellipsis
,
),
],
),
),
Stack
(
model
.
type
==
2
?
Stack
(
children:
[
//TODO 暂时隐藏 立即使用 按钮
/* Positioned(
...
...
@@ -111,10 +152,14 @@ class BuildItem extends StatelessWidget {
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Stack
(
children:
[
Stack
(
...
...
@@ -122,42 +167,74 @@ class BuildItem extends StatelessWidget {
Positioned
(
right:
10
.
w
,
top:
10
.
w
,
child:
GestureDetector
(
onTap:
(){
Navigator
.
of
(
context
).
pop
();
child:
GestureDetector
(
onTap:
()
{
Navigator
.
of
(
context
)
.
pop
();
},
child:
SizedBox
(
width:
20
.
w
,
height:
20
.
w
,
child:
Image
.
asset
(
'assets/images/close.png'
),
child:
Image
.
asset
(
'assets/images/close.png'
),
),
),
),
Container
(
padding:
EdgeInsets
.
only
(
top:
29.5
.
w
),
alignment:
Alignment
.
topCenter
,
padding:
EdgeInsets
.
only
(
top:
29.5
.
w
),
alignment:
Alignment
.
topCenter
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
'优惠券使用细则'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
),
),
SizedBox
(
height:
14
.
w
,
),
SizedBox
(
height:
14
.
w
,),
Container
(
padding:
EdgeInsets
.
only
(
left:
25.5
.
w
,
right:
18
.
w
),
child:
Text
(
'1.在系统开启情况下购买书籍可使用优惠券,金额需满足优惠券的限制金额。
\n\n
2.每笔订单最多使用一张优惠券,不可叠加使用。'
,
style:
TextStyle
(
fontSize:
11
.
w
,
color:
Colours
.
c9
,
padding:
EdgeInsets
.
only
(
left:
25.5
.
w
,
right:
18
.
w
),
child:
Text
(
'1.在系统开启情况下购买书籍可使用优惠券,金额需满足优惠券的限制金额。
\n\n
2.每笔订单最多使用一张优惠券,不可叠加使用。'
,
style:
TextStyle
(
fontSize:
11
.
w
,
color:
Colours
.
c9
,
),
),
),
SizedBox
(
height:
26.5
.
w
,
),
SizedBox
(
height:
26.5
.
w
,),
],
),
),
...
...
@@ -165,27 +242,43 @@ class BuildItem extends StatelessWidget {
),
],
),
],),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
);
},
);
},
child:
Container
(
padding:
EdgeInsets
.
only
(
bottom:
14
.
w
),
child:
Text
(
'优惠券使用规则>'
,
style:
TextStyle
(
fontSize:
10
.
w
,
fontWeight:
Fonts
.
medium
,
color:
AppTheme
.
primary
),),
padding:
EdgeInsets
.
only
(
bottom:
14
.
w
),
child:
Text
(
'优惠券使用规则>'
,
style:
TextStyle
(
fontSize:
10
.
w
,
fontWeight:
Fonts
.
medium
,
color:
AppTheme
.
primary
),
),
),
),
),
],
)
:
Container
(
alignment:
Alignment
.
center
,
padding:
EdgeInsets
.
only
(
right:
5.5
.
w
),
child:
SizedBox
(
height:
40
.
w
,
width:
64
.
w
,
child:
Image
.
asset
(
"assets/images/coupon_expired.png"
),
),
),
],
),
),
)
],
),
)
...
...
lib/pages/user_order/widgets/coin.dart
浏览文件 @
40c03017
...
...
@@ -15,7 +15,14 @@ class BuiltCoin extends StatelessWidget {
}
else
if
(
model
.
status
==
3
){
status
=
'已完成'
;
}
return
Container
(
return
GestureDetector
(
onTap:
()
{
if
(
model
.
status
==
1
){
context
.
pushNamed
(
Routes
.
orderCoinAwaiting
,
queryParameters:
{
'orderNum'
:
model
.
ordersnum
});
}
},
child:
Container
(
margin:
EdgeInsets
.
only
(
left:
10
.
w
,
right:
10
.
w
,
top:
10
.
w
),
padding:
EdgeInsets
.
only
(
left:
11.5
.
w
),
decoration:
BoxDecoration
(
...
...
@@ -93,6 +100,7 @@ class BuiltCoin extends StatelessWidget {
)),
],
),
),
);
}
}
lib/pages/user_order_coin_awaiting/controller.dart
0 → 100644
浏览文件 @
40c03017
part of
user_order_coin_awaiting
;
/// 紫荆币等待付款订单
class
UserOrderCoinAwaitingController
extends
GetxController
{
final
String
orderNum
;
UserOrderCoinAwaitingController
(
this
.
orderNum
);
// 订单编号
late
OrderInfoModel
model
;
// 应付款、订单编号等
List
<
OrderCompletedModel
>
orderAwaitings
=
[];
// 支付宝
Tobias
tobias
=
Tobias
();
// 微信
Fluwx
fluwx
=
Fluwx
();
late
PayOrderModel
payOrderModel
;
@override
void
onReady
()
{
getOrderInfo
();
super
.
onReady
();
}
/// 取消订单
void
cancelPay
()
async
{
final
result
=
await
MineAPI
.
cancelPay
(
ordersnum:
orderNum
);
if
(
result
)
{
Toast
.
show
(
'取消成功'
);
update
();
}
}
/// 获取订单信息
Future
<
void
>
getOrderInfo
()
async
{
model
=
await
MineAPI
.
getOrderInfo
(
orderNum:
orderNum
);
String
payWay
=
''
;
if
(
model
.
payType
==
1
){
payWay
=
'微信'
;
}
else
if
(
model
.
payType
==
2
){
payWay
=
'支付宝'
;
}
else
if
(
model
.
payType
==
3
){
payWay
=
'紫荆币'
;
}
orderAwaitings
=
[
OrderCompletedModel
(
name:
'订单编号'
,
value:
model
.
ordersnum
.
toString
()),
OrderCompletedModel
(
name:
'支付方式'
,
value:
payWay
),
OrderCompletedModel
(
name:
'支付时间'
,
value:
model
.
payTime
.
toString
()),
];
update
();
}
Future
<
void
>
payOrder
()
async
{
if
(
model
.
payType
==
3
){
final
result
=
await
MineAPI
.
coinPay
(
ordersNum:
orderNum
);
if
(
result
){
Toast
.
show
(
'订单支付完成'
);
getOrderInfo
();
}
}
else
{
payOrderModel
=
await
MineAPI
.
getPayInfo
(
ordersNum:
orderNum
);
// 支付宝
if
(
model
.
payType
==
2
){
final
result
=
await
tobias
.
isAliPayInstalled
;
if
(!
result
){
Toast
.
show
(
'请先安装支付宝'
);
}
else
{
requestAliPay
();
}
}
// 微信
if
(
model
.
payType
==
1
){
final
result
=
await
fluwx
.
isWeChatInstalled
;
if
(!
result
){
Toast
.
show
(
'请先安装微信'
);
}
else
{
requestWechat
();
}
}
}
}
// 支付宝支付
void
requestAliPay
(){
print
(
'================================================================
${payOrderModel.encryptionOrder!}
'
);
tobias
.
pay
(
payOrderModel
.
encryptionOrder
!).
then
((
payResult
){
if
(
payResult
[
'resultStatus'
]
==
'9000'
)
{
requestOrderStatus
();
}
else
{
Toast
.
show
(
payResult
[
'memo'
].
toString
());
}
});
}
// 微信支付
void
requestWechat
(){
Payment
payment
=
Payment
(
appId:
payOrderModel
.
appid
??
''
,
partnerId:
payOrderModel
.
partnerid
??
''
,
prepayId:
payOrderModel
.
prepayid
??
''
,
packageValue:
payOrderModel
.
package
??
''
,
nonceStr:
payOrderModel
.
noncestr
??
''
,
timestamp:
payOrderModel
.
timestamp
!.
toInt
(),
sign:
payOrderModel
.
sign
??
''
);
fluwx
.
pay
(
which:
payment
);
fluwx
.
addSubscriber
((
response
)
{
if
(
response
.
errCode
==
0
)
{
requestOrderStatus
();
}
else
{
Toast
.
show
(
'
${response.errStr}
'
);
}
});
}
void
requestOrderStatus
()
async
{
final
result
=
await
ShopAPI
.
orderStatus
(
orderNumber:
payOrderModel
.
ordersnum
??
''
,
receipt:
''
);
if
(
result
.
paySuccess
==
1
){
Toast
.
show
(
'订单支付完成'
);
getOrderInfo
();
}
}
}
lib/pages/user_order_coin_awaiting/index.dart
0 → 100644
浏览文件 @
40c03017
library
user_order_coin_awaiting
;
import
'package:flutter/material.dart'
;
import
'package:flutter_book/theme.dart'
;
import
'package:flutter_book/utils/index.dart'
;
import
'package:flutter_book/widgets/index.dart'
;
import
'package:fluwx/fluwx.dart'
;
import
'package:get/get.dart'
;
import
'package:get/get_state_manager/src/simple/get_controllers.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:get/get_state_manager/src/simple/get_state.dart'
;
import
'package:go_router/go_router.dart'
;
import
'package:tobias/tobias.dart'
;
import
'../../apis/index.dart'
;
import
'../../models/index.dart'
;
part
'view.dart'
;
part
'controller.dart'
;
\ No newline at end of file
lib/pages/user_order_coin_awaiting/view.dart
0 → 100644
浏览文件 @
40c03017
part of
user_order_coin_awaiting
;
/// 紫荆币待支付
class
UserOrderCoinAwaitingPage
extends
StatefulWidget
{
final
String
orderNum
;
// 订单编号
const
UserOrderCoinAwaitingPage
({
Key
?
key
,
required
this
.
orderNum
})
:
super
(
key:
key
);
@override
State
<
UserOrderCoinAwaitingPage
>
createState
()
=>
_UserOrderCoinAwaitingState
();
}
class
_UserOrderCoinAwaitingState
extends
State
<
UserOrderCoinAwaitingPage
>
{
late
UserOrderCoinAwaitingController
myController
;
@override
void
initState
()
{
myController
=
Get
.
put
(
UserOrderCoinAwaitingController
(
widget
.
orderNum
));
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
FutureBuilder
(
future:
myController
.
getOrderInfo
(),
builder:
(
context
,
snapshot
)
{
if
(
snapshot
.
connectionState
==
ConnectionState
.
waiting
)
{
return
Scaffold
(
appBar:
AppBar
(
centerTitle:
true
,
title:
const
Text
(
'待支付'
),
),
);
}
else
{
return
WillPopScope
(
onWillPop:
()
async
{
context
.
pop
(
true
);
return
false
;
},
child:
GetBuilder
<
UserOrderCoinAwaitingController
>(
init:
UserOrderCoinAwaitingController
(
widget
.
orderNum
),
builder:
(
controller
)
=>
Scaffold
(
appBar:
CustomAppBar
(
title:
const
Text
(
'待支付'
),
actions:
[],
),
body:
Column
(
children:
[
Container
(
margin:
EdgeInsets
.
symmetric
(
horizontal:
AppTheme
.
margin
,
vertical:
AppTheme
.
margin
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colours
.
cC7
.
withOpacity
(
0.5
),
offset:
Offset
(
3
.
w
,
0
),
blurRadius:
10
.
w
,
spreadRadius:
0
.
w
,
),
],
),
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
8
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Padding
(
padding:
EdgeInsets
.
only
(
left:
12.0
.
w
,
top:
17.5
.
w
,
bottom:
12.0
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Image
.
asset
(
'assets/images/coin.png'
,
// fit: BoxFit.cover, // 设置适应方式为充满
width:
42.0
.
w
,
height:
42.0
.
w
,
),
Expanded
(
child:
Padding
(
padding:
EdgeInsets
.
only
(
right:
16.5
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
end
,
// 下面的Text靠左
children:
[
Text
(
'充值
${controller.model.bean}
紫荆币'
,
style:
TextStyle
(
color:
Colours
.
c3
,
fontWeight:
Fonts
.
bold
,
fontSize:
13
.
w
,
),
maxLines:
2
,
overflow:
TextOverflow
.
ellipsis
,
// 超过部分显示省略号
),
SizedBox
(
height:
9
.
w
),
Text
(
"需付款 ¥
${controller.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:
controller
.
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
,
),
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:
GestureDetector
(
onTap:
()
{
// print("保存昵称");
// context.pushNamed(Routes.orderEvaluate);
},
child:
Text
(
'立即支付 ¥
${controller.model.finalTotalPrice}
'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
14
.
w
,
color:
Colours
.
cFF
),
)),
),
),
SizedBox
(
height:
11.5
.
w
,
),
GestureDetector
(
onTap:
()
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
{
return
AlertDialog
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
8.0
.
w
),
),
contentPadding:
EdgeInsets
.
zero
,
// 移除内容部分的内边距
content:
Wrap
(
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
44
.
w
,
bottom:
29
.
w
),
// 调整上下间距
child:
Center
(
child:
Text
(
'确定取消订单吗'
,
style:
TextStyle
(
fontSize:
15
.
w
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c3
,
),
),
),
),
Container
(
height:
1
.
w
,
// 设置分割线的高度
width:
double
.
infinity
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
],
),
// 去除操作按钮区域的内边距
actionsPadding:
EdgeInsets
.
zero
,
actions:
<
Widget
>[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
// 或者使用MainAxisAlignment.spaceEvenly
children:
[
GestureDetector
(
onTap:
()
=>
Navigator
.
of
(
context
).
pop
(),
child:
const
Text
(
'取消'
,
style:
TextStyle
(
fontSize:
12
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
c6
,
),
),
),
Container
(
height:
39.5
.
w
,
// 设置分割线的高度
width:
1
,
// 设置分割线的宽度
color:
Colours
.
cLine
,
// 设置分割线的颜色
),
GestureDetector
(
onTap:
()
{
controller
.
cancelPay
();
Navigator
.
of
(
context
).
pop
();
Navigator
.
pop
(
context
);
},
child:
const
Text
(
'确定'
,
style:
TextStyle
(
fontSize:
12
,
fontWeight:
Fonts
.
medium
,
color:
Colours
.
cAB1941
,
),
),
),
],
),
],
);
},
);
},
child:
Text
(
'取消订单'
,
style:
TextStyle
(
fontWeight:
Fonts
.
medium
,
fontSize:
15
.
w
,
color:
Colours
.
c9
,
),
),
),
],
),
)),
);
}
},
);
}
}
lib/pages/user_order_evaluate/view.dart
浏览文件 @
40c03017
...
...
@@ -15,7 +15,7 @@ class UserOrderEvaluatePage extends StatefulWidget {
State
<
UserOrderEvaluatePage
>
createState
()
=>
_UserOrderEvaluatePageState
();
}
class
_UserOrderEvaluatePageState
extends
State
<
UserOrderEvaluatePage
>
{
class
_UserOrderEvaluatePageState
extends
State
<
UserOrderEvaluatePage
>
with
AutomaticKeepAliveClientMixin
{
late
UserOrderEvaluateController
myController
;
List
<
TextEditingController
>
controllers
=
[];
List
<
OrderEvaluate
>
orderEvaluates
=
[];
...
...
@@ -290,4 +290,7 @@ class _UserOrderEvaluatePageState extends State<UserOrderEvaluatePage> {
),
);
}
@override
bool
get
wantKeepAlive
=>
true
;
}
lib/routes/index.dart
浏览文件 @
40c03017
...
...
@@ -33,6 +33,7 @@ import 'package:flutter_book/pages/user_nick/index.dart';
import
'package:flutter_book/pages/user_notes/index.dart'
;
import
'package:flutter_book/pages/user_notes_des/index.dart'
;
import
'package:flutter_book/pages/user_order_awaiting/index.dart'
;
import
'package:flutter_book/pages/user_order_coin_awaiting/index.dart'
;
import
'package:flutter_book/pages/user_order_completed/index.dart'
;
import
'package:flutter_book/pages/user_order_refunded/index.dart'
;
import
'package:flutter_book/pages/user_point/index.dart'
;
...
...
lib/routes/routes.dart
浏览文件 @
40c03017
...
...
@@ -108,8 +108,10 @@ abstract class Routes {
static
const
order
=
'order'
;
// 已完成订单
static
const
orderCompleted
=
'order_completed'
;
// 待付款订单
//
图书
待付款订单
static
const
orderAwaiting
=
'order_awaiting'
;
// 紫荆币待付款订单
static
const
orderCoinAwaiting
=
'order_coin_awaiting'
;
// 已退款订单
static
const
orderRefunded
=
'order_refunded'
;
// 搜索订单
...
...
@@ -528,7 +530,7 @@ abstract class Routes {
child:
UserOrderCompletedPage
(
orderNum:
state
.
uri
.
queryParameters
[
'orderNum'
].
toString
())
)
),
GoRoute
(
// 待付款订单
GoRoute
(
//
图书
待付款订单
path:
'/
$orderAwaiting
'
,
name:
orderAwaiting
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
...
...
@@ -537,6 +539,15 @@ abstract class Routes {
child:
UserOrderAwaitingPage
(
orderNum:
state
.
uri
.
queryParameters
[
'orderNum'
].
toString
())
)
),
GoRoute
(
// 紫荆币待付款订单
path:
'/
$orderCoinAwaiting
'
,
name:
orderCoinAwaiting
,
pageBuilder:
(
context
,
state
)
=>
CupertinoPage
(
name:
state
.
uri
.
toString
(),
key:
state
.
pageKey
,
child:
UserOrderCoinAwaitingPage
(
orderNum:
state
.
uri
.
queryParameters
[
'orderNum'
].
toString
())
)
),
GoRoute
(
// 已退款订单
path:
'/
$orderRefunded
'
,
name:
orderRefunded
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论