@@ -45,7 +45,7 @@ android { | |||
applicationId "cn.zhios.zhiying" | |||
minSdkVersion 21 | |||
targetSdkVersion 28 | |||
versionCode 1618056480 | |||
versionCode 1718056480 | |||
versionName "10.6.0" | |||
aaptOptions.cruncherEnabled = false | |||
aaptOptions.useNewCruncher = false | |||
@@ -161,6 +161,14 @@ public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommN | |||
map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ | |||
map.put("master_id", "123456"); | |||
map.put("secret_key", "123456"); | |||
// map.put("domain", "http://inapi.izhyin.cn/");//"http://120.76.175.204:8989");http://47.114.51.254:80 http://inapi.izhyin.cn/ | |||
// map.put("master_id", "22255132"); | |||
// map.put("secret_key", "123456"); | |||
///正式 | |||
// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 | |||
// map.put("master_id", "99813608"); | |||
// map.put("secret_key", "123456"); | |||
///正式 | |||
// map.put("domain", "http://api.zhios.cn/");//45678910,api.zhios.cn84198689 | |||
@@ -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())); | |||
}, | |||
) | |||
], | |||
), | |||
), | |||
); | |||
} | |||
} |
@@ -6,6 +6,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart'; | |||
import 'package:provider/provider.dart'; | |||
import 'package:flutter_bloc/flutter_bloc.dart'; | |||
import 'package:zhiying_base_widget/pages/main_page/notifier/main_page_notifier.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/bottom_pic/bottom_pic.dart'; | |||
import 'package:zhiying_base_widget/widgets/empty/empty_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/home/home_auth/home_auth.dart'; | |||
import 'package:zhiying_base_widget/widgets/refresh/refresh_header/refresh_gif_header.dart'; | |||
@@ -26,7 +27,7 @@ class CustomItemPage extends StatelessWidget { | |||
final String modPid; | |||
final String modId; | |||
final bool needBuildStatus; | |||
Function(double) scroller; | |||
Function(double) scroller; | |||
CustomItemPage(this.data, this.tabIndex, this.modId, this.modPid, this.needBuildStatus, {this.scroller}); | |||
@@ -38,7 +39,14 @@ class CustomItemPage extends StatelessWidget { | |||
], | |||
child: BlocProvider<CustomItemPageBloc>( | |||
create: (_) => CustomItemPageBloc(CustomItemPageRepository(this.data, this.tabIndex, this.modId, this.modPid)), | |||
child: _CustomItemPageContainer(this.data, this.tabIndex, this.modId, this.modPid, this.needBuildStatus,scroller: this.scroller,), | |||
child: _CustomItemPageContainer( | |||
this.data, | |||
this.tabIndex, | |||
this.modId, | |||
this.modPid, | |||
this.needBuildStatus, | |||
scroller: this.scroller, | |||
), | |||
), | |||
); | |||
} | |||
@@ -94,8 +102,9 @@ class __CustomItemPageContainerState extends State<_CustomItemPageContainer> wit | |||
_controller = ScrollController(); | |||
_eventBus = EventBus(); | |||
_refreshController = RefreshController(initialRefresh: false); | |||
_initEvent();_controller.addListener(() { | |||
if(widget.scroller!=null){ | |||
_initEvent(); | |||
_controller.addListener(() { | |||
if (widget.scroller != null) { | |||
widget?.scroller(_controller.offset); | |||
} | |||
}); | |||
@@ -186,6 +195,13 @@ class __CustomItemPageContainerState extends State<_CustomItemPageContainer> wit | |||
margin: const EdgeInsets.only(bottom: 8), | |||
child: _buildAuthWidget(model), | |||
), //_buildAuthWidget(model), | |||
), | |||
Align( | |||
alignment: Alignment.bottomCenter, | |||
child: Container( | |||
margin: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom), | |||
child: _buildBottomPic(model), | |||
), //_buildAuthWidget(model), | |||
) | |||
], | |||
), | |||
@@ -197,7 +213,7 @@ class __CustomItemPageContainerState extends State<_CustomItemPageContainer> wit | |||
List<Widget> result = []; | |||
for (int i = 0; i < datas.length; i++) { | |||
WidgetModel item = WidgetModel.fromJson(Map<String, dynamic>.from(datas[i])); | |||
if (item.modName == 'audit_tip') { | |||
if (item.modName == 'audit_tip' || item.modName == "bottom_suspension") { | |||
Logger.debug('授权组件,跳过'); | |||
continue; | |||
} | |||
@@ -261,4 +277,20 @@ class __CustomItemPageContainerState extends State<_CustomItemPageContainer> wit | |||
return rlt ?? Container(); | |||
} | |||
/// 特殊的底部图片跳转 | |||
Widget _buildBottomPic(final List<Map<String, dynamic>> datas) { | |||
int length = datas?.length ?? 0; | |||
if (length == 0) return Container(); | |||
Widget rlt; | |||
for (int i = 0; i < datas.length; i++) { | |||
WidgetModel item = WidgetModel.fromJson(Map<String, dynamic>.from(datas[i])); | |||
if (item.modName == 'bottom_suspension') { | |||
rlt = BottomPic(model: datas[i]); | |||
break; | |||
} | |||
} | |||
return rlt ?? Container(); | |||
} | |||
} |
@@ -354,7 +354,7 @@ class __CommonPageContainerState extends State<_CommonPageContainer> with Single | |||
return MyTab( | |||
icon: CachedNetworkImage( | |||
imageUrl: item['choose_image_url'] ?? '', | |||
width: 14, | |||
width: 16, | |||
), | |||
text: item['name'], | |||
); | |||
@@ -0,0 +1,31 @@ | |||
import 'dart:async'; | |||
import 'package:zhiying_comm/util/base_bloc.dart'; | |||
import 'order_found_result_model.dart'; | |||
class OrderFoundResultBloc | |||
extends BlocBase | |||
{ | |||
StreamController<OrderFoundResultModel> streamController = StreamController(); | |||
OrderFoundResultModel orderFoundResultModel; | |||
Stream get outData { | |||
return streamController.stream; | |||
} | |||
//获取页面数据 | |||
getData() { | |||
// NetUtil.request("", method: NetMethod.POST, onSuccess: (data) { | |||
// }); | |||
orderFoundResultModel = OrderFoundResultModel(); | |||
streamController.add(orderFoundResultModel); | |||
} | |||
@override | |||
void dispose() { | |||
streamController.close(); | |||
// TODO: implement dispose | |||
} | |||
} |
@@ -0,0 +1,104 @@ | |||
class OrderFoundResultModel { | |||
int uid; | |||
String nickname; | |||
bool hidOrder; | |||
String ordId; | |||
String providerOid; | |||
String itemId; | |||
int itemNum; | |||
String itemTitle; | |||
String itemPrice; | |||
String provider; | |||
String paidPrice; | |||
int orderType; | |||
int priceType; | |||
String priceName; | |||
String userCommission; | |||
String userCommissionRate; | |||
String reason; | |||
int state; | |||
String createAt; | |||
String updateAt; | |||
String confirmAt; | |||
String settleAt; | |||
String thumbnail; | |||
OrderFoundResultModel( | |||
{this.uid, | |||
this.nickname, | |||
this.hidOrder, | |||
this.ordId, | |||
this.providerOid, | |||
this.itemId, | |||
this.itemNum, | |||
this.itemTitle, | |||
this.itemPrice, | |||
this.provider, | |||
this.paidPrice, | |||
this.orderType, | |||
this.priceType, | |||
this.priceName, | |||
this.userCommission, | |||
this.userCommissionRate, | |||
this.reason, | |||
this.state, | |||
this.createAt, | |||
this.updateAt, | |||
this.confirmAt, | |||
this.settleAt, | |||
this.thumbnail}); | |||
OrderFoundResultModel.fromJson(Map<String, dynamic> json) { | |||
uid = json['uid']; | |||
nickname = json['nickname']; | |||
hidOrder = json['hid_order']; | |||
ordId = json['ord_id']; | |||
providerOid = json['provider_oid']; | |||
itemId = json['item_id']; | |||
itemNum = json['item_num']; | |||
itemTitle = json['item_title']; | |||
itemPrice = json['item_price']; | |||
provider = json['provider']; | |||
paidPrice = json['paid_price']; | |||
orderType = json['order_type']; | |||
priceType = json['price_type']; | |||
priceName = json['price_name']; | |||
userCommission = json['user_commission']; | |||
userCommissionRate = json['user_commission_rate']; | |||
reason = json['reason']; | |||
state = json['state']; | |||
createAt = json['create_at']; | |||
updateAt = json['update_at']; | |||
confirmAt = json['confirm_at']; | |||
settleAt = json['settle_at']; | |||
thumbnail = json['thumbnail']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['uid'] = this.uid; | |||
data['nickname'] = this.nickname; | |||
data['hid_order'] = this.hidOrder; | |||
data['ord_id'] = this.ordId; | |||
data['provider_oid'] = this.providerOid; | |||
data['item_id'] = this.itemId; | |||
data['item_num'] = this.itemNum; | |||
data['item_title'] = this.itemTitle; | |||
data['item_price'] = this.itemPrice; | |||
data['provider'] = this.provider; | |||
data['paid_price'] = this.paidPrice; | |||
data['order_type'] = this.orderType; | |||
data['price_type'] = this.priceType; | |||
data['price_name'] = this.priceName; | |||
data['user_commission'] = this.userCommission; | |||
data['user_commission_rate'] = this.userCommissionRate; | |||
data['reason'] = this.reason; | |||
data['state'] = this.state; | |||
data['create_at'] = this.createAt; | |||
data['update_at'] = this.updateAt; | |||
data['confirm_at'] = this.confirmAt; | |||
data['settle_at'] = this.settleAt; | |||
data['thumbnail'] = this.thumbnail; | |||
return data; | |||
} | |||
} |
@@ -0,0 +1,460 @@ | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/gestures.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:flutter/services.dart'; | |||
import 'package:zhiying_base_widget/pages/order_found_page/order_found_result/order_found_result_bloc.dart'; | |||
import 'package:zhiying_base_widget/pages/order_found_page/order_found_result/order_found_result_model.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
import 'package:fluttertoast/fluttertoast.dart'; | |||
class OrderFoundResultPage extends StatefulWidget { | |||
//有数据的model | |||
final OrderFoundResultModel orderFoundResultModel; | |||
//没有订单数据的空页面的title | |||
final String emptyOrderTitle; | |||
//没有订单数据的空页面的内容 | |||
final String emptyOrderContent; | |||
//没有订单数据的空页面的图片 | |||
final String emptyOrderPic; | |||
const OrderFoundResultPage( | |||
{Key key, | |||
this.orderFoundResultModel, | |||
this.emptyOrderTitle, | |||
this.emptyOrderContent, | |||
this.emptyOrderPic}) | |||
: super(key: key); | |||
@override | |||
_OrderFoundResultPageState createState() => _OrderFoundResultPageState(); | |||
} | |||
class _OrderFoundResultPageState extends State<OrderFoundResultPage> { | |||
// OrderFoundResultBloc _bloc; | |||
bool hasData = true; | |||
OrderFoundResultModel model; | |||
String emptyOrderTitle; | |||
String emptyOrderContent; | |||
String emptyOrderPic; | |||
@override | |||
void initState() { | |||
// TODO: implement initState | |||
super.initState(); | |||
model = widget.orderFoundResultModel; | |||
if (!EmptyUtil.isEmpty(model)) { | |||
hasData = true; | |||
} else { | |||
hasData = false; | |||
} | |||
emptyOrderTitle = widget.emptyOrderTitle; | |||
emptyOrderContent = widget.emptyOrderContent; | |||
emptyOrderPic = widget.emptyOrderPic; | |||
// _bloc = OrderFoundResultBloc(); | |||
// _bloc.getData(); | |||
} | |||
//找回订单操作 | |||
retrieveOrderClick() { | |||
print("是我的,找回该订单点击"); | |||
Map<String, dynamic> params = {}; | |||
params['oid'] = model?.ordId; | |||
NetUtil.request('/api/v1/order/find', method: NetMethod.POST, params: params, | |||
onSuccess: (data) { | |||
Fluttertoast.showToast(msg: "找回成功"); | |||
Navigator.pop(context, "success"); | |||
}); | |||
} | |||
continueToQuery() { | |||
print("继续查询点击"); | |||
Navigator.pop(context); | |||
} | |||
//复制订单号 | |||
copyOrderCode() async{ | |||
ClipboardData data = new ClipboardData(text: model?.ordId); | |||
await Clipboard.setData(data); | |||
Fluttertoast.showToast(msg: "已复制订单号"); | |||
} | |||
@override | |||
Widget build(BuildContext context) { | |||
return Scaffold( | |||
appBar: AppBar( | |||
elevation: 0, | |||
brightness: Brightness.light, | |||
backgroundColor: Colors.white, | |||
title: Text( | |||
"订单查询", | |||
style: TextStyle( | |||
fontSize: 16, | |||
color: HexColor.fromHex("#FF333333"), | |||
fontWeight: FontWeight.w600), | |||
), | |||
centerTitle: true, | |||
leading: Navigator.canPop(context) | |||
? IconButton( | |||
icon: Icon( | |||
Icons.arrow_back_ios, | |||
size: 18, | |||
color: HexColor.fromHex("#FF444444"), | |||
), | |||
onPressed: () { | |||
Navigator.pop(context); | |||
}) | |||
: Container(), | |||
), | |||
body: Container( | |||
child: hasData ? hasOrderView() : emptyView(), | |||
), | |||
); | |||
} | |||
//有订单数据的页面 | |||
hasOrderView() { | |||
return Column( | |||
children: [ | |||
Expanded( | |||
child: Column( | |||
children: [ | |||
orderTip(), //提示文字 | |||
orderMsg(), //订单数据 | |||
], | |||
)), | |||
//继续查询按钮 | |||
GestureDetector( | |||
onTap: () { | |||
continueToQuery(); | |||
}, | |||
behavior: HitTestBehavior.opaque, | |||
child: Container( | |||
padding: EdgeInsets.all(12), | |||
child: Text( | |||
"不是我的,继续查询", | |||
style: TextStyle(fontSize: 14, color: HexColor.fromHex("#FF999999")), | |||
), | |||
), | |||
), | |||
//找回订单按钮 | |||
GestureDetector( | |||
onTap: () { | |||
retrieveOrderClick(); | |||
}, | |||
behavior: HitTestBehavior.opaque, | |||
child: Container( | |||
height: 50, | |||
width: double.infinity, | |||
margin: EdgeInsets.only(left: 24, right: 24, bottom: 24), | |||
decoration: | |||
BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.red), | |||
alignment: Alignment.center, | |||
child: Text( | |||
"是我的,找回该订单", | |||
style: TextStyle(fontSize: 14, color: Colors.white), | |||
), | |||
), | |||
), | |||
], | |||
); | |||
} | |||
//提示文字 | |||
orderTip() { | |||
return Container( | |||
margin: EdgeInsets.only(top: 15, left: 12), | |||
child: Row( | |||
children: [ | |||
Container( | |||
margin: EdgeInsets.only(right: 5), | |||
width: 4, | |||
height: 15, | |||
decoration: | |||
BoxDecoration(borderRadius: BorderRadius.circular(2), color: Colors.red), | |||
), | |||
Text( | |||
"是否为这笔订单?", | |||
style: TextStyle( | |||
fontSize: 15, | |||
color: HexColor.fromHex("#FF333333"), | |||
fontWeight: FontWeight.bold), | |||
) | |||
], | |||
), | |||
); | |||
} | |||
//订单数据 | |||
orderMsg() { | |||
return Container( | |||
height: 150, | |||
margin: EdgeInsets.only(top: 10, left: 12, right: 12), | |||
padding: EdgeInsets.only(top: 10, left: 10, right: 10), | |||
decoration: | |||
BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white), | |||
child: Column( | |||
children: [ | |||
Row( | |||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |||
children: [ | |||
Text( | |||
"自购订单", | |||
style: TextStyle( | |||
fontSize: 12, | |||
color: HexColor.fromHex("#FF333333"), | |||
fontWeight: FontWeight.w600), | |||
), | |||
], | |||
), | |||
Container( | |||
child: Row( | |||
children: [ | |||
Container( | |||
margin: EdgeInsets.only(top: 10, bottom: 10), | |||
width: 97, | |||
height: 97, | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(7.5), | |||
image: DecorationImage( | |||
image: NetworkImage(model?.thumbnail ?? ""), fit: BoxFit.fill)), | |||
), | |||
Expanded( | |||
child: Container( | |||
margin: EdgeInsets.only(left: 10), | |||
height: 100, | |||
child: Column( | |||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |||
crossAxisAlignment: CrossAxisAlignment.start, | |||
children: [ | |||
Row( | |||
children: [ | |||
Container( | |||
margin: EdgeInsets.only(right: 4), | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(2.5), | |||
color: Colors.red), | |||
padding: EdgeInsets.only(left: 10, right: 10), | |||
child: Text( | |||
model?.provider, | |||
style: TextStyle(fontSize: 10, color: Colors.white), | |||
), | |||
), | |||
Expanded( | |||
child: Text( | |||
model?.itemTitle, | |||
style: TextStyle( | |||
fontSize: 13, | |||
color: HexColor.fromHex("#FF333333"), | |||
), | |||
maxLines: 1, | |||
overflow: TextOverflow.ellipsis, | |||
), | |||
) | |||
], | |||
), | |||
Row( | |||
children: [ | |||
Text( | |||
"订单编号:${model?.ordId}", | |||
style: TextStyle( | |||
fontSize: 10, | |||
color: HexColor.fromHex("#FF999999"), | |||
), | |||
), | |||
GestureDetector( | |||
onTap: () { | |||
copyOrderCode(); | |||
}, | |||
behavior: HitTestBehavior.opaque, | |||
child: Container( | |||
width: 40, | |||
margin: EdgeInsets.only(left: 4), | |||
decoration: BoxDecoration( | |||
border: new Border.all( | |||
color: HexColor.fromHex("#FFD6D6D6"), width: 0.5), | |||
borderRadius: BorderRadius.circular(2.5), | |||
color: HexColor.fromHex("#FFF5F5F5")), | |||
alignment: Alignment.center, | |||
child: Text( | |||
"复制", | |||
style: TextStyle( | |||
fontSize: 9, color: HexColor.fromHex("#FF999999")), | |||
), | |||
), | |||
) | |||
], | |||
), | |||
Text( | |||
"下单时间:${model?.createAt}", | |||
style: TextStyle( | |||
fontSize: 10, | |||
color: HexColor.fromHex("#FF999999"), | |||
), | |||
), | |||
Text( | |||
"完成时间:${model?.updateAt}", | |||
style: TextStyle( | |||
fontSize: 10, | |||
color: HexColor.fromHex("#FF999999"), | |||
), | |||
), | |||
Row( | |||
children: [ | |||
Expanded( | |||
child: Text( | |||
"订单金额:¥ ${model?.paidPrice}", | |||
style: TextStyle( | |||
fontSize: 10, | |||
color: HexColor.fromHex("#FF333333"), | |||
), | |||
), | |||
), | |||
// RichText( | |||
// text: TextSpan(children: [ | |||
// TextSpan( | |||
// text: "收益:¥ ", | |||
// style: TextStyle( | |||
// fontSize: 11, | |||
// color: Colors.red, | |||
// fontWeight: FontWeight.w600)), | |||
// TextSpan( | |||
// text: "10.19", | |||
// style: TextStyle( | |||
// fontSize: 18, | |||
// color: Colors.red, | |||
// fontWeight: FontWeight.w600)) | |||
// ]), | |||
// ) | |||
], | |||
), | |||
], | |||
), | |||
), | |||
), | |||
], | |||
), | |||
), | |||
// Container( | |||
// padding: EdgeInsets.only(left: 6), | |||
// height: 25, | |||
// alignment: Alignment.centerLeft, | |||
// decoration: BoxDecoration( | |||
// borderRadius: BorderRadius.circular(2.5), | |||
// color: HexColor.fromHex("#FFF9F9F9")), | |||
// child: RichText( | |||
// text: TextSpan(children: [ | |||
// TextSpan( | |||
// text: "补贴于", | |||
// style: TextStyle( | |||
// fontSize: 10, color: HexColor.fromHex("#FF666666"))), | |||
// TextSpan( | |||
// text: "2020年07月23日", | |||
// style: TextStyle( | |||
// fontSize: 10, color: HexColor.fromHex("#FFFF4242"))), | |||
// TextSpan( | |||
// text: "到账,注意查收", | |||
// style: TextStyle( | |||
// fontSize: 10, color: HexColor.fromHex("#FF666666"))) | |||
// ]), | |||
// ), | |||
// ) | |||
], | |||
), | |||
); | |||
} | |||
//没有订单数据的空页面 | |||
emptyView() { | |||
return Column( | |||
children: [ | |||
Expanded( | |||
child: Column( | |||
children: [ | |||
Container( | |||
width: double.infinity, | |||
margin: EdgeInsets.only(top: 8, left: 12, right: 12), | |||
padding: EdgeInsets.only(bottom: 16, left: 12, right: 12, top: 28), | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(12), color: Colors.white), | |||
child: Column( | |||
children: [ | |||
CachedNetworkImage( | |||
imageUrl: emptyOrderPic ?? "", | |||
width: 152, | |||
fit: BoxFit.fitWidth, | |||
), | |||
Container( | |||
margin: EdgeInsets.only(top: 16), | |||
child: Text( | |||
"未查询到该订单", | |||
style: | |||
TextStyle(fontSize: 15, color: HexColor.fromHex("#FF999999")), | |||
), | |||
), | |||
Container( | |||
margin: EdgeInsets.only(top: 24), | |||
color: HexColor.fromHex("#FFF9F9F9"), | |||
), | |||
Container( | |||
margin: EdgeInsets.only(top: 16), | |||
child: Row( | |||
children: [ | |||
Container( | |||
margin: EdgeInsets.only(right: 5), | |||
width: 4, | |||
height: 15, | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(2), color: Colors.red), | |||
), | |||
Text( | |||
emptyOrderTitle ?? "", | |||
style: TextStyle( | |||
fontSize: 15, | |||
color: HexColor.fromHex("#FF333333"), | |||
fontWeight: FontWeight.bold), | |||
) | |||
], | |||
), | |||
), | |||
Container( | |||
alignment: Alignment.topLeft, | |||
margin: EdgeInsets.only(top: 8), | |||
child: Text( | |||
emptyOrderContent ?? "", | |||
style: | |||
TextStyle(fontSize: 12, color: HexColor.fromHex("#FF999999")), | |||
), | |||
) | |||
], | |||
), | |||
), | |||
], | |||
)), | |||
GestureDetector( | |||
onTap: () { | |||
continueToQuery(); | |||
}, | |||
behavior: HitTestBehavior.opaque, | |||
child: Container( | |||
height: 50, | |||
width: double.infinity, | |||
margin: EdgeInsets.only(left: 24, right: 24, bottom: 24), | |||
decoration: | |||
BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.red), | |||
alignment: Alignment.center, | |||
child: Text( | |||
"重新查询", | |||
style: TextStyle(fontSize: 14, color: Colors.white), | |||
), | |||
), | |||
), | |||
], | |||
); | |||
} | |||
} |
@@ -0,0 +1,184 @@ | |||
class OrderFoundSearchStyle { | |||
Top top; | |||
SearchCss searchCss; | |||
RuleCss ruleCss; | |||
FindRuleCss findRuleCss; | |||
ResultCss resultCss; | |||
FindRuleCss notFindRuleCss; | |||
OrderFoundSearchStyle( | |||
{this.top, | |||
this.searchCss, | |||
this.ruleCss, | |||
this.findRuleCss, | |||
this.resultCss, | |||
this.notFindRuleCss}); | |||
OrderFoundSearchStyle.fromJson(Map<String, dynamic> json) { | |||
top = json['top'] != null ? new Top.fromJson(json['top']) : null; | |||
searchCss = json['search_css'] != null | |||
? new SearchCss.fromJson(json['search_css']) | |||
: null; | |||
ruleCss = json['rule_css'] != null | |||
? new RuleCss.fromJson(json['rule_css']) | |||
: null; | |||
findRuleCss = json['find_rule_css'] != null | |||
? new FindRuleCss.fromJson(json['find_rule_css']) | |||
: null; | |||
resultCss = json['result_css'] != null | |||
? new ResultCss.fromJson(json['result_css']) | |||
: null; | |||
notFindRuleCss = json['not_find_rule_css'] != null | |||
? new FindRuleCss.fromJson(json['not_find_rule_css']) | |||
: null; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
if (this.top != null) { | |||
data['top'] = this.top.toJson(); | |||
} | |||
if (this.searchCss != null) { | |||
data['search_css'] = this.searchCss.toJson(); | |||
} | |||
if (this.ruleCss != null) { | |||
data['rule_css'] = this.ruleCss.toJson(); | |||
} | |||
if (this.findRuleCss != null) { | |||
data['find_rule_css'] = this.findRuleCss.toJson(); | |||
} | |||
if (this.resultCss != null) { | |||
data['result_css'] = this.resultCss.toJson(); | |||
} | |||
if (this.notFindRuleCss != null) { | |||
data['not_find_rule_css'] = this.notFindRuleCss.toJson(); | |||
} | |||
return data; | |||
} | |||
} | |||
class Top { | |||
String bgColor; | |||
String bgSubColor; | |||
String str; | |||
String strColor; | |||
Top({this.bgColor, this.bgSubColor, this.str, this.strColor}); | |||
Top.fromJson(Map<String, dynamic> json) { | |||
bgColor = json['bg_color']; | |||
bgSubColor = json['bg_sub_color']; | |||
str = json['str']; | |||
strColor = json['str_color']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['bg_color'] = this.bgColor; | |||
data['bg_sub_color'] = this.bgSubColor; | |||
data['str'] = this.str; | |||
data['str_color'] = this.strColor; | |||
return data; | |||
} | |||
} | |||
class SearchCss { | |||
String str; | |||
String bgColor; | |||
String strColor; | |||
String btnStr; | |||
String btnStrColor; | |||
String btnBgColor; | |||
String btnBgSubColor; | |||
SearchCss( | |||
{this.str, | |||
this.bgColor, | |||
this.strColor, | |||
this.btnStr, | |||
this.btnStrColor, | |||
this.btnBgColor, | |||
this.btnBgSubColor}); | |||
SearchCss.fromJson(Map<String, dynamic> json) { | |||
str = json['str']; | |||
bgColor = json['bg_color']; | |||
strColor = json['str_color']; | |||
btnStr = json['btn_str']; | |||
btnStrColor = json['btn_str_color']; | |||
btnBgColor = json['btn_bg_color']; | |||
btnBgSubColor = json['btn_bg_sub_color']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['str'] = this.str; | |||
data['bg_color'] = this.bgColor; | |||
data['str_color'] = this.strColor; | |||
data['btn_str'] = this.btnStr; | |||
data['btn_str_color'] = this.btnStrColor; | |||
data['btn_bg_color'] = this.btnBgColor; | |||
data['btn_bg_sub_color'] = this.btnBgSubColor; | |||
return data; | |||
} | |||
} | |||
class RuleCss { | |||
String str; | |||
String img; | |||
String imgUrl; | |||
RuleCss({this.str, this.img, this.imgUrl}); | |||
RuleCss.fromJson(Map<String, dynamic> json) { | |||
str = json['str']; | |||
img = json['img']; | |||
imgUrl = json['img_url']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['str'] = this.str; | |||
data['img'] = this.img; | |||
data['img_url'] = this.imgUrl; | |||
return data; | |||
} | |||
} | |||
class FindRuleCss { | |||
String title; | |||
String content; | |||
FindRuleCss({this.title, this.content}); | |||
FindRuleCss.fromJson(Map<String, dynamic> json) { | |||
title = json['title']; | |||
content = json['content']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['title'] = this.title; | |||
data['content'] = this.content; | |||
return data; | |||
} | |||
} | |||
class ResultCss { | |||
String btnBgColor; | |||
String btnBgSubColor; | |||
ResultCss({this.btnBgColor, this.btnBgSubColor}); | |||
ResultCss.fromJson(Map<String, dynamic> json) { | |||
btnBgColor = json['btn_bg_color']; | |||
btnBgSubColor = json['btn_bg_sub_color']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['btn_bg_color'] = this.btnBgColor; | |||
data['btn_bg_sub_color'] = this.btnBgSubColor; | |||
return data; | |||
} | |||
} |
@@ -0,0 +1,69 @@ | |||
import 'dart:async'; | |||
import 'dart:convert'; | |||
import 'package:flutter/cupertino.dart'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/dialog/loading/loading.dart'; | |||
import 'package:zhiying_base_widget/pages/order_found_page/order_found_result/order_found_result_model.dart'; | |||
import 'package:zhiying_base_widget/pages/order_found_page/order_found_result/order_found_result_page.dart'; | |||
import 'package:zhiying_base_widget/pages/order_found_page/order_found_search_page/model/order_found_search_style.dart'; | |||
import 'package:zhiying_comm/util/base_bloc.dart'; | |||
import 'package:zhiying_comm/util/empty_util.dart'; | |||
import 'package:zhiying_comm/util/log/let_log.dart'; | |||
import 'package:zhiying_comm/util/net_util.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
class OrderFoundSearchBloc extends BlocBase { | |||
StreamController streamController = StreamController.broadcast(); | |||
Stream get outData => streamController.stream; | |||
OrderFoundSearchStyle style; | |||
loadStyle() { | |||
NetUtil.request("/api/v1/order/find/css", onSuccess: (data) { | |||
style = OrderFoundSearchStyle.fromJson(json.decode(data['data'])); | |||
streamController.add(style); | |||
Logger.log(json.encode(data['data'])); | |||
}); | |||
} | |||
searchOrderById(BuildContext context, String id) { | |||
var params = {"oid": id}; | |||
Loading.show(context); | |||
NetUtil.request("/api/v1/order/find/search", params: params, method: NetMethod.POST, onSuccess: (data) { | |||
Loading.dismiss(); | |||
if (EmptyUtil.isEmpty(data)) { | |||
Navigator.push( | |||
context, | |||
MaterialPageRoute( | |||
builder: (_) => OrderFoundResultPage( | |||
emptyOrderTitle: style?.notFindRuleCss?.title ?? '', | |||
emptyOrderContent: style?.notFindRuleCss?.content ?? "", | |||
))); | |||
} else { | |||
Navigator.push( | |||
context, | |||
MaterialPageRoute( | |||
builder: (_) => OrderFoundResultPage( | |||
orderFoundResultModel: OrderFoundResultModel.fromJson(data), | |||
emptyOrderTitle: style?.notFindRuleCss?.title ?? '', | |||
emptyOrderContent: style?.notFindRuleCss?.content ?? "", | |||
))).then((value) { | |||
if (value != null && value == "success") { | |||
Navigator.pop(context); | |||
} | |||
}); | |||
} | |||
streamController.add(style); | |||
Logger.log(json.encode(data['data'])); | |||
}, onError: (e) { | |||
Loading.dismiss(); | |||
}); | |||
} | |||
@override | |||
void dispose() { | |||
// TODO: implement dispose | |||
} | |||
} |
@@ -0,0 +1,221 @@ | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/pages/order_found_page/order_found_search_page/order_found_search_bloc.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
import 'model/order_found_search_style.dart'; | |||
///订单搜索页 | |||
class OrderFoundSearchPage extends StatefulWidget { | |||
@override | |||
_OrderFoundSearchPageState createState() => _OrderFoundSearchPageState(); | |||
} | |||
class _OrderFoundSearchPageState extends State<OrderFoundSearchPage> { | |||
OrderFoundSearchBloc _bloc; | |||
OrderFoundSearchStyle style; | |||
TextEditingController textEditingController; | |||
@override | |||
void initState() { | |||
textEditingController = TextEditingController(); | |||
_bloc = OrderFoundSearchBloc(); | |||
_bloc.loadStyle(); | |||
super.initState(); | |||
} | |||
@override | |||
Widget build(BuildContext context) { | |||
return StreamBuilder( | |||
stream: _bloc.outData, | |||
builder: (context, asyn) { | |||
if (asyn.data == null) { | |||
return Container( | |||
color: Colors.white, | |||
); | |||
} | |||
style = asyn.data; | |||
return Stack( | |||
children: [ | |||
Container( | |||
color: HexColor.fromHex("#f9f9f9"), | |||
), | |||
Container( | |||
height: 200, | |||
width: MediaQuery.of(context).size.width, | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6), bottomRight: Radius.circular(6)), | |||
gradient: LinearGradient( | |||
begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [HexColor.fromHex(style?.top?.bgColor), HexColor.fromHex(style?.top?.bgSubColor ?? '')])), | |||
), | |||
Scaffold( | |||
backgroundColor: Colors.transparent, | |||
appBar: _buildAppBar(), | |||
body: Container( | |||
child: ListView( | |||
children: [_buildSearch(), _buildCenter(), _buildBottom()], | |||
), | |||
), | |||
), | |||
], | |||
); | |||
}); | |||
} | |||
_buildAppBar() { | |||
return AppBar( | |||
backgroundColor: Colors.transparent, | |||
elevation: 0, | |||
leading: Navigator.canPop(context) | |||
? IconButton( | |||
icon: Icon( | |||
Icons.arrow_back_ios_rounded, | |||
), | |||
iconSize: 18, | |||
onPressed: () { | |||
Navigator.pop(context); | |||
}) | |||
: Container(), | |||
title: Text( | |||
style?.top?.str ?? '', | |||
style: TextStyle(fontSize: 17, color: HexColor.fromHex(style?.top?.strColor)), | |||
), | |||
centerTitle: true, | |||
actions: [ | |||
IconButton( | |||
icon: Icon( | |||
Icons.refresh, | |||
color: HexColor.fromHex(style?.top?.strColor), | |||
), | |||
onPressed: () { | |||
_bloc?.loadStyle(); | |||
}) | |||
], | |||
); | |||
} | |||
///构建搜索 | |||
_buildSearch() { | |||
return Container( | |||
height: 50, | |||
decoration: BoxDecoration(color: HexColor.fromHex(style?.searchCss?.bgColor ?? ''), 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( | |||
controller: textEditingController, | |||
decoration: InputDecoration( | |||
border: InputBorder.none, | |||
hintText: style?.searchCss?.str ?? '', | |||
hintStyle: TextStyle(color: HexColor.fromHex(style?.searchCss?.strColor ?? ""), fontSize: 14), | |||
isDense: true), | |||
)), | |||
GestureDetector( | |||
onTap: () { | |||
if (textEditingController?.text.trim().length == 0) { | |||
Fluttertoast.showToast(msg: "请输入搜索的订单编号"); | |||
return; | |||
} | |||
FocusScope.of(context).requestFocus(new FocusNode()); | |||
_bloc.searchOrderById(context, textEditingController.text); | |||
}, | |||
child: Container( | |||
height: 42, | |||
alignment: Alignment.center, | |||
padding: EdgeInsets.only(left: 24, right: 24), | |||
decoration: BoxDecoration( | |||
borderRadius: BorderRadius.circular(10), | |||
gradient: LinearGradient( | |||
begin: Alignment.centerLeft, | |||
end: Alignment.centerRight, | |||
colors: [HexColor.fromHex(style?.searchCss?.btnBgColor), HexColor.fromHex(style?.searchCss?.btnBgSubColor ?? '')])), | |||
child: Text( | |||
style?.searchCss?.btnStr ?? "", | |||
style: TextStyle(color: HexColor.fromHex(style?.searchCss?.btnStrColor ?? "")), | |||
), | |||
), | |||
), | |||
], | |||
), | |||
); | |||
} | |||
_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?.ruleCss?.str ?? "", | |||
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 15, fontWeight: FontWeight.w500), | |||
) | |||
], | |||
), | |||
SizedBox( | |||
height: 16, | |||
), | |||
GestureDetector( | |||
onTap: () { | |||
PhotoPreview.showPhotoPreviewByimages(context, [style?.ruleCss?.img ?? ""]); | |||
}, | |||
child: CachedNetworkImage( | |||
imageUrl: style?.ruleCss?.img ?? '', | |||
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?.findRuleCss?.title ?? '', | |||
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 15, fontWeight: FontWeight.w500), | |||
) | |||
], | |||
), | |||
SizedBox( | |||
height: 16, | |||
), | |||
ListView( | |||
shrinkWrap: true, | |||
physics: NeverScrollableScrollPhysics(), | |||
children: [ | |||
Text( | |||
style?.findRuleCss?.content ?? "", | |||
style: TextStyle(color: HexColor.fromHex("#999999"), fontSize: 12, fontWeight: FontWeight.w500), | |||
) | |||
], | |||
) | |||
], | |||
), | |||
); | |||
} | |||
} |
@@ -9,7 +9,7 @@ import 'package:zhiying_comm/zhiying_comm.dart'; | |||
class OrderContentBloc extends BlocBase { | |||
final String skipIdentifier; | |||
OrderContentBloc({this.skipIdentifier}); | |||
OrderContentBloc({this.skipIdentifier,this.source}); | |||
List<OrderModel> _orders = List(); | |||
@@ -21,6 +21,7 @@ class OrderContentBloc extends BlocBase { | |||
OrderFilterModel _filter; | |||
RefreshController refreshController = | |||
RefreshController(initialRefresh: false); | |||
String source; | |||
@override | |||
void dispose() { | |||
_ordersController.close(); | |||
@@ -40,6 +41,9 @@ class OrderContentBloc extends BlocBase { | |||
params.removeWhere((key, value) => value == null || value == ''); | |||
params['state'] = _state; | |||
String reqUrl = skipIdentifier == 'pub.flutter.order_by_userlvup' ? '/api/v1/order_by_userlvup' : '/api/v1/order'; | |||
if(skipIdentifier=="pub.flutter.order_list"){ | |||
reqUrl="/api/v1/order_list/"+(source??""); | |||
} | |||
NetUtil.request(reqUrl, method: NetMethod.POST, params: params, | |||
onCache: (data) { | |||
//_parseData(data); | |||
@@ -19,13 +19,24 @@ class OrderPageBloc extends BlocBase { | |||
_styleController = null; | |||
} | |||
void loadData(String skipIdentifier) async { | |||
NetUtil.request('/api/v1/mod/${skipIdentifier.toString()}', | |||
method: NetMethod.GET, onCache: (data) { | |||
// _loadData(data); | |||
}, onSuccess: (data) { | |||
_loadData(data); | |||
}); | |||
void loadData(String skipIdentifier,{String source}) async { | |||
if(skipIdentifier=="pub.flutter.order_list"){ | |||
skipIdentifier="pub.flutter.my_order"; | |||
NetUtil.request('/api/v1/mod/${skipIdentifier.toString()}?source_type='+source, | |||
method: NetMethod.GET, onCache: (data) { | |||
// _loadData(data); | |||
}, onSuccess: (data) { | |||
_loadData(data); | |||
}); | |||
}else{ | |||
NetUtil.request('/api/v1/mod/${skipIdentifier.toString()}', | |||
method: NetMethod.GET, onCache: (data) { | |||
// _loadData(data); | |||
}, onSuccess: (data) { | |||
_loadData(data); | |||
}); | |||
} | |||
} | |||
void _loadData(dynamic data) { | |||
@@ -14,6 +14,7 @@ class OrderSearchBloc extends BlocBase { | |||
int _page = 1; | |||
String _keyword = ''; | |||
String source; | |||
@override | |||
void dispose() { | |||
_ordersController.close(); | |||
@@ -18,9 +18,10 @@ class OrderContentPage extends StatefulWidget { | |||
final int index; | |||
final EventBus eventBus; | |||
final String skipIdentifier; | |||
final String source;///通过自定义页面订单分类进入的订单类型 | |||
const OrderContentPage(this.state, | |||
{Key key, this.filter, this.style, this.index, this.eventBus, this.skipIdentifier}) | |||
{Key key, this.filter, this.style, this.index, this.eventBus, this.skipIdentifier,this.source}) | |||
: super(key: key); | |||
@override | |||
@@ -31,7 +32,7 @@ class _OrderContentPageState extends State<OrderContentPage> { | |||
@override | |||
Widget build(BuildContext context) { | |||
return BlocProvider<OrderContentBloc>( | |||
bloc: OrderContentBloc(skipIdentifier: widget?.skipIdentifier), | |||
bloc: OrderContentBloc(skipIdentifier: widget?.skipIdentifier,source: widget?.source), | |||
child: OrderContentContainer( | |||
widget.state, | |||
widget.filter, | |||
@@ -49,7 +50,6 @@ class OrderContentContainer extends StatefulWidget { | |||
final OrderPageStyleModel style; | |||
final int index; | |||
final EventBus eventBus; | |||
const OrderContentContainer(this.state, this.filter, this.style, | |||
{Key key, this.index, this.eventBus}) | |||
: super(key: key); | |||
@@ -67,7 +67,7 @@ class _OrdersPageState extends State<OrdersPage> { | |||
) | |||
: Container(), | |||
middle: Text( | |||
widget.data['skip_identifier'] == 'pub.flutter.my_order' ? '我的订单' : '会员升级订单', | |||
widget?.data["skip_name"] ??( widget.data['skip_identifier'] == 'pub.flutter.my_order' ? '我的订单' : '会员升级订单'), | |||
style: TextStyle( | |||
fontSize: 15, | |||
color: Color(0xff333333), | |||
@@ -86,8 +86,7 @@ class _OrdersContainer extends StatefulWidget { | |||
_OrdersContainerState createState() => _OrdersContainerState(); | |||
} | |||
class _OrdersContainerState extends State<_OrdersContainer> | |||
with TickerProviderStateMixin { | |||
class _OrdersContainerState extends State<_OrdersContainer> with TickerProviderStateMixin { | |||
TabController _tabController; | |||
GlobalKey _tabKey = GlobalKey(); | |||
OrderPageBloc _bloc; | |||
@@ -100,11 +99,21 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||
EventBus _eventBus = EventBus(); | |||
String source; | |||
@override | |||
void initState() { | |||
_bloc = BlocProvider.of<OrderPageBloc>(context); | |||
if (widget.data.containsKey('skip_identifier')) { | |||
_bloc.loadData(widget.data['skip_identifier']); | |||
String source = null; | |||
if (widget?.data['data'] != null) { | |||
source = widget?.data['data']['source_type']; | |||
} | |||
_bloc.loadData(widget.data['skip_identifier'], source: source); | |||
} | |||
if(widget?.data['data']!=null&&widget.data['data']['source_type']!=null){ | |||
source=widget.data['data']['source_type']; | |||
} | |||
super.initState(); | |||
@@ -128,8 +137,7 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||
List<OrderTypeModel> type = model.filter.orderState; | |||
_tabController?.dispose(); | |||
_tabController = | |||
TabController(length: type?.length ?? 0, vsync: this); | |||
_tabController = TabController(length: type?.length ?? 0, vsync: this); | |||
_tabController.addListener(() { | |||
Logger.debug('????? ${_tabController.index.toString()}'); | |||
}); | |||
@@ -143,6 +151,7 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||
index: index, | |||
eventBus: _eventBus, | |||
skipIdentifier: widget.data['skip_identifier'], | |||
source: source, | |||
), | |||
); | |||
@@ -155,13 +164,13 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||
child: GestureDetector( | |||
child: OrderSearchWidget(model), | |||
onTap: () { | |||
Navigator.of(context) | |||
.push(CupertinoPageRoute(builder: (BuildContext context) { | |||
Navigator.of(context).push(CupertinoPageRoute(builder: (BuildContext context) { | |||
return OrderSearchPage(model); | |||
})); | |||
}, | |||
), | |||
), | |||
/// TabBar 分类导航 | |||
OrderTabbarWidget( | |||
model, | |||
@@ -174,6 +183,7 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||
}); | |||
}, | |||
), | |||
/// TabView 子视图 | |||
Expanded( | |||
child: Stack( | |||
@@ -182,6 +192,7 @@ class _OrdersContainerState extends State<_OrdersContainer> | |||
children: _contents, | |||
controller: _tabController, | |||
), | |||
/// 筛选视图 | |||
Visibility( | |||
visible: _isFilterShow, | |||
@@ -43,6 +43,7 @@ import 'package:zhiying_base_widget/widgets/custom/banner/custom_banner_widget.d | |||
import 'package:zhiying_base_widget/widgets/custom/goods/custom_goods_creater.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/multi_nav/custom_quick_entry.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/notice/custom_notice_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/ordedr_class/order_class_nav/order_class_nav.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/search/custom_search_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/share_content/share_content_widget.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/slide_banner/custom_slide_banner_creater.dart'; | |||
@@ -310,6 +311,12 @@ class BaseWidgetRegister { | |||
/// 通用模块 | |||
PageFactory.regist('pub.flutter.custom', (model) => CustomPage(model)); | |||
///订单找回 | |||
PageFactory.regist("pub.flutter.order_find", (model) => OrderFoundSearchPage()); | |||
/// 订单页面 | |||
PageFactory.regist('pub.flutter.order_list', (model) => OrdersPage(model)); | |||
} | |||
// 注册控件 | |||
@@ -453,5 +460,7 @@ class BaseWidgetRegister { | |||
WidgetFactory.regist('audit_tip', DefaultWidgetCreater((model) => HomeAuth(model))); | |||
// 分享内容组件 | |||
WidgetFactory.regist('share_content', DefaultWidgetCreater((model) => CustomShareContentWidget(model))); | |||
WidgetFactory.regist('features_cate', DefaultWidgetCreater((model) => OrderClassNav(model))); | |||
} | |||
} |
@@ -0,0 +1,42 @@ | |||
import 'dart:convert'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_comm/util/log/let_log.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
import 'bottom_pic_style.dart'; | |||
class BottomPic extends StatelessWidget { | |||
final Map<String, dynamic> model; | |||
BottomPic({Key key, this.model}) : super(key: key); | |||
@override | |||
BottomPicStyle style; | |||
Widget build(BuildContext context) { | |||
style = BottomPicStyle.fromJson(json.decode(model['data'])); | |||
Logger.log(model['data']); | |||
if (style == null) { | |||
return Container(); | |||
} | |||
return GestureDetector( | |||
onTap: () { | |||
RouterUtil.route(SkipModel.fromJson(style.toJson()), style.toJson(), context); | |||
}, | |||
child: Container( | |||
margin: EdgeInsets.only( | |||
left: double.tryParse(style?.leftRightMargin ?? "0"), right: double.tryParse(style?.leftRightMargin ?? "0"), top: double.tryParse(style?.topMargin ?? "0"), bottom: 0), | |||
decoration: BoxDecoration( | |||
color: HexColor.fromHex(style?.bgColor ?? ''), | |||
borderRadius: BorderRadius.only( | |||
topLeft: Radius.circular(double.tryParse(style?.topLeftRadius ?? "0")), | |||
topRight: Radius.circular(double.tryParse(style?.topRightRadius ?? "0")), | |||
bottomLeft: Radius.circular(double.tryParse(style?.bottomLeftRadius ?? "0")), | |||
bottomRight: Radius.circular(double.tryParse(style?.bottomRightRadius ?? "0")))), | |||
child: CachedNetworkImage( | |||
imageUrl: style?.bgImage ?? "", | |||
), | |||
), | |||
); | |||
} | |||
} |
@@ -0,0 +1,100 @@ | |||
class BottomPicStyle { | |||
String name; | |||
String desc; | |||
String moduleType; | |||
String moduleKey; | |||
String isTopMargin; | |||
String isLeftRightMargin; | |||
String isShow; | |||
String topMargin; | |||
String leftRightMargin; | |||
String topLeftRadius; | |||
String topRightRadius; | |||
String bottomLeftRadius; | |||
String bottomRightRadius; | |||
String bgColor; | |||
String bgImage; | |||
String bgImageUrl; | |||
String skipIdentifier; | |||
String skipName; | |||
String requiredLogin; | |||
String requiredTaobaoAuth; | |||
String isJump; | |||
String cateTag; | |||
BottomPicStyle( | |||
{this.name, | |||
this.desc, | |||
this.moduleType, | |||
this.moduleKey, | |||
this.isTopMargin, | |||
this.isLeftRightMargin, | |||
this.isShow, | |||
this.topMargin, | |||
this.leftRightMargin, | |||
this.topLeftRadius, | |||
this.topRightRadius, | |||
this.bottomLeftRadius, | |||
this.bottomRightRadius, | |||
this.bgColor, | |||
this.bgImage, | |||
this.bgImageUrl, | |||
this.skipIdentifier, | |||
this.skipName, | |||
this.requiredLogin, | |||
this.requiredTaobaoAuth, | |||
this.isJump, | |||
this.cateTag}); | |||
BottomPicStyle.fromJson(Map<String, dynamic> json) { | |||
name = json['name']; | |||
desc = json['desc']; | |||
moduleType = json['module_type']; | |||
moduleKey = json['module_key']; | |||
isTopMargin = json['is_top_margin']; | |||
isLeftRightMargin = json['is_left_right_margin']; | |||
isShow = json['is_show']; | |||
topMargin = json['top_margin']; | |||
leftRightMargin = json['left_right_margin']; | |||
topLeftRadius = json['top_left_radius']; | |||
topRightRadius = json['top_right_radius']; | |||
bottomLeftRadius = json['bottom_left_radius']; | |||
bottomRightRadius = json['bottom_right_radius']; | |||
bgColor = json['bg_color']; | |||
bgImage = json['bg_image']; | |||
bgImageUrl = json['bg_image_url']; | |||
skipIdentifier = json['skip_identifier']; | |||
skipName = json['skip_name']; | |||
requiredLogin = json['required_login']; | |||
requiredTaobaoAuth = json['required_taobao_auth']; | |||
isJump = json['is_jump']; | |||
cateTag = json['cate_tag']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['name'] = this.name; | |||
data['desc'] = this.desc; | |||
data['module_type'] = this.moduleType; | |||
data['module_key'] = this.moduleKey; | |||
data['is_top_margin'] = this.isTopMargin; | |||
data['is_left_right_margin'] = this.isLeftRightMargin; | |||
data['is_show'] = this.isShow; | |||
data['top_margin'] = this.topMargin; | |||
data['left_right_margin'] = this.leftRightMargin; | |||
data['top_left_radius'] = this.topLeftRadius; | |||
data['top_right_radius'] = this.topRightRadius; | |||
data['bottom_left_radius'] = this.bottomLeftRadius; | |||
data['bottom_right_radius'] = this.bottomRightRadius; | |||
data['bg_color'] = this.bgColor; | |||
data['bg_image'] = this.bgImage; | |||
data['bg_image_url'] = this.bgImageUrl; | |||
data['skip_identifier'] = this.skipIdentifier; | |||
data['skip_name'] = this.skipName; | |||
data['required_login'] = this.requiredLogin; | |||
data['required_taobao_auth'] = this.requiredTaobaoAuth; | |||
data['is_jump'] = this.isJump; | |||
data['cate_tag'] = this.cateTag; | |||
return data; | |||
} | |||
} |
@@ -0,0 +1,133 @@ | |||
import 'dart:convert'; | |||
import 'package:flutter/material.dart'; | |||
import 'package:zhiying_base_widget/widgets/custom/ordedr_class/order_class_nav/order_class_style.dart'; | |||
import 'package:zhiying_comm/util/extension/color.dart'; | |||
import 'package:zhiying_comm/zhiying_comm.dart'; | |||
///订单分类 | |||
class OrderClassNav extends StatelessWidget { | |||
final Map<String, dynamic> model; | |||
OrderClassNav(this.model, {Key key}) : super(key: key); | |||
OrderClassStyle style; | |||
BuildContext context; | |||
@override | |||
Widget build(BuildContext context) { | |||
// Logger.log(model['data']); | |||
style = OrderClassStyle.fromJson(json.decode(model['data'])); | |||
if (style == null) { | |||
return Container(); | |||
} | |||
this.context = context; | |||
return Container( | |||
margin: EdgeInsets.only( | |||
left: double.tryParse(style?.leftRightMargin ?? "0"), right: double.tryParse(style?.leftRightMargin ?? "0"), top: double.tryParse(style?.topMargin ?? "0"), bottom: 0), | |||
padding: EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10), | |||
decoration: BoxDecoration( | |||
color: HexColor.fromHex(style?.bgColor ?? ''), | |||
borderRadius: BorderRadius.only( | |||
topLeft: Radius.circular(double.tryParse(style?.topLeftRadius ?? "0")), | |||
topRight: Radius.circular(double.tryParse(style?.topRightRadius ?? "0")), | |||
bottomLeft: Radius.circular(double.tryParse(style?.bottomLeftRadius ?? "0")), | |||
bottomRight: Radius.circular(double.tryParse(style?.bottomRightRadius ?? "0")))), | |||
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?.title ?? "", | |||
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 15, fontWeight: FontWeight.w500), | |||
) | |||
], | |||
), | |||
Padding( | |||
padding: const EdgeInsets.only(left: 15), | |||
child: Text( | |||
style?.subTitle ?? "", | |||
style: TextStyle(color: HexColor.fromHex("#999999"), fontSize: 12, fontWeight: FontWeight.w500), | |||
), | |||
), | |||
SizedBox( | |||
height: 10, | |||
), | |||
createNav() | |||
], | |||
), | |||
); | |||
} | |||
createNav() { | |||
List<Widget> listWidget = List(); | |||
int row = (style?.listStyle?.length / style?.columSize).ceil(); | |||
for (var index = 0; index < row; index++) { | |||
listWidget.add(Row( | |||
children: _buildRow(index), | |||
)); | |||
} | |||
return Column(children: listWidget); | |||
} | |||
_buildRow(int index2) { | |||
List<Widget> listWidget = List(); | |||
int currentIndex = index2 * style?.columSize; | |||
for (var index = 0; index < style?.columSize; index++) { | |||
var nowIndex = currentIndex + index; | |||
listWidget.add(Expanded( | |||
child: _buildItem(nowIndex), | |||
)); | |||
} | |||
return listWidget; | |||
} | |||
_buildItem(int currentIndex) { | |||
print(currentIndex.toString()); | |||
if (currentIndex >= style?.listStyle?.length) { | |||
return Container(); | |||
} | |||
var item = style.listStyle[currentIndex]; | |||
print(currentIndex.toString() + item?.title); | |||
return GestureDetector( | |||
onTap: () { | |||
RouterUtil.route(SkipModel.fromJson(item.toJson() ?? ''), item.toJson(), context); | |||
}, | |||
child: Container( | |||
margin: EdgeInsets.only(top: 10), | |||
child: Column( | |||
children: [ | |||
CachedNetworkImage( | |||
imageUrl: item?.img ?? "", | |||
width: 40, | |||
height: 40, | |||
), | |||
SizedBox( | |||
height: 6, | |||
), | |||
Text( | |||
item?.title, | |||
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 12), | |||
), | |||
Text( | |||
item?.subTitle, | |||
style: TextStyle(color: HexColor.fromHex("#333333"), fontSize: 10), | |||
), | |||
], | |||
), | |||
), | |||
); | |||
} | |||
} |
@@ -0,0 +1,186 @@ | |||
class OrderClassStyle { | |||
String name; | |||
String desc; | |||
String title; | |||
int customFeaturesCate; | |||
String moduleType; | |||
String moduleKey; | |||
String isTopMargin; | |||
String isLeftRightMargin; | |||
String isShow; | |||
String topMargin; | |||
String leftRightMargin; | |||
String topLeftRadius; | |||
String topRightRadius; | |||
String bottomLeftRadius; | |||
String bottomRightRadius; | |||
String bgColor; | |||
String subTitle; | |||
List<ListStyle> listStyle; | |||
int columSize; | |||
OrderClassStyle( | |||
{this.name, | |||
this.desc, | |||
this.title, | |||
this.customFeaturesCate, | |||
this.moduleType, | |||
this.moduleKey, | |||
this.isTopMargin, | |||
this.isLeftRightMargin, | |||
this.isShow, | |||
this.topMargin, | |||
this.leftRightMargin, | |||
this.topLeftRadius, | |||
this.topRightRadius, | |||
this.bottomLeftRadius, | |||
this.bottomRightRadius, | |||
this.bgColor, | |||
this.subTitle, | |||
this.listStyle, | |||
this.columSize}); | |||
OrderClassStyle.fromJson(Map<String, dynamic> json) { | |||
name = json['name']; | |||
desc = json['desc']; | |||
title = json['title']; | |||
customFeaturesCate = json['custom_features_cate']; | |||
moduleType = json['module_type']; | |||
moduleKey = json['module_key']; | |||
isTopMargin = json['is_top_margin']; | |||
isLeftRightMargin = json['is_left_right_margin']; | |||
isShow = json['is_show']; | |||
topMargin = json['top_margin']; | |||
leftRightMargin = json['left_right_margin']; | |||
topLeftRadius = json['top_left_radius']; | |||
topRightRadius = json['top_right_radius']; | |||
bottomLeftRadius = json['bottom_left_radius']; | |||
bottomRightRadius = json['bottom_right_radius']; | |||
bgColor = json['bg_color']; | |||
subTitle = json['sub_title']; | |||
if (json['list_style'] != null) { | |||
listStyle = new List<ListStyle>(); | |||
json['list_style'].forEach((v) { | |||
listStyle.add(new ListStyle.fromJson(v)); | |||
}); | |||
} | |||
columSize = json['colum_size']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['name'] = this.name; | |||
data['desc'] = this.desc; | |||
data['title'] = this.title; | |||
data['custom_features_cate'] = this.customFeaturesCate; | |||
data['module_type'] = this.moduleType; | |||
data['module_key'] = this.moduleKey; | |||
data['is_top_margin'] = this.isTopMargin; | |||
data['is_left_right_margin'] = this.isLeftRightMargin; | |||
data['is_show'] = this.isShow; | |||
data['top_margin'] = this.topMargin; | |||
data['left_right_margin'] = this.leftRightMargin; | |||
data['top_left_radius'] = this.topLeftRadius; | |||
data['top_right_radius'] = this.topRightRadius; | |||
data['bottom_left_radius'] = this.bottomLeftRadius; | |||
data['bottom_right_radius'] = this.bottomRightRadius; | |||
data['bg_color'] = this.bgColor; | |||
data['sub_title'] = this.subTitle; | |||
if (this.listStyle != null) { | |||
data['list_style'] = this.listStyle.map((v) => v.toJson()).toList(); | |||
} | |||
data['colum_size'] = this.columSize; | |||
return data; | |||
} | |||
} | |||
class ListStyle { | |||
String idx; | |||
String title; | |||
String img; | |||
Data data; | |||
String imgUrl; | |||
String subTitle; | |||
String isShow; | |||
String rightIcon; | |||
String rightIconUrl; | |||
String skipIdentifier; | |||
String requiredLogin; | |||
String requiredTaobaoAuth; | |||
String isJump; | |||
String cateTag; | |||
String skipName; | |||
ListStyle( | |||
{this.idx, | |||
this.title, | |||
this.img, | |||
this.data, | |||
this.imgUrl, | |||
this.subTitle, | |||
this.isShow, | |||
this.rightIcon, | |||
this.rightIconUrl, | |||
this.skipIdentifier, | |||
this.requiredLogin, | |||
this.requiredTaobaoAuth, | |||
this.isJump, | |||
this.cateTag, | |||
this.skipName}); | |||
ListStyle.fromJson(Map<String, dynamic> json) { | |||
idx = json['idx']; | |||
title = json['title']; | |||
img = json['img']; | |||
data = json['data'] != null ? new Data.fromJson(json['data']) : null; | |||
imgUrl = json['img_url']; | |||
subTitle = json['sub_title']; | |||
isShow = json['is_show']; | |||
rightIcon = json['right_icon']; | |||
rightIconUrl = json['right_icon_url']; | |||
skipIdentifier = json['skip_identifier']; | |||
requiredLogin = json['required_login']; | |||
requiredTaobaoAuth = json['required_taobao_auth']; | |||
isJump = json['is_jump']; | |||
cateTag = json['cate_tag']; | |||
skipName = json['skip_name']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['idx'] = this.idx; | |||
data['title'] = this.title; | |||
data['img'] = this.img; | |||
if (this.data != null) { | |||
data['data'] = this.data.toJson(); | |||
} | |||
data['img_url'] = this.imgUrl; | |||
data['sub_title'] = this.subTitle; | |||
data['is_show'] = this.isShow; | |||
data['right_icon'] = this.rightIcon; | |||
data['right_icon_url'] = this.rightIconUrl; | |||
data['skip_identifier'] = this.skipIdentifier; | |||
data['required_login'] = this.requiredLogin; | |||
data['required_taobao_auth'] = this.requiredTaobaoAuth; | |||
data['is_jump'] = this.isJump; | |||
data['cate_tag'] = this.cateTag; | |||
data['skip_name'] = this.skipName; | |||
return data; | |||
} | |||
} | |||
class Data { | |||
String sourceType; | |||
Data({this.sourceType}); | |||
Data.fromJson(Map<String, dynamic> json) { | |||
sourceType = json['source_type']; | |||
} | |||
Map<String, dynamic> toJson() { | |||
final Map<String, dynamic> data = new Map<String, dynamic>(); | |||
data['source_type'] = this.sourceType; | |||
return data; | |||
} | |||
} |
@@ -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'); | |||
@@ -39,8 +39,8 @@ dependencies: | |||
# image_gallery_saver: ^1.6.0 | |||
permission_handler: | |||
git: | |||
ref: 0.0.2 | |||
url: http://192.168.0.138:3000/FnuoOS_Flutter_Components/permission_handler.git | |||
ref: 0.0.2 | |||
more_picture_share: | |||
git: | |||
@@ -63,8 +63,8 @@ dependencies: | |||
zhiying_flutter_webview: | |||
git: | |||
ref: 0.0.4 | |||
url: http://192.168.0.138:3000/FnuoOS_ZhiYing/zhiying_flutter_webview.git | |||
ref: 0.0.4 | |||
# 特效底部 | |||
# convex_bottom_bar: ^2.7.1+2 | |||