提交 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,9 +34,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -33,9 +34,7 @@ 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),
builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: const Text('等待付款'), title: const Text('等待付款'),
actions: [], actions: [],
...@@ -72,7 +71,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -72,7 +71,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Image.network( Image.network(
controller.model?.bookList?[0].img??'', myController.model?.bookList?[0].img??'',
fit: BoxFit.cover, // 设置适应方式为充满 fit: BoxFit.cover, // 设置适应方式为充满
width: 72.0.w, width: 72.0.w,
height: 86.0.w, height: 86.0.w,
...@@ -90,7 +89,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -90,7 +89,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
CrossAxisAlignment.end, // 下面的Text靠左 CrossAxisAlignment.end, // 下面的Text靠左
children: [ children: [
Text( Text(
controller.model.bookList?[0].name??'', myController.model.bookList?[0].name??'',
style: TextStyle( style: TextStyle(
color: Colours.c3, color: Colours.c3,
fontWeight: Fonts.bold, fontWeight: Fonts.bold,
...@@ -102,7 +101,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -102,7 +101,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
SizedBox(height: 25.5.w), SizedBox(height: 25.5.w),
Text( Text(
"需付款 ¥${controller.model.finalTotalPrice}", "需付款 ¥${myController.model.finalTotalPrice}",
style: TextStyle( style: TextStyle(
color: Colours.cAB1941, color: Colours.cAB1941,
fontWeight: Fonts.bold, fontWeight: Fonts.bold,
...@@ -129,7 +128,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -129,7 +128,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
children: children:
controller.orderAwaitings.map((model) { myController.orderAwaitings.map((model) {
return Padding( return Padding(
padding: EdgeInsets.only(top: 12.w), padding: EdgeInsets.only(top: 12.w),
child: Row( child: Row(
...@@ -168,7 +167,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -168,7 +167,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
controller.payOrder(); myController.payOrder();
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric(horizontal: 15.w), margin: EdgeInsets.symmetric(horizontal: 15.w),
...@@ -180,7 +179,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -180,7 +179,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
Border.all(color: Colours.cC31F4C, width: 0.5.w)), Border.all(color: Colours.cC31F4C, width: 0.5.w)),
child: Center( child: Center(
child: Text( child: Text(
'立即支付 ¥${controller.model.finalTotalPrice}', '立即支付 ¥${myController.model.finalTotalPrice}',
style: TextStyle( style: TextStyle(
fontWeight: Fonts.medium, fontWeight: Fonts.medium,
fontSize: 14.w, fontSize: 14.w,
...@@ -230,6 +229,10 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -230,6 +229,10 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () => Navigator.of(context).pop(), onTap: () => Navigator.of(context).pop(),
child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text( child: const Text(
'取消', '取消',
style: TextStyle( style: TextStyle(
...@@ -239,6 +242,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -239,6 +242,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
), ),
), ),
),
Container( Container(
height: 39.5.w, // 设置分割线的高度 height: 39.5.w, // 设置分割线的高度
width: 1, // 设置分割线的宽度 width: 1, // 设置分割线的宽度
...@@ -246,10 +250,14 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -246,10 +250,14 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
controller.cancelPay(); myController.cancelPay();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.pop(context); Navigator.pop(context);
}, },
child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text( child: const Text(
'确定', '确定',
style: TextStyle( style: TextStyle(
...@@ -259,6 +267,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -259,6 +267,7 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
), ),
), ),
), ),
),
], ],
), ),
...@@ -267,20 +276,25 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> { ...@@ -267,20 +276,25 @@ class _UserOrderAwaitingState extends State<UserOrderAwaitingPage> {
}, },
); );
}, },
child: Text( child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消订单', '取消订单',
style: TextStyle( style: TextStyle(
fontWeight: Fonts.medium, fontWeight: Fonts.medium,
fontSize: 15.w, fontSize: 15,
color: Colours.c9, 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,9 +39,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -38,9 +39,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
context.pop(true); context.pop(true);
return false; return false;
}, },
child: GetBuilder<UserOrderCoinAwaitingController>( child: Scaffold(
init: UserOrderCoinAwaitingController(widget.orderNum),
builder: (controller) => Scaffold(
appBar: CustomAppBar( appBar: CustomAppBar(
title: const Text('待支付'), title: const Text('待支付'),
actions: [], actions: [],
...@@ -99,7 +98,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -99,7 +98,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
// 下面的Text靠左 // 下面的Text靠左
children: [ children: [
Text( Text(
'充值${controller.model.bean}紫荆币', '充值${myController.model.bean}紫荆币',
style: TextStyle( style: TextStyle(
color: Colours.c3, color: Colours.c3,
fontWeight: Fonts.bold, fontWeight: Fonts.bold,
...@@ -111,7 +110,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -111,7 +110,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
), ),
SizedBox(height: 9.w), SizedBox(height: 9.w),
Text( Text(
"需付款 ¥${controller.model.finalTotalPrice}", "需付款 ¥${myController.model.finalTotalPrice}",
style: TextStyle( style: TextStyle(
color: Colours.cAB1941, color: Colours.cAB1941,
fontWeight: Fonts.bold, fontWeight: Fonts.bold,
...@@ -139,7 +138,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -139,7 +138,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
child: Column( child: Column(
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.spaceEvenly, MainAxisAlignment.spaceEvenly,
children: controller.orderAwaitings children: myController.orderAwaitings
.map((model) { .map((model) {
return Padding( return Padding(
padding: EdgeInsets.only(top: 12.w), padding: EdgeInsets.only(top: 12.w),
...@@ -192,7 +191,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -192,7 +191,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
// context.pushNamed(Routes.orderEvaluate); // context.pushNamed(Routes.orderEvaluate);
}, },
child: Text( child: Text(
'立即支付 ¥${controller.model.finalTotalPrice}', '立即支付 ¥${myController.model.finalTotalPrice}',
style: TextStyle( style: TextStyle(
fontWeight: Fonts.medium, fontWeight: Fonts.medium,
fontSize: 14.w, fontSize: 14.w,
...@@ -250,6 +249,10 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -250,6 +249,10 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
GestureDetector( GestureDetector(
onTap: () => onTap: () =>
Navigator.of(context).pop(), Navigator.of(context).pop(),
child:Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text( child: const Text(
'取消', '取消',
style: TextStyle( style: TextStyle(
...@@ -259,6 +262,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -259,6 +262,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
), ),
), ),
), ),
),
Container( Container(
height: 39.5.w, // 设置分割线的高度 height: 39.5.w, // 设置分割线的高度
width: 1, // 设置分割线的宽度 width: 1, // 设置分割线的宽度
...@@ -266,10 +270,14 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -266,10 +270,14 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
), ),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
controller.cancelPay(); myController.cancelPay();
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.pop(context); Navigator.pop(context);
}, },
child:Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text( child: const Text(
'确定', '确定',
style: TextStyle( style: TextStyle(
...@@ -279,6 +287,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -279,6 +287,7 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
), ),
), ),
), ),
),
], ],
), ),
], ],
...@@ -286,18 +295,23 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> { ...@@ -286,18 +295,23 @@ class _UserOrderCoinAwaitingState extends State<UserOrderCoinAwaitingPage> {
}, },
); );
}, },
child: Text( child: Container(
width: 105.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text(
'取消订单', '取消订单',
style: TextStyle( style: TextStyle(
fontWeight: Fonts.medium, fontWeight: Fonts.medium,
fontSize: 15.w, fontSize: 15,
color: Colours.c9, 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,6 +307,11 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -312,6 +307,11 @@ 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:
Container(
width: 85.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text( child: const Text(
'稍后再说', '稍后再说',
style: TextStyle( style: TextStyle(
...@@ -319,6 +319,7 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -319,6 +319,7 @@ class _UserSetPageState extends State<UserSetPage> {
fontSize: 12, fontSize: 12,
fontWeight: Fonts.medium), fontWeight: Fonts.medium),
), ),
),
onTap: () => Navigator.of(context).pop(), onTap: () => Navigator.of(context).pop(),
),), ),),
...@@ -329,6 +330,10 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -329,6 +330,10 @@ class _UserSetPageState extends State<UserSetPage> {
), ),
Padding(padding: EdgeInsets.only(left: 28.w), Padding(padding: EdgeInsets.only(left: 28.w),
child: GestureDetector( child: GestureDetector(
child: Container(
width: 85.w,
color: Colours.cFF,
alignment: Alignment.center,
child: const Text( child: const Text(
'立即更新', '立即更新',
style: TextStyle( style: TextStyle(
...@@ -336,6 +341,7 @@ class _UserSetPageState extends State<UserSetPage> { ...@@ -336,6 +341,7 @@ class _UserSetPageState extends State<UserSetPage> {
fontSize: 12, fontSize: 12,
fontWeight: Fonts.medium), fontWeight: Fonts.medium),
), ),
),
onTap: () { onTap: () {
_appUpdate(); _appUpdate();
if (!forcedUpgrade) { if (!forcedUpgrade) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论