|
|
|
import 'dart:async';
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
|
|
import 'dart:ui';
|
|
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
...
|
...
|
@@ -13,30 +14,27 @@ import 'package:flutter_lunar_datetime_picker/flutter_lunar_datetime_picker.dart |
|
|
|
import 'package:flutter_picker_plus/flutter_picker_plus.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/constant/constant.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/models/filter_btn_model.dart';
|
|
|
|
import 'package:one_key/models/remark.dart';
|
|
|
|
import 'package:one_key/models/seller_role_model.dart';
|
|
|
|
import 'package:one_key/models/table_list.dart';
|
|
|
|
import 'package:one_key/pages/message/message_dialog_item.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/pages/message/message_dialog_item_f.dart';
|
|
|
|
import 'package:one_key/provider/message_dialog_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/NumLengthInputFormatter.dart';
|
|
|
|
import 'package:one_key/utils/misc.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/pick_date_nonli_gongli/lunar_calendar_util.dart';
|
|
|
|
import 'package:one_key/utils/pick_date_nonli_gongli/pick_calendar_day.dart';
|
|
|
|
import 'package:one_key/utils/pick_date_nonli_gongli/pick_calendar_month.dart';
|
|
|
|
import 'package:one_key/utils/pick_date_nonli_gongli/pick_calendar_year.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/utils/screen_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/common_button.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/table_item.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:table_calendar/table_calendar.dart';
|
|
...
|
...
|
@@ -56,10 +54,9 @@ import '../models/seller_version_model.dart'; |
|
|
|
import '../models/table_or_reserve_model.dart';
|
|
|
|
import '../models/theme_color_model.dart';
|
|
|
|
import '../models/titlte_type_model.dart';
|
|
|
|
import '../pages/my/marketing_center/theme_model.dart';
|
|
|
|
|
|
|
|
import '../provider/collect_store_provider.dart';
|
|
|
|
|
|
|
|
import 'package:flutter_lunar_datetime_picker/flutter_lunar_datetime_picker.dart';
|
|
|
|
import 'package:flutter_lunar_datetime_picker/datetime_picker_theme.dart'
|
|
|
|
as picker_theme;
|
|
|
|
|
|
...
|
...
|
@@ -1545,6 +1542,312 @@ class DialogUtil { |
|
|
|
}));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
static rechargeItem(context, String title, String subTitle) {
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text(title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151, fontSize: font(14)))),
|
|
|
|
HEmptyView(32),
|
|
|
|
Expanded(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Container(
|
|
|
|
height: w(40),
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(12)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(10)),
|
|
|
|
border: Border.all(
|
|
|
|
width: w(0.5), color: MyColours.color_CBCBCB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
// controller: controller,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
maxLines: 1,
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
// inputFormatters: title ==
|
|
|
|
// '券名称'
|
|
|
|
// ? [
|
|
|
|
// LengthLimitingTextInputFormatter(
|
|
|
|
// 15)
|
|
|
|
// ]
|
|
|
|
// : title == '领取后有效天数' ||
|
|
|
|
// title ==
|
|
|
|
// '发放总量限制'
|
|
|
|
// ? [
|
|
|
|
// FilteringTextInputFormatter
|
|
|
|
// .digitsOnly
|
|
|
|
// ]
|
|
|
|
// : title == '券金额' ||
|
|
|
|
// title ==
|
|
|
|
// '分享佣金' ||
|
|
|
|
// title ==
|
|
|
|
// '消费要求(0为无门槛)'
|
|
|
|
// ? [
|
|
|
|
// FilteringTextInputFormatter.allow(
|
|
|
|
// RegExp("[0-9.]")),
|
|
|
|
// ]
|
|
|
|
// : [], // 限制输入为数字,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
// focusNode: focusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
isCollapsed: true,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '请输入',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
enabledBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
})),
|
|
|
|
Container(
|
|
|
|
child: Text(subTitle,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(14)))),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///券说明
|
|
|
|
static Widget rechargeWidget(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) {},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
//余额充值弹框
|
|
|
|
static showRechargeDialog(
|
|
|
|
BuildContext context, String title, CustomCallBack callback,
|
|
|
|
{GestureTapCallback? onTapLeft, GestureTapCallback? onTapRight}) {
|
|
|
|
return showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: true,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return Center(child: StatefulBuilder(builder: (context, state) {
|
|
|
|
// locationState = state;
|
|
|
|
return Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
margin: EdgeInsets.symmetric(horizontal: w(37)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
r(8),
|
|
|
|
)),
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: <Widget>[
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(40),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('充值余额',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(16)))),
|
|
|
|
VEmptyView(30),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text('充值优惠活动',
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_515151,
|
|
|
|
fontSize: font(14)))),
|
|
|
|
HEmptyView(32),
|
|
|
|
Expanded(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Container(
|
|
|
|
height: w(40),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: w(12)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(
|
|
|
|
r(10)),
|
|
|
|
border: Border.all(
|
|
|
|
width: w(0.5),
|
|
|
|
color: MyColours
|
|
|
|
.color_CBCBCB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment
|
|
|
|
.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text('请选择',
|
|
|
|
style: TextStyle(
|
|
|
|
color: true
|
|
|
|
? MyColours
|
|
|
|
.color_999999
|
|
|
|
: MyColours
|
|
|
|
.color_515151,
|
|
|
|
fontSize:
|
|
|
|
font(14))),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'c_arrow_down_unsel'),
|
|
|
|
width: w(17),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
rechargeItem(context, '充值金额', '元'),
|
|
|
|
VEmptyView(30),
|
|
|
|
rechargeItem(context, '赠送金额', '元'),
|
|
|
|
VEmptyView(30),
|
|
|
|
rechargeItem(context, '赠送积分', '分'),
|
|
|
|
rechargeWidget('备注', '请输入备注',
|
|
|
|
TextEditingController(), FocusNode()),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
child: RoundButton(
|
|
|
|
text: '确定',
|
|
|
|
// width: (ScreenUtil().screenWidth -
|
|
|
|
// ScreenUtil().setWidth(62) * 2) /
|
|
|
|
// 2,
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart:
|
|
|
|
Colors.transparent,
|
|
|
|
gradientEnd: Colors.transparent,
|
|
|
|
textColor:
|
|
|
|
MyColours.color_515151,
|
|
|
|
isBold: false,
|
|
|
|
fontSize: 32,
|
|
|
|
onPressed: () {
|
|
|
|
if (Navigator.canPop(
|
|
|
|
context)) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
]))
|
|
|
|
])));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// static showSellerVersionBuyDialog(
|
|
|
|
// BuildContext context, String title, CustomCallBack callback,
|
|
|
|
// {GestureTapCallback onTapLeft, GestureTapCallback onTapRight}) {
|
...
|
...
|
|