diff --git a/lib/pages/lottery/lottery_order_detail_page.dart b/lib/pages/lottery/lottery_order_detail_page.dart new file mode 100644 index 0000000..0bcbe4c --- /dev/null +++ b/lib/pages/lottery/lottery_order_detail_page.dart @@ -0,0 +1,190 @@ +import 'package:flutter/material.dart'; +import 'package:recook/constants/header.dart'; +import 'package:recook/pages/lottery/widget/lottery_scaffold.dart'; + +class LotteryOrderDetailPage extends StatefulWidget { + final dynamic arguments; + LotteryOrderDetailPage({Key key, this.arguments}) : super(key: key); + + @override + _LotteryOrderDetailPageState createState() => _LotteryOrderDetailPageState(); +} + +class _LotteryOrderDetailPageState extends State { + @override + Widget build(BuildContext context) { + return LotteryScaffold( + title: '我的订单', + red: true, + appBarBottom: PreferredSize( + preferredSize: Size.fromHeight(rSize(40)), + child: Container( + height: rSize(40), + color: Color(0xFFFFF9ED), + padding: EdgeInsets.symmetric(horizontal: rSize(15)), + alignment: Alignment.centerLeft, + child: DefaultTextStyle( + style: TextStyle( + color: Color(0xFFE02020), + fontSize: rSP(14), + ), + child: Row( + children: [ + Text('双色球'), + VerticalDivider( + color: Color(0xFFF8DCCF), + width: rSize(14), + thickness: rSize(1), + indent: rSize(10), + endIndent: rSize(10), + ), + Text('第20200823期'), + ], + ), + ), + ), + ), + body: ListView( + children: [ + _childBox( + child: Row( + children: [ + Expanded( + child: Column( + children: [ + Text( + '-', + style: TextStyle( + color: Color(0xFF333333), + ), + ), + SizedBox(height: rSize(10)), + Text('中奖金额(元)'), + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + '未出票', + style: TextStyle( + color: Color(0xFF333333), + ), + ), + SizedBox(height: rSize(10)), + Text('订单状态'), + ], + ), + ), + Expanded( + child: Column( + children: [ + Text( + '90', + style: TextStyle( + color: Color(0xFFDB2D2D), + ), + ), + SizedBox(height: rSize(10)), + Text('投注金额(元)'), + ], + ), + ), + ], + ), + ), + SizedBox(height: rSize(8)), + _childBox( + child: Row( + children: [ + Text('预计开奖'), + Spacer(), + Text( + '2020-08-22 21:15:00', + style: TextStyle( + color: Color(0xFF333333), + ), + ), + ], + ), + ), + SizedBox(height: rSize(8)), + _childBox( + child: Column( + children: [ + Row( + children: [ + Text('投注信息'), + Spacer(), + Text( + '60注 1倍', + style: TextStyle( + color: Color(0xFF333333), + ), + ), + ], + ), + ], + ), + ), + SizedBox(height: rSize(8)), + _childBox( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '订单详情', + style: TextStyle(color: Color(0xFF333333)), + ), + SizedBox(height: rSize(10)), + Container( + height: rSize(128), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _childList('订单编号', 'TE20202020010023012'), + _childList('下单时间', '2020-08-20 13:22:08'), + _childList('用户姓名', '邓嵘嵘'), + _childList('用户身份证号', '330***********5016'), + _childList('凭证手机号', '13609391873'), + ], + ), + ), + ], + ), + ), + ], + ), + ); + } + + _childBox({@required Widget child}) { + return DefaultTextStyle( + style: TextStyle( + fontSize: rSP(14), + color: Color(0xFF999999), + ), + child: Container( + color: Colors.white, + padding: EdgeInsets.all(rSize(16)), + child: child, + ), + ); + } + + _childList(String prefix, String suffix) { + return Row( + children: [ + Text(prefix), + Spacer(), + Text( + suffix, + style: TextStyle( + color: Color(0xFF333333), + ), + ), + ], + ); + } +} diff --git a/lib/pages/lottery/lottery_order_page.dart b/lib/pages/lottery/lottery_order_page.dart index 2a57bef..e31d59d 100644 --- a/lib/pages/lottery/lottery_order_page.dart +++ b/lib/pages/lottery/lottery_order_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:recook/constants/header.dart'; import 'package:recook/pages/lottery/widget/lottery_scaffold.dart'; class LotteryOrderPage extends StatefulWidget { @@ -13,7 +14,67 @@ class _LotteryOrderPageState extends State { Widget build(BuildContext context) { return LotteryScaffold( red: true, + whiteBg: true, title: '我的订单', + body: ListView.separated( + itemBuilder: (context, index) { + return _buildLotteryCard(); + }, + separatorBuilder: (context, index) { + return Divider( + height: rSize(1), + thickness: rSize(1), + color: Color(0xFFEEEEEE), + ); + }, + itemCount: 10, + ), + ); + } + + _buildLotteryCard() { + return InkWell( + onTap: () => AppRouter.push(context, RouteName.LOTTERY_ORDER_DETAIL_PAGE), + child: Container( + padding: EdgeInsets.all(rSize(16)), + child: DefaultTextStyle( + style: TextStyle( + fontSize: rSP(14), + color: Color(0xFF999999), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Row( + children: [ + Text( + '大乐透', + style: TextStyle( + color: Color(0xFF333333), + fontWeight: FontWeight.w600, + ), + ), + Spacer(), + Text('2020-08-19 23:25:58'), + ], + ), + SizedBox(height: rSize(10)), + Row( + children: [ + Text('期号:20200823'), + Spacer(), + Text( + '未出票', + style: TextStyle( + color: Color(0xFF666666), + ), + ), + ], + ), + ], + ), + ), + ), ); } } diff --git a/lib/pages/lottery/lottery_picker_page.dart b/lib/pages/lottery/lottery_picker_page.dart index 8da99b4..69ce59d 100644 --- a/lib/pages/lottery/lottery_picker_page.dart +++ b/lib/pages/lottery/lottery_picker_page.dart @@ -220,22 +220,38 @@ class _LotteryPickerPageState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - '${lotteryShots * 2}瑞币或$lotteryShots\彩票券', - maxLines: 2, - style: TextStyle( - height: 1, - fontSize: rSP(12), - color: Color(0xFF666666), - ), - ), - Text( - '$lotteryShots\注', - style: TextStyle( - fontSize: rSP(12), - color: Color(0xFF666666), - ), - ), + lotteryShots == 0 + ? Text( + widget.arguments['type'] + ? '至少选6红球1蓝球' + : '至少选5红球2蓝球', + style: TextStyle( + height: 1, + fontSize: rSP(12), + color: Color(0xFF666666), + ), + ) + : SizedBox(), + lotteryShots == 0 + ? SizedBox() + : Text( + '${lotteryShots * 2}瑞币或$lotteryShots\彩票券', + maxLines: 2, + style: TextStyle( + height: 1, + fontSize: rSP(12), + color: Color(0xFF666666), + ), + ), + lotteryShots == 0 + ? SizedBox() + : Text( + '$lotteryShots\注', + style: TextStyle( + fontSize: rSP(12), + color: Color(0xFF666666), + ), + ), ], ), ), diff --git a/lib/pages/lottery/redeem_lottery_page.dart b/lib/pages/lottery/redeem_lottery_page.dart index 685a215..5af713b 100644 --- a/lib/pages/lottery/redeem_lottery_page.dart +++ b/lib/pages/lottery/redeem_lottery_page.dart @@ -25,7 +25,8 @@ class _RedeemLotteryPageState extends State { MaterialButton( padding: EdgeInsets.symmetric(horizontal: rSize(16)), minWidth: rSize(52), - onPressed: () {}, + onPressed: () => + AppRouter.push(context, RouteName.LOTTERY_ORDER_PAGE), child: Image.asset( R.ASSETS_LOTTERY_REDEEM_LOTTERY_LIST_PNG, width: rSize(20), @@ -98,7 +99,7 @@ class _RedeemLotteryPageState extends State { ), ), Text( - 'DATE', + '第20200820期', style: TextStyle( color: Color(0xFF666666), fontSize: rSP(12), diff --git a/lib/utils/app_router.dart b/lib/utils/app_router.dart index de1301f..3618301 100644 --- a/lib/utils/app_router.dart +++ b/lib/utils/app_router.dart @@ -28,6 +28,8 @@ import 'package:recook/pages/login/wechat_bind_page.dart'; import 'package:recook/pages/login/wechat_input_invitecode_page.dart'; import 'package:recook/pages/lottery/lottery_help_page.dart'; import 'package:recook/pages/lottery/lottery_history_page.dart'; +import 'package:recook/pages/lottery/lottery_order_detail_page.dart'; +import 'package:recook/pages/lottery/lottery_order_page.dart'; import 'package:recook/pages/lottery/lottery_picker_page.dart'; import 'package:recook/pages/lottery/redeem_lottery_page.dart'; import 'package:recook/pages/shop/cumulative_income_page.dart'; @@ -312,6 +314,12 @@ class RouteName { ///彩票开奖历史记录 static const String LOTTERY_HISTORY_PAGE = "/LotteryHistoryPage"; + + ///彩票订单历史 + static const String LOTTERY_ORDER_PAGE = "/LotteryOrderPage"; + + ///彩票订单详情 + static const String LOTTERY_ORDER_DETAIL_PAGE = "/LotteryOrderDetailPage"; } typedef RouteBuilder = Widget Function(BuildContext context, @@ -618,6 +626,9 @@ final Map _routes = { LotteryHelpPage(arguments: arguments), RouteName.LOTTERY_HISTORY_PAGE: (context, {arguments}) => LotteryHistoryPage(arguments: arguments), + RouteName.LOTTERY_ORDER_PAGE: (context, {arguments}) => LotteryOrderPage(), + RouteName.LOTTERY_ORDER_DETAIL_PAGE: (context, {arguments}) => + LotteryOrderDetailPage(arguments: arguments), }; /// 应用中路由跳转