@@ -620,7 +620,7 @@ | |||||
"languageVersion": "2.1" | "languageVersion": "2.1" | ||||
} | } | ||||
], | ], | ||||
"generated": "2020-10-15T08:14:11.281280Z", | |||||
"generated": "2020-10-15T12:19:28.149342Z", | |||||
"generator": "pub", | "generator": "pub", | ||||
"generatorVersion": "2.8.2" | "generatorVersion": "2.8.2" | ||||
} | } |
@@ -0,0 +1,91 @@ | |||||
import 'package:flutter/cupertino.dart'; | |||||
import 'package:flutter/material.dart'; | |||||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||||
import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart'; | |||||
// 订单搜索页面 | |||||
class OrderSearchPage extends StatefulWidget { | |||||
@override | |||||
_OrderSearchPageState createState() => _OrderSearchPageState(); | |||||
} | |||||
class _OrderSearchPageState extends State<OrderSearchPage> { | |||||
final TextEditingController _keywordController = TextEditingController(); | |||||
@override | |||||
void initState() { | |||||
// TODO: implement initState | |||||
super.initState(); | |||||
} | |||||
@override | |||||
Widget build(BuildContext context) { | |||||
return Scaffold( | |||||
appBar: _createNav(), | |||||
body: SafeArea( | |||||
child: Container(width: double.infinity, | |||||
height: double.infinity, | |||||
child: Center(child: EmptyWidget())), | |||||
), | |||||
); | |||||
} | |||||
// 导航栏 | |||||
Widget _createNav() { | |||||
return CupertinoNavigationBar( | |||||
border: Border( | |||||
bottom: BorderSide( | |||||
width: 0.0, // One physical pixel. | |||||
style: BorderStyle.none, | |||||
), | |||||
), | |||||
backgroundColor: Colors.white, | |||||
leading: Navigator.canPop(context) | |||||
? GestureDetector( | |||||
child: Container( | |||||
padding: EdgeInsets.zero, | |||||
child: Icon( | |||||
Icons.arrow_back_ios, | |||||
size: 20, | |||||
), | |||||
), | |||||
onTap: () { | |||||
if (Navigator.canPop(context)) { | |||||
Navigator.pop(context); | |||||
} | |||||
}, | |||||
) | |||||
: Container(), | |||||
middle: Container( | |||||
height: 32, | |||||
child: CupertinoTextField( | |||||
autofocus: true, | |||||
padding: EdgeInsets.only(left: 12, right: 12), | |||||
decoration: BoxDecoration( | |||||
borderRadius: BorderRadius.circular(16), | |||||
color: Color(0xfff9f9f9)), | |||||
placeholder: '搜索商品标题/粉丝姓名/订单号', | |||||
placeholderStyle: TextStyle(color: Color(0xff999999), fontSize: 14), | |||||
controller: _keywordController, | |||||
style: TextStyle(fontSize: 14, color: Color(0xff333333)), | |||||
), | |||||
), | |||||
trailing: Container( | |||||
padding: EdgeInsets.only(left: 10), | |||||
child: CupertinoButton( | |||||
padding: EdgeInsets.zero, | |||||
child: Text( | |||||
'搜索', | |||||
style: TextStyle( | |||||
fontSize: 14, | |||||
color: Colors.redAccent, | |||||
), | |||||
), | |||||
onPressed: () { | |||||
Logger.debug(_keywordController.text); | |||||
}, | |||||
), | |||||
), | |||||
); | |||||
} | |||||
} |
@@ -1,5 +1,6 @@ | |||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:zhiying_base_widget/pages/orders_page/order_search_page.dart'; | |||||
import 'package:zhiying_base_widget/pages/orders_page/views/order_filter.dart'; | import 'package:zhiying_base_widget/pages/orders_page/views/order_filter.dart'; | ||||
import 'package:zhiying_base_widget/pages/orders_page/views/order_item_widget.dart'; | import 'package:zhiying_base_widget/pages/orders_page/views/order_item_widget.dart'; | ||||
import 'package:zhiying_base_widget/pages/orders_page/views/order_serch_widget.dart'; | import 'package:zhiying_base_widget/pages/orders_page/views/order_serch_widget.dart'; | ||||
@@ -9,8 +10,7 @@ import 'package:zhiying_base_widget/pages/orders_page/views/order_tabbar_widget. | |||||
class OrdersPage extends StatefulWidget { | class OrdersPage extends StatefulWidget { | ||||
final Map<String, dynamic> data; | final Map<String, dynamic> data; | ||||
const OrdersPage( | |||||
this.data, { | |||||
const OrdersPage(this.data, { | |||||
Key key, | Key key, | ||||
}) : super(key: key); | }) : super(key: key); | ||||
@@ -42,19 +42,19 @@ class _OrdersPageState extends State<OrdersPage> { | |||||
backgroundColor: Colors.white, | backgroundColor: Colors.white, | ||||
leading: Navigator.canPop(context) | leading: Navigator.canPop(context) | ||||
? GestureDetector( | ? GestureDetector( | ||||
child: Container( | |||||
padding: EdgeInsets.zero, | |||||
child: Icon( | |||||
Icons.arrow_back_ios, | |||||
size: 20, | |||||
), | |||||
), | |||||
onTap: () { | |||||
if (Navigator.canPop(context)) { | |||||
Navigator.pop(context); | |||||
} | |||||
}, | |||||
) | |||||
child: Container( | |||||
padding: EdgeInsets.zero, | |||||
child: Icon( | |||||
Icons.arrow_back_ios, | |||||
size: 20, | |||||
), | |||||
), | |||||
onTap: () { | |||||
if (Navigator.canPop(context)) { | |||||
Navigator.pop(context); | |||||
} | |||||
}, | |||||
) | |||||
: Container(), | : Container(), | ||||
middle: Text( | middle: Text( | ||||
'我的订单', | '我的订单', | ||||
@@ -90,7 +90,15 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
return Column( | return Column( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
OrderSearchWidget(), | |||||
GestureDetector( | |||||
child: OrderSearchWidget(), | |||||
onTap: () { | |||||
Navigator.of(context) | |||||
.push(MaterialPageRoute(builder: (BuildContext context) { | |||||
return OrderSearchPage(); | |||||
})); | |||||
}, | |||||
), | |||||
OrderTabbarWidget( | OrderTabbarWidget( | ||||
_tabController, | _tabController, | ||||
[ | [ | ||||
@@ -9,14 +9,17 @@ class OrderSearchWidget extends StatelessWidget { | |||||
height: 40, | height: 40, | ||||
padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4), | padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4), | ||||
color: Colors.white, | color: Colors.white, | ||||
child: CupertinoTextField( | |||||
textAlign: TextAlign.center, | |||||
textInputAction: TextInputAction.search, | |||||
child: Container( | |||||
padding: EdgeInsets.only(left: 12, right: 12), | padding: EdgeInsets.only(left: 12, right: 12), | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
borderRadius: BorderRadius.circular(16), color: Color(0xfff9f9f9)), | borderRadius: BorderRadius.circular(16), color: Color(0xfff9f9f9)), | ||||
placeholder: '搜索商品标题/粉丝姓名/订单号', | |||||
placeholderStyle: TextStyle(color: Color(0xff999999), fontSize: 14), | |||||
child: Center( | |||||
child: Text( | |||||
'搜索商品标题/粉丝姓名/订单号', | |||||
textAlign: TextAlign.center, | |||||
style: TextStyle(color: Color(0xff999999), fontSize: 14), | |||||
), | |||||
), | |||||
), | ), | ||||
); | ); | ||||
} | } | ||||
@@ -0,0 +1,26 @@ | |||||
import 'package:flutter/material.dart'; | |||||
class EmptyWidget extends StatelessWidget { | |||||
final String tips; | |||||
const EmptyWidget({Key key, this.tips = '暂无数据~'}) : super(key: key); | |||||
@override | |||||
Widget build(BuildContext context) { | |||||
return Column( | |||||
crossAxisAlignment: CrossAxisAlignment.center, | |||||
mainAxisAlignment: MainAxisAlignment.center, | |||||
children: <Widget>[ | |||||
Image.asset( | |||||
'assets/images/empty/empty.png', | |||||
package: 'zhiying_base_widget', | |||||
), | |||||
Padding(padding: const EdgeInsets.all(16.0), | |||||
child: Text(tips, style: TextStyle( | |||||
fontSize: 15, | |||||
color: Color(0xff999999), | |||||
))), | |||||
], | |||||
); | |||||
} | |||||
} |
@@ -65,7 +65,7 @@ flutter: | |||||
# To add assets to your plugin package, add an assets section, like this: | # To add assets to your plugin package, add an assets section, like this: | ||||
assets: | assets: | ||||
- assets/images/launch_image/launch_image.png | - assets/images/launch_image/launch_image.png | ||||
# - images/a_dot_ham.jpeg | |||||
- assets/images/empty/empty.png | |||||
# | # | ||||
# For details regarding assets in packages, see | # For details regarding assets in packages, see | ||||
# https://flutter.dev/assets-and-images/#from-packages | # https://flutter.dev/assets-and-images/#from-packages | ||||