Commit dfdd644e1e4112d1e8ca39bd88fb9b1508bcf673

Authored by wdn127929
1 parent 6d2dcae5

预订定金和核餐UI

import 'package:common_utils/common_utils.dart';
class BookDepositModel {
int ret;
List<BookDepositSunModel> data;
String msg;
BookDepositModel({this.ret, this.data, this.msg});
BookDepositModel.fromJson(Map<String, dynamic> json) {
ret = json['ret'];
if (json['data'] != null) {
data = <BookDepositSunModel>[];
json['data'].forEach((v) {
data.add(new BookDepositSunModel.fromJson(v));
});
}
msg = json['msg'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ret'] = this.ret;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
data['msg'] = this.msg;
return data;
}
}
class BookDepositSunModel {
String id;
String sid;
String rid;
String price;
String rname;
String collectionUid;
String rtime;
String pay;
String depositId;
String no;
String nickName;
// String dname;
String get ddateStr {
if (rtime.toString() == '0') {
return '';
}
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(int.parse(rtime.toString()) * 1000);
return DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d);
}
BookDepositSunModel(
{this.id,
this.sid,
this.rid,
this.price,
this.rname,
this.collectionUid,
this.rtime,
this.pay,
this.depositId,
this.no,
this.nickName,
});
BookDepositSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
sid = json['sid'];
rid = json['rid'];
price = json['price'];
rname = json['rname'];
collectionUid = json['collection_uid'];
rtime = json['rtime'];
pay = json['pay'];
depositId = json['deposit_id'];
no = json['no'];
nickName = json['nick_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['sid'] = this.sid;
data['rid'] = this.rid;
data['price'] = this.price;
data['rname'] = this.rname;
data['collection_uid'] = this.collectionUid;
data['rtime'] = this.rtime;
data['pay'] = this.pay;
data['deposit_id'] = this.depositId;
data['no'] = this.no;
data['nick_name'] = this.nickName;
return data;
}
}
... ...
... ... @@ -317,9 +317,9 @@ class Cancel {
DateTime dateTime =
DateTime.fromMillisecondsSinceEpoch(int.parse(cdate) * 1000);
return dateTime.year.toString() +
"/" +
"-" +
Utils.addZeroNumber(dateTime.month) +
"/" +
"-" +
Utils.addZeroNumber(dateTime.day) +
" " +
Utils.addZeroNumber(dateTime.hour) +
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_picker/Picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/filter_btn_model.dart';
import 'package:one_key/models/get_deposit_model.dart';
import 'package:one_key/route/route_handles.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../models/book_deposit_model.dart';
import '../../models/get_banquet_deposit_model.dart';
import '../../provider/feast_model.dart';
import '../../provider/user_model.dart';
import '../../res/colors.dart';
import '../../utils/dialog_util.dart';
import '../../utils/event_bus.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/h_empty_view.dart';
import '../../widgets/system_app_bar.dart';
/**
* 定金
*/
class BookDepositPage extends StatefulWidget {
final String rid;
final BookDepositSunModel depositSunModel;
BookDepositPage({Key key, this.rid, this.depositSunModel}) : super(key: key);
@override
_BookDepositPageState createState() => _BookDepositPageState();
}
class _BookDepositPageState extends State<BookDepositPage> {
String collectionP = '请选择'; //收款人
int collectionPIndex; //收款人
String paymentTime = '请选择'; //付款时间
String paymentType = '请选择'; //支付方式
List<String> payType = []; //支付方式
int payTypeIndex; //支付方式
// String depositType = '请选择'; //定金类型
// int depositTypeIndex; //定金类型
TextEditingController moneyC = TextEditingController();
FocusNode moneyF = FocusNode();
TextEditingController paymentC = TextEditingController();
FocusNode paymentF = FocusNode();
TextEditingController receiptNumberC = TextEditingController();
FocusNode receiptNumberF = FocusNode();
bool showDateSelWidget = false;
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
FeastModel feastModel;
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
payType = ['现金', '刷卡', '微信', '支付宝', '转账'];
if (widget.depositSunModel != null) {
moneyC.text = widget.depositSunModel.price;
if (widget.depositSunModel.rname != '') {
paymentC.text = widget.depositSunModel.rname;
}
if (widget.depositSunModel.pay != '') {
paymentType = widget.depositSunModel.pay;
payTypeIndex = payType.indexOf(paymentType);
}
if (widget.depositSunModel.ddateStr != '') {
paymentTime = widget.depositSunModel.ddateStr;
}
if (widget.depositSunModel.nickName != null) {
collectionP = widget.depositSunModel.nickName;
}
if (widget.depositSunModel.no != '0') {
receiptNumberC.text = widget.depositSunModel.no;
}
}
moneyF.addListener(() {
if (moneyF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
paymentF.addListener(() {
if (moneyF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
receiptNumberF.addListener(() {
if (moneyF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
WidgetsBinding.instance.addPostFrameCallback((_) {
_getSellerUserBySellerid();
});
}
///获取经理数据 ---- 接单人---全部员工
_getSellerUserBySellerid() async {
await feastModel.getAuthUserLists(context);
if (widget.depositSunModel != null &&
widget.depositSunModel.nickName != null) {
List sellerList = feastModel.sellerManageList.map((item) {
return item.title;
}).toList();
collectionPIndex = sellerList.indexOf(widget.depositSunModel.nickName);
}
}
_setBanquetDeposit() async {
// if (moneyC.text.trim().length == 0) {
// Utils.showToast('请输入金额');
// return;
// }
// Map<String, String> pramas = {
// 'sid': Provider.of<UserModel>(context, listen: false).user.sellerid,
// 'rid': widget.rid,
// 'price': moneyC.text,
// 'rname': paymentC.text,
// 'collection_uid': collectionPIndex == null
// ? null
// : feastModel.sellerManageList[collectionPIndex].id,
// 'rtime': paymentTime == '请选择'
// ? null
// : (DateUtil.getDateTime(paymentTime).millisecondsSinceEpoch / 1000)
// .floor()
// .toString(),
// 'pay': payTypeIndex == null ? null : payType[payTypeIndex],
// 'deposit_id': depositTypeIndex == null
// ? null
// : feastModel.depositData[depositTypeIndex].id,
// 'no': receiptNumberC.text
// };
// if (widget.depositSunModel != null) {
// pramas['id'] = widget.depositSunModel.id;
// }
// bool success = await feastModel.setBanquetDeposit(context, pramas);
// if (success) {
// Navigator.pop(context);
// bus.emit('feast_deposit_list');
// }
}
///请输入
///输入框
Widget _textfield(
String title,
String hintText,
TextEditingController editingController,
FocusNode focusNode,
String subTitle,
{TextInputType inputType = TextInputType.text}) {
return Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(35),
child: Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151),
),
),
HEmptyView(60),
Expanded(
child: Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: h(1), color: MyColours.color_DBDBDB))),
child: Row(
children: [
Expanded(
child: Container(
// height: ScreenUtil().setHeight(120),
height: ScreenUtil().setWidth(64),
child: TextField(
controller: editingController,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
inputFormatters: [],
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
),
focusNode: focusNode,
decoration: InputDecoration(
border:
OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == '请输入'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
),
Container(
child: Text(
subTitle,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
),
],
),
))
],
),
);
}
///请选择
Widget _selectWidget(String title, String labelShow,
{GestureTapCallback onTap, bool need = true}) {
return InkWell(
onTap: onTap,
// () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context,
// customerProvider.labelList.map((item) {
// return item.label;
// }).toList(), (value) {
// if (value != null) {
// setState(() {
// customerProvider.labelSelIndex =
// value.first;
// labelShow = customerProvider
// .labelList[
// customerProvider.labelSelIndex]
// .label;
// });
// }
// },
// selecteds:
// customerProvider.labelSelIndex == null
// ? []
// : [
// customerProvider.labelSelIndex
// ])
// .then((value) {});
// },
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setWidth(35),
child: Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151),
),
),
HEmptyView(60),
Expanded(
child: Container(
height: ScreenUtil().setWidth(64),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: Color.fromRGBO(220, 220, 220, 1)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
labelShow,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: labelShow == '请选择'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
)),
HEmptyView(10),
Image.asset(
Utils.getImgPath('f_arrow_down'),
width: ScreenUtil().setWidth(64),
// height: ScreenUtil().setWidth(10),
),
HEmptyView(16),
],
))),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
feastModel = Provider.of<FeastModel>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
key: scaffoldKey,
appBar: SystemAppBar(
'添加定金',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.only(left: w(30), right: w(13)),
child: Column(
children: [
VEmptyView(50),
_textfield('金额', '请输入', moneyC, moneyF, '元',
inputType:
TextInputType.numberWithOptions(decimal: true)),
VEmptyView(66),
// _textfield('付款人', '请输入', paymentC, paymentF, '',
// inputType: TextInputType.text),
// VEmptyView(66),
_selectWidget('收款人', collectionP, onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context,
feastModel.sellerManageList.map((item) {
return item.title;
}).toList(), (value) {
if (value != null) {
setState(() {
collectionPIndex = value.first;
collectionP = feastModel
.sellerManageList[collectionPIndex].title;
});
}
},
cancelText: '',
title: '选择收款人',
selecteds: collectionPIndex == null
? []
: [collectionPIndex])
.then((value) {});
}),
VEmptyView(66),
_selectWidget('付款时间', paymentTime, onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出时间选择器
// showPickerDateTime(context);
showDateSelWidget = true;
DialogUtil.showPickerDateTime24Feast(
context,
scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
setState(() {
print(value);
paymentTime = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
showDateSelWidget = false;
},
pickerDateTimeType: PickerDateTimeType.kYMD,
dateTime: DateUtil.getDateTime(paymentTime),
cancelText: '',
title: '选择付款时间',
onCancel: () {
showDateSelWidget = false;
});
}),
VEmptyView(66),
_selectWidget('支付方式', paymentType, onTap: () {
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(context, payType,
(value) {
if (value != null) {
setState(() {
payTypeIndex = value.first;
paymentType = payType[payTypeIndex];
});
}
},
cancelText: '',
title: '选择支付方式',
selecteds:
payTypeIndex == null ? [] : [payTypeIndex])
.then((value) {});
}),
// VEmptyView(66),
// _selectWidget('定金类型', depositType, onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context,
// feastModel.depositData.map((item) {
// return item.dname;
// }).toList(), (value) {
// if (value != null) {
// setState(() {
// depositTypeIndex = value.first;
// depositType = feastModel
// .depositData[depositTypeIndex].dname;
// });
// }
// },
// cancelText: '',
// title: '选择定金类型',
// selecteds: depositTypeIndex == null
// ? []
// : [depositTypeIndex])
// .then((value) {});
// }),
VEmptyView(66),
_textfield(
'收据编号', '请输入', receiptNumberC, receiptNumberF, '',
inputType: TextInputType.text),
],
)),
)),
Container(
padding: EdgeInsets.symmetric(horizontal: w(24), vertical: w(35)),
child: Row(
children: [
RoundButton(
text: '取消',
width: w(100),
height: w(43),
radius: r(5),
fontSize: 32,
isBold: true,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
onPressed: () {
Navigator.pop(context);
},
),
HEmptyView(24),
Expanded(
child: RoundButton(
text: '保存并返回',
height: w(43),
radius: r(5),
isBold: true,
fontSize: 32,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
onPressed: () {
_setBanquetDeposit();
},
)),
],
),
)
],
));
}
}
... ...
... ... @@ -4,6 +4,7 @@ import 'dart:io';
import 'package:common_utils/common_utils.dart';
import 'package:easy_contact_picker/easy_contact_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_picker/flutter_picker.dart';
... ... @@ -112,6 +113,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
FocusNode priceF = FocusNode();
CollectStoreProvider collectStoreProvider;
ScrollController controller = ScrollController();
@override
void initState() {
... ... @@ -643,7 +645,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
ScreenUtil().setSp(32),
fontWeight: FontWeight.normal,
decoration: TextDecoration.none,
color: MyColours.color_333333))
color: MyColours.color_515151))
],
),
value['title'] == '其他原因' && isShowTF
... ... @@ -828,7 +830,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
child: Text(
'备注',
style: TextStyle(
color: MyColours.color_333333,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
),
... ... @@ -854,7 +856,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
focusNode: _cusdemNode,
autofocus: true,
style: TextStyle(
color: MyColours.color_333333,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
... ... @@ -958,7 +960,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
width: ScreenUtil().setWidth(180),
radius: ScreenUtil().setWidth(10),
gradientStart: MyColours.color_ffffff,
textColor: MyColours.color_333333,
textColor: MyColours.color_515151,
borderColor: MyColours.color_199095,
gradientEnd: MyColours.color_ffffff,
onPressed: () {
... ... @@ -1267,6 +1269,350 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
);
}
Widget djTextType1(String title, String data, String per) {
return RichText(
textScaleFactor: 1,
overflow: TextOverflow.ellipsis,
// textDirection: TextDirection.ltr,
text: TextSpan(
children: [
TextSpan(
text: title,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24)),
recognizer: TapGestureRecognizer()..onTap = () {}),
TextSpan(
text: data,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(24)),
recognizer: TapGestureRecognizer()..onTap = () {}),
TextSpan(
text: per,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
//点击事件
recognizer: TapGestureRecognizer()..onTap = () {}),
],
));
}
Widget djText(String title, String per) {
return RichText(
textScaleFactor: 1,
overflow: TextOverflow.ellipsis,
// textDirection: TextDirection.ltr,
text: TextSpan(
children: [
TextSpan(
text: title,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24)),
recognizer: TapGestureRecognizer()..onTap = () {}),
TextSpan(
text: per,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24)),
//点击事件
recognizer: TapGestureRecognizer()..onTap = () {}),
],
));
}
///预订定金UI
Widget _deposit() {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
VEmptyView(30),
MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
VEmptyView(56),
Row(
children: [
Text(
'预订订金',
overflow: TextOverflow.ellipsis,
style: TextStyle(color: MyColours.color_515151, fontSize: font(15)),
),
Spacer(),
RoundButton(
text: '添加一项',
radius: r(11),
width: w(72),
height: w(22),
fontSize: 24,
textColor: MyColours.color_438E93,
isBold: false,
borderColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
onPressed: () {
NavigatorUtil.goBookDepositPage(context, detailEntity.id);
},
),
],
),
ListView.builder(
padding: EdgeInsets.only(left: w(13), top: w(20)),
itemCount: 2,
shrinkWrap: true,
controller: controller,
itemBuilder: (BuildContext context, int index) {
// GetBanquetDepositSunModel data =
// feastModel.banquetDepositData[index];
return InkWell(
onTap: () {
// NavigatorUtil.goFeastDepositPage(context, feastModel.rid,
// isNew: false, getBanquetDepositSunModel: data);
},
child: Container(
height: w(85),
margin: EdgeInsets.only(bottom: w(10)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(5)),
border: Border.all(
width: w(1), color: MyColours.color_999999)),
child: Column(children: [
Container(
height: w(24),
padding: EdgeInsets.only(left: w(16), right: w(8)),
decoration: BoxDecoration(
// color: MyColours.color_438E93,
// borderRadius: BorderRadius.only(
// topLeft: Radius.circular(r(4)),
// topRight: Radius.circular(r(4))),
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours.color_999999))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'收据编号 SJ000001',
// '收据编号 ${data.no == '0' ? '' : data.no}',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)),
),
InkWell(
onTap: () {
//弹框确认是否删除
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "是否确定删除?",
isBoldContent: true,
contentColor: MyColours.color_E6000000,
rTitle: "删除", rCallback: () {
// _delBanquetDeposit(data.id);
});
},
child: Image.asset(
Utils.getImgPath('delete_g'),
width: w(20),
))
],
),
),
Expanded(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
HEmptyView(32),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
djTextType1('定金金额 ', '200', ' 元'),
djText('支付方式 ', '现金'),
],
),
HEmptyView(140),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
djText('付款时间 ', '2023-10-01'),
djText('收款人 ', 'cccc经理'),
// djText('收款人 ',
// '${data.nickName == null ? '' : data.nickName}'),
],
)
],
))
])));
}),
VEmptyView(20),
MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
]);
}
///核餐确认UI
Widget _verifyFood() {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
VEmptyView(30),
MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
VEmptyView(56),
Row(
children: [
Text(
'核餐确认',
overflow: TextOverflow.ellipsis,
style: TextStyle(color: MyColours.color_515151, fontSize: font(15)),
),
Spacer(),
RoundButton(
text: '添加一项',
radius: r(11),
width: w(72),
height: w(22),
fontSize: 24,
textColor: MyColours.color_438E93,
isBold: false,
borderColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
onPressed: () {
NavigatorUtil.goVerifyFoodPage(
context,
);
},
),
],
),
ListView.builder(
padding: EdgeInsets.only(left: w(13), top: w(20)),
itemCount: 3,
shrinkWrap: true,
controller: controller,
itemBuilder: (BuildContext context, int index) {
// GetBanquetDepositSunModel data =
// feastModel.banquetDepositData[index];
return Container(
margin: EdgeInsets.only(bottom: w(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'未接通、已确认、待定',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(14)),
),
Text(
'张小娴 2023-12-16 15:23',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999, fontSize: font(14)),
),
]));
}),
VEmptyView(20),
MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
]);
}
///订单操作UI
Widget _operatingRecord() {
return Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
VEmptyView(30),
MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
VEmptyView(56),
Text(
'订单操作',
overflow: TextOverflow.ellipsis,
style: TextStyle(color: MyColours.color_515151, fontSize: font(15)),
),
Container(
padding: EdgeInsets.only(left: w(13), top: w(20)),
child:
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(
'预订下单',
overflow: TextOverflow.ellipsis,
style:
TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
Text(
'${detailEntity.place_order_name ?? ''} ${_getDateTime(detailEntity.cdate)}',
overflow: TextOverflow.ellipsis,
style:
TextStyle(color: MyColours.color_999999, fontSize: font(14)),
),
])),
Container(
padding: EdgeInsets.only(left: w(13), top: w(10)),
child:
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Text(
'最后修改',
overflow: TextOverflow.ellipsis,
style:
TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
HEmptyView(40),
Expanded(
child: Text(
'${detailEntity.nick_name ?? ''}' +
' ' +
'${detailEntity.seller_user_phone ?? ''} xxxx时间/电话范德萨发顺丰?',
// overflow: TextOverflow.ellipsis,
style:
TextStyle(color: MyColours.color_999999, fontSize: font(14)),
)),
])),
Offstage(
offstage: (detailEntity.status == "4" && detailEntity.cancel != null)
? false
: true,
child: Column(children: <Widget>[
Container(
padding: EdgeInsets.only(left: w(13), top: w(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'取消预订',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(14)),
),
Text(
'${detailEntity.abolition == '2' ? '顾客在线取消' : detailEntity.cancel?.uname ?? ""} ${detailEntity.cancel?.cdateStr ?? ""}',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999, fontSize: font(14)),
),
])),
Container(
padding: EdgeInsets.only(left: w(13), top: w(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'取消原因',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(14)),
),
Text(
detailEntity.cancel?.desc ?? "",
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999, fontSize: font(14)),
),
]))
])),
VEmptyView(20),
MyDivider(double.infinity, w(0.5), color: MyColours.color_BFC4D4),
]);
}
@override
Widget build(BuildContext context) {
if (MediaQuery.of(context).viewInsets.bottom == 0) {
... ... @@ -1341,6 +1687,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
child: Container(
color: MyColours.color_ffffff,
child: SingleChildScrollView(
controller: controller,
child: Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.symmetric(
... ... @@ -1367,7 +1714,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
'预订桌位',
style: TextStyle(
color: MyColours
.color_333333,
.color_515151,
fontSize: ScreenUtil()
.setSp(30)),
),
... ... @@ -1457,7 +1804,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
RowMultiText(
"预订日期", detailEntity.ddateF,
textColor:
MyColours.color_333333),
MyColours.color_515151),
Row(
children: [
... ... @@ -1466,7 +1813,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
child: RowMultiText("时段",
detailEntity.ddateSolt,
textColor: MyColours
.color_333333)),
.color_515151)),
HEmptyView(60),
Expanded(
flex: 1,
... ... @@ -1661,7 +2008,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
RowMultiText("下单人",
'${detailEntity.place_order_name ?? ''}',
textColor: MyColours
.color_333333),
.color_515151),
// Offstage(
// offstage: detailEntity
// .nick_name ==
... ... @@ -1676,7 +2023,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
' ' +
'${detailEntity.seller_user_phone ?? ''}',
textColor: MyColours
.color_333333),
.color_515151),
// ),
],
),
... ... @@ -1697,13 +2044,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
_getDateTime(
detailEntity.cdate),
textColor:
MyColours.color_333333),
MyColours.color_515151),
detailEntity.cusdem != null &&
detailEntity.cusdem != ''
? RowMultiText(
"备注", detailEntity.cusdem,
textColor:
MyColours.color_333333)
MyColours.color_515151)
: TitleAndBtn(
title: "备注",
uid: widget.uid,
... ... @@ -1744,14 +2091,14 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
"",
textAlign: TextAlign.left,
textColor: MyColours
.color_333333),
.color_515151),
RowMultiText(
"取消时间",
detailEntity.cancel
?.cdateStr ??
"",
textColor: MyColours
.color_333333),
.color_515151),
RowMultiText(
"操作人",
detailEntity.abolition ==
... ... @@ -1761,7 +2108,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
?.uname ??
"",
textColor: MyColours
.color_333333),
.color_515151),
],
),
),
... ... @@ -1804,7 +2151,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
"发票抬头",
style: TextStyle(
color: MyColours
.color_333333,
.color_515151,
fontSize:
ScreenUtil()
.setSp(
... ... @@ -2379,7 +2726,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// gradientStart:
// MyColours.color_ffffff,
// textColor:
// MyColours.color_333333,
// MyColours.color_515151,
// borderColor:
// MyColours.color_199095,
// gradientEnd:
... ... @@ -2522,12 +2869,12 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// children: [
// Text(
// detailModel.userHistorys[index].phone,
// style: TextStyle(color: MyColours.color_333333, fontSize: ScreenUtil().setSp(32)),
// style: TextStyle(color: MyColours.color_515151, fontSize: ScreenUtil().setSp(32)),
// ),
// Expanded(
// child: Text(
// detailModel.userHistorys[index].rname,
// style: TextStyle(color: MyColours.color_333333, fontSize: ScreenUtil().setSp(32)),
// style: TextStyle(color: MyColours.color_515151, fontSize: ScreenUtil().setSp(32)),
// ))
// ],
// ),
... ... @@ -2566,7 +2913,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
: detailEntity
.rnameStr,
textColor: MyColours
.color_333333),
.color_515151),
(detailEntity.status ==
"4" &&
detailEntity
... ... @@ -2624,9 +2971,13 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
: Utils.starPhone(detailEntity
.phone),
textColor: MyColours
.color_333333))
.color_515151))
],
)
),
_deposit(),
_verifyFood(),
_operatingRecord(),
// InkWell(
// onTap: () {
... ... @@ -2668,7 +3019,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// formatPhone)
// : formatPhone,
// textColor:
// MyColours.color_333333),
// MyColours.color_515151),
// ),
// Container(
... ... @@ -2686,7 +3037,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// "客户经理",
// style: TextStyle(
// color: MyColours
// .color_333333,
// .color_515151,
// fontSize: ScreenUtil()
// .setSp(30)),
// ),
... ... @@ -3730,7 +4081,7 @@ class TitleAndBtn extends StatelessWidget {
child: Text(
title,
style: TextStyle(
color: MyColours.color_333333,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(30)),
),
),
... ... @@ -3981,7 +4332,7 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield>
child: Text(
widget.title,
style: TextStyle(
color: MyColours.color_333333,
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(30)),
),
),
... ...
import 'package:flutter/material.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import '../../res/colors.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/h_empty_view.dart';
import '../../widgets/round_button.dart';
import '../../widgets/v_empty_view.dart';
/**
* 核餐页面
* */
class VerifyFoodPage extends StatefulWidget {
VerifyFoodPage({Key key}) : super(key: key);
@override
_VerifyFoodPageState createState() => _VerifyFoodPageState();
}
class _VerifyFoodPageState extends State<VerifyFoodPage> {
bool confirmed = true; //已确认
bool connected = false; //未接通
bool undetermined = false; //待定
TextEditingController customController = TextEditingController();
FocusNode _cusdemNode = FocusNode();
_itemRadioWidget(bool select, String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Row(children: [
Image.asset(
Utils.getImgPath(
select ? 'plan_dish_select' : 'plan_dish_unselect'),
width: w(20),
),
HEmptyView(6),
Text(
title,
style: TextStyle(color: MyColours.color_515151, fontSize: font(16)),
),
]));
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('核餐确认'),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.symmetric(horizontal: w(16), vertical: w(24)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
_itemRadioWidget(confirmed, '已确认', onTap: () {
if (!confirmed) {
setState(() {
confirmed = true;
connected = false;
undetermined = false;
});
}
}),
Spacer(),
_itemRadioWidget(connected, '未接通', onTap: () {
if (!connected) {
setState(() {
connected = true;
confirmed = false;
undetermined = false;
});
}
}),
Spacer(),
_itemRadioWidget(undetermined, '待定', onTap: () {
if (!undetermined) {
setState(() {
undetermined = true;
connected = false;
confirmed = false;
});
}
}),
],
),
VEmptyView(40),
Text(
'备注',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(15)),
),
VEmptyView(30),
//输入框
Container(
width: double.infinity,
padding:
EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),
alignment: Alignment.topLeft,
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border.all(
color: MyColours.color_DBDBDB, width: w(1)),
borderRadius: BorderRadius.circular(r(8))),
child: TextField(
controller: customController,
focusNode: _cusdemNode,
style: TextStyle(
color: MyColours.color_333333,
fontSize: font(14),
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
maxLines: 5,
maxLength: 100,
decoration: InputDecoration(
hintText: "请输入备注或点击快捷选择标签",
hintStyle: TextStyle(
color: MyColours.color_979797,
fontSize: font(14),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(borderSide: BorderSide.none),
),
keyboardType: TextInputType.text,
onChanged: (value) {
// setState(() {
// currentRemark = value ?? "";
// });
// if (value.length < currRemark.length &&
// currRemark.substring(value.length) != ',') {
// setState(() {
// currRemark = value ?? "";
// });
// if (sum == 0) {
// for (int i = 0; i < remarks.length; i++) {
// if (remarks[i].isSelect &&
// remarks[i].remark == selectItem.last) {
// setState(() {
// remarks[i].isSelect = false;
// });
// }
// }
// }
// sum++;
// if (sum == selectItem.last.length ||
// selectItem.length == 1 ||
// selectItem.length == 0) {
// selectItem.removeLast();
// sum = 0;
// }
// } else {
// setState(() {
// currRemark = value ?? "";
// });
// }
}),
),
VEmptyView(20),
MyDivider(
double.infinity,
w(0.5),
color: MyColours.color_BFC4D4,
),
VEmptyView(30),
Container(
margin: EdgeInsets.only(bottom: w(10)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'未接通、已确认、待定',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)),
),
Text(
'张小娴 2023-12-16 15:23',
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14)),
),
]))
],
),
))),
Container(
padding: EdgeInsets.symmetric(horizontal: w(24), vertical: w(35)),
child: Row(
children: [
RoundButton(
text: '取消',
width: w(100),
height: w(43),
radius: r(5),
fontSize: 32,
isBold: true,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
onPressed: () {
Navigator.pop(context);
},
),
HEmptyView(24),
Expanded(
child: RoundButton(
text: '保存',
height: w(43),
radius: r(5),
isBold: true,
fontSize: 32,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
onPressed: () {
// _setBanquetDeposit();
},
)),
],
),
)
],
),
);
}
}
... ...
... ... @@ -27,6 +27,7 @@ import 'package:sqflite/sqlite_api.dart';
import '../app.dart';
import '../models/IsExamineModel.dart';
import '../models/book_deposit_model.dart';
import '../models/get_banquet_by_id_new_model.dart';
import '../models/get_banquet_deposit_model.dart';
import '../models/menu_unit_model.dart';
... ... @@ -1849,4 +1850,23 @@ class NavigatorUtil {
"${Routes.invitation_theme_home_preview_page}?themeSunModel=${FluroConvertUtils.object2string(themeSunModel)}",
replace: replace);
}
///预订----添加定金
static Future<dynamic> goBookDepositPage(BuildContext context, String rid,
{replace = false,
bool onlyShow = false,
bool isNew = true,
BookDepositSunModel bookDepositModel}) {
return _navigateTo(context,
"${Routes.book_deposit_page}?rid=$rid&bookDepositModel=${FluroConvertUtils.object2string(bookDepositModel)}&isNew=$isNew",
replace: replace);
}
///预订----核餐确认
static Future<dynamic> goVerifyFoodPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.verify_food_page}", replace: replace);
}
}
... ...
... ... @@ -154,6 +154,7 @@ import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
import '../models/IsExamineModel.dart';
import '../models/book_deposit_model.dart';
import '../models/get_banquet_by_id_new_model.dart';
import '../models/menu_unit_model.dart';
import '../models/month_statics_model.dart';
... ... @@ -168,6 +169,8 @@ import '../models/wine_manage_model.dart';
import '../pages/coupon/coupon_setting_page.dart';
import '../pages/coupon/coupon_verification_detail_page.dart';
import '../pages/coupon/verification_coupon_page.dart';
import '../pages/detail/book_deposit_page.dart';
import '../pages/detail/verify_food_page.dart';
import '../pages/feast/feast_board.dart';
import '../pages/feast/feast_create_page.dart';
import '../pages/feast/feast_deposit_data_page.dart';
... ... @@ -3117,7 +3120,7 @@ var invitationThemeHomePageHandle = new Handler(
});
//邀请函主题选择预览
var invitationThemeHomePreviewPage = new Handler(
var invitationThemeHomePreviewPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
// String year = params["year"].first;
// String month = params["month"].first;
... ... @@ -3133,3 +3136,32 @@ var invitationThemeHomePreviewPage = new Handler(
create: (_) => MarketingCenterProvider(),
child: InvitationThemeHomePreviewPage(themeSunModel: themeSunModel));
});
//预订定金
var bookDepositPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String rid = params["rid"].first;
// String uids = params["uids"].first;
bool isNew = FluroConvertUtils.string2bool(params["isNew"].first);
if (!isNew) {
BookDepositSunModel depositSunModel = BookDepositSunModel.fromJson(
json.decode(FluroConvertUtils.fluroCnParamsDecode(
params["bookDepositModel"].first)));
return ChangeNotifierProvider<NotebookDetailModel>(
create: (_) => NotebookDetailModel(),
child: BookDepositPage(rid: rid, depositSunModel: depositSunModel));
}
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: BookDepositPage(
rid: rid,
));
});
//核餐确认
var verifyFoodPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
return ChangeNotifierProvider<NotebookDetailModel>(
create: (_) => NotebookDetailModel(), child: VerifyFoodPage());
});
... ...
... ... @@ -299,6 +299,13 @@ class Routes {
static String invitation_theme_home_preview_page =
"/invitation_theme_home_preview_page"; //邀请函主题选择预览页
static String book_deposit_page =
"/book_deposit_page"; //预订订金
static String verify_food_page =
"/verify_food_page"; //核餐确认
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -557,7 +564,15 @@ class Routes {
handler: invitationThemeHomePageHandle);
router.define(invitation_theme_home_preview_page,
handler: invitationThemeHomePreviewPage);
handler: invitationThemeHomePreviewPageHandle);
router.define(book_deposit_page,
handler: bookDepositPageHandle);
router.define(verify_food_page,
handler: verifyFoodPageHandle);
}
}
... ...