payment_view.dart
parent
0cbc7a545f
commit
410f162eed
|
|
@ -6,5 +6,7 @@ const String addByBarcodeViewRoute = 'AddByBarcodeView';
|
||||||
|
|
||||||
const String contragentSelectViewRoute = 'ContragentSelectViewRoute';
|
const String contragentSelectViewRoute = 'ContragentSelectViewRoute';
|
||||||
|
|
||||||
|
const String paymentViewRoute = 'paymentViewRoute';
|
||||||
|
|
||||||
const String settingPrinterBluetoothViewRoute = 'SettingPrinterBluetoothView';
|
const String settingPrinterBluetoothViewRoute = 'SettingPrinterBluetoothView';
|
||||||
// Generate the views here
|
// Generate the views here
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import 'package:satu/views/login/login_view.dart';
|
||||||
import 'package:satu/views/main/main_view.dart';
|
import 'package:satu/views/main/main_view.dart';
|
||||||
import 'package:satu/views/settings/printer_bluetooth/PrinterSelect.dart';
|
import 'package:satu/views/settings/printer_bluetooth/PrinterSelect.dart';
|
||||||
import 'package:satu/views/work/views/contragent/select_contragent_view.dart';
|
import 'package:satu/views/work/views/contragent/select_contragent_view.dart';
|
||||||
|
import 'package:satu/views/work/views/payment/payment_view.dart';
|
||||||
import 'package:satu/views/work/work_view.dart';
|
import 'package:satu/views/work/work_view.dart';
|
||||||
|
|
||||||
import './route_names.dart';
|
import './route_names.dart';
|
||||||
|
|
@ -48,7 +49,11 @@ Route<dynamic> generateRoute(RouteSettings settings) {
|
||||||
routeName: settings.name!,
|
routeName: settings.name!,
|
||||||
viewToShow: SelectContragentView(),
|
viewToShow: SelectContragentView(),
|
||||||
);
|
);
|
||||||
|
case paymentViewRoute:
|
||||||
|
return _getPageRoute(
|
||||||
|
routeName: settings.name!,
|
||||||
|
viewToShow: PaymentView(),
|
||||||
|
);
|
||||||
// case ImageShowRoute:
|
// case ImageShowRoute:
|
||||||
// ImageShowModel data = settings.arguments as ImageShowModel;
|
// ImageShowModel data = settings.arguments as ImageShowModel;
|
||||||
// //return SlideRightRoute(widget: ImageShowContainer(data));
|
// //return SlideRightRoute(widget: ImageShowContainer(data));
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ class SellView extends StatelessWidget {
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: state.items!.length,
|
itemCount: state.items!.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
final ProductDao product = state.items!.elementAt(0);
|
final ProductDao product = state.items!.elementAt(index);
|
||||||
return ProductListItem(
|
return ProductListItem(
|
||||||
key: UniqueKey(),
|
key: UniqueKey(),
|
||||||
ean: product.eanCode,
|
ean: product.eanCode,
|
||||||
|
|
@ -103,7 +103,8 @@ class SellView extends StatelessWidget {
|
||||||
mini: true,
|
mini: true,
|
||||||
elevation: 2,
|
elevation: 2,
|
||||||
backgroundColor: successColor,
|
backgroundColor: successColor,
|
||||||
onPressed: () => print('check'),
|
onPressed: () => locator<NavigatorService>()
|
||||||
|
.push(paymentViewRoute),
|
||||||
child: Icon(Icons.check, color: whiteColor, size: 35.sp),
|
child: Icon(Icons.check, color: whiteColor, size: 35.sp),
|
||||||
)),
|
)),
|
||||||
Column(
|
Column(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:satu/core/redux/state/sell_state.dart';
|
||||||
|
import 'package:satu/core/redux/store.dart';
|
||||||
|
import 'package:satu/shared/app_colors.dart';
|
||||||
|
import 'package:satu/widgets/bar/products_app_bar.dart';
|
||||||
|
import 'package:satu/widgets/bar/products_header_bar.dart';
|
||||||
|
import 'package:satu/widgets/bar/products_title_bar.dart';
|
||||||
|
import 'package:satu/views/work/tabs/utils/ProductUtils.dart';
|
||||||
|
import 'package:satu/widgets/buttons/busy_button.dart';
|
||||||
|
|
||||||
|
class PaymentView extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_PaymentViewState createState() => _PaymentViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PaymentViewState extends State<PaymentView> {
|
||||||
|
bool combine = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return StoreConnector<AppState, SellState>(
|
||||||
|
converter: (store) => store.state.sellState!,
|
||||||
|
builder: (_, state) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: ProductsAppBar(
|
||||||
|
title: 'Способ оплаты',
|
||||||
|
backgroundColor: backgroundColor,
|
||||||
|
childHeight: 60,
|
||||||
|
child: ProductHeaderBar(
|
||||||
|
count: state.items!.length,
|
||||||
|
sum: sumProducts(state.items!),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
physics: const BouncingScrollPhysics(),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 15.w),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Способ оплаты',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16.sp, color: placeholderColor),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Комбинированный',
|
||||||
|
style: TextStyle(fontSize: 14.sp, color: placeholderColor),
|
||||||
|
),
|
||||||
|
Switch(
|
||||||
|
value: combine,
|
||||||
|
onChanged: (vl) {
|
||||||
|
setState(() {
|
||||||
|
combine = !combine;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 45.0),
|
||||||
|
child: BusyButton(title: 'ОПЛАТА', onPressed: () {}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -24,7 +24,7 @@ class ProductsTitleBarBar extends StatelessWidget {
|
||||||
padding: EdgeInsets.symmetric( vertical: 10.w ),
|
padding: EdgeInsets.symmetric( vertical: 10.w ),
|
||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
style: TextStyle(fontSize: ScreenUtil().setSp(14), color: placeholderColor),
|
style: TextStyle(fontSize: 16.sp, color: placeholderColor),
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
if(itemsExist)
|
if(itemsExist)
|
||||||
|
|
@ -51,7 +51,7 @@ class ProductsTitleBarBar extends StatelessWidget {
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'Удалить все',
|
'Удалить все',
|
||||||
style: TextStyle(fontSize: 14.sp, color: dangerColor),
|
style: TextStyle(fontSize: 16.sp, color: dangerColor),
|
||||||
))
|
))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue