|
|
|
|
|
|
|
// import 'dart:convert';
|
|
|
|
|
|
|
|
// import 'package:common_utils/common_utils.dart';
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
// import 'package:flutter/services.dart';
|
|
|
|
// import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
|
|
|
// import 'package:flutter_picker_plus/flutter_picker_plus.dart';
|
|
|
|
// import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
// import 'package:one_key/models/coupon_model.dart';
|
|
|
|
// import 'package:one_key/models/filter_btn_model.dart';
|
|
|
|
// import 'package:one_key/provider/user_model.dart';
|
|
|
|
// import 'package:one_key/route/navigator_util.dart';
|
|
|
|
// import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
// import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
// import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
// import '../../../../provider/marketing_center_provider.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/round_button.dart';
|
|
|
|
// import '../../../../widgets/v_empty_view.dart';
|
|
|
|
|
|
|
|
// /**
|
|
|
|
// *
|
|
|
|
// * 新建优惠券
|
|
|
|
// */
|
|
|
|
|
|
|
|
// class RechargeEditPage extends StatefulWidget {
|
|
|
|
// final String? idstr;
|
|
|
|
// RechargeEditPage({Key? key, this.idstr}) : super(key: key);
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// _RechargeEditPageState createState() => _RechargeEditPageState();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// class _RechargeEditPageState extends State<RechargeEditPage> {
|
|
|
|
// TextEditingController nameC = TextEditingController();
|
|
|
|
// TextEditingController priceminC = TextEditingController();
|
|
|
|
// TextEditingController givePriceC = TextEditingController(); //赠送金额
|
|
|
|
// TextEditingController giveScoreC = TextEditingController(); //积分
|
|
|
|
// TextEditingController remarkC = TextEditingController(); //备注
|
|
|
|
|
|
|
|
// FocusNode nameF = FocusNode();
|
|
|
|
// FocusNode priceminF = FocusNode();
|
|
|
|
// FocusNode givePricF = FocusNode();
|
|
|
|
// FocusNode giveScoreF = FocusNode();
|
|
|
|
// FocusNode remarkF = FocusNode();
|
|
|
|
// bool fixdate = true;
|
|
|
|
// bool weekly = false;
|
|
|
|
// bool birthday = false;
|
|
|
|
// final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
|
|
|
|
// bool showDateSelWidget = false;
|
|
|
|
// String fromDate = '点击设置开始日期'; //有效期开始时间
|
|
|
|
// String endDate = '点击设置结束日期'; //有效期结束时间
|
|
|
|
|
|
|
|
// List<FilterBtnModel>? weekData = [];
|
|
|
|
|
|
|
|
// String weekShow = '点击设置可用日期';
|
|
|
|
// bool canUse = true;
|
|
|
|
// List<dynamic>? coupons = [];
|
|
|
|
|
|
|
|
// List<dynamic>? selectIDs = [];
|
|
|
|
|
|
|
|
// bool givePriceSwich = false;
|
|
|
|
// bool giveScoreSwich = false;
|
|
|
|
// bool giveCouponsSwich = false;
|
|
|
|
|
|
|
|
// List<CouponSunModel>? couponsData = [];
|
|
|
|
|
|
|
|
// MarketingCenterProvider? marketingCenterProvider;
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// void initState() {
|
|
|
|
// super.initState();
|
|
|
|
|
|
|
|
// _initWeekData();
|
|
|
|
|
|
|
|
// nameF.addListener(() {
|
|
|
|
// if (nameF.hasFocus) {
|
|
|
|
// //有焦点
|
|
|
|
// if (showDateSelWidget) {
|
|
|
|
// if (Navigator.canPop(context)) {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //失去焦点
|
|
|
|
// // _editingController.text = '';
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// priceminF.addListener(() {
|
|
|
|
// if (priceminF.hasFocus) {
|
|
|
|
// //有焦点
|
|
|
|
// if (showDateSelWidget) {
|
|
|
|
// if (Navigator.canPop(context)) {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //失去焦点
|
|
|
|
// // _editingController.text = '';
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// givePricF.addListener(() {
|
|
|
|
// if (givePricF.hasFocus) {
|
|
|
|
// //有焦点
|
|
|
|
// if (showDateSelWidget) {
|
|
|
|
// if (Navigator.canPop(context)) {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //失去焦点
|
|
|
|
// // _editingController.text = '';
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// giveScoreF.addListener(() {
|
|
|
|
// if (giveScoreF.hasFocus) {
|
|
|
|
// //有焦点
|
|
|
|
// if (showDateSelWidget) {
|
|
|
|
// if (Navigator.canPop(context)) {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //失去焦点
|
|
|
|
// // _editingController.text = '';
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// remarkF.addListener(() {
|
|
|
|
// if (remarkF.hasFocus) {
|
|
|
|
// //有焦点
|
|
|
|
// if (showDateSelWidget) {
|
|
|
|
// if (Navigator.canPop(context)) {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //失去焦点
|
|
|
|
// // _editingController.text = '';
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
// _getNewRechargeDetail();
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// _getNewRechargeDetail() async {
|
|
|
|
// bool success = await marketingCenterProvider!.getNewRechargeDetail(
|
|
|
|
// context, widget.idstr);
|
|
|
|
// if (success) {
|
|
|
|
// //请求成功
|
|
|
|
// nameC.text = marketingCenterProvider!.rechargeDetail!.rname??"";
|
|
|
|
// priceminC.text = marketingCenterProvider!.rechargeDetail!.rechargeMoney??"";
|
|
|
|
// givePriceSwich =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.isPrice == '1'
|
|
|
|
// ? true
|
|
|
|
// : false;
|
|
|
|
// givePriceC.text =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.price!;
|
|
|
|
// giveScoreSwich =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.isScore == '1'
|
|
|
|
// ? true
|
|
|
|
// : false;
|
|
|
|
// giveScoreC.text =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.score!;
|
|
|
|
// giveCouponsSwich =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.isCoupons == '1'
|
|
|
|
// ? true
|
|
|
|
// : false;
|
|
|
|
// selectIDs =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsIds;
|
|
|
|
|
|
|
|
// couponsData = marketingCenterProvider!.rechargeDetail!.rechargeList!.coupons;
|
|
|
|
// coupons =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.rechargeList!.couponsNames;
|
|
|
|
// fixdate = marketingCenterProvider!.rechargeDetail!.expDate!.isFix == '1'
|
|
|
|
// ? true
|
|
|
|
// : false;
|
|
|
|
// // if (marketingCenterProvider.rechargeDetail.expDate.fixSdate != '') {
|
|
|
|
// fromDate = marketingCenterProvider!.rechargeDetail!.stimeStr;
|
|
|
|
// // }
|
|
|
|
// // if (marketingCenterProvider.rechargeDetail.expDate.fixEdate != '') {
|
|
|
|
// endDate = marketingCenterProvider!.rechargeDetail!.etimeStr;
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// weekly = marketingCenterProvider!.rechargeDetail!.expDate!.isWeek == '1'
|
|
|
|
// ? true
|
|
|
|
// : false;
|
|
|
|
// if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow != '') {
|
|
|
|
// weekShow = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateShow!;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData!.length >
|
|
|
|
// 0) {
|
|
|
|
// weekData = marketingCenterProvider!.rechargeDetail!.expDate!.weekDateData;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// birthday =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.expDate!.isBirthday == '1'
|
|
|
|
// ? true
|
|
|
|
// : false;
|
|
|
|
|
|
|
|
// remarkC.text = marketingCenterProvider!.rechargeDetail!.explain??"";
|
|
|
|
// canUse =
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.isOpen == '1' ? true : false;
|
|
|
|
// setState(() {});
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// _initWeekData() {
|
|
|
|
// FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
// filterBtnModel.select = false;
|
|
|
|
// filterBtnModel.title = '周日';
|
|
|
|
// weekData!.add(filterBtnModel);
|
|
|
|
// for (int i = 1; i < 7; i++) {
|
|
|
|
// FilterBtnModel filterBtnModel = FilterBtnModel();
|
|
|
|
// filterBtnModel.select = false;
|
|
|
|
// filterBtnModel.title = '周${Utils.formatWeekDayNum(i)}';
|
|
|
|
// weekData!.add(filterBtnModel);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ///输入框
|
|
|
|
// Widget _textfield(String title, String hintText,
|
|
|
|
// TextEditingController controller, FocusNode node,
|
|
|
|
// {TextInputType textInputStyle = TextInputType.text}) {
|
|
|
|
// return Container(
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(80),
|
|
|
|
// Expanded(
|
|
|
|
// child: TextField(
|
|
|
|
// controller: controller,
|
|
|
|
// focusNode: node,
|
|
|
|
// textAlign: TextAlign.right,
|
|
|
|
// textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
// maxLines: 1,
|
|
|
|
// // //光标颜色
|
|
|
|
// // cursorColor:
|
|
|
|
// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
// //输入文本的样式
|
|
|
|
|
|
|
|
// inputFormatters:
|
|
|
|
// title == '活动名称' ? [LengthLimitingTextInputFormatter(15)] : [],
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
// hintText: hintText,
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// onEditingComplete: () {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// },
|
|
|
|
// keyboardType: textInputStyle,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(32)
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ///时间选择
|
|
|
|
// Widget _selectTime(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: onTap,
|
|
|
|
// child: Container(
|
|
|
|
// // padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
// child: Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// // height: ScreenUtil().setWidth(40),
|
|
|
|
// // color: Colors.red,
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: title == '点击设置可用日期'
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(20),
|
|
|
|
// Spacer(),
|
|
|
|
// Text(hintText,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
|
|
|
|
// ? MyColours.color_438E93
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// )),
|
|
|
|
// HEmptyView(20),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath('arrow_right_new'),
|
|
|
|
// width: ScreenUtil().setWidth(20),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(32),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ///时间选择
|
|
|
|
// Widget _select(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: onTap,
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.only(left: ScreenUtil().setWidth(32)),
|
|
|
|
// child: Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// // height: ScreenUtil().setWidth(40),
|
|
|
|
// // color: Colors.red,
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: title == '点击设置可用日期'
|
|
|
|
// ? MyColours.color_999999
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(20),
|
|
|
|
// Spacer(),
|
|
|
|
// Text(hintText,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: hintText == '点击设置开始日期' || hintText == '点击设置结束日期'
|
|
|
|
// ? MyColours.color_999999
|
|
|
|
// : MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// )),
|
|
|
|
// HEmptyView(20),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath('arrow_right_new'),
|
|
|
|
// width: ScreenUtil().setWidth(18),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(32),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ///券说明
|
|
|
|
// Widget _explain(String title, String hintText,
|
|
|
|
// TextEditingController controller, FocusNode node) {
|
|
|
|
// return Container(
|
|
|
|
// // height: ScreenUtil().setWidth(380),
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
// child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// Align(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// textAlign: TextAlign.left,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// )),
|
|
|
|
// VEmptyView(26),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// TextField(
|
|
|
|
// controller: controller,
|
|
|
|
// focusNode: node,
|
|
|
|
// // keyboardType: TextInputType.numberWithOptions(decimal: true), //键盘类型,数字键盘
|
|
|
|
// maxLines: 3,
|
|
|
|
// maxLength: 150,
|
|
|
|
|
|
|
|
// // maxLengthEnforced: true,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// color: MyColours.color_333333), //输入文本的样式
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(30)),
|
|
|
|
// hintText: hintText,
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
|
|
|
|
// // fillColor: MyColours.color_F9F9F9,
|
|
|
|
// // // fillColor: Colors.red,
|
|
|
|
// // filled: true,
|
|
|
|
// // enabledBorder: OutlineInputBorder(
|
|
|
|
// // //未选中时候的颜色
|
|
|
|
// // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// // borderSide: BorderSide(
|
|
|
|
// // color: MyColours.color_cccccc,
|
|
|
|
// // width: ScreenUtil().setWidth(2)),
|
|
|
|
// // ),
|
|
|
|
// // focusedBorder: OutlineInputBorder(
|
|
|
|
// // //选中时外边框颜色
|
|
|
|
// // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// // borderSide: BorderSide(
|
|
|
|
// // color: MyColours.app_main,
|
|
|
|
// // ),
|
|
|
|
// // ),
|
|
|
|
// // border: OutlineInputBorder(
|
|
|
|
// // borderRadius:
|
|
|
|
// // BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// // borderSide: BorderSide(
|
|
|
|
// // color: Colors.red, width: ScreenUtil().setWidth(2))),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// _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: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ]));
|
|
|
|
// }
|
|
|
|
|
|
|
|
// ///是否立即启用
|
|
|
|
// Widget _canUse(String title, bool swich, GestureTapCallback onTap) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: onTap,
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
|
|
|
|
// margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)),
|
|
|
|
// child: Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Container(
|
|
|
|
// // height: ScreenUtil().setWidth(40),
|
|
|
|
// // color: Colors.red,
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Spacer(),
|
|
|
|
// Image.asset(
|
|
|
|
// swich
|
|
|
|
// ? Utils.getImgPath('swich_on')
|
|
|
|
// : Utils.getImgPath('swich_off'),
|
|
|
|
// width: ScreenUtil().setWidth(44 * 2),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
// marketingCenterProvider =
|
|
|
|
// Provider.of<MarketingCenterProvider>(context, listen: true);
|
|
|
|
// return KeyboardDismissOnTap(
|
|
|
|
// child: Scaffold(
|
|
|
|
// key: scaffoldKey,
|
|
|
|
// backgroundColor: MyColours.color_ffffff,
|
|
|
|
// appBar: SystemAppBar(
|
|
|
|
// '充值优惠详情',
|
|
|
|
// rightImgName: marketingCenterProvider != null &&
|
|
|
|
// marketingCenterProvider!.rechargeDetail != null &&
|
|
|
|
// widget.idstr != null &&
|
|
|
|
// widget.idstr != 'null' &&
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.isOpen == '1'
|
|
|
|
// ? 'share.png'
|
|
|
|
// : '',
|
|
|
|
// onTapRight: () {
|
|
|
|
// if (widget.idstr != null &&
|
|
|
|
// widget.idstr != 'null' &&
|
|
|
|
// marketingCenterProvider!.rechargeDetail!.isOpen == '1') {
|
|
|
|
// Utils.goShareBuyRechargeToWeChat(
|
|
|
|
// context, widget.idstr, marketingCenterProvider!.rechargeDetail!);
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// body: Column(
|
|
|
|
// children: [
|
|
|
|
// Expanded(
|
|
|
|
// child: SingleChildScrollView(
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(left: w(32)),
|
|
|
|
// child: Column(
|
|
|
|
// children: [
|
|
|
|
// _textfield('活动名称', '点击输入活动名称', nameC, nameF),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _textfield('充值满', '点击输入充值金额门槛', priceminC, priceminF,
|
|
|
|
// textInputStyle:
|
|
|
|
// TextInputType.numberWithOptions(decimal: true)),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(48),
|
|
|
|
// Container(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// child: Text(
|
|
|
|
// '优惠活动',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(26),
|
|
|
|
// Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// Row(
|
|
|
|
// children: [
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// givePriceSwich = !givePriceSwich;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(16),
|
|
|
|
// right: w(8),
|
|
|
|
// ),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(givePriceSwich
|
|
|
|
// ? 'f_select'
|
|
|
|
// : 'f_select_not'),
|
|
|
|
// width: w(20),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Text(
|
|
|
|
// '赠送',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(16),
|
|
|
|
// Container(
|
|
|
|
// width: w(140),
|
|
|
|
// height: w(28),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// border: Border.all(
|
|
|
|
// width: w(1),
|
|
|
|
// color: MyColours.color_DBDBDB)),
|
|
|
|
// child: TextField(
|
|
|
|
// controller: givePriceC,
|
|
|
|
// focusNode: givePricF,
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
// maxLines: 1,
|
|
|
|
|
|
|
|
// // //光标颜色
|
|
|
|
// // cursorColor:
|
|
|
|
// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
// //输入文本的样式
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none),
|
|
|
|
// hintText: '',
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// contentPadding: EdgeInsets.zero,
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// onEditingComplete: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// },
|
|
|
|
// keyboardType: TextInputType.numberWithOptions(
|
|
|
|
// decimal: true),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(16),
|
|
|
|
// Text(
|
|
|
|
// '元余额',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// VEmptyView(20),
|
|
|
|
// Row(
|
|
|
|
// children: [
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// giveScoreSwich = !giveScoreSwich;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(16),
|
|
|
|
// right: w(8),
|
|
|
|
// ),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(giveScoreSwich
|
|
|
|
// ? 'f_select'
|
|
|
|
// : 'f_select_not'),
|
|
|
|
// width: w(20),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Text(
|
|
|
|
// '赠送',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(16),
|
|
|
|
// Container(
|
|
|
|
// width: w(140),
|
|
|
|
// height: w(28),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// border: Border.all(
|
|
|
|
// width: w(1),
|
|
|
|
// color: MyColours.color_DBDBDB)),
|
|
|
|
// child: TextField(
|
|
|
|
// controller: giveScoreC,
|
|
|
|
// focusNode: giveScoreF,
|
|
|
|
// textAlign: TextAlign.center,
|
|
|
|
// // textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
// maxLines: 1,
|
|
|
|
|
|
|
|
// // //光标颜色
|
|
|
|
// // cursorColor:
|
|
|
|
// // widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
// //输入文本的样式
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
// // focusNode: title == '券名称' ? _nameFocusNode : _requireFocusNode,
|
|
|
|
// decoration: InputDecoration(
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none),
|
|
|
|
// hintText: '',
|
|
|
|
// hintStyle: TextStyle(
|
|
|
|
// color: MyColours.color_999999,
|
|
|
|
// fontSize: ScreenUtil().setSp(32),
|
|
|
|
// ),
|
|
|
|
// enabledBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// contentPadding: EdgeInsets.zero,
|
|
|
|
// focusedBorder: new UnderlineInputBorder(
|
|
|
|
// borderSide: BorderSide.none,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onChanged: (value) {},
|
|
|
|
// onEditingComplete: () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// },
|
|
|
|
// keyboardType: TextInputType.numberWithOptions(
|
|
|
|
// decimal: true),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(16),
|
|
|
|
// Text(
|
|
|
|
// '积分',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// VEmptyView(20),
|
|
|
|
// Row(
|
|
|
|
// children: [
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// setState(() {
|
|
|
|
// giveCouponsSwich = !giveCouponsSwich;
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(16),
|
|
|
|
// right: w(8),
|
|
|
|
// ),
|
|
|
|
// child: Image.asset(
|
|
|
|
// Utils.getImgPath(giveCouponsSwich
|
|
|
|
// ? 'f_select'
|
|
|
|
// : 'f_select_not'),
|
|
|
|
// width: w(20),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Text(
|
|
|
|
// '赠送优惠券',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// HEmptyView(60),
|
|
|
|
// if (giveCouponsSwich)
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () async {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode());
|
|
|
|
// Map? object = await NavigatorUtil
|
|
|
|
// .goRechargeSelectStoreCouponPage(
|
|
|
|
// context, selectIDs!.join(',')) ;
|
|
|
|
// print(object);
|
|
|
|
// if (object != null &&
|
|
|
|
// object['couponsid'] != null) {
|
|
|
|
// List<CouponSunModel> data =
|
|
|
|
// object['couponsdata'];
|
|
|
|
|
|
|
|
// couponsData = [];
|
|
|
|
// //
|
|
|
|
// selectIDs = object['couponsid'];
|
|
|
|
// coupons = [];
|
|
|
|
// data.forEach((element) {
|
|
|
|
// if (element.isCheck) {
|
|
|
|
// coupons!.add(element.aname);
|
|
|
|
// couponsData!.add(element);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// setState(() {});
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// child: Text(
|
|
|
|
// '选择优惠券',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_438E93,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// )),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// if (giveCouponsSwich) VEmptyView(20),
|
|
|
|
// if (giveCouponsSwich)
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(45),
|
|
|
|
// right: w(8),
|
|
|
|
// ),
|
|
|
|
// child: Wrap(
|
|
|
|
// spacing: w(9),
|
|
|
|
// runSpacing: w(9),
|
|
|
|
// alignment: WrapAlignment.start,
|
|
|
|
// runAlignment: WrapAlignment.start,
|
|
|
|
// children: coupons!.map((e) {
|
|
|
|
// return Text(
|
|
|
|
// e,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// );
|
|
|
|
// }).toList())),
|
|
|
|
// VEmptyView(20),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(48),
|
|
|
|
// Container(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// child: Text(
|
|
|
|
// '使用限制:',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// Row(
|
|
|
|
// children: [
|
|
|
|
// HEmptyView(30),
|
|
|
|
// _itemRadioWidget(fixdate, '无', onTap: () {
|
|
|
|
// if (!fixdate) {
|
|
|
|
// setState(() {
|
|
|
|
// fixdate = true;
|
|
|
|
// weekly = false;
|
|
|
|
// birthday = false;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }),
|
|
|
|
// Spacer(),
|
|
|
|
// _itemRadioWidget(weekly, '每周', onTap: () {
|
|
|
|
// if (!weekly) {
|
|
|
|
// setState(() {
|
|
|
|
// weekly = true;
|
|
|
|
// fixdate = false;
|
|
|
|
// birthday = false;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }),
|
|
|
|
// Spacer(),
|
|
|
|
// _itemRadioWidget(birthday, '会员生日当天', onTap: () {
|
|
|
|
// if (!birthday) {
|
|
|
|
// setState(() {
|
|
|
|
// birthday = true;
|
|
|
|
// weekly = false;
|
|
|
|
// fixdate = false;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// }),
|
|
|
|
// HEmptyView(30),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// birthday ? SizedBox() : VEmptyView(24),
|
|
|
|
// // fixdate
|
|
|
|
// // ? Column(
|
|
|
|
// // children: [
|
|
|
|
// // _select('有效期从', fromDate, () {
|
|
|
|
// // FocusScope.of(context)
|
|
|
|
// // .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// // //弹出时间选择器
|
|
|
|
// // // showPickerDateTime(context);
|
|
|
|
// // showDateSelWidget = true;
|
|
|
|
// // DialogUtil.showPickerDateTime24(
|
|
|
|
// // context,
|
|
|
|
// // scaffoldKey,
|
|
|
|
// // (value) {
|
|
|
|
// // // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
// // if (value != null) {
|
|
|
|
// // setState(() {
|
|
|
|
// // print(value);
|
|
|
|
// // fromDate = DateUtil.formatDateStr(
|
|
|
|
// // value,
|
|
|
|
// // format: DateFormats.y_mo_d);
|
|
|
|
// // });
|
|
|
|
// // }
|
|
|
|
// // showDateSelWidget = false;
|
|
|
|
// // },
|
|
|
|
// // dateTime: DateUtil.getDateTime(fromDate),
|
|
|
|
// // pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
// // onCancel: () {
|
|
|
|
// // showDateSelWidget = false;
|
|
|
|
// // });
|
|
|
|
// // }),
|
|
|
|
// // VEmptyView(24),
|
|
|
|
// // _select('有效期至', endDate, () {
|
|
|
|
// // FocusScope.of(context)
|
|
|
|
// // .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// // //弹出时间选择器
|
|
|
|
// // // showPickerDateTime(context);
|
|
|
|
// // showDateSelWidget = true;
|
|
|
|
// // DialogUtil.showPickerDateTime24(
|
|
|
|
// // context,
|
|
|
|
// // scaffoldKey,
|
|
|
|
// // (value) {
|
|
|
|
// // // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
// // if (value != null) {
|
|
|
|
// // setState(() {
|
|
|
|
// // print(value);
|
|
|
|
// // endDate = DateUtil.formatDateStr(
|
|
|
|
// // value,
|
|
|
|
// // format: DateFormats.y_mo_d);
|
|
|
|
// // });
|
|
|
|
// // }
|
|
|
|
// // showDateSelWidget = false;
|
|
|
|
// // },
|
|
|
|
// // dateTime: DateUtil.getDateTime(endDate),
|
|
|
|
// // pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
// // onCancel: () {
|
|
|
|
// // showDateSelWidget = false;
|
|
|
|
// // });
|
|
|
|
// // })
|
|
|
|
// // ],
|
|
|
|
// // )
|
|
|
|
// // : SizedBox(),
|
|
|
|
// weekly
|
|
|
|
// ? _select(weekShow, '', () async {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// //弹出时间选择器
|
|
|
|
// // showPickerDateTime(context);
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
|
|
|
|
// List<FilterBtnModel> data =
|
|
|
|
// await DialogUtil.openWeekSelectModalBottomSheet(
|
|
|
|
// context, weekData!);
|
|
|
|
// if (data != null) {
|
|
|
|
// //改变了
|
|
|
|
// weekData = [];
|
|
|
|
// weekData!.addAll(data);
|
|
|
|
// weekShow = '';
|
|
|
|
|
|
|
|
// weekData!.forEach((element) {
|
|
|
|
// if (element.select!) {
|
|
|
|
// weekShow += '${element.title} ';
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// if (weekShow.endsWith(' ')) {
|
|
|
|
// weekShow =
|
|
|
|
// weekShow.substring(0, weekShow.length - 1);
|
|
|
|
// }
|
|
|
|
// if (weekShow == '') {
|
|
|
|
// weekShow = '点击设置可用日期';
|
|
|
|
// }
|
|
|
|
|
|
|
|
// setState(() {});
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// : SizedBox(),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(48),
|
|
|
|
// Container(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// child: Text(
|
|
|
|
// '有效期:',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_515151,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _selectTime('有效期从', fromDate, () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// //弹出时间选择器
|
|
|
|
// // showPickerDateTime(context);
|
|
|
|
// showDateSelWidget = true;
|
|
|
|
// DialogUtil.showPickerDateTime24(
|
|
|
|
// context,
|
|
|
|
// scaffoldKey,
|
|
|
|
// (value) {
|
|
|
|
// // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
// if (value != null) {
|
|
|
|
// setState(() {
|
|
|
|
// print(value);
|
|
|
|
// fromDate = DateUtil.formatDateStr(value,
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// },
|
|
|
|
// dateTime:fromDate == '点击设置开始日期' ? null: DateUtil.getDateTime(fromDate),
|
|
|
|
// pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
// onCancel: () {
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// });
|
|
|
|
// }),
|
|
|
|
// // Container(
|
|
|
|
// // height: ScreenUtil().setWidth(2),
|
|
|
|
// // color: MyColours.color_E7E7E7,
|
|
|
|
// // ),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// _selectTime('有效期至', endDate, () {
|
|
|
|
// FocusScope.of(context)
|
|
|
|
// .requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// //弹出时间选择器
|
|
|
|
// // showPickerDateTime(context);
|
|
|
|
// showDateSelWidget = true;
|
|
|
|
// DialogUtil.showPickerDateTime24(
|
|
|
|
// context,
|
|
|
|
// scaffoldKey,
|
|
|
|
// (value) {
|
|
|
|
// // {'text': picker.adapter.text, 'select': selecteds}
|
|
|
|
// if (value != null) {
|
|
|
|
// setState(() {
|
|
|
|
// print(value);
|
|
|
|
// endDate = DateUtil.formatDateStr(value,
|
|
|
|
// format: DateFormats.y_mo_d);
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// },
|
|
|
|
// dateTime:endDate =='点击设置结束日期'?null: DateUtil.getDateTime(endDate),
|
|
|
|
// pickerDateTimeType: PickerDateTimeType.kYMD,
|
|
|
|
// onCancel: () {
|
|
|
|
// showDateSelWidget = false;
|
|
|
|
// });
|
|
|
|
// }),
|
|
|
|
// VEmptyView(24),
|
|
|
|
// MyDivider(
|
|
|
|
// double.infinity,
|
|
|
|
// w(1),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
// VEmptyView(48),
|
|
|
|
// _explain('备注', '请输入备注信息', remarkC, remarkF),
|
|
|
|
// VEmptyView(72),
|
|
|
|
// _canUse('立即启用', canUse, () {
|
|
|
|
// setState(() {
|
|
|
|
// canUse = !canUse;
|
|
|
|
// });
|
|
|
|
// })
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// )),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(91 * 2),
|
|
|
|
// width: double.infinity,
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// top: ScreenUtil().setWidth(16 * 2),
|
|
|
|
// bottom: ScreenUtil().setWidth(35 * 2),
|
|
|
|
// left: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// right: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// ),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// boxShadow: [
|
|
|
|
// BoxShadow(
|
|
|
|
// spreadRadius: ScreenUtil().setWidth(2),
|
|
|
|
// color: Color.fromRGBO(0, 0, 0, 0.1),
|
|
|
|
// offset: Offset(0, ScreenUtil().setWidth(-2)),
|
|
|
|
// blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
// ],
|
|
|
|
// borderRadius: BorderRadius.all(
|
|
|
|
// Radius.circular(ScreenUtil().setWidth(16)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// child: RoundButton(
|
|
|
|
// text: '保存',
|
|
|
|
// height: ScreenUtil().setWidth(80),
|
|
|
|
// radius: ScreenUtil().setWidth(14),
|
|
|
|
// isBold: false,
|
|
|
|
// fontSize: 28,
|
|
|
|
// onPressed: () async {
|
|
|
|
// if (nameC.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请输入活动名称!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (priceminC.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请输入充值门槛金额!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (!Utils.isNumeric(priceminC.text.trim())) {
|
|
|
|
// Utils.showToast('充值门槛金额请输入数字!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (double.parse(priceminC.text.trim()) <= 0) {
|
|
|
|
// Utils.showToast('充值门槛金额需大于0!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// //优惠活动
|
|
|
|
// if (!giveScoreSwich && !givePriceSwich && !giveCouponsSwich) {
|
|
|
|
// Utils.showToast('请选择优惠活动!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (givePriceSwich && givePriceC.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请输入赠送金额!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (giveScoreSwich && giveScoreC.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请输入赠送积分!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (giveCouponsSwich && couponsData!.length == 0) {
|
|
|
|
// Utils.showToast('请选择赠送的优惠券!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //有效期
|
|
|
|
// if (!fixdate && !weekly && !birthday) {
|
|
|
|
// Utils.showToast('请选择有效期!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // if (fixdate) {
|
|
|
|
// //固定时间段
|
|
|
|
|
|
|
|
// if (fromDate == '点击设置开始日期') {
|
|
|
|
// Utils.showToast('请设置有效期的开始日期!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (endDate == '点击设置结束日期') {
|
|
|
|
// Utils.showToast('请设置有效期的结束日期!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (DateUtil.getDateTime(endDate)
|
|
|
|
// .compareTo(DateUtil.getDateTime(fromDate)) <
|
|
|
|
// 0) {
|
|
|
|
// Utils.showToast('有效期结束日期不能早于开始日期!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// if (weekly && weekShow == '点击设置可用日期') {
|
|
|
|
// Utils.showToast('请设置可用日期!');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// String from = fromDate + ' 00:00:00';
|
|
|
|
// String end = endDate + ' 23:59:59';
|
|
|
|
// String stime = fromDate == '点击设置开始日期'
|
|
|
|
// ? ""
|
|
|
|
// : '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}';
|
|
|
|
// String etime = endDate == '点击设置结束日期'
|
|
|
|
// ? ''
|
|
|
|
// : '${(DateUtil.getDateMsByTimeStr(end)! / 1000).floor()}';
|
|
|
|
|
|
|
|
// Map discounts = {
|
|
|
|
// 'is_price': givePriceSwich ? '1' : '0', //优惠活动,赠送金额
|
|
|
|
// 'is_score': giveScoreSwich ? '1' : '0', //赠送积分
|
|
|
|
// 'is_coupons': giveCouponsSwich ? '1' : '0', //赠送优惠券
|
|
|
|
// 'price': givePriceC.text,
|
|
|
|
// 'score': giveScoreC.text,
|
|
|
|
// 'coupons': couponsData,
|
|
|
|
// 'coupons_ids': selectIDs,
|
|
|
|
// 'coupons_names': coupons
|
|
|
|
// };
|
|
|
|
|
|
|
|
// String discountsStr = json.encode(discounts);
|
|
|
|
// print(discountsStr);
|
|
|
|
|
|
|
|
// Map date = {
|
|
|
|
// 'is_fix': fixdate ? '1' : '0',
|
|
|
|
// 'is_week': weekly ? '1' : '0',
|
|
|
|
// 'is_birthday': birthday ? '1' : '0',
|
|
|
|
// // 'fix_sdate': fixdate ? fromDate : '', // 开始时间
|
|
|
|
// // 'fix_edate': fixdate ? endDate : '', //结束时间
|
|
|
|
// 'week_date_show': weekly ? weekShow : '',
|
|
|
|
// 'week_date_data': weekly ? weekData : ''
|
|
|
|
// };
|
|
|
|
|
|
|
|
// String dateStr = json.encode(date);
|
|
|
|
// print(dateStr);
|
|
|
|
// Map<String, String?> pramas = {
|
|
|
|
// 'sellerid': Provider.of<UserModel>(context, listen: false)
|
|
|
|
// .user!
|
|
|
|
// .sellerid,
|
|
|
|
// 'uid': Provider.of<UserModel>(context, listen: false)
|
|
|
|
// .user!
|
|
|
|
// .openid,
|
|
|
|
// 'rname': nameC.text,
|
|
|
|
// 'recharge_money': priceminC.text,
|
|
|
|
// 'recharge_list': discountsStr,
|
|
|
|
// 'exp_date': dateStr,
|
|
|
|
// 'explain': remarkC.text,
|
|
|
|
// 'is_open': canUse ? '1' : '0',
|
|
|
|
// 'stime': stime,
|
|
|
|
// 'etime': etime
|
|
|
|
// };
|
|
|
|
// if (widget.idstr != null && widget.idstr != 'null') {
|
|
|
|
// pramas['id'] = widget.idstr;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// bool success = await marketingCenterProvider!.createNewRecharge(
|
|
|
|
// context, pramas);
|
|
|
|
|
|
|
|
// if (success) {
|
|
|
|
// //成功后返回前面列表
|
|
|
|
// if (Navigator.canPop(context)) {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// }
|
|
|
|
// //刷新列表
|
|
|
|
// bus.emit('refresh_marketting_page_recharge');
|
|
|
|
// bus.emit('refresh_recharge_home');
|
|
|
|
// }
|
|
|
|
|
|
|
|
// // "stime": fromDate == '点击选择'
|
|
|
|
// // ? ""
|
|
|
|
// // : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}',
|
|
|
|
// // "etime": endDate == '点击选择'
|
|
|
|
// // ? ''
|
|
|
|
// // : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}',
|
|
|
|
// // UserModel userModel =
|
|
|
|
// // Provider.of<UserModel>(context, listen: false);
|
|
|
|
// // if (userModel.user.role_name == '管理员' ||
|
|
|
|
// // userModel.user.role_name == '店长') {
|
|
|
|
// // NavigatorUtil.goRechargeEditPage(context);
|
|
|
|
// // } else {
|
|
|
|
// // bool needRefresh =
|
|
|
|
// // await NavigatorUtil.goCouponEditPage(context);
|
|
|
|
// // print(needRefresh);
|
|
|
|
// // if (needRefresh != null && needRefresh) {
|
|
|
|
// // bus.emit('refresh_coupon_list_f');
|
|
|
|
// // //刷新页面数据
|
|
|
|
// // // _controller.callRefresh();
|
|
|
|
// // // _couponNetworkData(tabController.index);
|
|
|
|
// // }
|
|
|
|
// // }
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ));
|
|
|
|
// }
|
|
|
|
// } |
...
|
...
|
|