添加彩票订单详情页面

master
laiiihz 5 years ago
parent 18551adb41
commit 08284c9216

@ -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<LotteryOrderDetailPage> {
@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),
),
),
],
);
}
}

@ -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<LotteryOrderPage> {
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 2325:58'),
],
),
SizedBox(height: rSize(10)),
Row(
children: [
Text('期号20200823'),
Spacer(),
Text(
'未出票',
style: TextStyle(
color: Color(0xFF666666),
),
),
],
),
],
),
),
),
);
}
}

@ -220,22 +220,38 @@ class _LotteryPickerPageState extends State<LotteryPickerPage> {
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),
),
),
],
),
),

@ -25,7 +25,8 @@ class _RedeemLotteryPageState extends State<RedeemLotteryPage> {
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<RedeemLotteryPage> {
),
),
Text(
'DATE',
'第20200820期',
style: TextStyle(
color: Color(0xFF666666),
fontSize: rSP(12),

@ -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<String, RouteBuilder> _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),
};
///

Loading…
Cancel
Save