Commit 68c8ce6ec03d4d40cf1b03d2063538a58ef10118

Authored by wdn127929
1 parent 24dbcdb7

企业资料上传UI && 支付返券UI OK

... ... @@ -449,7 +449,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5507;
CURRENT_PROJECT_VERSION = 55092;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -632,7 +632,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5507;
CURRENT_PROJECT_VERSION = 55092;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ... @@ -658,7 +658,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 5507;
CURRENT_PROJECT_VERSION = 55092;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
... ...
... ... @@ -1608,7 +1608,7 @@ class _CouponEidtPageState extends State<CouponEidtPage> {
return;
}
// 券开始早于活动开始 && 券结束大于活动结束
if (widget.from != null) {
if (widget.from != null&& widget.from != 'null') {
if (DateUtil.getDateTime(fromDate)
.compareTo(DateUtil.getDateTime(widget.from!)) >
0) {
... ...
import 'package:cached_network_image/cached_network_image.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_picker_plus/picker.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:provider/provider.dart';
// import 'package:flutter/material.dart';
// import 'package:one_key/widgets/system_app_bar.dart';
// /**
// * 企业资料上传
// */
// class EnterpriseInformationUploadPage extends StatefulWidget {
// const EnterpriseInformationUploadPage({super.key});
// @override
// State<EnterpriseInformationUploadPage> createState() => _EnterpriseInformationUploadPageState();
// }
// class _EnterpriseInformationUploadPageState extends State<EnterpriseInformationUploadPage> {
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// appBar: SystemAppBar('资料上传'),
// body: ,
// );
// }
// }
\ No newline at end of file
import '../../../models/upload_img_model.dart';
import '../../../provider/finance_provider.dart';
import '../../../provider/upload_img_provider.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/upload_image_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/v_empty_view.dart';
import '../../online_check/img_picker_widget.dart';
import '../marketing_center/book_notification/img_picker_invitation_widget.dart';
/**
* 企业资料上传
*/
class EnterpriseInformationUploadPage extends StatefulWidget {
const EnterpriseInformationUploadPage({super.key});
@override
State<EnterpriseInformationUploadPage> createState() =>
_EnterpriseInformationUploadPageState();
}
class _EnterpriseInformationUploadPageState
extends State<EnterpriseInformationUploadPage> {
String stime = '点击选择营业执照开始日期';
String etime = '点击选择营业执照结束日期';
ScrollController _controller = ScrollController();
late UploadImageProvider _uploadImageProvider;
late FinanceProvider financeProvider;
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_getQiniuInfo();
});
}
@override
void dispose() {
_uploadImageProvider.storeImage1 = UploadImgModel();
_uploadImageProvider.storeImage2 = UploadImgModel();
super.dispose();
}
///获取七牛云token
///
_getQiniuInfo() async {
await _uploadImageProvider.getQiniuInfo(context, {});
}
Widget _title(String title) {
return Padding(
padding: EdgeInsets.only(left: w(16), top: w(10), bottom: w(10)),
child: Text(
title,
style: TextStyle(color: MyColours.color_515151, fontSize: font(16)),
),
);
}
Widget _inputWidget(String title, TextEditingController controller,
FocusNode focusNode, String hintText,
{num width = 40}) {
return Container(
margin: EdgeInsets.only(left: w(width)),
padding: EdgeInsets.only(top: w(10), bottom: w(10), right: w(16)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
child: Row(
children: [
Text(
title,
style: TextStyle(color: MyColours.color_515151, fontSize: font(14)),
),
HEmptyView(10),
Expanded(
child: TextField(
controller: controller,
textAlign: TextAlign.right,
textAlignVertical: TextAlignVertical.center,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
inputFormatters: [
// FilteringTextInputFormatter.allow(RegExp("[0-9.]")),
], // 限制输入为数字,
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(24),
),
focusNode: focusNode,
decoration: InputDecoration(
isCollapsed: true,
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: MyColours.color_999999,
fontSize: ScreenUtil().setSp(24),
),
enabledBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
focusedBorder: new UnderlineInputBorder(
borderSide: BorderSide.none,
),
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.numberWithOptions()),
),
],
),
);
}
///是否立即启用
Widget _canUse(
String title,
bool swich,
GestureTapCallback onTap,
) {
return InkWell(
onTap: onTap,
child: Container(
margin: EdgeInsets.only(left: w(40)),
padding: EdgeInsets.only(top: w(10), bottom: w(10), right: w(16)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
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,
fontWeight: FontWeight.normal,
fontSize: font(14)),
),
),
Spacer(),
Image.asset(
swich
? Utils.getImgPath('swich_on_lit')
: Utils.getImgPath('swich_off_lit'),
width: ScreenUtil().setWidth(44 * 2),
)
],
),
),
);
}
///时间选择
Widget _select(String title, String hintText, GestureTapCallback onTap) {
return InkWell(
onTap: onTap,
child: Container(
margin: EdgeInsets.only(left: w(40)),
padding: EdgeInsets.only(top: w(10), bottom: w(10), right: w(16)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(color: MyColours.color_E7E7E7, width: w(0.5)))),
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: font(14)),
),
),
HEmptyView(20),
Spacer(),
Text(hintText,
style: TextStyle(
color: hintText == '点击选择营业执照开始日期' ||
hintText == '点击选择营业执照结束日期' ||
hintText == '点击选择开户银行'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: font(12),
)),
HEmptyView(8),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: w(7),
),
],
),
),
);
}
@override
Widget build(BuildContext context) {
_uploadImageProvider =
Provider.of<UploadImageProvider>(context, listen: false);
financeProvider = Provider.of<FinanceProvider>(context, listen: false);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
key: scaffoldKey,
appBar: SystemAppBar('资料上传'),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: SingleChildScrollView(
controller: _controller,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_title('营业执照信息'),
Container(
padding:
EdgeInsets.only(top: w(8), bottom: w(8), right: w(16)),
margin: EdgeInsets.only(left: w(40)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
'企业/个体户选择',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(14)),
),
Spacer(),
Container(
// width: w(100),
// height: w(30),
padding: EdgeInsets.symmetric(
horizontal: w(10), vertical: w(5)),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(r(5)),
bottomLeft: Radius.circular(r(5)))),
child: Text(
'企业',
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: font(14)),
),
),
Container(
padding: EdgeInsets.symmetric(
horizontal: w(10), vertical: w(5)),
decoration: BoxDecoration(
color: MyColours.color_DBDBDB,
borderRadius: BorderRadius.only(
topRight: Radius.circular(r(5)),
bottomRight: Radius.circular(r(5)))),
child: Text(
'个体',
style: TextStyle(
color: MyColours.color_438E93,
fontSize: font(14)),
),
)
],
),
),
_inputWidget(
'注册号', TextEditingController(), FocusNode(), '点击输入营业执照注册号'),
_inputWidget('注册名称', TextEditingController(), FocusNode(),
'点击输入营业执照上的企业名称'),
_select('营业执照开始于', stime, () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出时间选择器
DialogUtil.showPickerDateTime24(
context,
scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
setState(() {
print(value);
stime = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
// showDateSelWidget = false;
},
dateTime: stime == '点击选择营业执照开始日期'
? null
: DateUtil.getDateTime(stime),
pickerDateTimeType: PickerDateTimeType.kYMD,
onCancel: () {
// showDateSelWidget = false;
});
}),
_canUse('营业期限长期有效', true, () {}),
_select(
'营业执照结束于',
etime,
() {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出时间选择器
DialogUtil.showPickerDateTime24(
context,
scaffoldKey,
(value) {
// {'text': picker.adapter.text, 'select': selecteds}
if (value != null) {
setState(() {
print(value);
etime = DateUtil.formatDateStr(value,
format: DateFormats.y_mo_d);
});
}
// showDateSelWidget = false;
},
dateTime: etime == '点击选择营业执照结束日期'
? null
: DateUtil.getDateTime(etime),
pickerDateTimeType: PickerDateTimeType.kYMD,
onCancel: () {
// showDateSelWidget = false;
});
},
),
_inputWidget('经营者/法人姓名', TextEditingController(), FocusNode(),
'点击输入经营者/法人姓名'),
_inputWidget(
'注册地址', TextEditingController(), FocusNode(), '点击输入注册地址'),
Consumer<UploadImageProvider>(builder: (context, model, _) {
return Padding(
padding: EdgeInsets.only(
left: w(20), top: w(20), bottom: w(12)),
child: ImgPickerWidget(
scrollController: _controller,
model: model,
maxImageNumber: 1,
uploadType: UploadType.TableManagerType,
subTips: '营业执照照片',
deleteCallback: (int index) {
// _delTablePhoto(
// context,
// _uploadImageProvider.tableImageList[index].photoID,
// index);
},
callback: () {
// for (UploadImgModel item
// in _uploadImageProvider.tableImageList) {
// if (item.process! < 1) {
// Utils.showToast('正在上传图片,请稍等');
// return;
// }
// }
// //接口,和桌子绑定
// List imageQiniuUrlList = [];
// for (int i = 0;
// i < _uploadImageProvider.tableImageList.length;
// i++) {
// if (!_uploadImageProvider.tableImageList[i].isUpload) {
// imageQiniuUrlList.add({
// "url":
// _uploadImageProvider.tableImageList[i].qiniuUrl
// });
// }
// }
// _setTablePhoto(context, imageQiniuUrlList);
},
));
}),
VEmptyView(24),
_title('经营者/法人信息'),
VEmptyView(20),
_inputWidget('法人身份证号码', TextEditingController(), FocusNode(),
'点击输入法人身份证号码'),
_inputWidget('法人身份证住址', TextEditingController(), FocusNode(),
'点击输入法人身份证住址'),
_inputWidget(
'电话', TextEditingController(), FocusNode(), '点击输入法人电话号码'),
_inputWidget('邮箱', TextEditingController(), FocusNode(),
'点击输入用来收取支付信息的邮箱'),
Row(children: [
Padding(
padding: EdgeInsets.only(
left: w(20), top: w(20), bottom: w(12)),
child: ImgPickerInvitationWidget(
scrollController: _controller,
uploadType: UploadType.InvitationStoreType,
model: _uploadImageProvider,
index: 5,
imageModel: _uploadImageProvider.storeImage1,
subTips: '法人身份证人像页',
callback: () {},
)),
Padding(
padding: EdgeInsets.only(
left: w(20), top: w(20), bottom: w(12)),
child: ImgPickerInvitationWidget(
scrollController: _controller,
uploadType: UploadType.InvitationStoreType,
model: _uploadImageProvider,
index: 6,
imageModel: _uploadImageProvider.storeImage2,
subTips: '法人身份证国徽页',
callback: () {},
)),
]),
_title('收款信息'),
VEmptyView(20),
_select('开户银行', '点击选择开户银行', () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
//弹出开户银行
}),
_inputWidget('开户银行网点', TextEditingController(), FocusNode(),
'点击输入开户银行网点全称'),
_inputWidget(
'银行账户', TextEditingController(), FocusNode(), '点击录入银行账户号'),
_inputWidget('收款商户简称', TextEditingController(), FocusNode(),
'点击输入商户简称,用户支付时可见'),
_inputWidget(
'服务电话', TextEditingController(), FocusNode(), '点击输入服务电话'),
VEmptyView(44),
Padding(
padding: EdgeInsets.only(left: w(16)),
child: Text(
'注:如果填写信息遇到问题,请联系400-000-9690解决。',
style: TextStyle(
fontSize: font(10), color: MyColours.color_515151),
),
),
VEmptyView(44),
],
),
)),
Container(
padding: EdgeInsets.only(
top: w(13), left: w(45), right: w(45), bottom: w(26)),
child: RoundButton(
text: '立即提交',
height: w(43),
radius: r(5),
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
isBold: true,
fontSize: 32,
onPressed: () {},
),
)
],
),
);
}
}
... ...
... ... @@ -67,10 +67,12 @@ class _FinanceManageHomePageState extends State<FinanceManageHomePage> {
body: SingleChildScrollView(
child: Column(
children: [
_item('收银资料上传', () {}),
_item('收银资料上传', () {
NavigatorUtil.goEnterpriseInformationUploadPage(context);
}),
_item('微信商户账户开通结果查询', () {}),
_item('支付返券', () {
// NavigatorUtil.goPaymentGiftPage(context);
NavigatorUtil.goPaymentGiftPage(context);
}),
_item('门店收款码', () {
NavigatorUtil.goPaymentCodePage(context);
... ...
... ... @@ -171,8 +171,7 @@ class _TransactionRecordDetailPageState
// :
body: Consumer<FinanceProvider>(builder: (context, model, _) {
if (model.pageStateRecordDetail != PageState.Success) {
return Expanded(
child: ExceptionPage(
return ExceptionPage(
pageState: model.pageStateRecordHome,
callback: () async {
_getDiscountOrderInfo(isShowLoading: true);
... ... @@ -180,7 +179,7 @@ class _TransactionRecordDetailPageState
emptyMsg: "暂时没有交易详情信息哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍候...",
));
);
} else {
// bool isPay = false;
// if ((model.discountOrderInfoModelData?.refundId != null &&
... ... @@ -286,35 +285,39 @@ class _TransactionRecordDetailPageState
],
),
)),
if (widget.status != '00' &&
model.discountOrderInfoModelData?.status == '2')
Container(
padding: EdgeInsets.only(
top: w(13), left: w(45), right: w(45), bottom: w(26)),
child: RoundButton(
text: '申请退款',
height: w(43),
radius: r(5),
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
isBold: true,
fontSize: 32,
onPressed: () {
//余额充足,可申请退款
DialogUtil.cupertinoAlertDialog(context,
title: '提示',
content: '退款成功后,退款金额将原路返回到顾客账户,请确认是否退款!',
lTitle: '取消退款',
rTitle: '确认退款',
contentColor: MyColours.color_000000,
rCallback: () {
_discountPayRefundApply();
});
},
),
)
(widget.status != '00' &&
model.discountOrderInfoModelData?.status == '2')
? Container(
padding: EdgeInsets.only(
top: w(13),
left: w(45),
right: w(45),
bottom: w(26)),
child: RoundButton(
text: '申请退款',
height: w(43),
radius: r(5),
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_ffffff,
isBold: true,
fontSize: 32,
onPressed: () {
//余额充足,可申请退款
DialogUtil.cupertinoAlertDialog(context,
title: '提示',
content: '退款成功后,退款金额将原路返回到顾客账户,请确认是否退款!',
lTitle: '取消退款',
rTitle: '确认退款',
contentColor: MyColours.color_000000,
rCallback: () {
_discountPayRefundApply();
});
},
),
)
: SizedBox()
],
);
}
... ...
import 'dart:convert';
import 'dart:io';
... ... @@ -53,6 +52,7 @@ class ImgPickerInvitationWidget extends StatefulWidget {
final double height;
final EdgeInsets padding;
final String? subTips;
ImgPickerInvitationWidget(
{Key? key,
this.scrollController,
... ... @@ -67,7 +67,8 @@ class ImgPickerInvitationWidget extends StatefulWidget {
this.padding = EdgeInsets.zero,
this.maxImageNumber,
this.index,
this.height = 281})
this.height = 281,
this.subTips})
: super(key: key);
@override
... ... @@ -107,7 +108,7 @@ class _ImgPickerInvitationWidgetState
}
///#相机拍照,单图选择
Future _getFromPictureOrCamera(imageSource) async {
Future _getFromPictureOrCamera(imageSource) async {
final pickedFile = await picker.pickImage(source: imageSource);
if (pickedFile != null) {
File compressedFile = await FlutterNativeImage.compressImage(
... ... @@ -135,8 +136,8 @@ class _ImgPickerInvitationWidgetState
if (need) {
file = File(compressedFile.absolute.path);
}
UploadImageUtil()
.startUploadOnly(context, file, widget.index, true, widget.model!,widget.callback);
UploadImageUtil().startUploadOnly(
context, file, widget.index, true, widget.model!, widget.callback);
}
}
}
... ... @@ -314,7 +315,7 @@ class _ImgPickerInvitationWidgetState
// }
///添加图片UI弹出
Future _openModalBottomSheet(context) async {
Future _openModalBottomSheet(context) async {
final option = await showModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
... ... @@ -335,8 +336,8 @@ class _ImgPickerInvitationWidgetState
Utils.getPickPermission(context, () {
_getFromPictureOrCamera(ImageSource.camera);
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
Navigator.pop(context);
}
}, Permission.camera);
},
child: Container(
... ... @@ -363,8 +364,8 @@ class _ImgPickerInvitationWidgetState
// pickAsset(RequestType.image);
_getFromPictureOrCamera(ImageSource.gallery);
if (Navigator.canPop(context)) {
Navigator.pop(context);
}
Navigator.pop(context);
}
},
Platform.isAndroid
? Permission.storage
... ... @@ -391,8 +392,7 @@ class _ImgPickerInvitationWidgetState
InkWell(
onTap: () {
if (Navigator.canPop(context)) {
Navigator.pop(context, '取消');
Navigator.pop(context, '取消');
}
},
child: Container(
... ... @@ -464,6 +464,8 @@ class _ImgPickerInvitationWidgetState
/// 九宫格
Widget _getGridImg(context, UploadImgModel imageModel) {
double width =
(ScreenUtil().screenWidth - ScreenUtil().setWidth(40) * 2) / 3;
return imageModel.file != null ||
(imageModel.qiniuUrl != null && imageModel.qiniuUrl != '')
? InkWell(
... ... @@ -493,88 +495,76 @@ class _ImgPickerInvitationWidgetState
child: Stack(alignment: Alignment.bottomCenter, children: [
Stack(clipBehavior: Clip.none, children: [
imageModel.qiniuUrl != null && imageModel.qiniuUrl != ''
? Center(
child: Image.network(
imageModel.qiniuUrl!,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
// height: ScreenUtil().setWidth(281 * 2),
))
: Center(
? CachedNetworkImage(
imageUrl: imageModel.qiniuUrl!,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(100 * 2),
height: ScreenUtil().setWidth(100 * 2),
)
: Container(
child: Image.file(
imageModel.file!,
fit: BoxFit.contain,
// width: double.infinity,
// width: ScreenUtil()
// .setWidth(imgSize * 2),
// height: ScreenUtil().setWidth(281 * 2),
)),
Positioned(
left: 0,
top: 0,
child: (imageModel.file != null) &&
imageModel.process != 1 &&
imageModel.process != 0.01
? Container(
width: ScreenUtil().screenWidth,
height: w(widget.height),
color: MyColours.color_4D000000,
child: Center(
child: Text('上传中',
style:
TextStyle(color: MyColours.color_F8F9FD)),
),
)
: Container()),
imageModel.file!,
fit: BoxFit.cover,
width: ScreenUtil().setWidth(100 * 2),
height: ScreenUtil().setWidth(100 * 2),
),
),
// Positioned(
// left: 0,
// top: 0,
// child: (imageModel.file != null) &&
// imageModel.process != 1 &&
// imageModel.process != 0.01
// ? Container(
// width: ScreenUtil().screenWidth,
// height: w(widget.height),
// color: MyColours.color_4D000000,
// child: Center(
// child: Text('上传中',
// style:
// TextStyle(color: MyColours.color_F8F9FD)),
// ),
// )
// : Container()),
Offstage(
offstage: imageModel.process! < 1,
child: Align(
alignment: Alignment.topRight,
child: GestureDetector(
child: Image.asset(
Utils.getImgPath("delete"),
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
),
onTap: () {
// if (widget.uploadType ==
// UploadType.TableManagerType) {
// if (imageModel.isUpload) {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "是否确定删除该照片?", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
widget.deleteCallback!();
});
// } else {
// //直接删除
// setState(() {
// temp.removeWhere((element) =>
// element == imageModel);
// });
})),
child: Image.asset(
Utils.getImgPath("delete"),
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
),
onTap: () {
// if (widget.uploadType ==
// UploadType.TableManagerType) {
// if (imageModel.isUpload) {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(context,
title: "", content: "是否确定删除该照片?", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
widget.deleteCallback!();
});
// } else {
// //直接删除
// setState(() {
// temp.removeWhere((element) =>
// element == imageModel);
// });
},
)),
),
]),
imageModel.process == 1
? Container(
width: w(150),
height: w(30),
color: MyColours.color_4D000000,
alignment: Alignment.center,
child: Text(
'点击图片可以更换',
style: TextStyle(
color: MyColours.color_F8F9FD,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
: SizedBox(),
Offstage(
offstage: !(imageModel.file != null &&
imageModel.process != 1 &&
imageModel.process != 0.01),
child: Progress(imageModel.process),
)
]))
: InkWell(
onTap: () {
... ... @@ -594,30 +584,39 @@ class _ImgPickerInvitationWidgetState
// }
},
child: Container(
color: MyColours.color_d9d9d9,
width: double.infinity,
height: w(widget.height),
width: width,
height: width,
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_E0E0E0,
width: ScreenUtil().setWidth(2)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// VEmptyView(80),
// VEmptyView(46),
Image.asset(
Utils.getImgPath('add_img'),
width: w(63),
Utils.getImgPath('add_image'),
width: ScreenUtil().setWidth(44),
height: ScreenUtil().setWidth(40),
),
VEmptyView(28),
Container(
width: w(139),
height: w(60),
child: Text(
'点击上传照片\n为了更好的效果\n建议上传4:3照片',
textAlign: TextAlign.center,
style: TextStyle(
height: 1.4,
color: MyColours.color_ffffff,
fontSize: font(14),
fontWeight: FontWeight.bold),
))
VEmptyView(10),
Text(
'上传照片',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_999999),
),
if (widget.subTips != null)
Padding(
padding: EdgeInsets.only(top: w(5)),
child: Text(
'${widget.subTips}',
style: TextStyle(
fontSize: ScreenUtil().setSp(18),
color: MyColours.color_999999),
)),
],
),
));
... ...
... ... @@ -102,7 +102,6 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
}
_getThemeData() async {
(bool, bool, bool) result = await (
_getSellerTemplateColorList(),
getSellerTemplateConf(context),
... ... @@ -163,7 +162,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
}
}
Future<bool> getSellerTemplateConf(BuildContext context) async {
Future<bool> getSellerTemplateConf(BuildContext context) async {
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
if (success && marketingCenterProvider.markDataModel != null) {
return true;
... ... @@ -337,7 +336,7 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
return false;
}
Future<bool> getColorsData() async {
Future<bool> getColorsData() async {
bool success = await marketingCenterProvider.getColorsData(context);
if (success) {
return true;
... ... @@ -654,16 +653,31 @@ class _InvitationThemeHomePageState extends State<InvitationThemeHomePage> {
itemBuilder: (BuildContext context, int index) {
SellerTemplateColorListSunModel themeSunModel =
marketingCenterProvider.templeteDatas![index];
return new ClipRRect(
borderRadius: BorderRadius.circular(r(10)),
child: CachedNetworkImage(
imageUrl: themeSunModel.urlSmall!,
// width:
// (ScreenUtil().screenWidth - w(62)) / 2,
// height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
));
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: new ClipRRect(
borderRadius: BorderRadius.circular(r(10)),
child: CachedNetworkImage(
imageUrl: themeSunModel.urlSmall!,
// width:
// (ScreenUtil().screenWidth - w(62)) / 2,
// height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
)),
),
VEmptyView(10),
Text(
'模板 ${themeSunModel.id}',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
)
],
);
},
onTap: (v) {
print(v);
... ...
... ... @@ -422,11 +422,25 @@ class NoteBookPageState extends State<NoteBookPage> {
// }
dateTimeNow = day;
Duration days = day!.difference(DateTime.now());
DateTime nowDay = (DateTime.parse((dateTimeNow!.year.toString() +
"-" +
Utils.addZeroNumber(dateTimeNow!.month) +
"-" +
Utils.addZeroNumber(dateTimeNow!.day) +
" 00:00:00")));
DateTime startDay = (DateTime.parse((DateTime.now().year.toString() +
"-" +
Utils.addZeroNumber(DateTime.now().month) +
"-" +
Utils.addZeroNumber(DateTime.now().day) +
" 00:00:00")));
Duration days = nowDay.difference(startDay);
print(days);
/// _focusedDay
if ((days.inDays == 0) || (days.inDays > 0 && days.inDays < 7)) {
if ((days.inDays == 0 ) ||
(days.inDays > 0 && days.inDays <7)) {
// _calendarController.setSelectedDay(day);
dateText = '更多\n日期';
clearSel = false;
... ... @@ -434,7 +448,7 @@ class NoteBookPageState extends State<NoteBookPage> {
} else {
clearSel = true;
// dateText = '${day.year}年\n${day.month}月\n${day.day}日';
dateText = '${day.month}月\n${day.day}日';
dateText = '${day!.month}月\n${day.day}日';
}
});
}
... ... @@ -704,8 +718,8 @@ class NoteBookPageState extends State<NoteBookPage> {
Container(
color: MyColours.color_ffffff,
padding: EdgeInsets.only(
right: ScreenUtil().setWidth(24),
),
left: ScreenUtil().setWidth(20),
right: ScreenUtil().setWidth(20)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
... ... @@ -715,13 +729,15 @@ class NoteBookPageState extends State<NoteBookPage> {
lastDay: DateTime(2050),
focusedDay: _focusedDay!,
currentDay: DateTime.now(),
rowHeight: ScreenUtil().setWidth(74 * 2),
rowHeight: ScreenUtil().setWidth(40 * 2),
// calendarController: _calendarController,
// initialSelectedDay: dateTimeNow,
headerVisible: false,
// daysOfWeekHeight: w(10),
startingDayOfWeek: startingDayOfWeek,
selectedDayPredicate: (day) =>
isSameDay(dateTimeNow!, day),
selectedDayPredicate: (day) => clearSel
? false
: isSameDay(dateTimeNow!, day),
// startDay: DateTime.now(),
// endDay: DateTime.now().add(Duration(days: 5)),
onDaySelected: (
... ... @@ -746,6 +762,14 @@ class NoteBookPageState extends State<NoteBookPage> {
locale: "zh_CN",
calendarFormat: CalendarFormat.week,
calendarStyle: CalendarStyle(
outsideTextStyle: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(28),
),
cellMargin: EdgeInsets.zero,
cellPadding: EdgeInsets.zero
// renderDaysOfWeek: false,
// defaultTextStyle: TextStyle(
// color: MyColours.color_515151,
... ... @@ -781,251 +805,168 @@ class NoteBookPageState extends State<NoteBookPage> {
// color: MyColours.font_color_333333),
),
calendarBuilders: CalendarBuilders(
dowBuilder: (context, date) {
return SizedBox();
dowBuilder: (context, day) {
return InkWell(
onTap: () {
if (!Utils.isOneDay(
day, dateTimeNow!)) {
//不是一天
dateTimeNow = day;
_focusedDay = dateTimeNow;
clearSel = false;
setState(() {
dateText = '更多\n日期';
});
ddateSoltSelect =
currTimeIndex.toString();
getMealSectionByDay(needInit: false);
_reserveCountDay();
}
},
child: Container(
padding: EdgeInsets.zero,
alignment: Alignment.center,
child: Text(
DateTime.now().weekday ==
day.weekday
? '今日'
: Utils.formatWeekDayNum(
day.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
day.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(28)),
)));
},
defaultBuilder: (context, dateTime, date2) {
return Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
dateTime.weekday
? '今日'
: Utils.formatWeekDayNum(
dateTime.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
dateTime.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(28)),
),
),
Container(
width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
)
]);
},
disabledBuilder: (context, dateTime, events) {
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
padding: EdgeInsets.all(
ScreenUtil().setWidth(4),
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
outsideBuilder: (context, day, focusedDay) {
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// ),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
day.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
disabledBuilder: (context, dateTime, events) {
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// ),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_999999),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
// weekNumberBuilder: (context, weekday) {
// return Container(
// color: MyColours.color_ffffff,
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(16)),
// child: Text(
// "周${Utils.formatWeekDayNum(DateTime.now().weekday)}" ==
// weekday
// ? '今日'
// : weekday.toString(),
// style: TextStyle(
// color:
// "周${Utils.formatWeekDayNum(dateTimeNow!.weekday)}" ==
// weekday &&
// !clearSel
// ? MyColours.color_438E93
// : MyColours.color_BFC4D4,
// fontSize: ScreenUtil().setSp(28)),
// ),
// );
// },
selectedBuilder: (context, date, _) {
return clearSel
? Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical:
ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
date.weekday
? '今日'
: Utils.formatWeekDayNum(
date.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
date.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(28)),
),
),
Container(
width:
ScreenUtil().setWidth(28 * 2),
height:
ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
child: Text(
date.day.toString(),
style: TextStyle().copyWith(
fontSize:
ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
)
])
: Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical:
ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
date.weekday
? '今日'
: Utils.formatWeekDayNum(
date.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
date.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(28)),
),
),
Container(
width:
ScreenUtil().setWidth(28 * 2),
height:
ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [
MyColours.color_438E93,
MyColours.color_438E93
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
// border: Border.all(color: MyColours.color_FFB116)
),
alignment: Alignment.center,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
padding: EdgeInsets.all(
ScreenUtil().setWidth(4),
),
child: Text(
date.day.toString(),
style: TextStyle().copyWith(
fontSize:
ScreenUtil().setSp(28),
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold),
),
)
]);
},
todayBuilder: (context, dateTime, _) {
return Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
dateTime.weekday
? '今日'
: Utils.formatWeekDayNum(
dateTime.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
dateTime.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(28)),
),
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: clearSel
? null
: LinearGradient(
colors: [
MyColours.color_438E93,
MyColours.color_438E93
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
date.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: clearSel
? MyColours.color_515151
: MyColours.color_ffffff,
fontWeight: FontWeight.bold),
),
Container(
width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
)
]);
);
},
singleMarkerBuilder:
(context, dateTime, event) {
todayBuilder: (context, dateTime, _) {
return Container(
width: ScreenUtil().setWidth(6),
height: ScreenUtil().setWidth(6),
margin: const EdgeInsets.symmetric(
horizontal: 0.3),
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: MyColours.color_ff0000,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
// singleMarkerBuilder:
// (context, dateTime, event) {
// return Container(
// width: ScreenUtil().setWidth(6),
// height: ScreenUtil().setWidth(6),
// margin: const EdgeInsets.symmetric(
// horizontal: 0.3),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// color: MyColours.color_ff0000,
// ),
// );
// },
))),
InkWell(
onTap: () {
... ...
import 'dart:convert';
import 'dart:io';
... ... @@ -17,6 +16,7 @@ import 'package:one_key/provider/upload_img_provider.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/misc.dart';
import 'package:one_key/utils/screen_util.dart';
import 'package:one_key/utils/upload_image_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
... ... @@ -49,6 +49,7 @@ class ImgPickerWidget extends StatefulWidget {
final DeleteCallback? deleteCallback;
final String? maxRemind;
final List<UploadImgModel>? imageList;
final String? subTips;
ImgPickerWidget(
{Key? key,
this.scrollController,
... ... @@ -59,7 +60,8 @@ class ImgPickerWidget extends StatefulWidget {
this.uploadType,
this.deleteCallback,
this.maxRemind,
this.imageList})
this.imageList,
this.subTips})
: super(key: key);
@override
... ... @@ -168,8 +170,8 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
if (need) {
file = File(path);
}
UploadImageUtil().startUpload(
context, file, temp!.length - 1, true, widget.model!, widget.uploadType,
UploadImageUtil().startUpload(context, file, temp!.length - 1, true,
widget.model!, widget.uploadType,
callback: widget.callback, countAll: 1, imageList: widget.imageList);
}
}
... ... @@ -592,6 +594,15 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_999999),
),
if (widget.subTips != null)
Padding(
padding: EdgeInsets.only(top: w(5)),
child: Text(
'${widget.subTips}',
style: TextStyle(
fontSize: ScreenUtil().setSp(18),
color: MyColours.color_999999),
)),
widget.maxRemind != null ? VEmptyView(10) : SizedBox(),
widget.maxRemind != null
? Text(
... ...
... ... @@ -48,7 +48,8 @@ class InvitationThemeHomePageSim extends StatefulWidget {
_InvitationThemeHomePageSimState();
}
class _InvitationThemeHomePageSimState extends State<InvitationThemeHomePageSim> {
class _InvitationThemeHomePageSimState
extends State<InvitationThemeHomePageSim> {
late MarketingCenterProvider marketingCenterProvider;
ScrollController controller = ScrollController();
... ... @@ -103,7 +104,6 @@ class _InvitationThemeHomePageSimState extends State<InvitationThemeHomePageSim>
}
_getThemeData() async {
(bool, bool, bool) result = await (
_getSellerTemplateColorList(),
getSellerTemplateConf(context),
... ... @@ -164,7 +164,7 @@ class _InvitationThemeHomePageSimState extends State<InvitationThemeHomePageSim>
}
}
Future<bool> getSellerTemplateConf(BuildContext context) async {
Future<bool> getSellerTemplateConf(BuildContext context) async {
bool success = await marketingCenterProvider.getSellerTemplateConf(context);
if (success && marketingCenterProvider.markDataModel != null) {
return true;
... ... @@ -338,7 +338,7 @@ class _InvitationThemeHomePageSimState extends State<InvitationThemeHomePageSim>
return false;
}
Future<bool> getColorsData() async {
Future<bool> getColorsData() async {
bool success = await marketingCenterProvider.getColorsData(context);
if (success) {
return true;
... ... @@ -655,16 +655,31 @@ class _InvitationThemeHomePageSimState extends State<InvitationThemeHomePageSim>
itemBuilder: (BuildContext context, int index) {
SellerTemplateColorListSunModel themeSunModel =
marketingCenterProvider.templeteDatas![index];
return new ClipRRect(
borderRadius: BorderRadius.circular(r(10)),
child: CachedNetworkImage(
imageUrl: themeSunModel.urlSmall!,
// width:
// (ScreenUtil().screenWidth - w(62)) / 2,
// height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
));
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Expanded(
child: new ClipRRect(
borderRadius: BorderRadius.circular(r(10)),
child: CachedNetworkImage(
imageUrl: themeSunModel.urlSmall!,
// width:
// (ScreenUtil().screenWidth - w(62)) / 2,
// height: w(348),
fit: BoxFit.fitWidth,
alignment: Alignment.topCenter,
)),
),
VEmptyView(10),
Text(
'模板 ${themeSunModel.id}',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(16)),
)
],
);
},
onTap: (v) {
print(v);
... ...
... ... @@ -419,9 +419,9 @@ class _CustomerNoticeSettingPageSimState
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar('客户通知设置'),
body: Consumer<MarketingCenterProvider>(builder: (context1, model, _) {
if (model.pageState != PageState.Success) {
if (model.pageStateSetting != PageState.Success) {
return ExceptionPage(
pageState: model.pageState,
pageState: model.pageStateSetting,
callback: () async {
getDzSellerConf();
// _getThemeData();
... ...
... ... @@ -385,8 +385,22 @@ class NoteBookPageSimState extends State<NoteBookPageSim> {
// }
dateTimeNow = day;
Duration days = day!.difference(DateTime.now());
DateTime nowDay = (DateTime.parse((dateTimeNow!.year.toString() +
"-" +
Utils.addZeroNumber(dateTimeNow!.month) +
"-" +
Utils.addZeroNumber(dateTimeNow!.day) +
" 00:00:00")));
DateTime startDay = (DateTime.parse((DateTime.now().year.toString() +
"-" +
Utils.addZeroNumber(DateTime.now().month) +
"-" +
Utils.addZeroNumber(DateTime.now().day) +
" 00:00:00")));
Duration days = nowDay.difference(startDay);
print(days);
if ((days.inDays == 0) || (days.inDays > 0 && days.inDays < 7)) {
// _calendarController.setSelectedDay(day);
dateTimeNow = day;
... ... @@ -395,7 +409,7 @@ class NoteBookPageSimState extends State<NoteBookPageSim> {
clearSel = false;
} else {
clearSel = true;
dateText = '${day.month}月\n${day.day}日';
dateText = '${day!.month}月\n${day.day}日';
}
});
}
... ... @@ -596,13 +610,15 @@ class NoteBookPageSimState extends State<NoteBookPageSim> {
lastDay: DateTime(2050),
focusedDay: _focusedDay!,
currentDay: DateTime.now(),
rowHeight: ScreenUtil().setWidth(74 * 2),
rowHeight: ScreenUtil().setWidth(40 * 2),
// calendarController: _calendarController,
// initialSelectedDay: dateTimeNow,
headerVisible: false,
// daysOfWeekHeight: w(10),
startingDayOfWeek: startingDayOfWeek,
selectedDayPredicate: (day) =>
isSameDay(dateTimeNow!, day),
selectedDayPredicate: (day) => clearSel
? false
: isSameDay(dateTimeNow!, day),
// startDay: DateTime.now(),
// endDay: DateTime.now().add(Duration(days: 5)),
onDaySelected: (
... ... @@ -625,6 +641,14 @@ class NoteBookPageSimState extends State<NoteBookPageSim> {
locale: "zh_CN",
calendarFormat: CalendarFormat.week,
calendarStyle: CalendarStyle(
outsideTextStyle: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(28),
),
cellMargin: EdgeInsets.zero,
cellPadding: EdgeInsets.zero
// renderDaysOfWeek: false,
// defaultTextStyle: TextStyle(
// color: MyColours.color_515151,
... ... @@ -660,248 +684,149 @@ class NoteBookPageSimState extends State<NoteBookPageSim> {
// color: MyColours.font_color_333333),
),
calendarBuilders: CalendarBuilders(
dowBuilder: (context, date) {
return SizedBox();
dowBuilder: (context, day) {
return InkWell(
onTap: () {
if (!Utils.isOneDay(
day, dateTimeNow!)) {
//不是一天
dateTimeNow = day;
_focusedDay = dateTimeNow;
clearSel = false;
setState(() {
dateText = '更多\n日期';
});
_getReserveList();
_reserveCountDay();
}
},
child: Container(
padding: EdgeInsets.zero,
alignment: Alignment.center,
child: Text(
DateTime.now().weekday ==
day.weekday
? '今日'
: Utils.formatWeekDayNum(
day.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
day.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(28)),
)));
},
defaultBuilder: (context, dateTime, date2) {
return Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
dateTime.weekday
? '今日'
: Utils.formatWeekDayNum(
dateTime.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
dateTime.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(28)),
),
),
Container(
width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
)
]);
},
disabledBuilder: (context, dateTime, events) {
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
padding: EdgeInsets.all(
ScreenUtil().setWidth(4),
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
outsideBuilder: (context, day, focusedDay) {
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// ),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
day.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
disabledBuilder: (context, dateTime, events) {
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
// decoration: BoxDecoration(
// shape: BoxShape.circle,
// ),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_999999),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
// weekNumberBuilder: (context, weekday) {
// return Container(
// color: MyColours.color_ffffff,
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(
// vertical: ScreenUtil().setWidth(16)),
// child: Text(
// "周${Utils.formatWeekDayNum(DateTime.now().weekday)}" ==
// weekday
// ? '今日'
// : weekday.toString(),
// style: TextStyle(
// color:
// "周${Utils.formatWeekDayNum(dateTimeNow!.weekday)}" ==
// weekday &&
// !clearSel
// ? MyColours.color_438E93
// : MyColours.color_BFC4D4,
// fontSize: ScreenUtil().setSp(28)),
// ),
// );
// },
selectedBuilder: (context, date, _) {
return clearSel
? Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical:
ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
date.weekday
? '今日'
: Utils.formatWeekDayNum(
date.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
date.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(28)),
),
),
Container(
width:
ScreenUtil().setWidth(28 * 2),
height:
ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
child: Text(
date.day.toString(),
style: TextStyle().copyWith(
fontSize:
ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
)
])
: Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical:
ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
date.weekday
? '今日'
: Utils.formatWeekDayNum(
date.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
date.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(28)),
),
),
Container(
width:
ScreenUtil().setWidth(28 * 2),
height:
ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: LinearGradient(
colors: [
MyColours.color_438E93,
MyColours.color_438E93
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
// border: Border.all(color: MyColours.color_FFB116)
),
alignment: Alignment.center,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
padding: EdgeInsets.all(
ScreenUtil().setWidth(4),
),
child: Text(
date.day.toString(),
style: TextStyle().copyWith(
fontSize:
ScreenUtil().setSp(28),
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold),
),
)
]);
},
todayBuilder: (context, dateTime, _) {
return Column(children: [
Container(
color: MyColours.color_ffffff,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(
vertical: ScreenUtil().setWidth(16)),
child: Text(
DateTime.now().weekday ==
dateTime.weekday
? '今日'
: Utils.formatWeekDayNum(
dateTime.weekday),
style: TextStyle(
color: dateTimeNow!.weekday ==
dateTime.weekday &&
!clearSel
? MyColours.color_438E93
: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(28)),
),
return Container(
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
gradient: clearSel
? null
: LinearGradient(
colors: [
MyColours.color_438E93,
MyColours.color_438E93
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter),
),
Container(
width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
margin: EdgeInsets.all(
ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
)
]);
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
date.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: clearSel
? MyColours.color_515151
: MyColours.color_ffffff,
fontWeight: FontWeight.bold),
),
);
},
singleMarkerBuilder:
(context, dateTime, event) {
todayBuilder: (context, dateTime, _) {
return Container(
width: ScreenUtil().setWidth(6),
height: ScreenUtil().setWidth(6),
margin: const EdgeInsets.symmetric(
horizontal: 0.3),
// width: ScreenUtil().setWidth(28 * 2),
height: ScreenUtil().setWidth(28 * 2),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: MyColours.color_ff0000,
),
alignment: Alignment.center,
padding: EdgeInsets.zero,
// margin: EdgeInsets.all(
// ScreenUtil().setWidth(8)),
child: Text(
dateTime.day.toString(),
style: TextStyle().copyWith(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_515151,
fontWeight: FontWeight.bold),
),
);
},
... ...
... ... @@ -359,13 +359,18 @@ class NavigatorUtil {
/// 创建优惠券
static Future<dynamic> goCouponEditPage(BuildContext context,
{replace = false, String? from,String? end,bool isMine = true, CouponSunModel? couponSunModel}) {
{replace = false,
String? from,
String? end,
bool isMine = true,
CouponSunModel? couponSunModel}) {
if (couponSunModel != null) {
return _navigateTo(context,
"${Routes.coupon_edit}?isMine=${isMine}&from=${from}&end=$end&couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}",
replace: replace);
}
return _navigateTo(context, "${Routes.coupon_edit}?isMine=${isMine}&from=${from}&end=$end",
return _navigateTo(
context, "${Routes.coupon_edit}?isMine=${isMine}&from=${from}&end=$end",
replace: replace);
}
... ... @@ -2412,4 +2417,13 @@ class NavigatorUtil {
"${Routes.payment_gift_select_page}?object=${FluroConvertUtils.object2string(object)}&from=$from&end=$end&type=$type&mulSelect=${mulSelect}",
replace: replace);
}
///支付返券------企业资料上传
static Future<dynamic> goEnterpriseInformationUploadPage(
BuildContext context, {
replace = false,
}) {
return _navigateTo(context, "${Routes.enterprise_information_upload_page}",
replace: replace);
}
}
... ...
... ... @@ -221,6 +221,7 @@ import '../pages/my/feast_manage/feast_setmeal_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_type_page.dart';
import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_wine_manage_page.dart';
import '../pages/my/finance_manage/enterprise_information_upload_page.dart';
import '../pages/my/finance_manage/finance_manage_home_page.dart';
import '../pages/my/finance_manage/payment_code_page.dart';
import '../pages/my/finance_manage/payment_gift_page.dart';
... ... @@ -890,8 +891,8 @@ var handleCouponEditPageHandler = new Handler(
bool isMine =
FluroConvertUtils.string2bool(params["isMine"]!.first as String);
String from= params["from"]?.first as String;
String end = params["end"]?.first as String;
String from = params["from"]?.first as String;
String end = params["end"]?.first as String;
CouponSunModel? couponSunModel;
if (params.keys.contains("couponSunModel")) {
couponSunModel = CouponSunModel.fromJson(json.decode(
... ... @@ -901,7 +902,11 @@ var handleCouponEditPageHandler = new Handler(
return ChangeNotifierProvider<UploadImageProvider>(
create: (_) => UploadImageProvider(),
child: CouponEidtPage(isMine: isMine,from:from,end:end, couponSunModel: couponSunModel));
child: CouponEidtPage(
isMine: isMine,
from: from,
end: end,
couponSunModel: couponSunModel));
});
///选择优惠券
... ... @@ -4233,9 +4238,9 @@ var paymentGiftSelectPageHandle = new Handler(
// String idstr = params["idstr"].first;dfdf
String type = params["type"]!.first as String;
String from= params["from"]!.first as String;
String end = params["end"]!.first as String;
List<CouponSunModel> res = [];
String from = params["from"]!.first as String;
String end = params["end"]!.first as String;
List<CouponSunModel> res = [];
if (params.keys.contains('object')) {
Map object =
FluroConvertUtils.string2map(params["object"]!.first as String)!;
... ... @@ -4249,8 +4254,22 @@ var paymentGiftSelectPageHandle = new Handler(
FluroConvertUtils.string2bool(params["mulSelect"]!.first as String);
// NotebookDetail detailEntity = NotebookDetail.fromJson(json
// .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
return ChangeNotifierProvider<MarketingCenterProvider>(
create: (_) => MarketingCenterProvider(),
return ChangeNotifierProvider< FinanceProvider>(
create: (_) => FinanceProvider(),
child: PaymentGiftSelectPage(
type: type, couponList: res, mulSelect: mulSelect,from :from,end:end));
type: type,
couponList: res,
mulSelect: mulSelect,
from: from,
end: end));
});
///企业资料上传
var enterpriseInformationUploadPageHandle = new Handler(
handlerFunc: (BuildContext? context, Map<dynamic, List<Object>> params) {
return ChangeNotifierProvider< FinanceProvider>(
create: (_) => FinanceProvider(),
child: ChangeNotifierProvider<UploadImageProvider>(
create: (_) => UploadImageProvider(),
child: EnterpriseInformationUploadPage()));
});
... ...
... ... @@ -421,6 +421,10 @@ class Routes {
"/payment_gift_page"; //支付返券
static String payment_gift_select_page =
"/payment_gift_select_page"; //支付返券选择券页面(免费代金券)
static String enterprise_information_upload_page =
"/enterprise_information_upload_page"; //企业客户资料上传页面
static void configureRoutes(FluroRouter router) {
... ... @@ -797,6 +801,11 @@ class Routes {
router.define(payment_gift_select_page,
handler:paymentGiftSelectPageHandle);
router.define(enterprise_information_upload_page,
handler:enterpriseInformationUploadPageHandle);
... ...
import 'package:intl/intl.dart';
class LunarCalendar {
... ... @@ -13,7 +12,7 @@ class LunarCalendar {
///中文月名称
static List<String> chineseNumberShow = [
"一月",
"正月",
"二月",
"三月",
"四月",
... ... @@ -27,7 +26,7 @@ class LunarCalendar {
"腊月"
];
///中文月名称
///中文月名称
static List<String> chineseNumber = [
"一",
"二",
... ... @@ -280,7 +279,7 @@ class LunarCalendar {
}
static String getChinaDayString(int day) {
List<String> chineseTen = ["初", "十", "廿", "卅"];
List<String> chineseTen = ["初", "十", "廿", "三"];
int n = day % 10 == 0 ? 9 : day % 10 - 1;
if (day > 30) return "";
if (day == 10)
... ... @@ -289,9 +288,9 @@ class LunarCalendar {
return chineseTen[day ~/ 10] + chineseNumber[n];
}
String getChinaMonthString() {
return chineseNumber[month - 1];
}
// String getChinaMonthString() {
// return chineseNumber[month - 1];
// }
String getChinaMonthStringShow() {
return chineseNumberShow[month - 1];
... ...
... ... @@ -958,7 +958,7 @@ class Utils {
static String lunarCalendarUtils(DateTime day) {
LunarCalendar lunarCalendar = LunarCalendar(day);
String time =
'${lunarCalendar.getChinaMonthString()}月${LunarCalendar.getChinaDayString(lunarCalendar.day!)}';
'${lunarCalendar.getChinaMonthStringShow()}${LunarCalendar.getChinaDayString(lunarCalendar.day!)}';
return time;
}
... ...