Commit 5cb88650981de3240013b4f8d646d07adfa06ee8

Authored by wdn127929
1 parent 1a27bb74

充值优惠券首页and充值优惠新建页面UIok

... ... @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/dashed_line_widget.dart';
import 'package:one_key/widgets/h_empty_view.dart';
... ... @@ -55,276 +56,301 @@ class _CouponItemFState extends State<CouponItemF> {
5,
context);
}
return Stack(children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? sunModel.isType == '1'
? MyColours.color_438E93
: MyColours.color_ED7B2F
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(16)),
topRight:
Radius.circular(ScreenUtil().setWidth(16)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '店铺优惠券(核销)'
: '店铺优惠券'
: '我的优惠券',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24)),
),
InkWell(
onTap: widget.onPressedSwich,
child: Text(
return Stack(
alignment: widget.from == 'select'
? Alignment.centerLeft
: AlignmentDirectional.topStart,
children: [
InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(32)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(40),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? sunModel.isType == '1'
? MyColours.color_438E93
: MyColours.color_ED7B2F
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft:
Radius.circular(ScreenUtil().setWidth(16)),
topRight:
Radius.circular(ScreenUtil().setWidth(16)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
: '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
: '被领取:${sunModel.receiveNum}张',
maxLines: 1,
overflow: TextOverflow.ellipsis,
? '店铺优惠券(核销)'
: '店铺优惠券'
: '我的优惠券',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
),
],
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(9 * 2),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(20)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: ScreenUtil().setWidth(232 * 2),
child: Container(
height: ScreenUtil().setWidth(25 * 2),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(190)),
fontSize: ScreenUtil().setSp(24)),
),
InkWell(
onTap: widget.onPressedSwich,
child: Text(
sunModel.aname,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
sunModel.isType == '1'
? sunModel.isExamine == '1'
? '被领取:${sunModel.receiveNum}张 已核销:${sunModel.useNum}张'
: '创建人:${sunModel.nickname ?? sunModel.uid} 被领取:${sunModel.receiveNum}张'
: '被领取:${sunModel.receiveNum}张',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
),
],
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(9 * 2),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(20)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: ScreenUtil().setWidth(232 * 2),
child: Container(
height: ScreenUtil().setWidth(25 * 2),
constraints: BoxConstraints(
maxWidth: ScreenUtil().setWidth(190)),
child: Text(
sunModel.aname,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
),
)),
Container(
height: ScreenUtil().setWidth(14 * 2),
width: ScreenUtil().setWidth(232 * 2),
child: Text('${sunModel.desc}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(36),
fontWeight: FontWeight.bold),
),
)),
Container(
height: ScreenUtil().setWidth(14 * 2),
width: ScreenUtil().setWidth(232 * 2),
child: Text('${sunModel.desc}',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_515151
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
fontSize: ScreenUtil().setSp(20),
)),
),
VEmptyView(16),
(ObjectUtil.isNotEmpty(sunModel.stime) &&
sunModel.stime != '0') ||
(ObjectUtil.isNotEmpty(sunModel.etime) &&
sunModel.etime != '0')
? Container(
child: Text(
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20))),
)
: Container(),
],
),
VEmptyView(16),
(ObjectUtil.isNotEmpty(sunModel.stime) &&
sunModel.stime != '0') ||
(ObjectUtil.isNotEmpty(sunModel.etime) &&
sunModel.etime != '0')
? Container(
child: Text(
'使用时间:${ObjectUtil.isNotEmpty(sunModel.stime) ? Utils.getDateStrFromJiekou(sunModel.stime) : '--'} 至 ${ObjectUtil.isNotEmpty(sunModel.etime) ? Utils.getDateStrFromJiekou(sunModel.etime) : '--'}',
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20))),
)
: Container(),
],
),
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
ObjectUtil.isNotEmpty(sunModel.explain)
? const MySeparator(width: 3, color: MyColours.color_f3f3f3)
: SizedBox(),
ObjectUtil.isNotEmpty(sunModel.explain)
? InkWell(
onTap: () {
if (explainH > 19) {
setState(() {
widget.couponSonModel.showText =
!widget.couponSonModel.showText;
});
}
},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_ffffff
: notSelect
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
ObjectUtil.isNotEmpty(sunModel.explain)
? const MySeparator(
width: 3, color: MyColours.color_f3f3f3)
: SizedBox(),
ObjectUtil.isNotEmpty(sunModel.explain)
? InkWell(
onTap: () {
if (explainH > 19) {
setState(() {
widget.couponSonModel.showText =
!widget.couponSonModel.showText;
});
}
},
child: Container(
width: double.infinity,
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_ffffff
: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.couponSonModel.showText
? Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2),
child: Text('说明:${sunModel.explain}',
maxLines: 5,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20))),
)
: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2) +
ScreenUtil().setWidth(20),
child: Text('说明:${sunModel.explain}',
maxLines: 1,
overflow: TextOverflow.fade,
softWrap: false,
style: TextStyle(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(20))),
),
Spacer(),
explainH > 19
? Container(
margin: EdgeInsets.only(
top: ScreenUtil().setWidth(10),
right: ScreenUtil().setWidth(16)),
child: Image.asset(
!widget.couponSonModel.showText
? Utils.getImgPath(
'quan_down_f')
: Utils.getImgPath('quan_up_f'),
width: ScreenUtil().setWidth(28),
height: ScreenUtil().setWidth(28)),
)
: Container(),
HEmptyView(14)
],
)),
)
: Container(),
],
),
)),
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(37 * 2),
child: widget.showBtn
? RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(44 * 2)
: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: widget.from == 'history'
? '已过期'
: notSelect
? '停用'
: '启用',
fontSize: 24,
textColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
onPressed: widget.onPressedSwich,
)
: Container())
]);
: notSelect
? MyColours.color_ffffff
: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(
ScreenUtil().setWidth(20)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(20)))),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
widget.couponSonModel.showText
? Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2),
child: Text(
'说明:${sunModel.explain}',
maxLines: 5,
style: TextStyle(
color: widget.from ==
'history'
? MyColours.color_BFC4D4
: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20))),
)
: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(24 * 2),
ScreenUtil().setWidth(14),
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(14)),
width: ScreenUtil().screenWidth -
ScreenUtil().setWidth(92 * 2) +
ScreenUtil().setWidth(20),
child: Text(
'说明:${sunModel.explain}',
maxLines: 1,
overflow: TextOverflow.fade,
softWrap: false,
style: TextStyle(
color: widget.from ==
'history'
? MyColours.color_BFC4D4
: MyColours
.color_999999,
fontSize: ScreenUtil()
.setSp(20))),
),
Spacer(),
explainH > 19
? Container(
margin: EdgeInsets.only(
top: ScreenUtil().setWidth(10),
right:
ScreenUtil().setWidth(16)),
child: Image.asset(
!widget.couponSonModel.showText
? Utils.getImgPath(
'quan_down_f')
: Utils.getImgPath(
'quan_up_f'),
width:
ScreenUtil().setWidth(28),
height:
ScreenUtil().setWidth(28)),
)
: Container(),
HEmptyView(14)
],
)),
)
: Container(),
],
),
)),
Positioned(
left: ScreenUtil().setWidth(21),
child: widget.from == 'select'
? Image.asset(
Utils.getImgPath(
sunModel.isCheck ? 'c_mul_select' : 'c_not_edit'),
width: w(21),
)
: Container()),
Positioned(
right: ScreenUtil().setWidth(100),
top: ScreenUtil().setWidth(37 * 2),
child: widget.showBtn
? RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(44 * 2)
: ScreenUtil().setWidth(32 * 2),
height: ScreenUtil().setWidth(21 * 2),
radius: ScreenUtil().setWidth(10),
text: widget.from == 'history'
? '已过期'
: notSelect
? '停用'
: '启用',
fontSize: 24,
textColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? MyColours.color_438E93
: MyColours.color_999999,
onPressed: widget.onPressedSwich,
)
: Container())
]);
}
}
... ...
... ... @@ -107,42 +107,41 @@ class _MarketingCenterHomePageState extends State<MarketingCenterHomePage> {
child: SingleChildScrollView(
child: Column(
children: [
// InkWell(
// onTap: () {
// // NavigatorUtil.goWebPage(context, '隐私政策', "zc",
// // need: true);
// },
// child: Padding(
// padding: EdgeInsets.only(
// left: w(16),
// top: w(12),
// bottom: w(12),
// right: w(12)),
// child: Row(
// children: [
// Text(
// '会员充值优惠活动',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: ScreenUtil().setWidth(32)),
// ),
// Spacer(),
// Container(
// padding: EdgeInsets.symmetric(
// horizontal: w(7), vertical: w(4)),
// child: Image.asset(
// "assets/arrow_right_new.png",
// width: ScreenUtil().setWidth(18),
// height: ScreenUtil().setWidth(32),
// ),
// )
// ],
// ))),
// Padding(
// padding: EdgeInsets.only(left: w(16)),
// child: MyDivider(double.infinity, w(0.5),
// color: MyColours.color_E7E7E7)),
// VEmptyView(24),
InkWell(
onTap: () {
NavigatorUtil.goRechargeHomePage(context);
},
child: Padding(
padding: EdgeInsets.only(
left: w(16),
top: w(12),
bottom: w(12),
right: w(12)),
child: Row(
children: [
Text(
'会员充值优惠活动',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(32)),
),
Spacer(),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(7), vertical: w(4)),
child: Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(18),
height: ScreenUtil().setWidth(32),
),
)
],
))),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: MyDivider(double.infinity, w(0.5),
color: MyColours.color_E7E7E7)),
VEmptyView(24),
InkWell(
onTap: () {
setState(() {
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_picker/Picker.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/route/navigator_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import '../../../../res/colors.dart';
import '../../../../utils/dialog_util.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 {
RechargeEditPage({Key key}) : 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 = false;
List<String> coupons = [];
List<String> selectIDs = [];
@override
void initState() {
super.initState();
_initWeekData();
nameF.addListener(() {
if (nameF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
priceminF.addListener(() {
if (priceminF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
givePricF.addListener(() {
if (givePricF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
giveScoreF.addListener(() {
if (giveScoreF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
remarkF.addListener(() {
if (remarkF.hasFocus) {
//有焦点
if (showDateSelWidget) {
Navigator.pop(context);
showDateSelWidget = false;
}
} else {
//失去焦点
// _editingController.text = '';
}
});
}
_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,
//输入文本的样式
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 _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.number, //键盘类型,数字键盘
maxLines: 3,
maxLength: 50,
// maxLengthEnforced: true,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_333333), //输入文本的样式
decoration: InputDecoration(
contentPadding: EdgeInsets.all(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) {
return Scaffold(
key: scaffoldKey,
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('充值优惠详情'),
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()),
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),
Padding(
padding: EdgeInsets.only(
left: w(16),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Image.asset(
Utils.getImgPath(
true ? 'f_select' : 'f_select_not'),
width: w(20),
),
HEmptyView(16),
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(),
),
),
HEmptyView(16),
Text(
'元余额',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
],
),
VEmptyView(20),
Row(
children: [
Image.asset(
Utils.getImgPath(
true ? 'f_select' : 'f_select_not'),
width: w(20),
),
HEmptyView(16),
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(),
),
),
HEmptyView(16),
Text(
'积分',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
],
),
VEmptyView(20),
Row(
children: [
Image.asset(
Utils.getImgPath(
true ? 'f_select' : 'f_select_not'),
width: w(20),
),
HEmptyView(16),
Text(
'赠送优惠券',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32)),
),
HEmptyView(60),
InkWell(
onTap: () async {
Map object = await NavigatorUtil
.goRechargeSelectStoreCouponPage(
context, selectIDs.join(','));
print(object);
if (object != null &&
object['couponsid'] != null) {
List<CouponSunModel> data =
object['couponsdata'];
//
selectIDs = object['couponsid'];
coupons = [];
data.forEach((element) {
if (element.isCheck) {
coupons.add(element.aname);
}
});
setState(() {});
}
},
child: Text(
'选择优惠券',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(32)),
)),
],
),
VEmptyView(20),
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),
_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 {
// "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);
// }
// }
},
),
)
],
),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/pages/my/marketing_center/recharge/recharge_item.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
import '../../../../constant/state.dart';
import '../../../../provider/marketing_center_provider.dart';
import '../../../../route/navigator_util.dart';
import '../../../../utils/screen_util.dart';
import '../../../../widgets/page_exception.dart';
import '../../../../widgets/round_button.dart';
import '../../../../widgets/v_empty_view.dart';
/**
*
* 充值优惠首页
*/
class RechargeHomePage extends StatefulWidget {
RechargeHomePage({Key key}) : super(key: key);
@override
_RechargeHomePageState createState() => _RechargeHomePageState();
}
class _RechargeHomePageState extends State<RechargeHomePage> {
MarketingCenterProvider marketingCenterProvider;
EasyRefreshController _controller = EasyRefreshController();
@override
Widget build(BuildContext context) {
marketingCenterProvider =
Provider.of<MarketingCenterProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_f3f3f3,
appBar: SystemAppBar(
'充值优惠',
),
body: Container(
child: Column(
children: [
Expanded(child: Container(
child: Consumer<MarketingCenterProvider>(
builder: (context, model, _) {
if (model.pageStateRechargeHome != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateRechargeHome,
callback: () {
// offset = 0;
// getMessage(showLoading: true);
if (model.pageStateRechargeHome == PageState.Empty) {
// NavigatorUtil.goCouponHistoryPage(context);
} else {
// _couponNetworkData(widget.index);
}
},
emptyMsg: "暂时没有列表信息哦,",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
// showText: '查看过期优惠券',
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return RechargeItem(
from: 'quan',
// couponSonModel: couponProvider.couponList[index],
// showBtn: true,
// onPressedSwich: () {
// couponProvider.couponList[index].isOpenBool =
// !couponProvider.couponList[index].isOpenBool;
// _setCustomerActivity(index);
// },
// onPressed: () {
// NavigatorUtil.goCouponDetailPage(
// context, couponProvider.couponList[index]);
// },
);
}, childCount: 100),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return Column(
children: [
InkWell(
onTap: () {
// NavigatorUtil.goCouponHistoryPage(context);
},
child: RichText(
text: TextSpan(
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
),
children: [
TextSpan(
text: '没有更多了,',
style: TextStyle(
color: MyColours.color_000000)),
TextSpan(
text: '查看过期优惠券',
style: TextStyle(
color: MyColours.color_438E93)),
]))),
VEmptyView(80)
],
);
}, childCount: 1),
)
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
}),
)),
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 {
// 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);
// }
// }
},
),
)
],
),
),
);
}
}
... ...
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/coupon_model.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/dashed_line_widget.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../../utils/screen_util.dart';
class RechargeItem extends StatefulWidget {
final String from;
final VoidCallback onPressed;
final VoidCallback onPressedSwich;
final CouponSunModel couponSonModel;
final bool showBtn;
final bool showCheck;
RechargeItem(
{Key key,
this.from,
this.onPressed,
this.onPressedSwich,
this.couponSonModel,
this.showBtn = false,
this.showCheck = false})
: super(key: key);
@override
_RechargeItemState createState() => _RechargeItemState();
}
class _RechargeItemState extends State<RechargeItem> {
// bool showText = false;
@override
Widget build(BuildContext context) {
// CouponSunModel sunModel = widget.couponSonModel;
bool notSelect = true;
if (widget.from == 'history') {
notSelect = false;
} else {
// notSelect = sunModel.isOpenBool;
}
// double explainH = 0.0;
// if (ObjectUtil.isNotEmpty(sunModel.explain)) {
// explainH = Utils.calculateTextHeight(
// '说明:fdgdfgdgfgsdgsg',
// ScreenUtil().setSp(20),
// FontWeight.normal,
// ScreenUtil().screenWidth -
// ScreenUtil().setWidth(92 * 2) +
// ScreenUtil().setWidth(20),
// 5,
// context);
// }
return InkWell(
onTap: widget.onPressed,
child: Container(
// width: ScreenUtil().setWidth(610),
margin: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(30),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(0)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
boxShadow: [
BoxShadow(
spreadRadius: ScreenUtil().setWidth(2),
color: Color.fromRGBO(0, 0, 0, 0.25),
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.all(
Radius.circular(ScreenUtil().setWidth(16)),
),
),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
height: ScreenUtil().setWidth(60),
padding:
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
decoration: BoxDecoration(
color: widget.from == 'history'
? MyColours.color_BFC4D4
: notSelect
? true
? MyColours.color_438E93
: MyColours.color_ED7B2F
: MyColours.color_999999,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(16)),
topRight: Radius.circular(ScreenUtil().setWidth(16)))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'充500赠100',
style: TextStyle(
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
),
InkWell(
onTap: widget.onPressedSwich,
child: Text('更新时间:2022-12-18',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(20))),
),
],
),
),
Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20 * 2),
ScreenUtil().setWidth(26),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(26)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text('会员充值满1000元赠余额200元;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
VEmptyView(10),
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text('会员充值满1000元赠送50元代金券;',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
VEmptyView(10),
Container(
// height: ScreenUtil().setWidth(14 * 2),
// width: ScreenUtil().setWidth(232 * 2),
child: Text('会员充值满1000元赠送50元菜品券。',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(20),
)),
),
],
),
// widget.from == 'select'
// ? widget.showCheck
// ? Positioned(
// right: 0,
// top: ScreenUtil().setWidth(20),
// child: Image.asset(
// Utils.getImgPath(widget.couponSonModel.isCheck
// ? 'check_r'
// : 'check_un'),
// width: ScreenUtil().setWidth(40),
// height: ScreenUtil().setWidth(40),
// ))
// : Container()
// :
),
MySeparator(width: w(4), color: MyColours.color_BFC4D4),
VEmptyView(15),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
RoundButton(
width: widget.from == 'history'
? ScreenUtil().setWidth(50 * 2)
: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(20 * 2),
radius: ScreenUtil().setWidth(10),
text: '删除',
fontSize: 24,
textColor: MyColours.color_E34D59,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_E34D59,
onPressed: widget.onPressedSwich,
),
HEmptyView(34),
RoundButton(
width: ScreenUtil().setWidth(50 * 2),
height: ScreenUtil().setWidth(20 * 2),
radius: ScreenUtil().setWidth(10),
text: '禁用',
///启用
fontSize: 24,
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
onPressed: widget.onPressedSwich,
),
HEmptyView(38),
],
),
VEmptyView(15)
],
),
));
}
}
... ...
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/pages/coupon/coupon_item.dart';
import 'package:one_key/provider/SmsModel.dart';
import 'package:one_key/provider/coupon_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/page_exception.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import 'package:sendsms/sendsms.dart';
// import 'package:sendsms/sendsms.dart';
import 'package:flutter_sms/flutter_sms.dart';
import '../../../../utils/screen_util.dart';
import '../../../coupon/coupon_item_f.dart';
class RechargeSelectStoreCouponPage extends StatefulWidget {
final String from;
final List<String> selectList;
RechargeSelectStoreCouponPage({Key key, this.from, this.selectList})
: super(key: key);
@override
_RechargeSelectStoreCouponPageState createState() =>
_RechargeSelectStoreCouponPageState();
}
class _RechargeSelectStoreCouponPageState
extends State<RechargeSelectStoreCouponPage> {
EasyRefreshController _controller = EasyRefreshController();
CouponProvider couponProvider;
///获取优惠券列表数据(status == 1)
_couponNetworkData({bool isShowLoading = true}) async {
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
};
// if (!widget.hasModify) {
params['status'] = '1';
// }
await couponProvider.getRechargeSelectActivity(context, params,
isShowLoading: isShowLoading);
}
@override
void initState() {
// TODO: implement initState
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
// if (!couponProvider.hasModify) {
couponProvider.coupons = widget.selectList;
_couponNetworkData();
// } else {
// couponProvider.pageStateSelect = PageState.Success;
// // couponProvider.notifyListeners();
// }
});
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
couponProvider = Provider.of<CouponProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('选择优惠券'),
// appBar: AppBar(
// backgroundColor: Colors.transparent,
// elevation: 0,
// leading: InkWell(
// onTap: () {
// Navigator.pop(context);
// Utils.changeStatusColor(color: Colors.transparent);
// },
// child: Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(40),
// vertical: ScreenUtil().setWidth(15)),
// child: Row(
// children: <Widget>[
// Image.asset(
// "assets/icon_back.png",
// width: ScreenUtil().setWidth(20),
// height: ScreenUtil().setWidth(31),
// )
// ],
// )),
// ),
// title: Text(
// '优惠券',
// style: TextStyle(
// color: MyColours.color_353535,
// fontSize: ScreenUtil().setSp(34),
// decoration: TextDecoration.none),
// ),
// actions: <Widget>[
// couponProvider.pageStateSelect == PageState.Success
// ? InkWell(
// onTap: () {
// if (couponProvider.checkValue) {
// couponProvider.cancelAll();
// } else {
// couponProvider.addAll();
// }
// },
// child: Padding(
// padding:
// EdgeInsets.only(right: ScreenUtil().setWidth(40)),
// child: Row(children: [
// Container(
// // color: Colors.red,
// alignment: Alignment.center,
// child: Text(
// '全选',
// style: TextStyle(
// color: MyColours.color_199095,
// fontSize: ScreenUtil().setSp(34)),
// )),
// HEmptyView(20),
// Image.asset(
// Utils.getImgPath(couponProvider.checkValue
// ? 'check_g'
// : 'check_un'),
// width: ScreenUtil().setWidth(40))
// ])))
// : Container()
// ],
// centerTitle: true, // 标题居中
// ),
body: WillPopScope(
child: Column(
children: [
Expanded(child: Consumer<CouponProvider>(
builder: (context, model, _) {
if (model.pageStateSelect != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateSelect,
callback: () {
_couponNetworkData();
// offset = 0;
// getMessage(showLoading: true);
},
emptyMsg: "暂时没有列表信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return EasyRefresh.custom(
controller: _controller,
shrinkWrap: true,
slivers: [
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return VEmptyView(40);
}, childCount: 1),
),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
return InkWell(
onTap: () {
couponProvider.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
couponProvider.addData(index);
} else {
couponProvider.cancelData(index);
}
couponProvider.getCheckValue();
},
// child: Row(
// children: [
// HEmptyView(30),
// !widget.hasModify
// ? Checkbox(
// value: couponProvider
// .couponListSelect[index].isCheck,
// checkColor: MyColours.color_ffffff,
// activeColor: MyColours.app_main,
// onChanged: (bool value) {},
// )
// : Container(),
// Image.asset(
// couponProvider.listData[index]['checked']
// ? 'assets/select.png'
// : 'assets/unselect.png',
// width: ScreenUtil().setWidth(44)),
child: CouponItemF(
from: 'select',
showCheck: true,
couponSonModel:
couponProvider.couponListSelect[index],
onPressed: () {
//改这里 ******8
if (true) {
couponProvider
.couponListSelect[index].isCheck =
!couponProvider
.couponListSelect[index].isCheck;
if (couponProvider
.couponListSelect[index].isCheck) {
couponProvider.addData(index);
} else {
couponProvider.cancelData(index);
}
couponProvider.getCheckValue();
}
}));
}, childCount: couponProvider.couponListSelect.length),
)
],
// onRefresh: () async {
// // offset = 0;
// // getMessage(showLoading: false);
// },
// onLoad: () async {
// // offset++;
// // getMessage(showLoading: false);
// },
);
}
},
)),
couponProvider.pageStateSelect == PageState.Success
? Text(
'注:充值优惠选择的优惠券,全部来自店铺核销券',
style: TextStyle(
color: MyColours.color_999999, fontSize: font(12)),
)
: SizedBox(),
VEmptyView(20),
couponProvider.pageStateSelect == PageState.Success
? Padding(
padding: EdgeInsets.fromLTRB(ScreenUtil().setWidth(40), 0,
ScreenUtil().setWidth(40), ScreenUtil().setWidth(40)),
child: Row(
children: [
InkWell(
onTap: () {
if (couponProvider.checkValue) {
couponProvider.cancelAll();
} else {
couponProvider.addAll();
}
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(couponProvider.checkValue
? 'c_mul_select'
: 'c_mul_select_un'),
width: ScreenUtil().setWidth(40)),
HEmptyView(4),
Container(
// color: Colors.red,
alignment: Alignment.center,
child: Text(
'全选',
style: TextStyle(
color: MyColours.color_515151,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32)),
))
],
)),
HEmptyView(20),
Expanded(
child: RoundButton(
onPressed: () async {
if (widget.from == 'statistics') {
/*** 发版注释
DialogUtil.cupertinoAlertDialog(context,
title: '确认发送',
content: '是否确定为当前所选顾客发送该优惠券', lCallback: () {
print('取消发送');
}, rCallback: () async {
if (Platform.isIOS) {
List<String> phoneNumber = [
'18161963378',
'18729572142',
'18765432345'
];
String message = "test";
try {
String _result = await sendSMS(
message: message, recipients: phoneNumber);
print(_result);
} catch (error) {
print(error.toString());
}
} else {
print('确定发送');
String phoneNumber = "18161963378;18729572142";
String message = "test";
// await Sendsms.onGetPermission();
// if (await Sendsms.hasPermission()) {
await Sendsms.onSendSMS(phoneNumber, message);
}
// }
// SmsModel smsModel = new SmsModel();
// // String sms = await smsModel.getSmsContent(context, params);
// String phoneNumber = "";
// await Sendsms.onSendSMS(phoneNumber, '短信内容');
});
*/
} else {
Map temp = {
'couponsid': couponProvider.coupons,
'couponsdata': couponProvider.couponListSelect
};
Navigator.pop(context, temp);
}
},
text: '确认选择${couponProvider.coupons.length}个优惠券',
fontSize: 34,
isBold: false,
height: ScreenUtil().setWidth(80),
// width: double.infinity,
radius: ScreenUtil().setWidth(10),
))
],
))
: Container()
],
),
onWillPop: () async {
Utils.changeStatusColor(color: Colors.transparent);
Navigator.of(context).pop();
return true;
},
),
);
}
}
... ...
... ... @@ -394,6 +394,74 @@ class CouponProvider with ChangeNotifier {
}
///客户经理获取所创建活动列表(选择优惠券)
Future<List<CouponSunModel>> getRechargeSelectActivity(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
if (isShowLoading) {
pageStateSelect = PageState.Loading;
notifyListeners();
}
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_customer_activity,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {
switch (error.type) {
case 1:
pageStateSelect = PageState.ConnectivityError;
break;
case 2:
pageStateSelect = PageState.ConnectivityTimeOut;
break;
default:
pageStateSelect = PageState.ConnectivityError;
break;
}
}
notifyListeners();
});
if (baseResp.code == Constant.status_success) {
if (baseResp.data.isEmpty) {
pageStateSelect = PageState.Empty;
} else {
pageStateSelect = PageState.Success;
}
couponListSelect = CouponModel.fromJson(baseResp.responseData).data;
// if (hasModify) {
// //已经绑定
List<CouponSunModel> temp = [];
for (int i = 0; i < couponListSelect.length; i++) {
if (couponListSelect[i].isType == '1' &&
couponListSelect[i].isExamine == '1' &&
couponListSelect[i].status == '1') {
//istype == 1 店铺券 isExamine == '1 可核销券
temp.add(couponListSelect[i]);
}
}
couponListSelect = temp;
// } else {
for (int i = 0; i < couponListSelect.length; i++) {
for (int j = 0; j < coupons.length; j++) {
if (couponListSelect[i].id == coupons[j]) {
couponListSelect[i].isCheck = true;
}
}
}
// }
getCheckValue();
notifyListeners();
} else {
pageStateSelect = PageState.ConnectivityError;
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
}
return couponListSelect;
}
///客户经理获取所创建活动列表(选择优惠券)
Future<List<CouponSunModel>> getCustomerSelectActivity(
BuildContext context, Map<String, String> params,
{isShowLoading = true}) async {
... ...
... ... @@ -17,6 +17,7 @@ class MarketingCenterProvider extends ChangeNotifier {
MarkDataModel markDataModel;
PageState pageState = PageState.Loading;
PageState pageStateRechargeHome = PageState.Success;
//获取桌位列表
getTableList(context, {needLoading = true}) async {
... ...
... ... @@ -1542,4 +1542,33 @@ class NavigatorUtil {
"${Routes.out_store_record_detail_page}?detail=${FluroConvertUtils.object2string(outWineRecordSunModel)}",
replace: replace);
}
///充值优惠
static Future<dynamic> goRechargeHomePage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.recharge_home_page}",
replace: replace);
}
///充值优惠详情编辑页
static Future<dynamic> goRechargeEditPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.recharge_edit_page}",
replace: replace);
}
///充值优惠选择店铺可核销优惠券
static Future<dynamic> goRechargeSelectStoreCouponPage(
BuildContext context,
String selectIDs, {
replace = false,
}) {
return _navigateTo(context,
"${Routes.recharge_select_store_coupon_page}?selectIDs=$selectIDs",
replace: replace);
}
}
... ...
... ... @@ -189,6 +189,9 @@ import '../pages/my/marketing_center/book_notification/marking_coupon_select_pag
import '../pages/my/marketing_center/book_notification/marking_preview_page.dart';
import '../pages/my/marketing_center/book_notification/store_introduce_page.dart';
import '../pages/my/marketing_center/marketing_center_home_page.dart';
import '../pages/my/marketing_center/recharge/recharge_edit_page.dart';
import '../pages/my/marketing_center/recharge/recharge_home_page.dart';
import '../pages/my/marketing_center/recharge/recharge_select_store_coupon_page.dart';
import '../pages/my/plan_dish/final_plan_dish_page.dart';
import '../pages/my/plan_dish/my_plan_dish_home_page.dart';
import '../pages/my/plan_dish/plan_dish_create_select_type_page.dart';
... ... @@ -2482,3 +2485,44 @@ var outStoreRecordDetailPageHandle = new Handler(
child: OutStoreRecordDetailPage(
outWineRecordSunModel: outWineRecordSunModel));
});
///充值优惠-首页
var rechargeHomePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// OutWineRecordSunModel outWineRecordSunModel = OutWineRecordSunModel.fromJson(
// json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(), child: RechargeHomePage());
});
///充值优惠详情编辑
var rechargeEditPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// OutWineRecordSunModel outWineRecordSunModel = OutWineRecordSunModel.fromJson(
// json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(), child: RechargeEditPage());
});
///充值优惠选择店铺可核销优惠券
var rechargeSelectStoreCouponPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// OutWineRecordSunModel outWineRecordSunModel = OutWineRecordSunModel.fromJson(
// json.decode(
// FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
String selectIDs = params["selectIDs"].first;
List<String> selectList = [];
if (selectIDs.length > 0) {
selectList = selectIDs.split(',');
}
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
child: ChangeNotifierProvider<CouponProvider>(
create: (_) => CouponProvider(),
child: RechargeSelectStoreCouponPage(selectList: selectList)));
});
... ...
... ... @@ -222,6 +222,14 @@ class Routes {
static String out_store_record_detail_page =
"/out_store_record_detail_page"; //出库记录列表详情,一层循环
/** 充值优惠
*/
static String recharge_home_page = "/recharge_home_page"; //充值优惠首页
static String recharge_edit_page = "/recharge_edit_page"; //充值优惠详情编辑页
static String recharge_select_store_coupon_page =
"/recharge_select_store_coupon_page"; //充值优惠选择店铺可核销优惠券
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<String>> params) {
... ... @@ -429,5 +437,11 @@ class Routes {
router.define(out_store_record_detail_page,
handler: outStoreRecordDetailPageHandle);
router.define(recharge_home_page, handler: rechargeHomePageHandle);
router.define(recharge_edit_page, handler: rechargeEditPageHandle);
router.define(recharge_select_store_coupon_page,
handler: rechargeSelectStoreCouponPageHandle);
}
}
... ...
... ... @@ -280,6 +280,121 @@ class DialogUtil {
});
}
///优惠每周选择
static openWeekSelectModalBottomSheet(context, List<FilterBtnModel> weekData,
{VoidCallback lCallback, VoidCallback rCallback}) async {
List<FilterBtnModel> data = weekData.map((e) {
return FilterBtnModel.fromJson(e.toJson());
}).toList();
final option = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
isDismissible: false,
isScrollControlled: true,
builder: (BuildContext context) {
return StatefulBuilder(builder: (context, state) {
return Container(
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().setWidth(10)),
topRight: Radius.circular(ScreenUtil().setWidth(10)))),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
left: w(25), right: w(25), top: w(26), bottom: w(12)),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
Navigator.pop(context);
},
child: Container(
child: Text(
'取消',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151,
),
),
),
),
InkWell(
onTap: () {
Navigator.pop(context, data);
},
child: Container(
child: Text(
'确定',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_438E93,
),
),
),
),
],
)),
MyDivider(
double.infinity,
ScreenUtil().setWidth(2),
color: MyColours.color_DBDBDB,
),
VEmptyView(116),
ListView.builder(
shrinkWrap: true,
itemCount: data.length,
itemBuilder: (context, index) {
return InkWell(
onTap: () {
state(() {
data[index].select = !data[index].select;
});
},
child: Container(
margin: EdgeInsets.only(bottom: w(7)),
padding: EdgeInsets.only(
left: w(33),
right: w(33),
top: w(16),
bottom: w(7)),
decoration: index == data.length - 1
? null
: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color:
MyColours.color_DBDBDB))),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text(data[index].title,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16))),
Image.asset(
Utils.getImgPath(data[index].select
? 'c_mul_select'
: 'c_mul_select_un'),
width: w(20)),
],
)));
}),
],
),
);
});
});
print(option);
return option;
}
///添加图片UI弹出
static openImageModalBottomSheet(context,
{VoidCallback lCallback, VoidCallback rCallback}) async {
... ... @@ -4643,7 +4758,8 @@ class DialogUtil {
}
//主题颜色选择弹框
static showThemeColorSelectDialog(BuildContext context, List<ThemeColorModel> themeColorData,
static showThemeColorSelectDialog(
BuildContext context, List<ThemeColorModel> themeColorData,
{CustomCallBack callback}) {
return showModalBottomSheet(
context: context,
... ... @@ -4671,7 +4787,7 @@ class DialogUtil {
child: Container(
width: double.infinity,
height: w(106),
color:themeColorData[0].color,
color: themeColorData[0].color,
margin: EdgeInsets.symmetric(horizontal: w(30)),
padding: EdgeInsets.only(left: w(10), top: w(13)),
child: Container(
... ... @@ -5704,7 +5820,7 @@ class DialogUtil {
);
}
static Future cupertinoAlertDialogOnly(BuildContext context,
static Future cupertinoAlertDialogOnly(BuildContext context,
{String title = "",
String content = "内容",
String lTitle = "取消",
... ...
... ... @@ -36,7 +36,10 @@ class SystemAppBar extends StatelessWidget implements PreferredSizeWidget {
leftTitle != '' ? ScreenUtil().setWidth(84 * 2 + 40 + 10) : 56,
leading: showLeading
? InkWell(
onTap: onTap,
onTap: onTap ??
() {
Navigator.pop(context);
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
... ...