Commit 71d1edab914791de2c1253c47d7e0dc4db28a76b

Authored by wdn127929
1 parent 55329c5b

差合并桌位

... ... @@ -12,14 +12,14 @@ if (flutterRoot == null) {
}
def flutterVersionCode = "397"
def flutterVersionCode = "400"
if (flutterVersionCode == null) {
flutterVersionCode = '397'
flutterVersionCode = '400'
}
def flutterVersionName = "3.9.7"
def flutterVersionName = "4.0.0"
if (flutterVersionName == null) {
flutterVersionName = '3.9.7'
flutterVersionName = '4.0.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
... ...
... ... @@ -34,7 +34,7 @@ class SetMealSunModel {
String price;
String bargaining;
String status;
Null cdate;
dynamic cdate;
List<Classify> classify;
List<Cook> cook;
... ...
... ... @@ -290,5 +290,6 @@ class HttpUrl {
static const String set_deposit =
"?service=App.Banquet.SetDeposit"; // 添加/修改宴会定金
static const String del_deposit = "?service=App.Banquet.DelDeposit"; // 删除宴会定金
static const String create_banquet =
"?service=App.Banquet.CreateBanquet"; //创建意向
}
... ...
... ... @@ -13,6 +13,7 @@ import 'package:provider/provider.dart';
import '../../models/feast_menu_model.dart';
import '../../provider/feast_model.dart';
import '../../provider/upload_img_provider.dart';
import '../../provider/user_model.dart';
import '../../res/colors.dart';
import '../../utils/dialog_util.dart';
import '../../utils/screen_util.dart';
... ... @@ -601,7 +602,23 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
children: [
Expanded(
child: _callButton(
onPress: () {},
onPress: () {
Map<String, String> pramas = {
'sid': Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
'ddate': '',
'jiedan_id': '',
'staff_id': '',
'classify_id': '',
'rname': '',
'sex': '',
'phone': '',
'remark': '',
'images': ''
};
feastModel.createBanquet(context, pramas);
},
content: '仅保存',
hasLeftBorder: true,
isSelect: false)),
... ...
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../constant/state.dart';
import '../../provider/feast_model.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/MyDivider.dart';
import '../../widgets/loading.dart';
import '../../widgets/page_exception.dart';
import '../../widgets/round_button.dart';
import '../../widgets/system_app_bar.dart';
class FeastDepositDataPage extends StatefulWidget {
FeastDepositDataPage({Key key}) : super(key: key);
@override
_FeastDepositDataPageState createState() => _FeastDepositDataPageState();
}
class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
FeastModel feastModel;
TextEditingController editingController = TextEditingController();
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget buildFeastTypeHeader() {
return Container(
width: double.infinity,
height: h(46),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
border: Border(
bottom: BorderSide(width: w(1), color: MyColours.color_DBDBDB))),
child: Row(
children: [
RichText(
textScaleFactor: 1,
overflow: TextOverflow.ellipsis,
// textDirection: TextDirection.ltr,
// textAlign: TextAlign.left,
text: TextSpan(
children: [
TextSpan(
text: "收据编号",
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
),
TextSpan(
text: "*",
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
],
)),
HEmptyView(32),
Expanded(
child: Container(
// height: ScreenUtil().setHeight(120),
height: w(48),
padding: EdgeInsets.only(top: w(4)),
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),
color: MyColours.color_515151),
// focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: '请输入',
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(32),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.text,
)),
),
RoundButton(
onPressed: () async {},
text: '搜索',
fontSize: 28,
isBold: false,
height: h(28),
width: w(36),
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_F6F6F6,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
radius: r(4),
),
],
),
);
}
Widget buildFeastTypeItem() {
return Container(
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_f3f3f3, width: ScreenUtil().setWidth(2)),
boxShadow: [
BoxShadow(
color: MyColours.color_1F000000,
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.circular(ScreenUtil().radius(10))),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(8)),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().radius(10)),
topRight: Radius.circular(ScreenUtil().radius(10)),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'8月1日 午餐',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_F6F6F6,
fontSize: ScreenUtil().setSp(40)),
),
Text(
'婚宴',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_F6F6F6,
fontSize: ScreenUtil().setSp(40)),
)
],
)),
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(14)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(ScreenUtil().radius(10)),
bottomRight: Radius.circular(ScreenUtil().radius(10)),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
children: [
Text(
'[定金2000]',
style: TextStyle(
color: true
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
],
),
VEmptyView(5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'方先生 负责人:刘经理',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28)),
),
RoundButton(
onPressed: () async {
_showCancelWidget(context);
},
text: '退定金',
fontSize: 28,
isBold: false,
height: h(28),
width: w(58),
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_F6F6F6,
gradientStart: MyColours.color_E34D59,
gradientEnd: MyColours.color_E34D59,
borderColor: MyColours.color_E34D59,
radius: r(4),
),
],
)
],
),
)
],
),
);
}
///取消预订弹框
_showCancelWidget(context) {
ScrollController _scrollController = ScrollController();
TextEditingController _cancelController = TextEditingController();
FocusNode _cancelNode = FocusNode();
bool showPerson = true;
bool showType = true;
String person = '请选择';
String type = '请选择';
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return Scaffold(
backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
body: StatefulBuilder(builder: (context, state) {
// _cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Center(
child: Stack(children: [
Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(28 * 2)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10)),
),
height: ScreenUtil().setWidth(355 * 2 + 90),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: [
// Stack(
// children: [
VEmptyView(48),
Container(
height: ScreenUtil().setWidth(48),
child: Text(
'退定金',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Color.fromRGBO(0, 0, 0, 0.9)),
),
),
_textfield('退款金额', '请输入', null, null, '元'),
_selectWidget('操作人', person, onTap: () {
state(() {
showType = true;
showPerson = !showPerson;
});
}),
_selectWidget('退款方式', type, onTap: () {
state(() {
showPerson = true;
showType = !showType;
});
}),
_textfield('收款人', '请输入', null, null, '',
inputType: TextInputType.text),
VEmptyView(24),
Container(
decoration: BoxDecoration(
color: Color.fromRGBO(240, 240, 240, 1),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
// height: ScreenUtil().setWidth(42 * 2),
margin: EdgeInsets.symmetric(horizontal: w(12)),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16)),
child: TextField(
maxLines: 1,
controller: _cancelController,
focusNode: _cancelNode,
style: TextStyle(
textBaseline: TextBaseline.alphabetic),
textAlignVertical: TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
hintText: "备注",
// focusColor: Color.fromRGBO(0, 0, 0, 0.4),
hintStyle: TextStyle(
color: Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
),
// border: InputBorder.none,
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
},
// keyboardType: TextInputType.number,
),
),
VEmptyView(40),
MyDivider(
double.infinity, ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3),
Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '取消',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
Navigator.pop(context);
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: '确定退款',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E34D59,
fontSize: 32,
isBold: true,
onPressed: () {
Navigator.of(context).pop();
Loading.showLoading(context);
// setReserveStatus('4', desc: desc);
}),
])
],
),
),
Positioned(
left: ScreenUtil().setWidth(320),
top: ScreenUtil().setWidth(150 * 2),
child: Offstage(
offstage: showPerson,
child: Material(
color: Colors.transparent,
child: selectWidgetTableManage(
['dffd', 'fdf'], (index) {
state(() {
showPerson = !showPerson;
person = ['dffd', 'fdf'][index];
});
}),
))),
Positioned(
left: ScreenUtil().setWidth(320),
top: ScreenUtil().setWidth(200 * 2),
child: Offstage(
offstage: showType,
child: Material(
color: Colors.transparent,
child: selectWidgetTableManage([
'dffd',
'fdf',
'dffd',
'fdf',
'dffd',
'fdf'
], (index) {
state(() {
showType = !showType;
type = [
'dffd',
'fdf',
'dffd',
'fdf',
'dffd',
'fdf'
][index];
});
}),
))),
]),
));
}));
});
}
Widget _selectWidget(String title, String labelShow,
{GestureTapCallback onTap, bool need = true}) {
return InkWell(
onTap: onTap,
child: Container(
// height: ScreenUtil().setWidth(60),
margin: EdgeInsets.symmetric(horizontal: w(12)),
padding: EdgeInsets.only(
left: w(16), right: w(8), top: w(12), bottom: h(8)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_DBDBDB))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
width: w(80),
child: RichText(
textScaleFactor: 1,
overflow: TextOverflow.ellipsis,
// textDirection: TextDirection.ltr,
text: TextSpan(
children: [
TextSpan(
text: title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
recognizer: TapGestureRecognizer()
..onTap = () {}),
TextSpan(
text: need ? '*' : '',
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
//点击事件
recognizer: TapGestureRecognizer()
..onTap = () {}),
],
))),
HEmptyView(48),
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(32 * 2),
// height: ScreenUtil().setWidth(10),
)
],
),
));
}
///请输入
///输入框
Widget _textfield(
String title,
String hintText,
TextEditingController editingController,
FocusNode focusNode,
String subTitle,
{TextInputType inputType = TextInputType.number}) {
return Container(
margin: EdgeInsets.symmetric(horizontal: w(12)),
padding:
EdgeInsets.only(left: w(16), right: w(8), top: w(12), bottom: h(8)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: ScreenUtil().setWidth(2),
color: MyColours.color_DBDBDB))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: w(80),
child: RichText(
textScaleFactor: 1,
overflow: TextOverflow.ellipsis,
// textDirection: TextDirection.ltr,
text: TextSpan(
children: [
TextSpan(
text: title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28)),
recognizer: TapGestureRecognizer()..onTap = () {}),
TextSpan(
text: '*',
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
//点击事件
recognizer: TapGestureRecognizer()..onTap = () {}),
],
))),
HEmptyView(48),
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(28),
),
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)),
),
),
],
),
))
],
),
);
}
selectWidgetTableManage(List<String> data, CustomCallBack onTap) {
return Container(
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
border: Border.all(
color: MyColours.color_cccccc,
width: ScreenUtil().setWidth(2))),
width: ScreenUtil().setWidth(320),
constraints: BoxConstraints(
maxHeight: ScreenUtil().setWidth(140 * 2),
),
child: ListView.builder(
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
itemCount: data.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
onTap(index);
},
child: Container(
padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_efefef,
width: ScreenUtil().setWidth(2)))),
child: Text(data[index],
style: TextStyle(
color: MyColours.color_199095,
fontSize: ScreenUtil().setSp(28))),
),
);
}));
}
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);
feastModel.pageStateDepositData = PageState.Success;
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'定金管理',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_ffffff,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
// expandedHeight: ScreenUtil().setWidth(128 * 2),
automaticallyImplyLeading: false,
toolbarHeight: ScreenUtil().setWidth(64 * 2),
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
}, body: Consumer<FeastModel>(builder: (context, model, _) {
if (model.pageStateDepositData != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateDepositData,
callback: () {
// _getWine();
},
emptyMsg: "暂时没有定金数据哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return ListView.builder(
itemCount: 100,
padding:
EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
itemBuilder: (BuildContext context, int index) {
// WineSunModel data = feastModel.wineData[index];
return buildFeastTypeItem();
// '剑南春52度500ml', '1150元/份 不可议价'
});
}
}))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '回到今天',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '创建宴会',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../constant/state.dart';
import '../../provider/feast_model.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/MyDivider.dart';
import '../../widgets/loading.dart';
import '../../widgets/page_exception.dart';
import '../../widgets/round_button.dart';
import '../../widgets/system_app_bar.dart';
class FeastFollowUpPage extends StatefulWidget {
FeastFollowUpPage({Key key}) : super(key: key);
@override
_FeastFollowUpPageState createState() => _FeastFollowUpPageState();
}
class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
FeastModel feastModel;
DateTime dateTimeStart;
DateTime dateTimeEnd;
String start = '请选择';
String end = '请选择';
bool isFeastTime = false;
@override
void initState() {
super.initState();
dateTimeStart = DateTime.now();
start = createDateText(context, dateTimeStart);
dateTimeEnd = DateTime.now();
end = createDateText(context, dateTimeEnd);
Utils.changeStatusColor(color: MyColours.color_438E93);
}
//生成日期文本
createDateText(BuildContext context, DateTime day) {
// if (Utils.isOneDay(day, dateTime)) return; //日期没变
String ymd = "${day.year}-" +
Utils.addZeroNumber(day.month) +
"-" +
Utils.addZeroNumber(day.day);
// ymd += " (周${Utils.formatWeekDayNum(day.weekday)} ";
// ymd += Utils.lunarCalendarHolidays(day);
// ymd += ')';
return ymd;
}
Widget buildFeastTypeHeader() {
return Container(
width: double.infinity,
height: h(88),
// decoration: BoxDecoration(
// color: MyColours.color_F8F9FD,
// border: Border(
// bottom: BorderSide(width: w(1), color: MyColours.color_DBDBDB))),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
InkWell(
onTap: () {
if (!isFeastTime) {
return;
}
setState(() {
isFeastTime = !isFeastTime;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
!isFeastTime ? 'base_radio_sel' : 'base_radio_un'),
width: w(24),
),
HEmptyView(8),
Text(
'创建时间',
style: TextStyle(
fontSize: font(14),
color: !isFeastTime
? MyColours.color_438E93
: MyColours.color_999999),
)
],
),
),
HEmptyView(16),
InkWell(
onTap: () {
if (isFeastTime) {
return;
}
setState(() {
isFeastTime = !isFeastTime;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
isFeastTime ? 'base_radio_sel' : 'base_radio_un'),
width: w(24),
),
HEmptyView(8),
Text(
'宴会时间',
style: TextStyle(
fontSize: font(14),
color: isFeastTime
? MyColours.color_438E93
: MyColours.color_999999),
)
],
),
),
Spacer(),
RoundButton(
onPressed: () async {},
text: '搜索',
fontSize: 28,
isBold: false,
height: h(28),
width: w(36),
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_F6F6F6,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
radius: r(4),
),
],
),
VEmptyView(20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showCalendarDialog(context, dateTimeStart)
.then((day) async {
if (day != null) {
dateTimeStart = day;
start = createDateText(context, day);
setState(() {});
}
});
},
child: Row(
children: [
Text(
start,
style: TextStyle(
fontSize: font(18),
color: start == '请选择'
? MyColours.color_999999
: MyColours.color_515151),
),
HEmptyView(8),
Image.asset(
Utils.getImgPath('f_arrow_down'),
width: w(24),
)
],
)),
Text(
'至',
style: TextStyle(
fontSize: font(20), color: MyColours.color_515151),
),
InkWell(
onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showCalendarDialog(context, dateTimeEnd)
.then((day) async {
if (day != null) {
dateTimeEnd = day;
end = createDateText(context, day);
setState(() {});
}
});
},
child: Row(
children: [
Text(
end,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(18),
color: end == '请选择'
? MyColours.color_999999
: MyColours.color_515151),
),
HEmptyView(8),
Image.asset(
Utils.getImgPath('f_arrow_down'),
width: w(24),
),
],
))
],
)
],
),
);
}
Widget buildFeastTypeItem() {
return Container(
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_f3f3f3, width: ScreenUtil().setWidth(2)),
boxShadow: [
BoxShadow(
color: MyColours.color_1F000000,
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.circular(ScreenUtil().radius(10))),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(8)),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().radius(10)),
topRight: Radius.circular(ScreenUtil().radius(10)),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'8月1日 午餐',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_F6F6F6,
fontSize: ScreenUtil().setSp(40)),
),
Text(
'婚宴',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_F6F6F6,
fontSize: ScreenUtil().setSp(40)),
)
],
)),
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(14)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(ScreenUtil().radius(10)),
bottomRight: Radius.circular(ScreenUtil().radius(10)),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
children: [
Text(
'[已选桌/未选桌]',
style: TextStyle(
color: true
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
' [已选套餐/未选套餐]',
style: TextStyle(
color: true
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
' [定金2000/未交定金]',
style: TextStyle(
color: true
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
' [已担保/未担保]',
style: TextStyle(
color: true
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
' [已签约/未签约]',
style: TextStyle(
color: true
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
],
),
VEmptyView(20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'方先生 负责人:刘经理',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28)),
),
RoundButton(
onPressed: () async {
_showCancelWidget(context);
},
text: '丢单',
fontSize: 28,
isBold: false,
height: h(28),
width: w(44),
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_F6F6F6,
gradientStart: MyColours.color_E34D59,
gradientEnd: MyColours.color_E34D59,
borderColor: MyColours.color_E34D59,
radius: r(4),
),
],
)
],
),
)
],
),
);
}
///取消预订弹框
_showCancelWidget(context) {
ScrollController _scrollController = ScrollController();
TextEditingController _cancelController = TextEditingController();
FocusNode _cancelNode = FocusNode();
List cancelReasonList = [
{'title': '已选则其他酒店', 'select': false},
{'title': '不接受增值服务', 'select': false},
{'title': '场地无法满足客户', 'select': false},
{'title': '内部失误,跟单失败', 'select': false},
{'title': '其他原因', 'select': false},
];
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return Scaffold(
backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
body: StatefulBuilder(builder: (context, state) {
// _cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Center(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(28 * 2)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
),
height: ScreenUtil().setWidth(355 * 2 + 20),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: [
// Stack(
// children: [
VEmptyView(48),
Container(
height: ScreenUtil().setWidth(48),
child: Text(
'请选择丢单原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Color.fromRGBO(0, 0, 0, 0.9)),
),
),
// Positioned(
// top: ScreenUtil().setWidth(8),
// right: ScreenUtil().setWidth(0),
// child: GestureDetector(
// onTap: () {
// _initCancel();
// Navigator.of(context).pop();
// },
// child: Container(
// padding: EdgeInsets.only(left: 20),
// child: Image.asset(
// 'assets/close.png',
// width: ScreenUtil().setWidth(32),
// height: ScreenUtil().setWidth(32),
// ),
// )))
// ],
// ),
VEmptyView(40),
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: cancelReasonList.map((value) {
return value['title'] == '其他原因'
? SizedBox()
: GestureDetector(
onTap: () {
for (var item
in cancelReasonList) {
item['select'] = false;
// isShowTF = false;
// paddingBottom =
// ScreenUtil().screenHeight.ceil() -
// 138 -
// 340;
if (item['title'] ==
value['title']) {
item['select'] = true;
// if (item['title'] == '其他原因') {
// // isShowTF = true;
// // paddingBottom = 130;
// // paddingBottom =
// // ScreenUtil().screenHeight.ceil() -
// // 138 -
// // 340 -
// // 46;
// }
}
}
state(() {});
},
child: Container(
height: ScreenUtil().setWidth(48),
margin: EdgeInsets.only(
bottom: ScreenUtil()
.setWidth(40)),
child: Row(
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(42)),
HEmptyView(20),
Container(
child: Text(
value['title'],
style: TextStyle(
fontSize:
ScreenUtil()
.setSp(
32),
fontWeight:
FontWeight
.normal,
decoration:
TextDecoration
.none,
color: MyColours
.color_333333)))
],
),
),
);
}).toList(),
)),
Material(
child: Container(
color: Colors.white,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
height: ScreenUtil().setWidth(42 * 2),
child: Row(children: [
InkWell(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
}
cancelReasonList[4]['select'] =
true;
state(() {});
},
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil()
.setWidth(20)),
child: Image.asset(
cancelReasonList[4]['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(44)))),
Expanded(
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(
240, 240, 240, 1),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
// height: ScreenUtil().setWidth(42 * 2),
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(16)),
child: TextField(
maxLines: 1,
controller: _cancelController,
focusNode: _cancelNode,
style: TextStyle(
textBaseline:
TextBaseline.alphabetic),
textAlignVertical:
TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
hintText: "其他",
// focusColor: Color.fromRGBO(0, 0, 0, 0.4),
hintStyle: TextStyle(
color:
Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
),
// border: InputBorder.none,
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
},
// keyboardType: TextInputType.number,
),
))
]))),
VEmptyView(40),
MyDivider(double.infinity, ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3),
Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '取消',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
Navigator.pop(context);
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: '确定丢单',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E34D59,
fontSize: 32,
isBold: true,
onPressed: () {
String desc = '';
for (var value in cancelReasonList) {
if (value['select'] == true) {
desc = value['title'];
if (value['title'] == '其他原因') {
desc =
_cancelController.text.trim();
if (desc.isEmpty) {
Utils.showToast("请填写原因");
return;
}
}
}
}
if (desc == '') {
Utils.showToast('请选择原因');
return;
}
Navigator.of(context).pop();
Loading.showLoading(context);
// setReserveStatus('4', desc: desc);
}),
])
],
),
),
));
}));
});
}
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);
feastModel.pageStateFollowUp = PageState.Success;
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'待跟进宴会',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_ffffff,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
// expandedHeight: ScreenUtil().setWidth(128 * 2),
automaticallyImplyLeading: false,
toolbarHeight: ScreenUtil().setWidth(88 * 2),
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
}, body: Consumer<FeastModel>(builder: (context, model, _) {
if (model.pageStateFollowUp != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateFollowUp,
callback: () {
// _getWine();
},
emptyMsg: "暂时没有待跟进宴会哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return ListView.builder(
itemCount: 100,
padding: EdgeInsets.only(left: w(12), top: w(19),right:w(12)),
itemBuilder: (BuildContext context, int index) {
// WineSunModel data = feastModel.wineData[index];
return buildFeastTypeItem();
// '剑南春52度500ml', '1150元/份 不可议价'
});
}
}))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '回到今天',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '创建宴会',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
... ... @@ -60,7 +60,9 @@ class _FeastPageState extends State<FeastPage> {
NavigatorUtil.goFeastCreatePage(context);
}),
Stack(clipBehavior: Clip.none, children: [
upAndDown('y_schedule', '待跟进'),
upAndDown('y_schedule', '待跟进', onTap: () {
NavigatorUtil.goFeastFollowUpPage(context);
}),
Positioned(
right: ScreenUtil().setWidth(-6),
bottom: ScreenUtil().setWidth(32),
... ... @@ -82,7 +84,9 @@ class _FeastPageState extends State<FeastPage> {
),
)
]),
upAndDown('y_money', '定金管理')
upAndDown('y_money', '定金管理',onTap: (){
NavigatorUtil.goFeastDepositDataPage(context);
})
],
),
VEmptyView(102),
... ...
... ... @@ -238,11 +238,13 @@ class _FeastOthersetManageEditPageState
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_textfield(
'配置名称', '请输入', othersetNameC, othersetF, ''),
'配置名称', '请输入', othersetNameC, othersetF, '',
inputType: TextInputType.text),
_textfield('配置单价', '请输入', othersetPriceC,
othersetPriceF, '元'),
_textfield(
'配置规格', '请输入', othersetPerC, othersetPerF, ''),
'配置规格', '请输入', othersetPerC, othersetPerF, '',
inputType: TextInputType.text),
Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
... ...
... ... @@ -54,6 +54,40 @@ class FeastModel extends ChangeNotifier {
PageState pageStateDeposit = PageState.Loading; //其他配置
List<GetDepositSunModel> depositData = [];
PageState pageStateFollowUp = PageState.Loading; //待跟进宴会
PageState pageStateDepositData = PageState.Loading; //定金数据
/***
*
* 新建宴会
*/
///添加宴会员工
Future<dynamic> createBanquet(BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.create_banquet,
data: params, showLoading: isShowLoading)
.catchError((error) {
print(error.toString());
if (error is MyError) {}
return false;
});
if (baseResp.code == Constant.status_success) {
// if (baseResp.data == 1) {
return true;
// } else {
// return false;
// }
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
return false;
}
}
/***
*
* 宴会员工
... ...
... ... @@ -984,4 +984,18 @@ class NavigatorUtil {
return _navigateTo(context, "${Routes.feast_deposit_type_page}",
replace: replace);
}
///宴会----待跟进宴会
static Future<dynamic> goFeastFollowUpPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_follow_up_page}",
replace: replace);
}
///宴会----定金数据
static Future<dynamic> goFeastDepositDataPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_deposit_data_page}",
replace: replace);
}
}
... ...
... ... @@ -148,7 +148,9 @@ import 'package:provider/provider.dart';
import '../pages/feast/feast_board.dart';
import '../pages/feast/feast_create_page.dart';
import '../pages/feast/feast_deposit_data_page.dart';
import '../pages/feast/feast_deposit_page.dart';
import '../pages/feast/feast_followup_page.dart';
import '../pages/feast/feast_invoice_page.dart';
import '../pages/feast/feast_menu_page.dart';
import '../pages/feast/feast_set_page.dart';
... ... @@ -1566,3 +1568,23 @@ var feastDepositTypePageHandle = new Handler(
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastDepositTypePage());
});
///宴会---待跟进宴会
var feastFollowUpPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastFollowUpPage());
});
///宴会---定金数据
var feastDepositDataPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastDepositDataPage());
});
... ...
... ... @@ -144,6 +144,9 @@ class Routes {
"/feast_deposit_manage_page"; //宴会-----定金管理
static String feast_deposit_type_page =
"/feast_deposit_type_page"; //宴会-----定金类型
static String feast_follow_up_page = "/feast_follow_up_page"; //宴会-----待跟进
static String feast_deposit_data_page =
"/feast_deposit_data_page"; //宴会-----定金数据
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -290,5 +293,10 @@ class Routes {
router.define(feast_deposit_manage_page,
handler: feastDepositManagePageHandle);
router.define(feast_deposit_type_page, handler: feastDepositTypePageHandle);
router.define(feast_follow_up_page, handler: feastFollowUpPageHandle);
router.define(feast_deposit_data_page, handler: feastDepositDataPageHandle);
}
}
... ...
... ... @@ -724,7 +724,7 @@ class DialogUtil {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角
child: Expanded(
child: Container(
child: Column(
children: [
VEmptyView(64),
... ...