Sfoglia il codice sorgente

1.增加订单查找自定义组件

tags/0.0.17
“yanghuaxuan” 3 anni fa
parent
commit
54234a6f5c
5 ha cambiato i file con 292 aggiunte e 14 eliminazioni
  1. +35
    -0
      example/lib/main.dart
  2. +0
    -14
      lib/pages/order_found_page/order_found_search_page.dart
  3. +166
    -0
      lib/pages/order_found_page/order_found_search_page/order_found_search_page.dart
  4. +90
    -0
      lib/widgets/custom/ordedr_found/order_found_nav/order_found_nav.dart
  5. +1
    -0
      lib/zhiying_base_widget.dart

+ 35
- 0
example/lib/main.dart Vedi File

@@ -26,6 +26,7 @@ import 'package:zhiying_base_widget/zhiying_base_widget.dart';
import 'package:zhiying_acquisition/register.dart';
import 'package:zhiying_shopping_mall/zhiying_shopping_mall.dart';
import 'package:zhiying_credit_card/register.dart';
import 'package:zhiying_base_widget/zhiying_base_widget.dart';

void main() {
FlutterError.onError = (FlutterErrorDetails details) {
@@ -151,3 +152,37 @@ class _MyAppState extends State<MyApp> {
// if (!currentFocus.hasPrimaryFocus && currentFocus.focusedChild != null) {
// FocusManager.instance.primaryFocus.unfocus();
// }

class TestPage extends StatefulWidget {
@override
_TestPageState createState() => _TestPageState();
}

class _TestPageState extends State<TestPage> {
@override
void initState() {
NativeUtil.notifyInitSuccess();
super.initState();
}

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("临时测试页"),
),
body: Container(
child: ListView(
children: [
ListTile(
title: Text("查询页"),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) => OrderFoundSearchPage()));
},
)
],
),
),
);
}
}

+ 0
- 14
lib/pages/order_found_page/order_found_search_page.dart Vedi File

@@ -1,14 +0,0 @@
import 'package:flutter/material.dart';

///订单搜索页
class OrderFoundSearchPage extends StatefulWidget {
@override
_OrderFoundSearchPageState createState() => _OrderFoundSearchPageState();
}

class _OrderFoundSearchPageState extends State<OrderFoundSearchPage> {
@override
Widget build(BuildContext context) {
return Container();
}
}

+ 166
- 0
lib/pages/order_found_page/order_found_search_page/order_found_search_page.dart Vedi File

@@ -0,0 +1,166 @@
import 'package:flutter/material.dart';
import 'package:zhiying_base_widget/widgets/custom/ordedr_found/order_found_nav/order_found_nav.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

///订单搜索页
class OrderFoundSearchPage extends StatefulWidget {
@override
_OrderFoundSearchPageState createState() => _OrderFoundSearchPageState();
}

class _OrderFoundSearchPageState extends State<OrderFoundSearchPage> {
@override
Widget build(BuildContext context) {
return Stack(
children: [
Scaffold(
appBar: _buildAppBar(),
body: Container(
child: ListView(
children: [
_buildSearch(),
_buildCenter(),
_buildBottom(),
_buildTest()
],
),
),
),
],
);
}

_buildAppBar() {
return AppBar(
leading: Navigator.canPop(context)
? IconButton(
icon: Icon(
Icons.arrow_back_ios_rounded,
),
iconSize: 18,
onPressed: () {
Navigator.pop(context);
})
: Container(),
title: Text(
"订单查询",
style: TextStyle(fontSize: 17),
),
centerTitle: true,
actions: [IconButton(icon: Icon(Icons.refresh), onPressed: () {})],
);
}

///构建搜索
_buildSearch() {
return Container(
height: 50,
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10), border: Border.all(color: Colors.white)),
margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
padding: EdgeInsets.only(left: 10, right: 4),
child: Row(
children: [
Expanded(
child: TextField(
decoration: InputDecoration(border: InputBorder.none, hintText: "请输入或粘粘淘宝订单编号", hintStyle: TextStyle(color: HexColor.fromHex("#999999"), fontSize: 14), isDense: true),
)),
Container(
height: 42,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 24, right: 24),
decoration: BoxDecoration(color: HexColor.fromHex("#FF2020"), borderRadius: BorderRadius.circular(10)),
child: Text(
"搜索",
style: TextStyle(color: HexColor.fromHex("#FFFFFF")),
),
),
],
),
);
}

