Przeglądaj źródła

添加订单搜索页面

添加空页面
tags/0.0.1
Weller 4 lat temu
rodzic
commit
7988d25169
7 zmienionych plików z 151 dodań i 23 usunięć
  1. +1
    -1
      .dart_tool/package_config.json
  2. BIN
     
  3. +91
    -0
      lib/pages/orders_page/order_search_page.dart
  4. +24
    -16
      lib/pages/orders_page/orders_page.dart
  5. +8
    -5
      lib/pages/orders_page/views/order_serch_widget.dart
  6. +26
    -0
      lib/widgets/empty/empty_widget.dart
  7. +1
    -1
      pubspec.yaml

+ 1
- 1
.dart_tool/package_config.json Wyświetl plik

@@ -620,7 +620,7 @@
"languageVersion": "2.1"
}
],
"generated": "2020-10-15T08:14:11.281280Z",
"generated": "2020-10-15T12:19:28.149342Z",
"generator": "pub",
"generatorVersion": "2.8.2"
}


+ 91
- 0
lib/pages/orders_page/order_search_page.dart Wyświetl plik

@@ -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);
},
),
),
);
}
}

+ 24
- 16
lib/pages/orders_page/orders_page.dart Wyświetl plik

@@ -1,5 +1,6 @@
import 'package:flutter/cupertino.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_item_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 {
final Map<String, dynamic> data;

const OrdersPage(
this.data, {
const OrdersPage(this.data, {
Key key,
}) : super(key: key);

@@ -42,19 +42,19 @@ class _OrdersPageState extends State<OrdersPage> {
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);
}
},
)
child: Container(
padding: EdgeInsets.zero,
child: Icon(
Icons.arrow_back_ios,
size: 20,
),
),
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
},
)
: Container(),
middle: Text(
'我的订单',
@@ -90,7 +90,15 @@ class _OrdersContainerState extends State<_OrdersContainer>
Widget build(BuildContext context) {
return Column(
children: <Widget>[
OrderSearchWidget(),
GestureDetector(
child: OrderSearchWidget(),
onTap: () {
Navigator.of(context)
.push(MaterialPageRoute(builder: (BuildContext context) {
return OrderSearchPage();
}));
},
),
OrderTabbarWidget(
_tabController,
[


+ 8
- 5
lib/pages/orders_page/views/order_serch_widget.dart Wyświetl plik

@@ -9,14 +9,17 @@ class OrderSearchWidget extends StatelessWidget {
height: 40,
padding: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4),
color: Colors.white,
child: CupertinoTextField(
textAlign: TextAlign.center,
textInputAction: TextInputAction.search,
child: Container(
padding: EdgeInsets.only(left: 12, right: 12),
decoration: BoxDecoration(
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),
),
),
),
);
}


+ 26
- 0
lib/widgets/empty/empty_widget.dart Wyświetl plik

@@ -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),
))),
],
);
}
}

+ 1
- 1
pubspec.yaml Wyświetl plik

@@ -65,7 +65,7 @@ flutter:
# To add assets to your plugin package, add an assets section, like this:
assets:
- assets/images/launch_image/launch_image.png
# - images/a_dot_ham.jpeg
- assets/images/empty/empty.png
#
# For details regarding assets in packages, see
# https://flutter.dev/assets-and-images/#from-packages


Ładowanie…
Anuluj
Zapisz