Showing
4 changed files
with
141 additions
and
101 deletions
| @@ -10,10 +10,10 @@ class Constant { | @@ -10,10 +10,10 @@ class Constant { | ||
| 10 | * | 10 | * |
| 11 | * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! | 11 | * 测试账号变更,已经删除0001 账户 代替为 0019!!!!!!!注意!!!!!!!!!!!!!! |
| 12 | * */ | 12 | * */ |
| 13 | - static const WXMiniProgramType wxMiniProgramType = | ||
| 14 | - WXMiniProgramType.release; //正式版 | ||
| 15 | // static const WXMiniProgramType wxMiniProgramType = | 13 | // static const WXMiniProgramType wxMiniProgramType = |
| 16 | - // WXMiniProgramType.preview; //体验版 | 14 | + // WXMiniProgramType.release; //正式版 |
| 15 | + static const WXMiniProgramType wxMiniProgramType = | ||
| 16 | + WXMiniProgramType.preview; //体验版 | ||
| 17 | // static const WXMiniProgramType wxMiniProgramType = | 17 | // static const WXMiniProgramType wxMiniProgramType = |
| 18 | // WXMiniProgramType.test; //开发版 | 18 | // WXMiniProgramType.test; //开发版 |
| 19 | 19 |
| @@ -274,6 +274,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | @@ -274,6 +274,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | ||
| 274 | bus.on("refresh_action_log", (args) { | 274 | bus.on("refresh_action_log", (args) { |
| 275 | _getReserveActionLog(); //获取变更记录 | 275 | _getReserveActionLog(); //获取变更记录 |
| 276 | }); | 276 | }); |
| 277 | + | ||
| 278 | + bus.on("refresh_detail_relations", (args) { | ||
| 279 | + // _getReserveDetail(isShowLoading: false); | ||
| 280 | + _getReserveDetailRelationData(showCicle: true); | ||
| 281 | + }); | ||
| 277 | }); | 282 | }); |
| 278 | } | 283 | } |
| 279 | 284 | ||
| @@ -854,6 +859,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | @@ -854,6 +859,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | ||
| 854 | bus.off("refresh_detail_deposit"); | 859 | bus.off("refresh_detail_deposit"); |
| 855 | bus.off("refresh_detail_reserve_recheck"); | 860 | bus.off("refresh_detail_reserve_recheck"); |
| 856 | bus.off("refresh_action_log"); | 861 | bus.off("refresh_action_log"); |
| 862 | + bus.off("refresh_detail_relations"); | ||
| 857 | _uploadImageProvider!.qiniuInfoSunModel?.token = null; | 863 | _uploadImageProvider!.qiniuInfoSunModel?.token = null; |
| 858 | } | 864 | } |
| 859 | 865 | ||
| @@ -889,6 +895,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | @@ -889,6 +895,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | ||
| 889 | 'uid': Provider.of<UserModel>(context, listen: false).user!.openid, | 895 | 'uid': Provider.of<UserModel>(context, listen: false).user!.openid, |
| 890 | }, | 896 | }, |
| 891 | showCircle: showCicle); | 897 | showCircle: showCicle); |
| 898 | + | ||
| 899 | + couponType = couponTypes[int.parse(detailModel!.giveUser) - 1]; | ||
| 900 | + setState(() {}); | ||
| 892 | } | 901 | } |
| 893 | 902 | ||
| 894 | ///订座详情 | 903 | ///订座详情 |
| @@ -3404,43 +3413,60 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | @@ -3404,43 +3413,60 @@ class NotebookDetailPageState extends State<NotebookDetailPage> | ||
| 3404 | ) | 3413 | ) |
| 3405 | ]), | 3414 | ]), |
| 3406 | 3415 | ||
| 3407 | - // TitleAndBtn( | ||
| 3408 | - // title: "赠券对象", | ||
| 3409 | - // content: couponType, | ||
| 3410 | - // // list: personNumList, | ||
| 3411 | - // detailModel: model, | ||
| 3412 | - // callback: () { | ||
| 3413 | - // FocusScope.of(context) | ||
| 3414 | - // .requestFocus( | ||
| 3415 | - // FocusNode()); //隐藏键盘 | ||
| 3416 | - // // 存储 | 3416 | + TitleAndBtn( |
| 3417 | + title: "赠券对象", | ||
| 3418 | + content: couponType, | ||
| 3419 | + // list: personNumList, | ||
| 3420 | + detailModel: model, | ||
| 3421 | + callback: () { | ||
| 3422 | + FocusScope.of(context) | ||
| 3423 | + .requestFocus( | ||
| 3424 | + FocusNode()); //隐藏键盘 | ||
| 3425 | + // 存储 | ||
| 3426 | + | ||
| 3427 | + DialogUtil.showSelectCusmanDialog( | ||
| 3428 | + context, | ||
| 3429 | + couponTypes, | ||
| 3430 | + title: '赠送优惠券给', | ||
| 3431 | + (value) async { | ||
| 3432 | + if (value != null) { | ||
| 3433 | + int couponSelectIndex = | ||
| 3434 | + value.first; | ||
| 3435 | + couponType = couponTypes[ | ||
| 3436 | + couponSelectIndex]; | ||
| 3417 | 3437 | ||
| 3418 | - // DialogUtil.showSelectCusmanDialog( | ||
| 3419 | - // context, | ||
| 3420 | - // couponTypes, | ||
| 3421 | - // title: '赠送优惠券给', | ||
| 3422 | - // (value) async { | ||
| 3423 | - // if (value != null) { | ||
| 3424 | - // int couponSelectIndex = | ||
| 3425 | - // value.first; | ||
| 3426 | - // couponType = couponTypes[ | ||
| 3427 | - // couponSelectIndex]; | 3438 | + setState(() {}); |
| 3428 | 3439 | ||
| 3429 | - // setState(() {}); | ||
| 3430 | - // } | ||
| 3431 | - // }, | ||
| 3432 | - // selecteds: couponTypes | ||
| 3433 | - // .indexOf( | ||
| 3434 | - // couponType) == | ||
| 3435 | - // -1 | ||
| 3436 | - // ? [] | ||
| 3437 | - // : [ | ||
| 3438 | - // couponTypes | ||
| 3439 | - // .indexOf( | ||
| 3440 | - // couponType) | ||
| 3441 | - // ]) | ||
| 3442 | - // .then((value) {}); | ||
| 3443 | - // }), | 3440 | + print("确定"); |
| 3441 | + | ||
| 3442 | + await detailModel! | ||
| 3443 | + .upReserveInfo( | ||
| 3444 | + context, | ||
| 3445 | + widget.rid, | ||
| 3446 | + giveUser: | ||
| 3447 | + '${couponSelectIndex + 1}'); | ||
| 3448 | + | ||
| 3449 | + if (isback) { | ||
| 3450 | + Navigator.of(context) | ||
| 3451 | + .pop(); | ||
| 3452 | + } else { | ||
| 3453 | + bus.emit( | ||
| 3454 | + "refresh_detail_relations"); | ||
| 3455 | + } | ||
| 3456 | + } | ||
| 3457 | + }, | ||
| 3458 | + selecteds: couponTypes | ||
| 3459 | + .indexOf( | ||
| 3460 | + couponType) == | ||
| 3461 | + -1 | ||
| 3462 | + ? [] | ||
| 3463 | + : [ | ||
| 3464 | + couponTypes | ||
| 3465 | + .indexOf( | ||
| 3466 | + couponType) | ||
| 3467 | + ]) | ||
| 3468 | + .then((value) {}); | ||
| 3469 | + }), | ||
| 3444 | 3470 | ||
| 3445 | // ), | 3471 | // ), |
| 3446 | // Offstage( | 3472 | // Offstage( |
| @@ -199,7 +199,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -199,7 +199,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 199 | FocusNode moneyFocusNode = FocusNode(); | 199 | FocusNode moneyFocusNode = FocusNode(); |
| 200 | bool cancelCan = true; | 200 | bool cancelCan = true; |
| 201 | List<dynamic> couponTypes = ['仅预订人', '所有人', '被请客人', '不赠送']; //赠券对象 | 201 | List<dynamic> couponTypes = ['仅预订人', '所有人', '被请客人', '不赠送']; //赠券对象 |
| 202 | - String couponType = '所有人'; | 202 | + String couponType = ''; |
| 203 | 203 | ||
| 204 | @override | 204 | @override |
| 205 | void initState() { | 205 | void initState() { |
| @@ -549,6 +549,8 @@ class InvicationPageState extends State<InvicationPage> | @@ -549,6 +549,8 @@ class InvicationPageState extends State<InvicationPage> | ||
| 549 | }, | 549 | }, |
| 550 | showCircle: showCicle); | 550 | showCircle: showCicle); |
| 551 | 551 | ||
| 552 | + couponType = couponTypes[int.parse(detailModel.giveUser) - 1]; | ||
| 553 | + | ||
| 552 | noticeSms = detailModel.isNotice; | 554 | noticeSms = detailModel.isNotice; |
| 553 | if (detailModel.baseInfoSunModel != null) { | 555 | if (detailModel.baseInfoSunModel != null) { |
| 554 | name = detailModel.baseInfoSunModel!.name; | 556 | name = detailModel.baseInfoSunModel!.name; |
| @@ -3095,64 +3097,70 @@ class InvicationPageState extends State<InvicationPage> | @@ -3095,64 +3097,70 @@ class InvicationPageState extends State<InvicationPage> | ||
| 3095 | )) | 3097 | )) |
| 3096 | ], | 3098 | ], |
| 3097 | )), | 3099 | )), |
| 3098 | - // HEmptyView(20), | ||
| 3099 | - // Expanded( | ||
| 3100 | - // child: Row( | ||
| 3101 | - // // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 3102 | - // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 3103 | - // children: [ | ||
| 3104 | - // Text("赠券对象:", | ||
| 3105 | - // style: TextStyle( | ||
| 3106 | - // color: MyColours.color_515151, | ||
| 3107 | - // fontSize: ScreenUtil().setSp(28))), | ||
| 3108 | - // Expanded( | ||
| 3109 | - // child: InkWell( | ||
| 3110 | - // onTap: () { | ||
| 3111 | - // FocusScope.of(context) | ||
| 3112 | - // .requestFocus(FocusNode()); //隐藏键盘 | ||
| 3113 | - // // 存储 | ||
| 3114 | - | ||
| 3115 | - // DialogUtil.showSelectCusmanDialog( | ||
| 3116 | - // context, couponTypes, | ||
| 3117 | - // title: '赠送优惠券给', (value) async { | ||
| 3118 | - // if (value != null) { | ||
| 3119 | - // int couponSelectIndex = value.first; | ||
| 3120 | - // couponType = | ||
| 3121 | - // couponTypes[couponSelectIndex]; | ||
| 3122 | - | ||
| 3123 | - // setState(() {}); | ||
| 3124 | - // } | ||
| 3125 | - // }, | ||
| 3126 | - // selecteds: couponTypes | ||
| 3127 | - // .indexOf(couponType) == | ||
| 3128 | - // -1 | ||
| 3129 | - // ? [] | ||
| 3130 | - // : [ | ||
| 3131 | - // couponTypes | ||
| 3132 | - // .indexOf(couponType) | ||
| 3133 | - // ]) | ||
| 3134 | - // .then((value) {}); | ||
| 3135 | - // }, | ||
| 3136 | - // child: Row(children: [ | ||
| 3137 | - // Expanded( | ||
| 3138 | - // child: Text( | ||
| 3139 | - // couponType, | ||
| 3140 | - // textAlign: TextAlign.center, | ||
| 3141 | - // style: TextStyle( | ||
| 3142 | - // color: couponType == '请选择' | ||
| 3143 | - // ? MyColours.color_999999 | ||
| 3144 | - // : MyColours.color_515151, | ||
| 3145 | - // fontSize: ScreenUtil().setSp(28), | ||
| 3146 | - // ), | ||
| 3147 | - // )), | ||
| 3148 | - // HEmptyView(10), | ||
| 3149 | - // Image.asset(Utils.getImgPath('quan_down_f'), | ||
| 3150 | - // width: ScreenUtil().setWidth(28), | ||
| 3151 | - // height: ScreenUtil().setWidth(28)), | ||
| 3152 | - // ]), | ||
| 3153 | - // )) | ||
| 3154 | - // ], | ||
| 3155 | - // )) | 3100 | + HEmptyView(20), |
| 3101 | + Expanded( | ||
| 3102 | + child: Row( | ||
| 3103 | + // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 3104 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 3105 | + children: [ | ||
| 3106 | + Text("赠券对象:", | ||
| 3107 | + style: TextStyle( | ||
| 3108 | + color: MyColours.color_515151, | ||
| 3109 | + fontSize: ScreenUtil().setSp(28))), | ||
| 3110 | + Expanded( | ||
| 3111 | + child: InkWell( | ||
| 3112 | + onTap: () { | ||
| 3113 | + FocusScope.of(context) | ||
| 3114 | + .requestFocus(FocusNode()); //隐藏键盘 | ||
| 3115 | + // 存储 | ||
| 3116 | + | ||
| 3117 | + DialogUtil.showSelectCusmanDialog( | ||
| 3118 | + context, couponTypes, | ||
| 3119 | + title: '赠送优惠券给', (value) async { | ||
| 3120 | + if (value != null) { | ||
| 3121 | + int couponSelectIndex = value.first; | ||
| 3122 | + couponType = | ||
| 3123 | + couponTypes[couponSelectIndex]; | ||
| 3124 | + | ||
| 3125 | + setState(() {}); | ||
| 3126 | + | ||
| 3127 | + await detailModel.upReserveInfo( | ||
| 3128 | + context, widget.rid, | ||
| 3129 | + giveUser: | ||
| 3130 | + '${couponSelectIndex + 1}'); | ||
| 3131 | + bus.emit("refresh_detail_relations"); | ||
| 3132 | + } | ||
| 3133 | + }, | ||
| 3134 | + selecteds: couponTypes | ||
| 3135 | + .indexOf(couponType) == | ||
| 3136 | + -1 | ||
| 3137 | + ? [] | ||
| 3138 | + : [ | ||
| 3139 | + couponTypes | ||
| 3140 | + .indexOf(couponType) | ||
| 3141 | + ]) | ||
| 3142 | + .then((value) {}); | ||
| 3143 | + }, | ||
| 3144 | + child: Row(children: [ | ||
| 3145 | + Expanded( | ||
| 3146 | + child: Text( | ||
| 3147 | + couponType, | ||
| 3148 | + textAlign: TextAlign.center, | ||
| 3149 | + style: TextStyle( | ||
| 3150 | + color: couponType == '请选择' | ||
| 3151 | + ? MyColours.color_999999 | ||
| 3152 | + : MyColours.color_515151, | ||
| 3153 | + fontSize: ScreenUtil().setSp(28), | ||
| 3154 | + ), | ||
| 3155 | + )), | ||
| 3156 | + HEmptyView(10), | ||
| 3157 | + Image.asset(Utils.getImgPath('quan_down_f'), | ||
| 3158 | + width: ScreenUtil().setWidth(28), | ||
| 3159 | + height: ScreenUtil().setWidth(28)), | ||
| 3160 | + ]), | ||
| 3161 | + )) | ||
| 3162 | + ], | ||
| 3163 | + )) | ||
| 3156 | ], | 3164 | ], |
| 3157 | )), | 3165 | )), |
| 3158 | if (detailModel.isShowNoticeDeposit == '1') | 3166 | if (detailModel.isShowNoticeDeposit == '1') |
| @@ -99,6 +99,8 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -99,6 +99,8 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 99 | bool isNotice = false; | 99 | bool isNotice = false; |
| 100 | String? liteStyleTitle; | 100 | String? liteStyleTitle; |
| 101 | 101 | ||
| 102 | + String giveUser = '2'; | ||
| 103 | + | ||
| 102 | NotebookDetailModel() { | 104 | NotebookDetailModel() { |
| 103 | initSexList(); | 105 | initSexList(); |
| 104 | } | 106 | } |
| @@ -213,6 +215,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -213,6 +215,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 213 | data: params, showLoading: showCircle); | 215 | data: params, showLoading: showCircle); |
| 214 | if (baseResp.code == Constant.status_success) { | 216 | if (baseResp.code == Constant.status_success) { |
| 215 | if (baseResp.data is Map) { | 217 | if (baseResp.data is Map) { |
| 218 | + giveUser = baseResp.data["give_user"]??'2'; | ||
| 216 | liteStyleTitle = baseResp.data["lite_style_title"]; | 219 | liteStyleTitle = baseResp.data["lite_style_title"]; |
| 217 | remarks = (baseResp.data['user_remark']).map<Remark>((value) { | 220 | remarks = (baseResp.data['user_remark']).map<Remark>((value) { |
| 218 | return Remark.fromJson(value); | 221 | return Remark.fromJson(value); |
| @@ -350,7 +353,8 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -350,7 +353,8 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 350 | 353 | ||
| 351 | /// 通过预订ID查收订金详情 | 354 | /// 通过预订ID查收订金详情 |
| 352 | Future<List<ReserveDepositSunModel>?> getReserveDepositByRid( | 355 | Future<List<ReserveDepositSunModel>?> getReserveDepositByRid( |
| 353 | - BuildContext context, Map<String, String> params,{bool showLoading=false}) async { | 356 | + BuildContext context, Map<String, String> params, |
| 357 | + {bool showLoading = false}) async { | ||
| 354 | try { | 358 | try { |
| 355 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( | 359 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( |
| 356 | context, Method.post, HttpUrl.get_reserve_deposit_by_rid, | 360 | context, Method.post, HttpUrl.get_reserve_deposit_by_rid, |
| @@ -832,6 +836,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -832,6 +836,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 832 | String? phone, | 836 | String? phone, |
| 833 | String? ymd, | 837 | String? ymd, |
| 834 | String? reserveType, | 838 | String? reserveType, |
| 839 | + String? giveUser, | ||
| 835 | bool showLoading = false, | 840 | bool showLoading = false, |
| 836 | bool needToast = true, | 841 | bool needToast = true, |
| 837 | String? photoNote}) async { | 842 | String? photoNote}) async { |
| @@ -884,7 +889,9 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -884,7 +889,9 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 884 | if (reserveType != null && reserveType != '') { | 889 | if (reserveType != null && reserveType != '') { |
| 885 | params['reserve_type'] = reserveType; | 890 | params['reserve_type'] = reserveType; |
| 886 | } | 891 | } |
| 887 | - | 892 | + if (giveUser != null) { |
| 893 | + params['give_user'] = giveUser; | ||
| 894 | + } | ||
| 888 | bool sucess = await _upReserveInfo(context, params, | 895 | bool sucess = await _upReserveInfo(context, params, |
| 889 | showLoading: showLoading, needToast: needToast); | 896 | showLoading: showLoading, needToast: needToast); |
| 890 | if (sucess) { | 897 | if (sucess) { |
| @@ -897,8 +904,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -897,8 +904,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 897 | return false; | 904 | return false; |
| 898 | } | 905 | } |
| 899 | 906 | ||
| 900 | - Future<bool> _upReserveInfo( | ||
| 901 | - BuildContext context, Map<String, dynamic> params, | 907 | + Future<bool> _upReserveInfo(BuildContext context, Map<String, dynamic> params, |
| 902 | {ifPush = true, showLoading = false, bool needToast = true}) async { | 908 | {ifPush = true, showLoading = false, bool needToast = true}) async { |
| 903 | try { | 909 | try { |
| 904 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( | 910 | BaseResp<dynamic> baseResp = await DioUtil().request<dynamic>( |
-
Please register or login to post a comment