Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 743 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 642 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 523 B After Width: | Height: | Size: 637 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 866 B After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 588 B |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 1022 B |
Before Width: | Height: | Size: 875 B After Width: | Height: | Size: 400 B |
After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 311 B |
After Width: | Height: | Size: 706 B |
After Width: | Height: | Size: 625 B |
After Width: | Height: | Size: 700 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 318 B |
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 820 B |
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 223 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 659 B After Width: | Height: | Size: 865 B |
@ -0,0 +1,134 @@
|
||||
import 'package:flutter/material.dart'; |
||||
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
||||
import 'package:huixiang/generated/l10n.dart'; |
||||
import 'package:huixiang/utils/font_weight.dart'; |
||||
import 'package:huixiang/view_widget/login_tips_dialog.dart'; |
||||
import 'package:shared_preferences/shared_preferences.dart'; |
||||
|
||||
class MineOrderView extends StatefulWidget { |
||||
@override |
||||
State<StatefulWidget> createState() { |
||||
return _MineOrderView(); |
||||
} |
||||
} |
||||
|
||||
class _MineOrderView extends State<MineOrderView> { |
||||
@override |
||||
Widget build(BuildContext context) { |
||||
return Container( |
||||
margin: EdgeInsets.fromLTRB(16.w, 10.h, 16.w, 6.h), |
||||
padding: EdgeInsets.fromLTRB(20.w, 12.h, 20.w, 12.h), |
||||
decoration: BoxDecoration( |
||||
color: Colors.white, |
||||
borderRadius: BorderRadius.circular(8), |
||||
boxShadow: [ |
||||
BoxShadow( |
||||
color: Colors.black.withAlpha(12), |
||||
offset: Offset(0, 3), |
||||
blurRadius: 14, |
||||
spreadRadius: 0, |
||||
), |
||||
], |
||||
), |
||||
child: Column( |
||||
crossAxisAlignment: CrossAxisAlignment.start, |
||||
children: [ |
||||
Container( |
||||
padding: EdgeInsets.symmetric(vertical: 4.h), |
||||
child: Text( |
||||
"我的订单", |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontWeight: MyFontWeight.semi_bold, |
||||
fontSize: 16.sp, |
||||
), |
||||
), |
||||
), |
||||
SizedBox(height: 8.h,), |
||||
Row( |
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
InkWell( |
||||
onTap: (){ |
||||
toOrderHistory(1); |
||||
}, |
||||
child: orderStatusItem(1), |
||||
), |
||||
InkWell( |
||||
onTap: (){ |
||||
toOrderHistory(2); |
||||
}, |
||||
child: orderStatusItem(2), |
||||
), |
||||
InkWell( |
||||
onTap: (){ |
||||
toOrderHistory(3); |
||||
}, |
||||
child: orderStatusItem(3), |
||||
), |
||||
InkWell( |
||||
onTap: (){ |
||||
toOrderHistory(0); |
||||
}, |
||||
child: orderStatusItem(0), |
||||
), |
||||
], |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
|
||||
toOrderHistory(int status) { |
||||
SharedPreferences.getInstance().then((value) { |
||||
if (value.getString("token") == null || |
||||
value.getString("token") == "") { |
||||
LoginTipsDialog().show(context); |
||||
return; |
||||
} |
||||
Navigator.of(context).pushNamed('/router/order_history_page', arguments: {"status":status}); |
||||
}); |
||||
} |
||||
|
||||
List<String> orderStatusImg = [ |
||||
"assets/image/icon_mine_order_qb.png", |
||||
"assets/image/icon_mine_order_dfk.png", |
||||
"assets/image/icon_mine_order_wwc.png", |
||||
"assets/image/icon_mine_order_ywc.png", |
||||
]; |
||||
|
||||
List<String> orderStatusText = [ |
||||
S.current.quanbu, |
||||
S.current.daifukuan, |
||||
S.current.weiwancheng, |
||||
S.current.yiwancheng, |
||||
]; |
||||
|
||||
Widget orderStatusItem(int status) { |
||||
return Container( |
||||
margin: EdgeInsets.symmetric(vertical: 4.h), |
||||
child: Column( |
||||
mainAxisAlignment: MainAxisAlignment.center, |
||||
crossAxisAlignment: CrossAxisAlignment.center, |
||||
children: [ |
||||
Image.asset( |
||||
orderStatusImg[status], |
||||
fit: BoxFit.contain, |
||||
width: 32.w, |
||||
height: 32.w, |
||||
), |
||||
SizedBox(height: 4.h,), |
||||
Text( |
||||
orderStatusText[status], |
||||
style: TextStyle( |
||||
color: Color(0xFF353535), |
||||
fontSize: 12.sp, |
||||
fontWeight: MyFontWeight.medium, |
||||
), |
||||
), |
||||
], |
||||
), |
||||
); |
||||
} |
||||
} |