|
|
|
@ -33,7 +33,6 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
List<business.Tickets> tickets; |
|
|
|
|
TicketDetails ticketDetails; |
|
|
|
|
business.AdminOrderDtoList adminOrderDTOList; |
|
|
|
|
int nameIndex = 0; |
|
|
|
|
BusinessApiService businessService; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@ -50,7 +49,8 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
severalWiped(ticketWipedBatch) async { |
|
|
|
|
try { |
|
|
|
|
EasyLoading.show( |
|
|
|
|
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black); |
|
|
|
|
status: S.current.zhengzaijiazai, |
|
|
|
|
maskType: EasyLoadingMaskType.black); |
|
|
|
|
if (businessService == null) { |
|
|
|
|
businessService = BusinessApiService(Dio(), |
|
|
|
|
context: context, |
|
|
|
@ -62,7 +62,7 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
.wipedBatchs(jsonEncode(ticketWipedBatch).replaceAll("\\\"", "\"")) |
|
|
|
|
.catchError((error) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
Navigator.of(context).pop(1); |
|
|
|
|
Navigator.of(context).pop(); |
|
|
|
|
SmartDialog.showToast("核销成功", alignment: Alignment.center); |
|
|
|
|
} else { |
|
|
|
|
SmartDialog.showToast(baseData.msg, alignment: Alignment.center); |
|
|
|
@ -110,7 +110,9 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
writeOffInfo(), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
if (tickets != null ? (widget.arguments["ticketStatus"] == false) : (ticketDetails.state == 9)) { |
|
|
|
|
if (tickets != null |
|
|
|
|
? (widget.arguments["ticketStatus"] == false) |
|
|
|
|
: (ticketDetails.state == 9)) { |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
List<dynamic> ticketWipedBatch = []; |
|
|
|
@ -177,14 +179,22 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
margin: EdgeInsets.only(bottom: 55.h, top: (tickets != null ? tickets.length : ticketDetails.ticketItemList.length) <= 2 ? 125.h : 0), |
|
|
|
|
margin: EdgeInsets.only( |
|
|
|
|
bottom: 55.h, |
|
|
|
|
top: (tickets != null |
|
|
|
|
? tickets.length |
|
|
|
|
: ticketDetails.ticketItemList.length) <= |
|
|
|
|
1 |
|
|
|
|
? 125.h |
|
|
|
|
: 10.h), |
|
|
|
|
padding: EdgeInsets.symmetric(vertical: 16.h), |
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
borderRadius: BorderRadius.circular(27), |
|
|
|
|
color: (tickets != null ? (widget.arguments["ticketStatus"] == true) : (ticketDetails.state != 9)) |
|
|
|
|
color: (tickets != null |
|
|
|
|
? (widget.arguments["ticketStatus"] == true) |
|
|
|
|
: (ticketDetails.state != 9)) |
|
|
|
|
? Color(0xFF30415B) |
|
|
|
|
: |
|
|
|
|
Color(0xFFABACAB)), |
|
|
|
|
: Color(0xFFABACAB)), |
|
|
|
|
child: Text( |
|
|
|
|
"确认核销", |
|
|
|
|
style: TextStyle( |
|
|
|
@ -243,8 +253,13 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
), |
|
|
|
|
basicInfoItem("用户名称::", widget?.arguments["userName"] ?? ticketDetails?.userName ?? "" ), |
|
|
|
|
basicInfoItem("订单编号::", widget?.arguments["orderCode"] ?? (ticketDetails.code.replaceAll("T","")) ?? ""), |
|
|
|
|
basicInfoItem("用户名称::", |
|
|
|
|
widget?.arguments["userName"] ?? ticketDetails?.userName ?? ""), |
|
|
|
|
basicInfoItem( |
|
|
|
|
"订单编号::", |
|
|
|
|
widget?.arguments["orderCode"] ?? |
|
|
|
|
(ticketDetails.code.replaceAll("T", "")) ?? |
|
|
|
|
""), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
@ -322,19 +337,16 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
), |
|
|
|
|
ListView.builder( |
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
itemCount: tickets != null ?(tickets?.length ?? 0):(ticketDetails?.ticketItemList?.length ?? 0), |
|
|
|
|
itemCount: tickets != null |
|
|
|
|
? (tickets?.length ?? 0) |
|
|
|
|
: (ticketDetails?.ticketItemList?.length ?? 0), |
|
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: BouncingScrollPhysics(), |
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
setState(() { |
|
|
|
|
nameIndex = position; |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
child: tickets != null ? writeOffInfoItem(tickets[position]):scanCodeInfoItem(ticketDetails.ticketItemList[position]), |
|
|
|
|
); |
|
|
|
|
return tickets != null |
|
|
|
|
? writeOffInfoItem(tickets[position]) |
|
|
|
|
: scanCodeInfoItem(ticketDetails.ticketItemList[position]); |
|
|
|
|
}, |
|
|
|
|
) |
|
|
|
|
// ListView.builder( |
|
|
|
@ -444,27 +456,37 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Expanded(child: Text( |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
ticketItemList?.name ?? "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: ticketItemList.state == 1?Color(0xFF0D0D0D):Color(0xFFABACAB), |
|
|
|
|
color: ticketItemList.state == 1 |
|
|
|
|
? Color(0xFF0D0D0D) |
|
|
|
|
: Color(0xFFABACAB), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
Expanded(child: Column( |
|
|
|
|
Expanded( |
|
|
|
|
child: Column( |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end, |
|
|
|
|
children: [ |
|
|
|
|
Padding(padding: EdgeInsets.only(right:10.w), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 10.w), |
|
|
|
|
child: Text( |
|
|
|
|
(ticketItemList.state == 1) ? "待核销" : "已核销", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.semi_bold, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: (ticketItemList.state == 1)?Color(0xFF30415B):Color(0xFFACACAC), |
|
|
|
|
color: (ticketItemList.state == 1) |
|
|
|
|
? Color(0xFF30415B) |
|
|
|
|
: Color(0xFFACACAC), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 25.h, |
|
|
|
|
), |
|
|
|
|
),), |
|
|
|
|
SizedBox(height:25.h,), |
|
|
|
|
if (ticketItemList.state == 1) |
|
|
|
|
Checkbox( |
|
|
|
|
value: ticketItemList.isSelect, |
|
|
|
@ -502,8 +524,8 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
Icons.check, |
|
|
|
|
color: Color(0xFFCFCFCF), |
|
|
|
|
size: 14.w, |
|
|
|
|
) |
|
|
|
|
),), |
|
|
|
|
)), |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(bottom: 11.h, top: 13.h), |
|
|
|
|
width: double.infinity, |
|
|
|
@ -528,10 +550,12 @@ class _OrderWriteOff extends State<OrderWriteOff> {
|
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: MyFontWeight.regular, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF0D0D0D), |
|
|
|
|
color: ticketItemList.state == 1 |
|
|
|
|
? Color(0xFF0D0D0D) |
|
|
|
|
: Color(0xFFABACAB), |
|
|
|
|
), |
|
|
|
|
)), |
|
|
|
|
(tickets[nameIndex].state == 7 || tickets[nameIndex].state == 8) |
|
|
|
|
(ticketItemList.state == 7 || ticketItemList.state == 8) |
|
|
|
|
? (ticketItemList.state != 9 |
|
|
|
|
? Container( |
|
|
|
|
margin: EdgeInsets.symmetric(vertical: 20.h), |
|
|
|
|