提交 b0c5b2ee authored 作者: maodou's avatar maodou

1:修复订单列表点击查看详情与列表项不一致问题

2:修复订单列表进入后数据请求多次的问题 3:弹窗可点击区域扩大
上级 7a9c606e
...@@ -164,6 +164,11 @@ class OrderListModel { ...@@ -164,6 +164,11 @@ class OrderListModel {
} }
return map; return map;
} }
@override
String toString() {
return 'OrderListModel{id: $id, ordersnum: $ordersnum, totalPrice: $totalPrice, finalTotalPrice: $finalTotalPrice, num_: $num_, status: $status, payType: $payType, types: $types, createTime: $createTime, cartList: $cartList}';
}
} }
/// 书籍列表 /// 书籍列表
......
...@@ -195,26 +195,26 @@ class _LoginPageState extends State<LoginPage> { ...@@ -195,26 +195,26 @@ class _LoginPageState extends State<LoginPage> {
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(
width: 10.w, width: 14.w,
height: 10.w, height: 14.w,
// color: AppTheme.primary, // color: AppTheme.primary,
child: Image.asset( child: Image.asset(
controller.agree?'assets/images/check_box_select.png':'assets/images/uncheck.png', controller.agree?'assets/images/check_box_select.png':'assets/images/uncheck.png',
), ),
), ),
Gaps.hGaps5, Gaps.hGaps5,
Text('我已阅读并同意',style: TextStyle(color: Colours.c9,fontSize:10.w,height: 1.4)), Text('我已阅读并同意',style: TextStyle(color: Colours.c9,fontSize:14.w,height: 1.4)),
], ],
), ),
), ),
GestureDetector( GestureDetector(
child: Text('《用户协议》',style: TextStyle(color: Colours.cBlue,fontSize:10.w,height: 1.4)), child: Text('《用户协议》',style: TextStyle(color: Colours.cBlue,fontSize:14.w,height: 1.4)),
onTap: (){ onTap: (){
context.pushNamed(Routes.terms); context.pushNamed(Routes.terms);
}, },
), ),
GestureDetector( GestureDetector(
child: Text('《隐私政策》',style: TextStyle(color: Colours.cBlue,fontSize:10.w,height: 1.4)), child: Text('《隐私政策》',style: TextStyle(color: Colours.cBlue,fontSize:14.w,height: 1.4)),
onTap: (){ onTap: (){
context.pushNamed(Routes.terms); context.pushNamed(Routes.terms);
}, },
......
...@@ -29,16 +29,9 @@ class UserOrderController extends GetxController ...@@ -29,16 +29,9 @@ class UserOrderController extends GetxController
int _page = 1; int _page = 1;
bool _noMore = false; bool _noMore = false;
@override
void onInit() {
super.onInit();
}
@override @override
void onReady() { void onReady() {
onRefresh(); // onRefresh();
super.onReady(); super.onReady();
} }
...@@ -68,6 +61,7 @@ class UserOrderController extends GetxController ...@@ -68,6 +61,7 @@ class UserOrderController extends GetxController
void onRefresh() async { void onRefresh() async {
try { try {
await _getOrders(isRefresh:true); await _getOrders(isRefresh:true);
refreshController.finishRefresh(IndicatorResult.success); refreshController.finishRefresh(IndicatorResult.success);
refreshController.resetFooter(); refreshController.resetFooter();
} catch (error) { } catch (error) {
......
...@@ -2,10 +2,10 @@ part of user_order_awaiting; ...@@ -2,10 +2,10 @@ part of user_order_awaiting;
/// 等待付款订单 /// 等待付款订单
class UserOrderAwaitingController extends GetxController { class UserOrderAwaitingController extends GetxController {
final String orderNum; late String _orderNum;
final BuildContext context; final BuildContext context;
UserOrderAwaitingController(this.orderNum,this.context); // 订单编号 UserOrderAwaitingController(this.context); // 订单编号
late OrderInfoModel model; late OrderInfoModel model;
// 应付款、订单编号等 // 应付款、订单编号等
...@@ -18,6 +18,12 @@ class UserOrderAwaitingController extends GetxController { ...@@ -18,6 +18,12 @@ class UserOrderAwaitingController extends GetxController {
late PayOrderModel payOrderModel; late PayOrderModel payOrderModel;
String get orderNum => _orderNum; // 获取订单编号的方法
// 更新订单编号的方法
void updateOrderNum(String newOrderNum) {
_orderNum = newOrderNum;
}
@override @override
void onReady() { void onReady() {
......
...@@ -13,7 +13,8 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -13,7 +13,8 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
@override @override
void initState() { void initState() {
myController = Get.put(UserOrderAwaitingController(widget.orderNum,context)); myController = Get.put(UserOrderAwaitingController(context));
myController.updateOrderNum(widget.orderNum);
super.initState(); super.initState();
} }
...@@ -33,254 +34,267 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -33,254 +34,267 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
context.pop(true); context.pop(true);
return false; return false;
}, },
child: GetBuilder<UserOrderAwaitingController>( child: Scaffold(
init: UserOrderAwaitingController(widget.orderNum,context), appBar: CustomAppBar(
builder: (controller) => Scaffold( title: const Text('等待付款'),
appBar: CustomAppBar( actions: [],
title: const Text('等待付款'), ),
actions: [], body: Column(
), children: [
body: Column( 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: [ children: [
Container( Padding(
margin: EdgeInsets.symmetric( padding: EdgeInsets.only(
horizontal: AppTheme.margin, left: 12.0.w, top: 12.0.w, bottom: 12.0.w),
vertical: AppTheme.margin), child: Row(
decoration: BoxDecoration( mainAxisAlignment: MainAxisAlignment.start,
borderRadius: BorderRadius.circular(8.w), crossAxisAlignment: CrossAxisAlignment.start,
color: Colors.white, children: [
boxShadow: [ Image.network(
BoxShadow( myController.model?.bookList?[0].img??'',
color: Colours.cC7.withOpacity(0.5), fit: BoxFit.cover, // 设置适应方式为充满
offset: Offset(3.w, 0), width: 72.0.w,
blurRadius: 10.w, height: 86.0.w,
spreadRadius: 0.w,
), ),
], Expanded(
), child: Padding(
child: ClipRRect(
borderRadius: BorderRadius.circular(8.w),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
left: 12.0.w, top: 12.0.w, bottom: 12.0.w), left: 12.0.w,
child: Row( top: 5.5.w,
mainAxisAlignment: MainAxisAlignment.start, right: 23.5.w),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.end, // 下面的Text靠左
children: [ children: [
Image.network( Text(
controller.model?.bookList?[0].img??'', myController.model.bookList?[0].name??'',
fit: BoxFit.cover, // 设置适应方式为充满 style: TextStyle(
width: 72.0.w, color: Colours.c3,
height: 86.0.w, fontWeight: Fonts.bold,
fontSize: 13.w,
),
maxLines: 2,
overflow: TextOverflow
.ellipsis, // 超过部分显示省略号
), ),
Expanded( SizedBox(height: 25.5.w),
child: Padding( Text(
padding: EdgeInsets.only( "需付款 ¥${myController.model.finalTotalPrice}",
left: 12.0.w, style: TextStyle(
top: 5.5.w, color: Colours.cAB1941,
right: 23.5.w), fontWeight: Fonts.bold,
child: Column( fontSize: 14.w,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment:
CrossAxisAlignment.end, // 下面的Text靠左
children: [
Text(
controller.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(
"需付款 ¥${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( Container(
height: 39.w, color: Colours.cLine,
margin: EdgeInsets.only(
left: 10.w, right: 10.w, bottom: 12.w),
height: 1.w,
), ),
GestureDetector( Container(
onTap: (){ padding: EdgeInsets.only(
controller.payOrder(); left: 11.5.w, bottom: 8.w, right: 23.5.w),
}, child: Column(
child: Container( mainAxisAlignment:
margin: EdgeInsets.symmetric(horizontal: 15.w), MainAxisAlignment.spaceEvenly,
height: 40.w, children:
decoration: BoxDecoration( myController.orderAwaitings.map((model) {
color: AppTheme.primary, return Padding(
borderRadius: BorderRadius.circular(180.w), padding: EdgeInsets.only(top: 12.w),
border: child: Row(
Border.all(color: Colours.cC31F4C, width: 0.5.w)), mainAxisAlignment:
child: Center( MainAxisAlignment.spaceBetween,
child: Text( children: [
'立即支付 ¥${controller.model.finalTotalPrice}', Text(
style: TextStyle( model.name,
fontWeight: Fonts.medium, style: TextStyle(
fontSize: 14.w, fontSize: 13.w,
color: Colours.cFF), 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( SizedBox(
height: 11.5.w, height: 13.5.w,
), ),
GestureDetector( ],
onTap: () { ),
showDialog( ),
context: context, ),
builder: (BuildContext context) { SizedBox(
return AlertDialog( height: 39.w,
shape: RoundedRectangleBorder( ),
borderRadius: BorderRadius.circular(8.0.w), GestureDetector(
onTap: (){
myController.payOrder();
},
child: Container(
margin: EdgeInsets.symmetric(horizontal: 15.w),
height: 40.w,
decoration: BoxDecoration(
color: AppTheme.primary,
borderRadius: BorderRadius.circular(180.w),
border:
Border.all(color: Colours.cC31F4C, width: 0.5.w)),
child: Center(
child: Text(
'立即支付 ¥${myController.model.finalTotalPrice}',
style: TextStyle(
fontWeight: Fonts.medium,
fontSize: 14.w,
color: Colours.cFF),
),
),
),
),
SizedBox(
height: 11.5.w,
),
GestureDetector(
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.0.w),
),
contentPadding: EdgeInsets.zero, // 移除内容部分的内边距
content: Wrap(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,
), ),
contentPadding: EdgeInsets.zero, // 移除内容部分的内边距 ),
content: Wrap(children: [ ),
Container( ),
margin: EdgeInsets.only(top: 44.w, bottom: 29.w), // 调整上下间距 Container(
child: Center( height: 1.w, // 设置分割线的高度
child: Text( width: double.infinity, // 设置分割线的宽度
'确定取消订单吗', color: Colours.cLine, // 设置分割线的颜色
style: TextStyle( ),
fontSize: 15.w, ],),
fontWeight: Fonts.medium, // 去除操作按钮区域的内边距
color: Colours.c3, actionsPadding: EdgeInsets.zero,
), actions: <Widget>[
), Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // 或者使用MainAxisAlignment.spaceEvenly
children: [
GestureDetector(
onTap: () => Navigator.of(context).pop(),
child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消',
style: TextStyle(
fontSize: 12,
fontWeight: Fonts.medium,
color: Colours.c6,
), ),
), ),
Container( ),
height: 1.w, // 设置分割线的高度 ),
width: double.infinity, // 设置分割线的宽度 Container(
color: Colours.cLine, // 设置分割线的颜色 height: 39.5.w, // 设置分割线的高度
), width: 1, // 设置分割线的宽度
],), color: Colours.cLine, // 设置分割线的颜色
// 去除操作按钮区域的内边距 ),
actionsPadding: EdgeInsets.zero, GestureDetector(
actions: <Widget>[ onTap: () {
Row( myController.cancelPay();
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // 或者使用MainAxisAlignment.spaceEvenly Navigator.of(context).pop();
children: [ Navigator.pop(context);
GestureDetector( },
onTap: () => Navigator.of(context).pop(), child: Container(
child: const Text( width: 105.w,
'取消', color: Colours.cFF,
style: TextStyle( alignment: Alignment.center,
fontSize: 12, child: const Text(
fontWeight: Fonts.medium, '确定',
color: Colours.c6, style: TextStyle(
), fontSize: 12,
), fontWeight: Fonts.medium,
), color: Colours.cAB1941,
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,
), ),
),
),
], ],
);
},
);
},
child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消订单',
style: TextStyle(
fontWeight: Fonts.medium,
fontSize: 15,
color: Colours.c9,
),
), ),
)), ),
); ; ),
],
),
),
);
} }
......
...@@ -2,10 +2,14 @@ part of user_order_coin_awaiting; ...@@ -2,10 +2,14 @@ part of user_order_coin_awaiting;
/// 紫荆币等待付款订单 /// 紫荆币等待付款订单
class UserOrderCoinAwaitingController extends GetxController { class UserOrderCoinAwaitingController extends GetxController {
final String orderNum; late String _orderNum;
UserOrderCoinAwaitingController(this.orderNum); // 订单编号
String get orderNum => _orderNum; // 获取订单编号的方法
UserOrderCoinAwaitingController();
// 更新订单编号的方法
void updateOrderNum(String newOrderNum) {
_orderNum = newOrderNum;
}
late OrderInfoModel model; late OrderInfoModel model;
// 应付款、订单编号等 // 应付款、订单编号等
List<OrderCompletedModel> orderAwaitings = []; List<OrderCompletedModel> orderAwaitings = [];
...@@ -33,9 +37,6 @@ class UserOrderCoinAwaitingController extends GetxController { ...@@ -33,9 +37,6 @@ class UserOrderCoinAwaitingController extends GetxController {
} }
} }
/// 获取订单信息 /// 获取订单信息
Future<void> getOrderInfo() async { Future<void> getOrderInfo() async {
model = await MineAPI.getOrderInfo(orderNum: orderNum); model = await MineAPI.getOrderInfo(orderNum: orderNum);
...@@ -91,7 +92,6 @@ class UserOrderCoinAwaitingController extends GetxController { ...@@ -91,7 +92,6 @@ class UserOrderCoinAwaitingController extends GetxController {
// 支付宝支付 // 支付宝支付
void requestAliPay(){ void requestAliPay(){
print('================================================================${payOrderModel.encryptionOrder!}'); print('================================================================${payOrderModel.encryptionOrder!}');
tobias.pay(payOrderModel.encryptionOrder!).then((payResult){ tobias.pay(payOrderModel.encryptionOrder!).then((payResult){
if (payResult['resultStatus'] == '9000') { if (payResult['resultStatus'] == '9000') {
......
...@@ -16,7 +16,8 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -16,7 +16,8 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
@override @override
void initState() { void initState() {
myController = Get.put(UserOrderCoinAwaitingController(widget.orderNum)); myController = Get.put(UserOrderCoinAwaitingController());
myController.updateOrderNum(widget.orderNum);
super.initState(); super.initState();
} }
...@@ -38,266 +39,279 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -38,266 +39,279 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
context.pop(true); context.pop(true);
return false; return false;
}, },
child: GetBuilder<UserOrderCoinAwaitingController>( child: Scaffold(
init: UserOrderCoinAwaitingController(widget.orderNum), appBar: CustomAppBar(
builder: (controller) => Scaffold( title: const Text('待支付'),
appBar: CustomAppBar( actions: [],
title: const Text('待支付'), ),
actions: [], body: Column(
), children: [
body: Column( 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: [ children: [
Container( Padding(
margin: EdgeInsets.symmetric( padding: EdgeInsets.only(
horizontal: AppTheme.margin, left: 12.0.w,
vertical: AppTheme.margin), top: 17.5.w,
decoration: BoxDecoration( bottom: 12.0.w),
borderRadius: BorderRadius.circular(8.w), child: Row(
color: Colors.white, mainAxisAlignment:
boxShadow: [ MainAxisAlignment.start,
BoxShadow( crossAxisAlignment:
color: Colours.cC7.withOpacity(0.5), CrossAxisAlignment.start,
offset: Offset(3.w, 0), children: [
blurRadius: 10.w, Image.asset(
spreadRadius: 0.w, 'assets/images/coin.png',
// fit: BoxFit.cover, // 设置适应方式为充满
width: 42.0.w,
height: 42.0.w,
), ),
], Expanded(
), child: Padding(
child: ClipRRect( padding:
borderRadius: BorderRadius.circular(8.w), EdgeInsets.only(right: 16.5.w),
child: Column( 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:
MainAxisAlignment.start, MainAxisAlignment
.spaceBetween,
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.end,
// 下面的Text靠左
children: [ children: [
Image.asset( Text(
'assets/images/coin.png', '充值${myController.model.bean}紫荆币',
// fit: BoxFit.cover, // 设置适应方式为充满 style: TextStyle(
width: 42.0.w, color: Colours.c3,
height: 42.0.w, fontWeight: Fonts.bold,
fontSize: 13.w,
),
maxLines: 2,
overflow: TextOverflow
.ellipsis, // 超过部分显示省略号
), ),
Expanded( SizedBox(height: 9.w),
child: Padding( Text(
padding: "需付款 ¥${myController.model.finalTotalPrice}",
EdgeInsets.only(right: 16.5.w), style: TextStyle(
child: Column( color: Colours.cAB1941,
mainAxisAlignment: fontWeight: Fonts.bold,
MainAxisAlignment fontSize: 14.w,
.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( Container(
height: 11.5.w, color: Colours.cLine,
margin: EdgeInsets.only(
left: 10.w, right: 10.w, bottom: 12.w),
height: 1.w,
), ),
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 15.w), padding: EdgeInsets.only(
height: 40.w, left: 11.5.w,
decoration: BoxDecoration( bottom: 8.w,
color: AppTheme.primary, right: 23.5.w),
borderRadius: BorderRadius.circular(180.w), child: Column(
border: Border.all( mainAxisAlignment:
color: Colours.cC31F4C, width: 0.5.w)), MainAxisAlignment.spaceEvenly,
child: Center( children: myController.orderAwaitings
child: GestureDetector( .map((model) {
onTap: () { return Padding(
// print("保存昵称"); padding: EdgeInsets.only(top: 12.w),
// context.pushNamed(Routes.orderEvaluate); child: Row(
}, mainAxisAlignment:
child: Text( MainAxisAlignment.spaceBetween,
'立即支付 ¥${controller.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( SizedBox(
height: 11.5.w, height: 13.5.w,
), ),
GestureDetector( ],
onTap: () { ),
showDialog( ),
context: context, ),
builder: (BuildContext context) { SizedBox(
return AlertDialog( height: 11.5.w,
shape: RoundedRectangleBorder( ),
borderRadius: Container(
BorderRadius.circular(8.0.w), 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(
'立即支付 ¥${myController.model.finalTotalPrice}',
style: TextStyle(
fontWeight: Fonts.medium,
fontSize: 14.w,
color: Colours.cFF),
)),
),
),
SizedBox(
height: 11.5.w,
),
GestureDetector(
onTap: () {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(8.0.w),
),
contentPadding: EdgeInsets.zero,
// 移除内容部分的内边距
content: Wrap(
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,
),
), ),
contentPadding: EdgeInsets.zero, ),
// 移除内容部分的内边距 ),
content: Wrap( Container(
children: [ height: 1.w, // 设置分割线的高度
Container( width: double.infinity, // 设置分割线的宽度
margin: EdgeInsets.only( color: Colours.cLine, // 设置分割线的颜色
top: 44.w, ),
bottom: 29.w), // 调整上下间距 ],
child: Center( ),
child: Text( // 去除操作按钮区域的内边距
'确定取消订单吗', actionsPadding: EdgeInsets.zero,
style: TextStyle( actions: <Widget>[
fontSize: 15.w, Row(
fontWeight: Fonts.medium, mainAxisAlignment:
color: Colours.c3, MainAxisAlignment.spaceEvenly,
), // 或者使用MainAxisAlignment.spaceEvenly
), children: [
), GestureDetector(
), onTap: () =>
Container( Navigator.of(context).pop(),
height: 1.w, // 设置分割线的高度 child:Container(
width: double.infinity, // 设置分割线的宽度 width: 105.w,
color: Colours.cLine, // 设置分割线的颜色 color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消',
style: TextStyle(
fontSize: 12,
fontWeight: Fonts.medium,
color: Colours.c6,
), ),
], ),
), ),
// 去除操作按钮区域的内边距 ),
actionsPadding: EdgeInsets.zero, Container(
actions: <Widget>[ height: 39.5.w, // 设置分割线的高度
Row( width: 1, // 设置分割线的宽度
mainAxisAlignment: color: Colours.cLine, // 设置分割线的颜色
MainAxisAlignment.spaceEvenly, ),
// 或者使用MainAxisAlignment.spaceEvenly GestureDetector(
children: [ onTap: () {
GestureDetector( myController.cancelPay();
onTap: () => Navigator.of(context).pop();
Navigator.of(context).pop(), Navigator.pop(context);
child: const Text( },
'取消', child:Container(
style: TextStyle( width: 105.w,
fontSize: 12, color: Colours.cFF,
fontWeight: Fonts.medium, alignment: Alignment.center,
color: Colours.c6, child: const Text(
), '确定',
), style: TextStyle(
), fontSize: 12,
Container( fontWeight: Fonts.medium,
height: 39.5.w, // 设置分割线的高度 color: Colours.cAB1941,
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,
), ),
), ],
), );
], },
);
},
child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消订单',
style: TextStyle(
fontWeight: Fonts.medium,
fontSize: 15,
color: Colours.c9,
),
), ),
)), ),
),
],
),
),
); );
} }
}, },
......
...@@ -259,11 +259,6 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -259,11 +259,6 @@ class _UserSetPageState extends State<UserSetPage> {
// 去除操作按钮区域的内边距 // 去除操作按钮区域的内边距
actionsPadding: EdgeInsets.zero, actionsPadding: EdgeInsets.zero,
actions: <Widget>[ actions: <Widget>[
Wrap(
children: [
],
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
...@@ -312,12 +307,18 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -312,12 +307,18 @@ class _UserSetPageState extends State<UserSetPage> {
if (!forcedUpgrade) if (!forcedUpgrade)
Padding(padding: EdgeInsets.only(right: 28.w), Padding(padding: EdgeInsets.only(right: 28.w),
child: GestureDetector( child: GestureDetector(
child: const Text( child:
'稍后再说', Container(
style: TextStyle( width: 85.w,
color: Colours.c6, color: Colours.cFF,
fontSize: 12, alignment: Alignment.center,
fontWeight: Fonts.medium), child: const Text(
'稍后再说',
style: TextStyle(
color: Colours.c6,
fontSize: 12,
fontWeight: Fonts.medium),
),
), ),
onTap: () => Navigator.of(context).pop(), onTap: () => Navigator.of(context).pop(),
),), ),),
...@@ -329,12 +330,17 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -329,12 +330,17 @@ class _UserSetPageState extends State<UserSetPage> {
), ),
Padding(padding: EdgeInsets.only(left: 28.w), Padding(padding: EdgeInsets.only(left: 28.w),
child: GestureDetector( child: GestureDetector(
child: const Text( child: Container(
'立即更新', width: 85.w,
style: TextStyle( color: Colours.cFF,
color: Colours.cAB1941, alignment: Alignment.center,
fontSize: 12, child: const Text(
fontWeight: Fonts.medium), '立即更新',
style: TextStyle(
color: Colours.cAB1941,
fontSize: 12,
fontWeight: Fonts.medium),
),
), ),
onTap: () { onTap: () {
_appUpdate(); _appUpdate();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论