Browse Source

1、新增会员升级订单

tags/0.0.15+8
PH2 3 years ago
parent
commit
1abc1bd0be
4 changed files with 30 additions and 11 deletions
  1. +6
    -1
      lib/pages/orders_page/bloc/order_content_bloc.dart
  2. +3
    -2
      lib/pages/orders_page/order_content_page.dart
  3. +17
    -8
      lib/pages/orders_page/orders_page.dart
  4. +4
    -0
      lib/register.dart

+ 6
- 1
lib/pages/orders_page/bloc/order_content_bloc.dart View File

@@ -7,6 +7,10 @@ import 'package:zhiying_comm/util/base_bloc.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class OrderContentBloc extends BlocBase {

final String skipIdentifier;
OrderContentBloc({this.skipIdentifier});

List<OrderModel> _orders = List();

StreamController<List<OrderModel>> _ordersController =
@@ -35,7 +39,8 @@ class OrderContentBloc extends BlocBase {
Map<String, dynamic> params = _filter.toJson();
params.removeWhere((key, value) => value == null || value == '');
params['state'] = _state;
NetUtil.request('/api/v1/order', method: NetMethod.POST, params: params,
String reqUrl = skipIdentifier == 'pub.flutter.order_by_userlvup' ? '/api/v1/order_by_userlvup' : '/api/v1/order';
NetUtil.request(reqUrl, method: NetMethod.POST, params: params,
onCache: (data) {
//_parseData(data);
}, onSuccess: (data) {


+ 3
- 2
lib/pages/orders_page/order_content_page.dart View File

@@ -17,9 +17,10 @@ class OrderContentPage extends StatefulWidget {
final OrderFilterModel filter;
final int index;
final EventBus eventBus;
final String skipIdentifier;

const OrderContentPage(this.state,
{Key key, this.filter, this.style, this.index, this.eventBus})
{Key key, this.filter, this.style, this.index, this.eventBus, this.skipIdentifier})
: super(key: key);

@override
@@ -30,7 +31,7 @@ class _OrderContentPageState extends State<OrderContentPage> {
@override
Widget build(BuildContext context) {
return BlocProvider<OrderContentBloc>(
bloc: OrderContentBloc(),
bloc: OrderContentBloc(skipIdentifier: widget?.skipIdentifier),
child: OrderContentContainer(
widget.state,
widget.filter,


+ 17
- 8
lib/pages/orders_page/orders_page.dart View File

@@ -142,20 +142,27 @@ class _OrdersContainerState extends State<_OrdersContainer>
filter: _filter,
index: index,
eventBus: _eventBus,
skipIdentifier: widget.data['skip_identifier'],
),
);

return Column(
children: <Widget>[
GestureDetector(
child: OrderSearchWidget(model),
onTap: () {
Navigator.of(context)
.push(CupertinoPageRoute(builder: (BuildContext context) {
return OrderSearchPage(model);
}));
},
/// TODO 只有我的订单才显示搜索
/// 搜索框
Visibility(
visible: widget.data['skip_identifier'] == 'pub.flutter.my_order',
child: GestureDetector(
child: OrderSearchWidget(model),
onTap: () {
Navigator.of(context)
.push(CupertinoPageRoute(builder: (BuildContext context) {
return OrderSearchPage(model);
}));
},
),
),
/// TabBar 分类导航
OrderTabbarWidget(
model,
_tabController,
@@ -167,6 +174,7 @@ class _OrdersContainerState extends State<_OrdersContainer>
});
},
),
/// TabView 子视图
Expanded(
child: Stack(
children: <Widget>[
@@ -174,6 +182,7 @@ class _OrdersContainerState extends State<_OrdersContainer>
children: _contents,
controller: _tabController,
),
/// 筛选视图
Visibility(
visible: _isFilterShow,
child: OrderFilterWidget(


+ 4
- 0
lib/register.dart View File

@@ -262,7 +262,11 @@ class BaseWidgetRegister {

/// 订单页面
PageFactory.regist('pub.flutter.my_order', (model) => OrdersPage(model));
/// 会员订单页面
PageFactory.regist('pub.flutter.order_by_userlvup', (model) => OrdersPage(model));
/// 账号安全页面
PageFactory.regist('pub.flutter.account_security', (model) => SecurityPage(model));
/// 绑定支付宝页面
PageFactory.regist('pub.flutter.account_security_alipay', (model) => SecurityBindAlipayPage(model));

/// 登录密码


Loading…
Cancel
Save