_buildCenter() {
return Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(10)),
child: Column(
children: [
Row(
children: [
Container(
width: 4,
height: 14,
decoration: BoxDecoration(color: HexColor.fromHex("#FF2020"), borderRadius: BorderRadius.circular(10)),
margin: EdgeInsets.only(right: 10),
),
Text(
"如何获取订单编号?",
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 15, fontWeight: FontWeight.w500),
)
],
),
SizedBox(
height: 16,
),
CachedNetworkImage(
imageUrl: "https://alipic.lanhuapp.com/SketchPng9ae52da74764fe05917a1d5a4a8d5eb94a9013106c4412056afa00340164bde5",
fit: BoxFit.fitWidth,
)
],
),
);
}

_buildBottom() {
return Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 0, bottom: 10),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(10)),
child: Column(
children: [
Row(
children: [
Container(
width: 4,
height: 14,
margin: EdgeInsets.only(right: 10),
decoration: BoxDecoration(color: HexColor.fromHex("#FF2020"), borderRadius: BorderRadius.circular(10)),
),
Text(
"查询规则?",
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 15, fontWeight: FontWeight.w500),
)
],
),
SizedBox(
height: 16,
),
ListView(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
children: [
Text(
'''
1.购买人没同步的订单可通过订单查询找回;
2.当查找人查找到订单,并且该订单在订单库确实找不到归
属时,该订单归属到查找人;
3.当有多个用户输入同一订单号,以第一个输入人为准;
4.已归属的订单不支持继续查询;
5.建议购买人自查,运营商帮助超级会员查询时,不要点击
确认找回,可让购买人自查并找回;
6.收益将按查找人的当前的用户关系进行归属。
''',
style: TextStyle(color: HexColor.fromHex("#999999"), fontSize: 12, fontWeight: FontWeight.w500),
)
],
)
],
),
);
}

_buildTest() {
return OrderFoundNav();
}
}

+ 90
- 0
lib/widgets/custom/ordedr_found/order_found_nav/order_found_nav.dart Vedi File

@@ -0,0 +1,90 @@
import 'package:flutter/material.dart';
import 'package:zhiying_comm/util/extension/color.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class OrderFoundNav extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
decoration: BoxDecoration(color: HexColor.fromHex("#FFFFFF"), borderRadius: BorderRadius.circular(10)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Container(
width: 4,
height: 14,
decoration: BoxDecoration(color: HexColor.fromHex("#FF2020"), borderRadius: BorderRadius.circular(10)),
margin: EdgeInsets.only(right: 10),
),
Text(
"如何获取订单编号?",
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 15, fontWeight: FontWeight.w500),
)
],
),
Padding(
padding: const EdgeInsets.only(left: 15),
child: Text(
"美图、饿了么、权益等",
style: TextStyle(color: HexColor.fromHex("#999999"), fontSize: 12, fontWeight: FontWeight.w500),
),
),
SizedBox(
height: 10,
),
createNav()
],
),
);
}

createNav() {
List<Widget> listWidget = List();

for (var index = 0; index < 2; index++) {
listWidget.add(Row(
children: _buildRow(index),
));
}

return Column(children: listWidget);
}

_buildRow(int index2) {
List<Widget> listWidget = List();

for (var index = 0; index < 5; index++) {
listWidget.add(Expanded(
child: _buildItem(),
));
}

return listWidget;
}

_buildItem() {
return Container(
margin: EdgeInsets.only(top: 10),
child: Column(
children: [
CachedNetworkImage(
imageUrl: "https://alipic.lanhuapp.com/SketchPngcc0450a94dea814bcb680581f96ff1646a8b4f7c00a496f21e808f6c3dbfebe1",
width: 40,
height: 40,
),
SizedBox(
height: 6,
),
Text(
"苏宁",
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 12),
),
],
),
);
}
}

+ 1
- 0
lib/zhiying_base_widget.dart Vedi File

@@ -13,6 +13,7 @@ export 'package:amap_flutter_location/amap_flutter_location.dart';
export 'package:amap_flutter_location/amap_location_option.dart';
export 'package:tab_indicator_styler/tab_indicator_styler.dart';
export 'package:zhiying_base_widget/dialog/global_dialog/notification_setting_dialog/notification_setting_dialog.dart';
export 'pages/order_found_page/order_found_search_page/order_found_search_page.dart';

class ZhiyingBaseWidget {
static const MethodChannel _channel = const MethodChannel('zhiying_base_widget');


Caricamento…
Annulla
Salva