Commit 33071fffaa8a5ae6d7d6b635fa6a1bbea2c729e6

Authored by wdn127929
1 parent a3614750

营销中心设置优惠券样式okok

... ... @@ -508,8 +508,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 466;
DEVELOPMENT_TEAM = 8J59HM8B82;
... ... @@ -655,12 +654,12 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 466;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = debug;
FLUTTER_BUILD_MODE = release;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
... ... @@ -691,7 +690,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 466;
DEVELOPMENT_TEAM = 8J59HM8B82;
... ...
... ... @@ -71,6 +71,7 @@ class _CouponSunPageState extends State<CouponSunPage> {
Map<String, String> params = {
"id": couponProvider.couponList[index].id,
"status": couponProvider.couponList[index].isOpenBool ? '1' : '0',
'is_open': couponProvider.couponList[index].isOpenBool ? '1' : '0',
};
bool isSuccess = await couponProvider.setCustomerActivity(context, params,
isShowLoading: false);
... ...
... ... @@ -104,6 +104,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
MyTextSelectionControls();
TextEditingController pnumC = TextEditingController();
FocusNode pnumF = FocusNode();
FocusNode priceF = FocusNode();
@override
void initState() {
// TODO: implement initState
... ... @@ -120,7 +124,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
_initCancel();
_getReserveDetail();
_getOrderInfo();
_initPersonNumList();
// _initPersonNumList();
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid
};
... ... @@ -345,10 +349,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
showCircle: showCicle);
_initTime(int.parse(detailEntity.ddate_solt));
setState(() {
detailModel.selectNum = detailEntity.actual_pum;
detailModel.selectIndex = detailEntity.actual_pum != null
? personNumList.indexOf(detailEntity.actual_pum)
: null;
// detailModel.selectNum = detailEntity.actual_pum;
// detailModel.selectIndex = detailEntity.actual_pum != null
// ? personNumList.indexOf(detailEntity.actual_pum)
// : null;
pnumC.text = detailEntity.actual_pum;
if (detailEntity.con_amount != null) {
detailModel.prestrTF = detailEntity.con_amount;
detailModel.numController.text = detailEntity.con_amount;
... ... @@ -1407,57 +1412,80 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
// ? false
// : true,
// child:
TitleAndBtn(
// TitleAndBtn(
// title: "人数",
// content:
// detailEntity.actual_pum,
// list: personNumList,
// detailModel: model,
// callback: () {
// FocusScope.of(context)
// .requestFocus(
// FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context,
// personNumList,
// (value) async {
// if (value != null) {
// detailModel.selectIndex =
// value.first;
// detailModel.selectNum =
// personNumList[
// value.first];
// // detailModel
// // .notifyListeners();
// // setState(() {
// // selectPnum = value.first;
// // pnum = pnumlist[value.first];
// // });
// bool sucess = await detailModel
// .upReserveInfo(
// context,
// widget.rid,
// actualPum:
// detailModel
// .selectNum);
// if (sucess) {
// EventBus().emit(
// "refresh_tablemanager"); //刷新桌位
// await _getReserveDetail(
// showCicle: false);
// }
// }
// },
// selecteds: detailModel
// .selectIndex ==
// null
// ? []
// : [
// detailModel
// .selectIndex
// ])
// .then((value) {});
// }),
TitleAndTextfield(
title: "人数",
content:
detailEntity.actual_pum,
list: personNumList,
detailModel: model,
callback: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context,
personNumList,
(value) async {
if (value != null) {
detailModel.selectIndex =
value.first;
detailModel.selectNum =
personNumList[
value.first];
// detailModel
// .notifyListeners();
// setState(() {
// selectPnum = value.first;
// pnum = pnumlist[value.first];
// });
bool sucess = await detailModel
detailModel: detailModel,
rid: widget.rid,
isPrice: false,
controller: pnumC,
focusNode: pnumF,
callback: () async {
bool sucess =
await detailModel
.upReserveInfo(
context,
widget.rid,
actualPum:
detailModel
.selectNum);
if (sucess) {
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
await _getReserveDetail(
showCicle: false);
}
}
},
selecteds: detailModel
.selectIndex ==
null
? []
: [
detailModel
.selectIndex
])
.then((value) {});
pnumC.text);
if (sucess) {
EventBus().emit(
"refresh_tablemanager"); //刷新桌位
await _getReserveDetail(
showCicle: false);
}
}),
// ),
// Offstage(
... ... @@ -1516,6 +1544,10 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
title: "消费金额",
detailModel: detailModel,
rid: widget.rid,
isPrice: true,
controller:
detailModel.numController,
focusNode: priceF,
),
Offstage(
offstage:
... ... @@ -3323,6 +3355,11 @@ class TitleAndTextfield extends StatefulWidget {
final List<String> pnumlist;
final NotebookDetailModel detailModel;
final String rid;
final TextEditingController controller;
final FocusNode focusNode;
final bool isPrice;
final VoidCallback callback;
const TitleAndTextfield(
{Key key,
... ... @@ -3330,7 +3367,11 @@ class TitleAndTextfield extends StatefulWidget {
this.bookNum,
this.pnumlist,
this.detailModel,
this.rid})
this.rid,
this.controller,
this.focusNode,
this.isPrice = true,
this.callback})
: super(key: key);
@override
... ... @@ -3338,18 +3379,24 @@ class TitleAndTextfield extends StatefulWidget {
}
class _TitleAndTextfieldState extends State<TitleAndTextfield> {
FocusNode numberFocusNode = new FocusNode();
// FocusNode numberFocusNode = new FocusNode();
OverlayEntry overlayEntry;
@override
void initState() {
super.initState();
// if (Platform.isIOS) {
numberFocusNode.addListener(() {
if (numberFocusNode.hasFocus) {
widget.focusNode.addListener(() {
if (widget.focusNode.hasFocus) {
showOverlay(context);
} else {
_updateMoney();
if (widget.isPrice) {
_updateMoney();
} else {
//人数
widget.callback();
}
removeOverlay();
}
});
... ... @@ -3457,18 +3504,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> {
color: MyColours.color_199095))),
child: IntrinsicWidth(
child: TextField(
controller: widget.detailModel.numController,
controller: widget.controller,
maxLines: 1,
// inputFormatters: [
// LengthLimitingTextInputFormatter(9),
// FilteringTextInputFormatter.digitsOnly
// ],
inputFormatters: [
NumLengthInputFormatter(
decimalLength: 2, integerLength: 6),
],
focusNode: numberFocusNode,
inputFormatters: widget.isPrice
? [
NumLengthInputFormatter(
decimalLength: 2, integerLength: 6),
]
: [],
focusNode: widget.focusNode,
//光标颜色
cursorColor: MyColours.color_199095,
... ... @@ -3485,7 +3534,8 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> {
fontSize: ScreenUtil().setSp(30),
),
prefix: widget.detailModel.strTF != null &&
widget.detailModel.strTF.trim().length > 0
widget.detailModel.strTF.trim().length > 0 &&
widget.isPrice
? Text("¥",
style: TextStyle(color: MyColours.color_199095))
: SizedBox(),
... ... @@ -3504,17 +3554,20 @@ class _TitleAndTextfieldState extends State<TitleAndTextfield> {
border: OutlineInputBorder(borderSide: BorderSide.none),
),
onChanged: (value) {
widget.detailModel.strTF = value;
if (widget.isPrice) {
widget.detailModel.strTF = value;
print(widget.detailModel.numController.text);
widget.detailModel.notifyListeners();
print(widget.detailModel.numController.text);
widget.detailModel.notifyListeners();
}
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
// _updateMoney();
},
keyboardType:
TextInputType.numberWithOptions(decimal: true),
keyboardType: widget.isPrice
? TextInputType.numberWithOptions(decimal: true)
: TextInputType.number,
))),
]));
}
... ...
... ... @@ -420,18 +420,21 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
title,
style: TextStyle(
fontSize: font(14),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
),
Container(
constraints: BoxConstraints(maxWidth: w(150)),
child: Text(
title,
style: TextStyle(
fontSize: font(14),
fontWeight: FontWeight.bold,
color: MyColours.color_515151),
)),
HEmptyView(20),
subtile != ''
? Text(
... ... @@ -472,7 +475,7 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
color: MyColours.color_515151),
)
],
),
)),
RoundButton(
text: '切换活动',
width: w(72),
... ... @@ -758,6 +761,22 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
String couponsDesc = '';
if (couponData != null) {
if (couponData.expDate == null) {
couponsDesc = couponData.desc;
} else {
if (couponData.expDate.isNone) {
couponsDesc = '无限制,' + couponData.desc ?? '';
} else if (couponData.expDate.isBirthday) {
couponsDesc = '会员生日当天可用,' + couponData.desc ?? '';
} else if (couponData.expDate.isWeek) {
couponsDesc =
'${couponData.expDate.weekShow},' + couponData.desc ?? '';
}
}
}
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
... ... @@ -805,9 +824,15 @@ class _MarkingInteractionPageState extends State<MarkingInteractionPage> {
_headItem('预订安排中附带的营销推广'),
VEmptyView(24),
couponData != null
? _markingItem('推荐店内代金券优惠', couponData.aname,
couponData.desc, '100', '5折', select: isCoupon,
onPressedSelect: () {
? _markingItem(
'推荐店内代金券优惠',
couponData.aname,
couponsDesc,
couponData.price ?? '',
couponData.use != null && couponData.use.isCash
? '${(double.parse(couponData.price) / double.parse(couponData.use.cash)) * 10}折'
: '',
select: isCoupon, onPressedSelect: () {
setState(() {
isCoupon = !isCoupon;
});
... ...
... ... @@ -80,7 +80,7 @@ class TableManagerPageState extends State<TableManagerPage> {
BaseIndoProvider _baseIndoProvider;
int sexSelectIndex = 0;
String sexStr = '先生';
String actualPnum = '选填';
// String actualPnum = '选填';
String ddateHm = '选填';
int actualPnumIndex;
int ddateIndex;
... ... @@ -104,6 +104,12 @@ class TableManagerPageState extends State<TableManagerPage> {
// final MySpecialTextSpanBuilder _mySpecialTextSpanBuilder =
// MySpecialTextSpanBuilder();
TextEditingController controller = TextEditingController()..text = 'nnn';
MyTextSelectionControls _myExtendedMaterialTextSelectionControlsNum =
MyTextSelectionControls();
FocusNode _pnumNode = FocusNode();
TextEditingController pnumController = TextEditingController();
@override
void initState() {
... ... @@ -968,53 +974,98 @@ class TableManagerPageState extends State<TableManagerPage> {
fontSize: ScreenUtil().setSp(28)),
),
Expanded(
child: InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
DialogUtil.showSelectCusmanDialog(
context, personNumList,
(value) async {
if (value != null) {
actualPnumIndex = value.first;
actualPnum = personNumList[
value.first];
setState(() {});
}
},
title: '人数',
selecteds:
actualPnumIndex ==
null
? []
: [
actualPnumIndex
])
.then((value) {});
},
child: Container(
alignment: Alignment.center,
child: Text(actualPnum,
style: TextStyle(
fontSize: ScreenUtil()
.setSp(28),
color: actualPnum ==
'选填'
? MyColours
.color_999999
: MyColours
.color_515151))),
child: TextField(
textAlign: TextAlign.center,
selectionControls:
_myExtendedMaterialTextSelectionControlsNum,
maxLines: 1,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151),
controller: pnumController,
focusNode: _pnumNode,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
hintText: "选填",
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
border: OutlineInputBorder(
borderSide: BorderSide.none),
),
// HEmptyView(6),
// Image.asset(
// Utils.getImgPath(
// false ? 'c_arrow_up' : 'c_arrow_down'),
// width: ScreenUtil().setWidth(28),
// // height: ScreenUtil().setWidth(10),
// ),
),
onChanged: (value) async {
//操作
pnumController.text = value;
//添加的代码:光标一直在文本框后面
pnumController.value =
TextEditingValue(
text: pnumController.text,
selection: TextSelection
.fromPosition(
TextPosition(
affinity: TextAffinity
.downstream,
offset: pnumController
.text.length,
)));
},
onEditingComplete: () {
_pnumNode.unfocus();
},
onTap: () {},
keyboardType: TextInputType.number,
)),
// Expanded(
// child: InkWell(
// onTap: () {
// FocusScope.of(context)
// .requestFocus(
// FocusNode()); //隐藏键盘
// DialogUtil.showSelectCusmanDialog(
// context, personNumList,
// (value) async {
// if (value != null) {
// actualPnumIndex = value.first;
// actualPnum = personNumList[
// value.first];
// setState(() {});
// }
// },
// title: '人数',
// selecteds:
// actualPnumIndex ==
// null
// ? []
// : [
// actualPnumIndex
// ])
// .then((value) {});
// },
// child: Container(
// alignment: Alignment.center,
// child: Text(actualPnum,
// style: TextStyle(
// fontSize: ScreenUtil()
// .setSp(28),
// color: actualPnum ==
// '选填'
// ? MyColours
// .color_999999
// : MyColours
// .color_515151))),
// ),
// // HEmptyView(6),
// // Image.asset(
// // Utils.getImgPath(
// // false ? 'c_arrow_up' : 'c_arrow_down'),
// // width: ScreenUtil().setWidth(28),
// // // height: ScreenUtil().setWidth(10),
// // ),
// ),
]))),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(46),
... ... @@ -1752,7 +1803,7 @@ class TableManagerPageState extends State<TableManagerPage> {
_baseIndoProvider.phoneController.text = '';
sexSelectIndex = 0;
sexStr = '先生';
actualPnum = '选填';
pnumController.text = '';
ddateHm = '选填';
actualPnumIndex = null;
ddateIndex = null;
... ... @@ -2048,8 +2099,8 @@ class TableManagerPageState extends State<TableManagerPage> {
}
}
String pnum;
if (actualPnum != '选填') {
pnum = actualPnum;
if (pnumController.text != '') {
pnum = pnumController.text;
}
SunReserveInfoModel _model =
await tableManagerModel.setReserveInfo(context,
... ...