|
|
@@ -0,0 +1,430 @@ |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/gestures.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/services.dart'; |
|
|
|
import 'package:zhiying_base_widget/pages/order_found_page/order_found_result/order_found_result_bloc.dart'; |
|
|
|
|
|
|
|
import 'package:zhiying_comm/zhiying_comm.dart'; |
|
|
|
|
|
|
|
class OrderFoundResultPage extends StatefulWidget { |
|
|
|
@override |
|
|
|
_OrderFoundResultPageState createState() => _OrderFoundResultPageState(); |
|
|
|
} |
|
|
|
|
|
|
|
class _OrderFoundResultPageState extends State<OrderFoundResultPage> { |
|
|
|
OrderFoundResultBloc _bloc; |
|
|
|
bool hasData = true; |
|
|
|
|
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
// TODO: implement initState |
|
|
|
super.initState(); |
|
|
|
_bloc = OrderFoundResultBloc(); |
|
|
|
_bloc.getData(); |
|
|
|
} |
|
|
|
|
|
|
|
retrieveOrderClick() { |
|
|
|
print("是我的,找回该订单点击"); |
|
|
|
Map<String, dynamic> params = {}; |
|
|
|
params['oid'] = ""; |
|
|
|
NetUtil.request('/api/v1/order/find', |
|
|
|
method: NetMethod.POST, params: params, onSuccess: (data) {}); |
|
|
|
} |
|
|
|
|
|
|
|
continueToQuery() { |
|
|
|
print("继续查询点击"); |
|
|
|
Navigator.pop(context); |
|
|
|
} |
|
|
|
|
|
|
|
//复制订单号 |
|
|
|
copyOrderCode() { |
|
|
|
ClipboardData data = new ClipboardData(text: "复制的内容"); |
|
|
|
Clipboard.setData(data); |
|
|
|
} |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Scaffold( |
|
|
|
appBar: AppBar( |
|
|
|
elevation: 0, |
|
|
|
brightness: Brightness.light, |
|
|
|
backgroundColor: Colors.white, |
|
|
|
title: Text( |
|
|
|
"订单查询", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 16, |
|
|
|
color: HexColor.fromHex("#FF333333"), |
|
|
|
fontWeight: FontWeight.w600), |
|
|
|
), |
|
|
|
centerTitle: true, |
|
|
|
leading: Navigator.canPop(context) |
|
|
|
? IconButton( |
|
|
|
icon: Icon( |
|
|
|
Icons.arrow_back_ios, |
|
|
|
size: 18, |
|
|
|
color: HexColor.fromHex("#FF444444"), |
|
|
|
), |
|
|
|
onPressed: () { |
|
|
|
Navigator.pop(context); |
|
|
|
}) |
|
|
|
: Container(), |
|
|
|
), |
|
|
|
body: Container( |
|
|
|
child: hasData ? hasOrderView() : emptyView(), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
//有订单数据的页面 |
|
|
|
hasOrderView() { |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
orderTip(), //提示文字 |
|
|
|
orderMsg(), //订单数据 |
|
|
|
], |
|
|
|
)), |
|
|
|
//继续查询按钮 |
|
|
|
GestureDetector( |
|
|
|
onTap: () { |
|
|
|
continueToQuery(); |
|
|
|
}, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
child: Container( |
|
|
|
padding: EdgeInsets.all(12), |
|
|
|
child: Text( |
|
|
|
"不是我的,继续查询", |
|
|
|
style: TextStyle(fontSize: 14, color: HexColor.fromHex("#FF999999")), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
//找回订单按钮 |
|
|
|
GestureDetector( |
|
|
|
onTap: () { |
|
|
|
retrieveOrderClick(); |
|
|
|
}, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
child: Container( |
|
|
|
height: 50, |
|
|
|
width: double.infinity, |
|
|
|
margin: EdgeInsets.only(left: 24, right: 24, bottom: 24), |
|
|
|
decoration: |
|
|
|
BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.red), |
|
|
|
alignment: Alignment.center, |
|
|
|
child: Text( |
|
|
|
"是我的,找回该订单", |
|
|
|
style: TextStyle(fontSize: 14, color: Colors.white), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
//提示文字 |
|
|
|
orderTip() { |
|
|
|
return Container( |
|
|
|
margin: EdgeInsets.only(top: 15, left: 12), |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(right: 5), |
|
|
|
width: 4, |
|
|
|
height: 15, |
|
|
|
decoration: |
|
|
|
BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.red), |
|
|
|
), |
|
|
|
Text( |
|
|
|
"是否为这笔订单?", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15, |
|
|
|
color: HexColor.fromHex("#FF333333"), |
|
|
|
fontWeight: FontWeight.bold), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
//订单数据 |
|
|
|
orderMsg() { |
|
|
|
return Container( |
|
|
|
height: 150, |
|
|
|
margin: EdgeInsets.only(top: 10, left: 12, right: 12), |
|
|
|
padding: EdgeInsets.only(top: 10, left: 10, right: 10), |
|
|
|
decoration: |
|
|
|
BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
"自购订单", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12, |
|
|
|
color: HexColor.fromHex("#FF333333"), |
|
|
|
fontWeight: FontWeight.w600), |
|
|
|
), |
|
|
|
Text( |
|
|
|
"已结算", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 12, |
|
|
|
color: HexColor.fromHex("#FF999999"), |
|
|
|
fontWeight: FontWeight.w600), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
Container( |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(top: 10, bottom: 10), |
|
|
|
width: 97, |
|
|
|
height: 97, |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(7.5), |
|
|
|
image: DecorationImage( |
|
|
|
image: NetworkImage( |
|
|
|
"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fg.search.alicdn.com%2Fimg%2Fbao%2Fuploaded%2Fi4%2Fi2%2F2012325070%2FO1CN01LQlnX41nK6dBt4ILq_%21%212012325070.jpg&refer=http%3A%2F%2Fg.search.alicdn.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1623381327&t=ee9bbd715990660f92747f181a0c3858"), |
|
|
|
fit: BoxFit.fill)), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
child: Container( |
|
|
|
margin: EdgeInsets.only(left: 10), |
|
|
|
height: 100, |
|
|
|
child: Column( |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
children: [ |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(right: 4), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2.5), |
|
|
|
color: Colors.red), |
|
|
|
padding: EdgeInsets.only(left: 10, right: 10), |
|
|
|
child: Text( |
|
|
|
"京东", |
|
|
|
style: TextStyle(fontSize: 10, color: Colors.white), |
|
|
|
), |
|
|
|
), |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
"桶装水抽水器饮水机泵器动桶装水抽水器饮水机泵器动", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 13, |
|
|
|
color: HexColor.fromHex("#FF333333"), |
|
|
|
), |
|
|
|
maxLines: 1, |
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Text( |
|
|
|
"订单编号:15487945211587", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10, |
|
|
|
color: HexColor.fromHex("#FF999999"), |
|
|
|
), |
|
|
|
), |
|
|
|
GestureDetector( |
|
|
|
onTap: () { |
|
|
|
copyOrderCode(); |
|
|
|
}, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
child: Container( |
|
|
|
width: 40, |
|
|
|
margin: EdgeInsets.only(left: 4), |
|
|
|
decoration: BoxDecoration( |
|
|
|
border: new Border.all( |
|
|
|
color: HexColor.fromHex("#FFD6D6D6"), width: 0.5), |
|
|
|
borderRadius: BorderRadius.circular(2.5), |
|
|
|
color: HexColor.fromHex("#FFF5F5F5")), |
|
|
|
alignment: Alignment.center, |
|
|
|
child: Text( |
|
|
|
"复制", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 9, color: HexColor.fromHex("#FF999999")), |
|
|
|
), |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
Text( |
|
|
|
"下单时间:2020-06-18 17:11:15", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10, |
|
|
|
color: HexColor.fromHex("#FF999999"), |
|
|
|
), |
|
|
|
), |
|
|
|
Text( |
|
|
|
"完成时间:2020-06-18 17:11:15", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10, |
|
|
|
color: HexColor.fromHex("#FF999999"), |
|
|
|
), |
|
|
|
), |
|
|
|
Row( |
|
|
|
children: [ |
|
|
|
Expanded( |
|
|
|
child: Text( |
|
|
|
"订单金额:¥ 199", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 10, |
|
|
|
color: HexColor.fromHex("#FF333333"), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
// RichText( |
|
|
|
// text: TextSpan(children: [ |
|
|
|
// TextSpan( |
|
|
|
// text: "收益:¥ ", |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 11, |
|
|
|
// color: Colors.red, |
|
|
|
// fontWeight: FontWeight.w600)), |
|
|
|
// TextSpan( |
|
|
|
// text: "10.19", |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 18, |
|
|
|
// color: Colors.red, |
|
|
|
// fontWeight: FontWeight.w600)) |
|
|
|
// ]), |
|
|
|
// ) |
|
|
|
], |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
// Container( |
|
|
|
// padding: EdgeInsets.only(left: 6), |
|
|
|
// height: 25, |
|
|
|
// alignment: Alignment.centerLeft, |
|
|
|
// decoration: BoxDecoration( |
|
|
|
// borderRadius: BorderRadius.circular(2.5), |
|
|
|
// color: HexColor.fromHex("#FFF9F9F9")), |
|
|
|
// child: RichText( |
|
|
|
// text: TextSpan(children: [ |
|
|
|
// TextSpan( |
|
|
|
// text: "补贴于", |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 10, color: HexColor.fromHex("#FF666666"))), |
|
|
|
// TextSpan( |
|
|
|
// text: "2020年07月23日", |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 10, color: HexColor.fromHex("#FFFF4242"))), |
|
|
|
// TextSpan( |
|
|
|
// text: "到账,注意查收", |
|
|
|
// style: TextStyle( |
|
|
|
// fontSize: 10, color: HexColor.fromHex("#FF666666"))) |
|
|
|
// ]), |
|
|
|
// ), |
|
|
|
// ) |
|
|
|
], |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
//没有订单数据的空页面 |
|
|
|
emptyView() { |
|
|
|
return Column( |
|
|
|
children: [ |
|
|
|
Expanded( |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
width: double.infinity, |
|
|
|
margin: EdgeInsets.only(top: 8, left: 12, right: 12), |
|
|
|
padding: EdgeInsets.only(bottom: 16, left: 12, right: 12, top: 28), |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(12), color: Colors.white), |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
Image.network( |
|
|
|
"https://alipic.lanhuapp.com/SketchPng9ae52da74764fe05917a1d5a4a8d5eb94a9013106c4412056afa00340164bde5", |
|
|
|
width: 152, |
|
|
|
fit: BoxFit.fitWidth, |
|
|
|
), |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(top: 16), |
|
|
|
child: Text( |
|
|
|
"未查询到该订单", |
|
|
|
style: |
|
|
|
TextStyle(fontSize: 15, color: HexColor.fromHex("#FF999999")), |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(top: 24), |
|
|
|
color: HexColor.fromHex("#FFF9F9F9"), |
|
|
|
), |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(top: 16), |
|
|
|
child: Row( |
|
|
|
children: [ |
|
|
|
Container( |
|
|
|
margin: EdgeInsets.only(right: 5), |
|
|
|
width: 4, |
|
|
|
height: 15, |
|
|
|
decoration: BoxDecoration( |
|
|
|
borderRadius: BorderRadius.circular(2), color: Colors.red), |
|
|
|
), |
|
|
|
Text( |
|
|
|
"未查询到该订单可能原因", |
|
|
|
style: TextStyle( |
|
|
|
fontSize: 15, |
|
|
|
color: HexColor.fromHex("#FF333333"), |
|
|
|
fontWeight: FontWeight.bold), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Container( |
|
|
|
alignment: Alignment.topLeft, |
|
|
|
margin: EdgeInsets.only(top: 8), |
|
|
|
child: Text( |
|
|
|
"1.订单有延迟,建议下单后15分钟再查询\n" |
|
|
|
"2.非您购买或推广的订单" |
|
|
|
"
3.不是通过本APP下的订单
" |
|
|
|
"4.创建订单超过40分钟付款,次日才能同步", |
|
|
|
style: |
|
|
|
TextStyle(fontSize: 12, color: HexColor.fromHex("#FF999999")), |
|
|
|
), |
|
|
|
) |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
)), |
|
|
|
GestureDetector( |
|
|
|
onTap: () { |
|
|
|
continueToQuery(); |
|
|
|
}, |
|
|
|
behavior: HitTestBehavior.opaque, |
|
|
|
child: Container( |
|
|
|
height: 50, |
|
|
|
width: double.infinity, |
|
|
|
margin: EdgeInsets.only(left: 24, right: 24, bottom: 24), |
|
|
|
decoration: |
|
|
|
BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.red), |
|
|
|
alignment: Alignment.center, |
|
|
|
child: Text( |
|
|
|
"重新查询", |
|
|
|
style: TextStyle(fontSize: 14, color: Colors.white), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
); |
|
|
|
} |
|
|
|
} |