Commit 198f92794453e8bcc80484e0ee6d9b4ce14b9933

Authored by weixin_45529955
1 parent 84707344

配置赠券对象

... ... @@ -10,10 +10,10 @@ class Constant {
*
* 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!!
* */
static const WXMiniProgramType wxMiniProgramType =
WXMiniProgramType.release; //正式版
// static const WXMiniProgramType wxMiniProgramType =
// WXMiniProgramType.preview; //体验版
// WXMiniProgramType.release; //正式版
static const WXMiniProgramType wxMiniProgramType =
WXMiniProgramType.preview; //体验版
// static const WXMiniProgramType wxMiniProgramType =
// WXMiniProgramType.test; //开发版
... ...
... ... @@ -274,6 +274,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
bus.on("refresh_action_log", (args) {
_getReserveActionLog(); //获取变更记录
});
bus.on("refresh_detail_relations", (args) {
// _getReserveDetail(isShowLoading: false);
_getReserveDetailRelationData(showCicle: true);
});
});
}
... ... @@ -854,6 +859,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
bus.off("refresh_detail_deposit");
bus.off("refresh_detail_reserve_recheck");
bus.off("refresh_action_log");
bus.off("refresh_detail_relations");
_uploadImageProvider!.qiniuInfoSunModel?.token = null;
}
... ... @@ -889,6 +895,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
'uid': Provider.of<UserModel>(context, listen: false).user!.openid,
},
showCircle: showCicle);
couponType = couponTypes[int.parse(detailModel!.giveUser) - 1];
setState(() {});
}
///订座详情
... ... @@ -3404,43 +3413,60 @@ class NotebookDetailPageState extends State<NotebookDetailPage>
)
]),
// TitleAndBtn(
// title: "赠券对象",
// content: couponType,
// // list: personNumList,
// detailModel: model,
// callback: () {
// FocusScope.of(context)
// .requestFocus(
// FocusNode()); //隐藏键盘
// // 存储
TitleAndBtn(
title: "赠券对象",
content: couponType,
// list: personNumList,
detailModel: model,
callback: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //隐藏键盘
// 存储
DialogUtil.showSelectCusmanDialog(
context,
couponTypes,
title: '赠送优惠券给',
(value) async {
if (value != null) {
int couponSelectIndex =
value.first;
couponType = couponTypes[
couponSelectIndex];
// DialogUtil.showSelectCusmanDialog(
// context,
// couponTypes,
// title: '赠送优惠券给',
// (value) async {
// if (value != null) {
// int couponSelectIndex =
// value.first;
// couponType = couponTypes[
// couponSelectIndex];
setState(() {});
// setState(() {});
// }
// },
// selecteds: couponTypes
// .indexOf(
// couponType) ==
// -1
// ? []
// : [
// couponTypes
// .indexOf(
// couponType)
// ])
// .then((value) {});
// }),
print("确定");
await detailModel!
.upReserveInfo(
context,
widget.rid,
giveUser:
'${couponSelectIndex + 1}');
if (isback) {
Navigator.of(context)
.pop();
} else {
bus.emit(
"refresh_detail_relations");
}
}
},
selecteds: couponTypes
.indexOf(
couponType) ==
-1
? []
: [
couponTypes
.indexOf(
couponType)
])
.then((value) {});
}),
// ),
// Offstage(
... ...
... ... @@ -199,7 +199,7 @@ class InvicationPageState extends State<InvicationPage>
FocusNode moneyFocusNode = FocusNode();
bool cancelCan = true;
List<dynamic> couponTypes = ['仅预订人', '所有人', '被请客人', '不赠送']; //赠券对象
String couponType = '所有人';
String couponType = '';
@override
void initState() {
... ... @@ -549,6 +549,8 @@ class InvicationPageState extends State<InvicationPage>
},
showCircle: showCicle);
couponType = couponTypes[int.parse(detailModel.giveUser) - 1];
noticeSms = detailModel.isNotice;
if (detailModel.baseInfoSunModel != null) {
name = detailModel.baseInfoSunModel!.name;
... ... @@ -3095,64 +3097,70 @@ class InvicationPageState extends State<InvicationPage>
))
],
)),
// HEmptyView(20),
// Expanded(
// child: Row(
// // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.center,
// children: [
// Text("赠券对象:",
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28))),
// Expanded(
// child: InkWell(
// onTap: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //隐藏键盘
// // 存储
// DialogUtil.showSelectCusmanDialog(
// context, couponTypes,
// title: '赠送优惠券给', (value) async {
// if (value != null) {
// int couponSelectIndex = value.first;
// couponType =
// couponTypes[couponSelectIndex];
// setState(() {});
// }
// },
// selecteds: couponTypes
// .indexOf(couponType) ==
// -1
// ? []
// : [
// couponTypes
// .indexOf(couponType)
// ])
// .then((value) {});
// },
// child: Row(children: [
// Expanded(
// child: Text(
// couponType,
// textAlign: TextAlign.center,
// style: TextStyle(
// color: couponType == '请选择'
// ? MyColours.color_999999
// : MyColours.color_515151,
// fontSize: ScreenUtil().setSp(28),
// ),
// )),
// HEmptyView(10),
// Image.asset(Utils.getImgPath('quan_down_f'),
// width: ScreenUtil().setWidth(28),
// height: ScreenUtil().setWidth(28)),
// ]),
// ))
// ],
// ))
HEmptyView(20),
Expanded(
child: Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text("赠券对象:",
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
Expanded(
child: InkWell(
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// 存储
DialogUtil.showSelectCusmanDialog(
context, couponTypes,
title: '赠送优惠券给', (value) async {
if (value != null) {
int couponSelectIndex = value.first;
couponType =
couponTypes[couponSelectIndex];
setState(() {});
await detailModel.upReserveInfo(
context, widget.rid,
giveUser:
'${couponSelectIndex + 1}');
bus.emit("refresh_detail_relations");
}
},
selecteds: couponTypes
.indexOf(couponType) ==
-1
? []
: [
couponTypes
.indexOf(couponType)
])
.then((value) {});
},
child: Row(children: [
Expanded(
child: Text(
couponType,
textAlign: TextAlign.center,
style: TextStyle(
color: couponType == '请选择'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28),
),
)),
HEmptyView(10),
Image.asset(Utils.getImgPath('quan_down_f'),
width: ScreenUtil().setWidth(28),
height: ScreenUtil().setWidth(28)),
]),
))
],
))
],
)),
if (detailModel.isShowNoticeDeposit == '1')
... ...
... ... @@ -99,6 +99,8 @@ class NotebookDetailModel extends ChangeNotifier {
bool isNotice = false;
String? liteStyleTitle;
String giveUser = '2';
NotebookDetailModel() {
initSexList();
}
... ... @@ -213,6 +215,7 @@ class NotebookDetailModel extends ChangeNotifier {
data: params, showLoading: showCircle);
if (baseResp.code == Constant.status_success) {
if (baseResp.data is Map) {
giveUser = baseResp.data["give_user"]??'2';
liteStyleTitle = baseResp.data["lite_style_title"];
remarks = (baseResp.data['user_remark']).map<Remark>((value) {
return Remark.fromJson(value);
... ... @@ -350,7 +353,8 @@ class NotebookDetailModel extends ChangeNotifier {
/// 通过预订ID查收订金详情
Future<List<ReserveDepositSunModel>?> getReserveDepositByRid(
BuildContext context, Map<String, String> params,{bool showLoading=false}) async {
BuildContext context, Map<String, String> params,
{bool showLoading = false}) async {
try {
BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
context, Method.post, HttpUrl.get_reserve_deposit_by_rid,
... ... @@ -832,6 +836,7 @@ class NotebookDetailModel extends ChangeNotifier {
String? phone,
String? ymd,
String? reserveType,
String? giveUser,
bool showLoading = false,
bool needToast = true,
String? photoNote}) async {
... ... @@ -884,7 +889,9 @@ class NotebookDetailModel extends ChangeNotifier {
if (reserveType != null && reserveType != '') {
params['reserve_type'] = reserveType;
}
if (giveUser != null) {
params['give_user'] = giveUser;
}
bool sucess = await _upReserveInfo(context, params,
showLoading: showLoading, needToast: needToast);
if (sucess) {
... ... @@ -897,8 +904,7 @@ class NotebookDetailModel extends ChangeNotifier {
return false;
}
Future<bool> _upReserveInfo(
BuildContext context, Map<String, dynamic> params,
Future<bool> _upReserveInfo(BuildContext context, Map<String, dynamic> params,
{ifPush = true, showLoading = false, bool needToast = true}) async {
try {
BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>(
... ...