|
|
|
@ -5,6 +5,7 @@ import 'package:huixiang/generated/l10n.dart';
|
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/order_info.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/page.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/store.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/vip_card.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/utils/painter_bg.dart'; |
|
|
|
@ -130,7 +131,7 @@ class _VipDetailPage extends State<VipDetailPage> {
|
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
"历史订单", |
|
|
|
|
S.of(context).shiyongmendian, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 16.sp, |
|
|
|
@ -142,7 +143,7 @@ class _VipDetailPage extends State<VipDetailPage> {
|
|
|
|
|
width: 8.w, |
|
|
|
|
), |
|
|
|
|
Image.asset( |
|
|
|
|
"assets/image/icon_history.png", |
|
|
|
|
"assets/image/icon_shop.png", |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
@ -162,10 +163,10 @@ class _VipDetailPage extends State<VipDetailPage> {
|
|
|
|
|
itemBuilder: (context, position) { |
|
|
|
|
return GestureDetector( |
|
|
|
|
onTap: () {}, |
|
|
|
|
child: historyItem(orderInfos[position]), |
|
|
|
|
child: shopItem(), |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
itemCount: orderInfos != null ? orderInfos.length : 0, |
|
|
|
|
// itemCount: orderInfos != null ? orderInfos.length : 0, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
@ -295,8 +296,9 @@ class _VipDetailPage extends State<VipDetailPage> {
|
|
|
|
|
), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: () { |
|
|
|
|
Navigator.of(context) |
|
|
|
|
.pushNamed('/router/vip_balance', arguments: {"storeId":vipCard.id}); |
|
|
|
|
Navigator.of(context).pushNamed( |
|
|
|
|
'/router/vip_balance', |
|
|
|
|
arguments: {"storeId": vipCard.id}); |
|
|
|
|
}, |
|
|
|
|
child: Row( |
|
|
|
|
children: [ |
|
|
|
@ -405,7 +407,7 @@ class _VipDetailPage extends State<VipDetailPage> {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget historyItem(OrderInfo orderInfo) { |
|
|
|
|
Widget shopItem() { |
|
|
|
|
return Container( |
|
|
|
|
margin: EdgeInsets.all(16.w), |
|
|
|
|
child: Column( |
|
|
|
@ -413,213 +415,95 @@ class _VipDetailPage extends State<VipDetailPage> {
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Container( |
|
|
|
|
width: 19.w, |
|
|
|
|
height: 19.h, |
|
|
|
|
margin: EdgeInsets.only(left: 12.w, top: 12.h), |
|
|
|
|
alignment: Alignment.center, |
|
|
|
|
decoration: new BoxDecoration( |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
borderRadius: BorderRadius.circular(2), |
|
|
|
|
), |
|
|
|
|
child: Text( |
|
|
|
|
(orderInfo != null && orderInfo.isTakeOut == 0) ? "自" : "外", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Colors.white, |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
Expanded( |
|
|
|
|
child: Container( |
|
|
|
|
width: double.infinity, |
|
|
|
|
margin: EdgeInsets.only(left: 6.w, top: 12.h), |
|
|
|
|
alignment: Alignment.centerLeft, |
|
|
|
|
child: Text( |
|
|
|
|
(orderInfo != null) ? orderInfo.storeName : "", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
color: Color(0xFF353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
flex: 1, |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(top: 12.h, right: 12.w), |
|
|
|
|
child: Text( |
|
|
|
|
(orderInfo != null && |
|
|
|
|
orderInfo.storeVO != null && |
|
|
|
|
orderInfo.storeVO.posType != null) |
|
|
|
|
? StatusUtils.statusText( |
|
|
|
|
context, |
|
|
|
|
orderInfo.refundStatus, |
|
|
|
|
orderInfo.orderStatus, |
|
|
|
|
orderInfo.payStatus, |
|
|
|
|
orderInfo.sendStatus, |
|
|
|
|
orderInfo.isTakeOut) |
|
|
|
|
: "", |
|
|
|
|
"百年川椒重庆老火锅(汉街店)", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 14.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: (orderInfo == null) |
|
|
|
|
? Color(0xFF32A060) |
|
|
|
|
: (orderInfo.refundStatus == 1 || |
|
|
|
|
orderInfo.orderStatus >= 5) |
|
|
|
|
? Colors.grey |
|
|
|
|
: (orderInfo.orderStatus == 4) |
|
|
|
|
? Color(0xFF32A060) |
|
|
|
|
: Color(0xffFE951E), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(left: 37.w), |
|
|
|
|
child: Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center, |
|
|
|
|
children: [ |
|
|
|
|
Column( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text( |
|
|
|
|
S.of(context).xiadanshijian_( |
|
|
|
|
(orderInfo != null) ? orderInfo.createTime : ""), |
|
|
|
|
)), |
|
|
|
|
GestureDetector( |
|
|
|
|
onTap: (){ |
|
|
|
|
Navigator.of(context).pushNamed('/router/union_detail_page'); |
|
|
|
|
}, |
|
|
|
|
child:Text( |
|
|
|
|
"查看", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 10.sp, |
|
|
|
|
color: Color(0xFF727272), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 8.h, |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: FontWeight.w500, |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceAround, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: goodsItem( |
|
|
|
|
(orderInfo != null && orderInfo.productList != null) |
|
|
|
|
? orderInfo.productList |
|
|
|
|
: null), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
Padding( |
|
|
|
|
padding: EdgeInsets.only(right: 22.w), |
|
|
|
|
child: Image.asset( |
|
|
|
|
"assets/image/icon_more.png", |
|
|
|
|
fit: BoxFit.fill, |
|
|
|
|
alignment: Alignment.centerRight, |
|
|
|
|
width: 24.w, |
|
|
|
|
height: 24.h, |
|
|
|
|
Icon( |
|
|
|
|
Icons.chevron_right, |
|
|
|
|
color: Color(0xff32A060), |
|
|
|
|
size: 16, |
|
|
|
|
), |
|
|
|
|
) |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 12.h, |
|
|
|
|
height: 8.h, |
|
|
|
|
), |
|
|
|
|
Container( |
|
|
|
|
margin: EdgeInsets.only(right: 12.w, bottom: 12.h), |
|
|
|
|
child: Directionality( |
|
|
|
|
textDirection: TextDirection.rtl, |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
Text.rich( |
|
|
|
|
TextSpan( |
|
|
|
|
children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).gong, |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: (orderInfo != null && |
|
|
|
|
orderInfo.productList != null) |
|
|
|
|
? "${orderInfo.productList.length}" |
|
|
|
|
: "0", |
|
|
|
|
Text( |
|
|
|
|
"地址:", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Colors.black, |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xff353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).jian, |
|
|
|
|
Text( |
|
|
|
|
"楚河汉街第一街区万达总部国际C座对面", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xff353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
width: 4.w, |
|
|
|
|
height: 4.h, |
|
|
|
|
), |
|
|
|
|
Text.rich( |
|
|
|
|
TextSpan( |
|
|
|
|
Row( |
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start, |
|
|
|
|
children: [ |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).heji, |
|
|
|
|
Text( |
|
|
|
|
"营业时间:", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xff353535), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: totalPrice(orderInfo), |
|
|
|
|
Expanded( |
|
|
|
|
flex: 1, |
|
|
|
|
child: Text( |
|
|
|
|
"10:00-22:00", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
|
color: Colors.black, |
|
|
|
|
), |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xff353535), |
|
|
|
|
), |
|
|
|
|
TextSpan( |
|
|
|
|
text: S.of(context).yuan, |
|
|
|
|
)), |
|
|
|
|
Text( |
|
|
|
|
"3.9km", |
|
|
|
|
style: TextStyle( |
|
|
|
|
fontSize: 12.sp, |
|
|
|
|
color: Color(0xFF868686), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
fontWeight: FontWeight.w400, |
|
|
|
|
color: Color(0xff868686), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
SizedBox( |
|
|
|
|
height: 8.h, |
|
|
|
|
), |
|
|
|
|
Row( |
|
|
|
|
children: (orderInfo != null) |
|
|
|
|
? StatusUtils.statusBtn( |
|
|
|
|
context, |
|
|
|
|
orderInfo.payStatus, |
|
|
|
|
orderInfo.orderStatus, |
|
|
|
|
orderInfo.isTakeOut, |
|
|
|
|
orderInfo.sendStatus, |
|
|
|
|
orderInfo.refundStatus, |
|
|
|
|
orderInfo.dayFlowCode) |
|
|
|
|
: [], |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|