Commit 2da1398eaab23f8bc0be9c9ea189f4c626b21f96

Authored by weixin_45529955
1 parent 1809c4d0

生日和纪念日改版

1 import 'package:common_utils/common_utils.dart'; 1 import 'package:common_utils/common_utils.dart';
2 import 'package:json_annotation/json_annotation.dart'; 2 import 'package:json_annotation/json_annotation.dart';
  3 +import 'package:lunar/calendar/Lunar.dart';
  4 +import 'package:lunar/calendar/Solar.dart';
3 import 'dart:convert' as convert; 5 import 'dart:convert' as convert;
4 import 'package:one_key/models/table_list.dart' as t; 6 import 'package:one_key/models/table_list.dart' as t;
5 7
  8 +import '../utils/pick_date_nonli_gongli/lunar_calendar_util.dart';
  9 +
6 part 'guest_info_model.g.dart'; 10 part 'guest_info_model.g.dart';
7 11
8 @JsonSerializable() 12 @JsonSerializable()
@@ -106,6 +110,9 @@ class Guest extends Object { @@ -106,6 +110,9 @@ class Guest extends Object {
106 @JsonKey(name: 'c_day_self') 110 @JsonKey(name: 'c_day_self')
107 String? cDaySelf; 111 String? cDaySelf;
108 112
  113 + @JsonKey(name: 'n_day')
  114 + String? nDaySelf;
  115 +
109 String? get rnameStr { 116 String? get rnameStr {
110 if (rname == null || rname == '' || rname == ' ') return ""; 117 if (rname == null || rname == '' || rname == ' ') return "";
111 return rname; 118 return rname;
@@ -115,7 +122,27 @@ class Guest extends Object { @@ -115,7 +122,27 @@ class Guest extends Object {
115 if (cDaySelf == null || cDaySelf == '') return ''; 122 if (cDaySelf == null || cDaySelf == '') return '';
116 return DateUtil.formatDate( 123 return DateUtil.formatDate(
117 DateTime.fromMillisecondsSinceEpoch(int.parse(cDaySelf!) * 1000), 124 DateTime.fromMillisecondsSinceEpoch(int.parse(cDaySelf!) * 1000),
118 - format: DateFormats.y_mo_d); 125 + format: DateFormats.zh_y_mo_d);
  126 + }
  127 +
  128 + String get ndaySelfStr {
  129 + if (nDaySelf == null || nDaySelf == '') return '';
  130 +
  131 + DateTime time =
  132 + DateTime.fromMillisecondsSinceEpoch(int.parse(nDaySelf!) * 1000);
  133 +
  134 + // 获取当前阴历
  135 + Lunar currentLunarTime = Solar.fromDate(time).getLunar();
  136 + String yearStr = currentLunarTime.getYear().toString();
  137 + String monthStr = currentLunarTime.getMonth().abs().toString();
  138 + String dayStr = currentLunarTime.getDay().toString();
  139 + //转换成农历
  140 +
  141 + String show = (yearStr) +
  142 + '年' +
  143 + LunarCalendarUtil.formatLunarDate(
  144 + int.parse(monthStr), int.parse(dayStr));
  145 + return show;
119 } 146 }
120 147
121 String get sexStr { 148 String get sexStr {
@@ -159,7 +186,8 @@ class Guest extends Object { @@ -159,7 +186,8 @@ class Guest extends Object {
159 this.label, 186 this.label,
160 this.nickName, 187 this.nickName,
161 this.isMember, 188 this.isMember,
162 - this.cDaySelf); 189 + this.cDaySelf,
  190 + this.nDaySelf);
163 191
164 factory Guest.fromJson(Map<String, dynamic> srcJson) => 192 factory Guest.fromJson(Map<String, dynamic> srcJson) =>
165 _$GuestFromJson(srcJson); 193 _$GuestFromJson(srcJson);
@@ -77,6 +77,7 @@ Guest _$GuestFromJson(Map<String, dynamic> json) { @@ -77,6 +77,7 @@ Guest _$GuestFromJson(Map<String, dynamic> json) {
77 json['nick_name'] as String?, 77 json['nick_name'] as String?,
78 json['is_member'] as String?, 78 json['is_member'] as String?,
79 json['c_day_self'] as String?, 79 json['c_day_self'] as String?,
  80 + json['n_day'] as String?,
80 ); 81 );
81 } 82 }
82 83
@@ -99,7 +100,8 @@ Map<String, dynamic> _$GuestToJson(Guest instance) => <String, dynamic>{ @@ -99,7 +100,8 @@ Map<String, dynamic> _$GuestToJson(Guest instance) => <String, dynamic>{
99 'label': instance.label, 100 'label': instance.label,
100 'nick_name': instance.nickName, 101 'nick_name': instance.nickName,
101 'is_member': instance.isMember, 102 'is_member': instance.isMember,
102 - 'c_day_self': instance.cDaySelf 103 + 'c_day_self': instance.cDaySelf,
  104 + 'n_day':instance.nDaySelf
103 }; 105 };
104 106
105 Cday _$CdayFromJson(Map<String, dynamic> json) { 107 Cday _$CdayFromJson(Map<String, dynamic> json) {
@@ -176,7 +176,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { @@ -176,7 +176,7 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> {
176 await customerProvider.setGuestInfo(context, params, showLoading: true); 176 await customerProvider.setGuestInfo(context, params, showLoading: true);
177 if (sucess) { 177 if (sucess) {
178 Utils.showToast('保存成功'); 178 Utils.showToast('保存成功');
179 - bus.emit('refresh_guest_info'); 179 + bus.emit('refresh_guest_info_my');
180 bus.emit('refresh_guest_list_my'); 180 bus.emit('refresh_guest_list_my');
181 if (Navigator.canPop(context)) { 181 if (Navigator.canPop(context)) {
182 Navigator.pop(context); 182 Navigator.pop(context);
@@ -21,6 +21,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; @@ -21,6 +21,7 @@ import 'package:one_key/widgets/system_app_bar.dart';
21 import 'package:one_key/widgets/v_empty_view.dart'; 21 import 'package:one_key/widgets/v_empty_view.dart';
22 import 'package:provider/provider.dart'; 22 import 'package:provider/provider.dart';
23 23
  24 +import '../../../../utils/pick_date_nonli_gongli/lunar_calendar_util.dart';
24 import '../../../../utils/screen_util.dart'; 25 import '../../../../utils/screen_util.dart';
25 /** 26 /**
26 * 27 *
@@ -52,14 +53,14 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -52,14 +53,14 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
52 WidgetsBinding.instance.addPostFrameCallback((_) async { 53 WidgetsBinding.instance.addPostFrameCallback((_) async {
53 _getGuestInfo(); 54 _getGuestInfo();
54 }); 55 });
55 - bus.on("refresh_guest_info", (arg) { 56 + bus.on("refresh_guest_info_my", (arg) {
56 _getGuestInfo(); 57 _getGuestInfo();
57 }); 58 });
58 } 59 }
59 60
60 @override 61 @override
61 void dispose() { 62 void dispose() {
62 - bus.off('refresh_guest_info'); 63 + bus.off('refresh_guest_info_my');
63 super.dispose(); 64 super.dispose();
64 } 65 }
65 66
@@ -968,77 +969,101 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -968,77 +969,101 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
968 _lineItemWidget('服务', 969 _lineItemWidget('服务',
969 '${customerProvider.guestInfoSunModel!.guest!.serve == null ? '' : customerProvider.guestInfoSunModel!.guest!.serve}'), 970 '${customerProvider.guestInfoSunModel!.guest!.serve == null ? '' : customerProvider.guestInfoSunModel!.guest!.serve}'),
970 VEmptyView(20), 971 VEmptyView(20),
  972 +
971 Container( 973 Container(
972 - padding: EdgeInsets.symmetric(  
973 - horizontal: ScreenUtil().setWidth(40),  
974 - vertical: ScreenUtil().setWidth(30)),  
975 - color: MyColours.color_ffffff,  
976 - child: Row(  
977 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
978 - children: [  
979 - Text(  
980 - '生日',  
981 - style: TextStyle(  
982 - fontSize: ScreenUtil().setSp(36),  
983 - color: MyColours.color_333333),  
984 - ),  
985 - Spacer(),  
986 - Text(  
987 - birthday,  
988 - style: TextStyle(  
989 - fontSize: ScreenUtil().setSp(26),  
990 - color: MyColours.color_333333),  
991 - ),  
992 - HEmptyView(20),  
993 - RoundButton(  
994 - text: '编辑',  
995 - radius: ScreenUtil().setWidth(20),  
996 - width: ScreenUtil().setWidth(90),  
997 - height: ScreenUtil().setWidth(50),  
998 - fontSize: 26,  
999 - isBold: false,  
1000 - onPressed: () {  
1001 - DialogUtil.showPickerDateTime24(  
1002 - context,  
1003 - scaffoldKey,  
1004 - (value) async {  
1005 - // {'text': picker.adapter.text, 'select': selecteds}  
1006 - if (value != null) {  
1007 - setState(() {  
1008 - print(value);  
1009 - birthday = DateUtil.formatDateStr(value,  
1010 - format: DateFormats.y_mo_d);  
1011 - });  
1012 - // 请求接口,设置生日  
1013 - String from = birthday + ' 00:00:00';  
1014 - Map<String, String?> params = {  
1015 - 'id': widget.userHistoryEntity!.id,  
1016 - 'c_day':  
1017 - '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}',  
1018 - };  
1019 - bool sucess = await customerProvider  
1020 - .setGuestInfo(context, params,  
1021 - showLoading: true);  
1022 - if (sucess) {  
1023 - Utils.showToast('保存成功');  
1024 - }  
1025 - }  
1026 - // showDateSelWidget = false; 974 + padding: EdgeInsets.symmetric(
  975 + horizontal: ScreenUtil().setWidth(40),
  976 + vertical: ScreenUtil().setWidth(30)),
  977 + color: MyColours.color_ffffff,
  978 + child: Column(
  979 + children: [
  980 + Row(
  981 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  982 + children: [
  983 + Text(
  984 + '生日',
  985 + style: TextStyle(
  986 + fontSize: ScreenUtil().setSp(36),
  987 + color: MyColours.color_333333),
  988 + ),
  989 + Spacer(),
  990 + // Text(
  991 + // birthday,
  992 + // style: TextStyle(
  993 + // fontSize: ScreenUtil().setSp(26),
  994 + // color: MyColours.color_333333),
  995 + // ),
  996 + // HEmptyView(20),
  997 + RoundButton(
  998 + text: '编辑',
  999 + radius: ScreenUtil().setWidth(20),
  1000 + width: ScreenUtil().setWidth(90),
  1001 + height: ScreenUtil().setWidth(50),
  1002 + fontSize: 26,
  1003 + isBold: false,
  1004 + onPressed: () {
  1005 + NavigatorUtil.goSetBirthdayPage(
  1006 + context,
  1007 + widget.userHistoryEntity!.id,
  1008 + customerProvider
  1009 + .guestInfoSunModel!.guest!.nDaySelf,
  1010 + customerProvider
  1011 + .guestInfoSunModel!.guest!.cDaySelf,
  1012 + from: 'my');
1027 }, 1013 },
1028 - yearBegin: 1925,  
1029 - minValue: DateTime(1925),  
1030 - dateTime: birthday == ''  
1031 - ? DateTime.now()  
1032 - : DateUtil.getDateTime(birthday),  
1033 - pickerDateTimeType: PickerDateTimeType.kYMD,  
1034 - onCancel: () {  
1035 - // showDateSelWidget = false;  
1036 - });  
1037 - },  
1038 - ),  
1039 - ],  
1040 - ),  
1041 - ), 1014 + ),
  1015 + ],
  1016 + ),
  1017 + if (customerProvider
  1018 + .guestInfoSunModel!.guest!.cdaySelfStr !=
  1019 + '')
  1020 + Padding(
  1021 + padding: EdgeInsets.only(top: w(12)),
  1022 + child: Row(
  1023 + mainAxisAlignment:
  1024 + MainAxisAlignment.spaceBetween,
  1025 + children: [
  1026 + Text(
  1027 + '公历',
  1028 + style: TextStyle(
  1029 + fontSize: font(16),
  1030 + color: MyColours.color_438E93),
  1031 + ),
  1032 + Text(
  1033 + customerProvider.guestInfoSunModel!
  1034 + .guest!.cdaySelfStr,
  1035 + style: TextStyle(
  1036 + fontSize: font(14),
  1037 + color: MyColours.color_000000),
  1038 + ),
  1039 + ],
  1040 + )),
  1041 + if (customerProvider
  1042 + .guestInfoSunModel!.guest!.ndaySelfStr !=
  1043 + '')
  1044 + Padding(
  1045 + padding: EdgeInsets.only(top: w(12)),
  1046 + child: Row(
  1047 + mainAxisAlignment:
  1048 + MainAxisAlignment.spaceBetween,
  1049 + children: [
  1050 + Text(
  1051 + '农历',
  1052 + style: TextStyle(
  1053 + fontSize: font(16),
  1054 + color: MyColours.color_438E93),
  1055 + ),
  1056 + Text(
  1057 + customerProvider.guestInfoSunModel!
  1058 + .guest!.ndaySelfStr,
  1059 + style: TextStyle(
  1060 + fontSize: font(14),
  1061 + color: MyColours.color_000000),
  1062 + ),
  1063 + ],
  1064 + ))
  1065 + ],
  1066 + )),
1042 VEmptyView(20), 1067 VEmptyView(20),
1043 Container( 1068 Container(
1044 padding: EdgeInsets.symmetric( 1069 padding: EdgeInsets.symmetric(
@@ -1090,27 +1115,62 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -1090,27 +1115,62 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
1090 //最新的数据 1115 //最新的数据
1091 1116
1092 if (cday.year == null) { 1117 if (cday.year == null) {
1093 - show = cday.desc! +  
1094 - ':' +  
1095 - cday.month! +  
1096 - '-' +  
1097 - cday.day! +  
1098 - (cday.type == '1' ? '(公历)' : '(农历)'); 1118 + if (cday.type == '1') {
  1119 + show = '(公历)' +
  1120 + Utils.addZeroNumber(
  1121 + int.parse(cday.month!)) +
  1122 + '月' +
  1123 + Utils.addZeroNumber(
  1124 + int.parse(cday.day!)) +
  1125 + '日';
  1126 + } else {
  1127 + show = '(农历)' +
  1128 + LunarCalendarUtil.formatLunarDate(
  1129 + int.parse(cday.month!),
  1130 + int.parse(cday.day!));
  1131 + }
1099 } else { 1132 } else {
1100 - show = cday.desc! +  
1101 - ':' +  
1102 - cday.year! +  
1103 - '-' +  
1104 - cday.month! +  
1105 - '-' +  
1106 - cday.day! +  
1107 - (cday.type == '1' ? '(公历)' : '(农历)'); 1133 + if (cday.type == '1') {
  1134 + show = '(公历)' +
  1135 + cday.year! +
  1136 + '年' +
  1137 + Utils.addZeroNumber(
  1138 + int.parse(cday.month!)) +
  1139 + '月' +
  1140 + Utils.addZeroNumber(
  1141 + int.parse(cday.day!)) +
  1142 + '日';
  1143 + } else {
  1144 + show = '(农历)' +
  1145 + cday.year! +
  1146 + '年' +
  1147 + LunarCalendarUtil.formatLunarDate(
  1148 + int.parse(cday.month!),
  1149 + int.parse(cday.day!));
  1150 + }
1108 } 1151 }
1109 } else { 1152 } else {
1110 - show = cday.desc! +  
1111 - ':' +  
1112 - cday.dtime! +  
1113 - (cday.type == '1' ? '(公历)' : '(农历)'); 1153 + show = (cday.type == '1' ? '(公历)' : '(农历)') +
  1154 + cday.dtime!;
  1155 + List data = cday.dtime!.split('-');
  1156 + if (cday.type == '1') {
  1157 + show = '(公历)' +
  1158 + data[0] +
  1159 + '年' +
  1160 + Utils.addZeroNumber(
  1161 + int.parse(data[1])) +
  1162 + '月' +
  1163 + Utils.addZeroNumber(
  1164 + int.parse(data[2])) +
  1165 + '日';
  1166 + } else {
  1167 + show = '(农历)' +
  1168 + data[0] +
  1169 + '年' +
  1170 + LunarCalendarUtil.formatLunarDate(
  1171 + int.parse(data[1]),
  1172 + int.parse(data[2]));
  1173 + }
1114 } 1174 }
1115 } 1175 }
1116 return Padding( 1176 return Padding(
@@ -69,7 +69,7 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { @@ -69,7 +69,7 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> {
69 //刷新当前页 69 //刷新当前页
70 _getGuestInfoCday(); 70 _getGuestInfoCday();
71 // 刷新 71 // 刷新
72 - bus.emit('refresh_guest_info'); 72 + bus.emit('refresh_guest_info_my');
73 bus.emit('refresh_guest_list_my'); 73 bus.emit('refresh_guest_list_my');
74 // Navigator.pop(context); 74 // Navigator.pop(context);
75 } 75 }
@@ -84,8 +84,8 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { @@ -84,8 +84,8 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> {
84 //刷新当前页 84 //刷新当前页
85 _getGuestInfoCday(); 85 _getGuestInfoCday();
86 // 刷新 86 // 刷新
87 - bus.emit('refresh_guest_info');  
88 - bus.emit('refresh_guest_list'); 87 + bus.emit('refresh_guest_info_my');
  88 + bus.emit('refresh_guest_list_my');
89 // Navigator.pop(context); 89 // Navigator.pop(context);
90 } 90 }
91 } 91 }
@@ -197,7 +197,11 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { @@ -197,7 +197,11 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> {
197 197
198 if (cday.year == null) { 198 if (cday.year == null) {
199 if (cday.type == '1') { 199 if (cday.type == '1') {
200 - show = '(公历)' + cday.month! + '月' + cday.day! + '日'; 200 + show = '(公历)' +
  201 + Utils.addZeroNumber(int.parse(cday.month!)) +
  202 + '月' +
  203 + Utils.addZeroNumber(int.parse(cday.day!)) +
  204 + '日';
201 } else { 205 } else {
202 show = '(农历)' + 206 show = '(农历)' +
203 LunarCalendarUtil.formatLunarDate( 207 LunarCalendarUtil.formatLunarDate(
@@ -209,9 +213,9 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { @@ -209,9 +213,9 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> {
209 show = '(公历)' + 213 show = '(公历)' +
210 cday.year! + 214 cday.year! +
211 '年' + 215 '年' +
212 - cday.month! + 216 + Utils.addZeroNumber(int.parse(cday.month!)) +
213 '月' + 217 '月' +
214 - cday.day! + 218 + Utils.addZeroNumber(int.parse(cday.day!)) +
215 '日'; 219 '日';
216 } else { 220 } else {
217 show = '(农历)' + 221 show = '(农历)' +
@@ -223,16 +227,16 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { @@ -223,16 +227,16 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> {
223 } 227 }
224 } 228 }
225 } else { 229 } else {
226 - show =  
227 - (cday.type == '1' ? '(公历)' : '(农历)') + cday.dtime!; 230 + // show =
  231 + // (cday.type == '1' ? '(公历)' : '(农历)') + cday.dtime!;
228 List data = cday.dtime!.split('-'); 232 List data = cday.dtime!.split('-');
229 if (cday.type == '1') { 233 if (cday.type == '1') {
230 show = '(公历)' + 234 show = '(公历)' +
231 data[0] + 235 data[0] +
232 '年' + 236 '年' +
233 - data[1] + 237 + Utils.addZeroNumber(int.parse(data[1])) +
234 '月' + 238 '月' +
235 - data[2] + 239 + Utils.addZeroNumber(int.parse(data[2])) +
236 '日'; 240 '日';
237 } else { 241 } else {
238 show = '(农历)' + 242 show = '(农历)' +
@@ -251,7 +255,6 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { @@ -251,7 +255,6 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> {
251 title: "", 255 title: "",
252 content: "是否删除该纪念日", 256 content: "是否删除该纪念日",
253 rTitle: "删除", rCallback: () { 257 rTitle: "删除", rCallback: () {
254 -  
255 _delGuestInfocDay(model.cday![index].id); 258 _delGuestInfocDay(model.cday![index].id);
256 }); 259 });
257 }, onTapEdit: () { 260 }, onTapEdit: () {
@@ -979,42 +979,98 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -979,42 +979,98 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
979 '${customerProvider.guestInfoSunModel!.guest!.serve == null ? '' : customerProvider.guestInfoSunModel!.guest!.serve}'), 979 '${customerProvider.guestInfoSunModel!.guest!.serve == null ? '' : customerProvider.guestInfoSunModel!.guest!.serve}'),
980 VEmptyView(20), 980 VEmptyView(20),
981 Container( 981 Container(
982 - padding: EdgeInsets.symmetric(  
983 - horizontal: ScreenUtil().setWidth(40),  
984 - vertical: ScreenUtil().setWidth(30)),  
985 - color: MyColours.color_ffffff,  
986 - child: Row(  
987 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
988 - children: [  
989 - Text(  
990 - '生日',  
991 - style: TextStyle(  
992 - fontSize: ScreenUtil().setSp(36),  
993 - color: MyColours.color_333333),  
994 - ),  
995 - Spacer(),  
996 - // Text(  
997 - // birthday,  
998 - // style: TextStyle(  
999 - // fontSize: ScreenUtil().setSp(26),  
1000 - // color: MyColours.color_333333),  
1001 - // ),  
1002 - // HEmptyView(20),  
1003 - RoundButton(  
1004 - text: '编辑',  
1005 - radius: ScreenUtil().setWidth(20),  
1006 - width: ScreenUtil().setWidth(90),  
1007 - height: ScreenUtil().setWidth(50),  
1008 - fontSize: 26,  
1009 - isBold: false,  
1010 - onPressed: () {  
1011 - NavigatorUtil.goSetBirthdayPage(  
1012 - context, widget.userHistoryEntity!.gid);  
1013 - },  
1014 - ),  
1015 - ],  
1016 - ),  
1017 - ), 982 + padding: EdgeInsets.symmetric(
  983 + horizontal: ScreenUtil().setWidth(40),
  984 + vertical: ScreenUtil().setWidth(30)),
  985 + color: MyColours.color_ffffff,
  986 + child: Column(
  987 + children: [
  988 + Row(
  989 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  990 + children: [
  991 + Text(
  992 + '生日',
  993 + style: TextStyle(
  994 + fontSize: ScreenUtil().setSp(36),
  995 + color: MyColours.color_333333),
  996 + ),
  997 + Spacer(),
  998 + // Text(
  999 + // birthday,
  1000 + // style: TextStyle(
  1001 + // fontSize: ScreenUtil().setSp(26),
  1002 + // color: MyColours.color_333333),
  1003 + // ),
  1004 + // HEmptyView(20),
  1005 + RoundButton(
  1006 + text: '编辑',
  1007 + radius: ScreenUtil().setWidth(20),
  1008 + width: ScreenUtil().setWidth(90),
  1009 + height: ScreenUtil().setWidth(50),
  1010 + fontSize: 26,
  1011 + isBold: false,
  1012 + onPressed: () {
  1013 + NavigatorUtil.goSetBirthdayPage(
  1014 + context,
  1015 + widget.userHistoryEntity!.gid,
  1016 + customerProvider
  1017 + .guestInfoSunModel!.guest!.nDaySelf,
  1018 + customerProvider.guestInfoSunModel!
  1019 + .guest!.cDaySelf);
  1020 + },
  1021 + ),
  1022 + ],
  1023 + ),
  1024 + if (customerProvider
  1025 + .guestInfoSunModel!.guest!.cdaySelfStr !=
  1026 + '')
  1027 + Padding(
  1028 + padding: EdgeInsets.only(top: w(12)),
  1029 + child: Row(
  1030 + mainAxisAlignment:
  1031 + MainAxisAlignment.spaceBetween,
  1032 + children: [
  1033 + Text(
  1034 + '公历',
  1035 + style: TextStyle(
  1036 + fontSize: font(16),
  1037 + color: MyColours.color_438E93),
  1038 + ),
  1039 + Text(
  1040 + customerProvider.guestInfoSunModel!
  1041 + .guest!.cdaySelfStr,
  1042 + style: TextStyle(
  1043 + fontSize: font(14),
  1044 + color: MyColours.color_000000),
  1045 + ),
  1046 + ],
  1047 + )),
  1048 + if (customerProvider
  1049 + .guestInfoSunModel!.guest!.ndaySelfStr !=
  1050 + '')
  1051 + Padding(
  1052 + padding: EdgeInsets.only(top: w(12)),
  1053 + child: Row(
  1054 + mainAxisAlignment:
  1055 + MainAxisAlignment.spaceBetween,
  1056 + children: [
  1057 + Text(
  1058 + '农历',
  1059 + style: TextStyle(
  1060 + fontSize: font(16),
  1061 + color: MyColours.color_438E93),
  1062 + ),
  1063 + Text(
  1064 + customerProvider.guestInfoSunModel!
  1065 + .guest!.ndaySelfStr,
  1066 + style: TextStyle(
  1067 + fontSize: font(14),
  1068 + color: MyColours.color_000000),
  1069 + ),
  1070 + ],
  1071 + ))
  1072 + ],
  1073 + )),
1018 VEmptyView(20), 1074 VEmptyView(20),
1019 Container( 1075 Container(
1020 padding: EdgeInsets.symmetric( 1076 padding: EdgeInsets.symmetric(
@@ -1068,9 +1124,11 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -1068,9 +1124,11 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
1068 if (cday.year == null) { 1124 if (cday.year == null) {
1069 if (cday.type == '1') { 1125 if (cday.type == '1') {
1070 show = '(公历)' + 1126 show = '(公历)' +
1071 - cday.month! + 1127 + Utils.addZeroNumber(
  1128 + int.parse(cday.month!)) +
1072 '月' + 1129 '月' +
1073 - cday.day! + 1130 + Utils.addZeroNumber(
  1131 + int.parse(cday.day!)) +
1074 '日'; 1132 '日';
1075 } else { 1133 } else {
1076 show = '(农历)' + 1134 show = '(农历)' +
@@ -1083,9 +1141,11 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -1083,9 +1141,11 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
1083 show = '(公历)' + 1141 show = '(公历)' +
1084 cday.year! + 1142 cday.year! +
1085 '年' + 1143 '年' +
1086 - cday.month! + 1144 + Utils.addZeroNumber(
  1145 + int.parse(cday.month!)) +
1087 '月' + 1146 '月' +
1088 - cday.day! + 1147 + Utils.addZeroNumber(
  1148 + int.parse(cday.day!)) +
1089 '日'; 1149 '日';
1090 } else { 1150 } else {
1091 show = '(农历)' + 1151 show = '(农历)' +
@@ -1104,10 +1164,12 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -1104,10 +1164,12 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
1104 show = '(公历)' + 1164 show = '(公历)' +
1105 data[0] + 1165 data[0] +
1106 '年' + 1166 '年' +
1107 - data[1] +  
1108 - '月' +  
1109 - data[2] +  
1110 - '日'; 1167 + Utils.addZeroNumber(
  1168 + int.parse( data[1])) +
  1169 + '月' +
  1170 + Utils.addZeroNumber(
  1171 + int.parse( data[2])) +
  1172 + '日';
1111 } else { 1173 } else {
1112 show = '(农历)' + 1174 show = '(农历)' +
1113 data[0] + 1175 data[0] +
@@ -199,7 +199,10 @@ class _FestivalEditPageState extends State<FestivalEditPage> { @@ -199,7 +199,10 @@ class _FestivalEditPageState extends State<FestivalEditPage> {
199 199
200 if (cday.year == null) { 200 if (cday.year == null) {
201 if (cday.type == '1') { 201 if (cday.type == '1') {
202 - show = '(公历)' + cday.month! + '月' + cday.day! + '日'; 202 + show = '(公历)' + Utils.addZeroNumber(int.parse(cday.month!)) +
  203 + '月' +
  204 + Utils.addZeroNumber(int.parse(cday.day!)) +
  205 + '日';
203 } else { 206 } else {
204 show = '(农历)' + 207 show = '(农历)' +
205 LunarCalendarUtil.formatLunarDate( 208 LunarCalendarUtil.formatLunarDate(
@@ -211,9 +214,9 @@ class _FestivalEditPageState extends State<FestivalEditPage> { @@ -211,9 +214,9 @@ class _FestivalEditPageState extends State<FestivalEditPage> {
211 show = '(公历)' + 214 show = '(公历)' +
212 cday.year! + 215 cday.year! +
213 '年' + 216 '年' +
214 - cday.month! + 217 + Utils.addZeroNumber(int.parse(cday.month!)) +
215 '月' + 218 '月' +
216 - cday.day! + 219 + Utils.addZeroNumber(int.parse(cday.day!)) +
217 '日'; 220 '日';
218 } else { 221 } else {
219 show = '(农历)' + 222 show = '(农历)' +
@@ -232,9 +235,9 @@ class _FestivalEditPageState extends State<FestivalEditPage> { @@ -232,9 +235,9 @@ class _FestivalEditPageState extends State<FestivalEditPage> {
232 show = '(公历)' + 235 show = '(公历)' +
233 data[0] + 236 data[0] +
234 '年' + 237 '年' +
235 - data[1] + 238 + Utils.addZeroNumber(int.parse(data[1])) +
236 '月' + 239 '月' +
237 - data[2] + 240 + Utils.addZeroNumber(int.parse(data[2])) +
238 '日'; 241 '日';
239 } else { 242 } else {
240 show = '(农历)' + 243 show = '(农历)' +
@@ -2,9 +2,13 @@ import 'package:common_utils/common_utils.dart'; @@ -2,9 +2,13 @@ import 'package:common_utils/common_utils.dart';
2 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
3 import 'package:flutter_lunar_datetime_picker/date_init.dart'; 3 import 'package:flutter_lunar_datetime_picker/date_init.dart';
4 import 'package:flutter_picker_plus/picker.dart'; 4 import 'package:flutter_picker_plus/picker.dart';
  5 +import 'package:lunar/calendar/Lunar.dart';
  6 +import 'package:lunar/calendar/Solar.dart';
5 import 'package:one_key/provider/customer_provider.dart'; 7 import 'package:one_key/provider/customer_provider.dart';
6 import 'package:one_key/res/colors.dart'; 8 import 'package:one_key/res/colors.dart';
7 import 'package:one_key/utils/dialog_util.dart'; 9 import 'package:one_key/utils/dialog_util.dart';
  10 +import 'package:one_key/utils/event_bus.dart';
  11 +import 'package:one_key/utils/pick_date_nonli_gongli/lunar_calendar_util.dart';
8 import 'package:one_key/utils/screen_util.dart'; 12 import 'package:one_key/utils/screen_util.dart';
9 import 'package:one_key/utils/utils.dart'; 13 import 'package:one_key/utils/utils.dart';
10 import 'package:one_key/widgets/MyDivider.dart'; 14 import 'package:one_key/widgets/MyDivider.dart';
@@ -22,7 +26,16 @@ import 'package:flutter_lunar_datetime_picker/datetime_picker_theme.dart' @@ -22,7 +26,16 @@ import 'package:flutter_lunar_datetime_picker/datetime_picker_theme.dart'
22 */ 26 */
23 class SetBirthdayPage extends StatefulWidget { 27 class SetBirthdayPage extends StatefulWidget {
24 final String? gid; 28 final String? gid;
25 - const SetBirthdayPage({super.key, required this.gid}); 29 + final String from;
  30 + final String birthdayLunar;
  31 + final String birthdaySolar;
  32 +
  33 + const SetBirthdayPage(
  34 + {super.key,
  35 + required this.gid,
  36 + this.from = 'store',
  37 + required this.birthdayLunar,
  38 + required this.birthdaySolar});
26 39
27 @override 40 @override
28 State<SetBirthdayPage> createState() => _SetBirthdayPageState(); 41 State<SetBirthdayPage> createState() => _SetBirthdayPageState();
@@ -31,7 +44,42 @@ class SetBirthdayPage extends StatefulWidget { @@ -31,7 +44,42 @@ class SetBirthdayPage extends StatefulWidget {
31 class _SetBirthdayPageState extends State<SetBirthdayPage> { 44 class _SetBirthdayPageState extends State<SetBirthdayPage> {
32 late CustomerProvider customerProvider; 45 late CustomerProvider customerProvider;
33 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>(); 46 final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
34 - String birthday = ''; 47 + String birthdayLunar = ''; //农历生日
  48 + String birthdaySolar = ''; //阳历生日
  49 +
  50 + @override
  51 + void initState() {
  52 + // TODO: implement initState
  53 + super.initState();
  54 +
  55 + if (widget.birthdaySolar == 'null' || widget.birthdaySolar == '') {
  56 + birthdaySolar = '';
  57 + } else {
  58 + birthdaySolar = DateUtil.formatDate(
  59 + DateTime.fromMillisecondsSinceEpoch(
  60 + int.parse(widget.birthdaySolar) * 1000),
  61 + format: DateFormats.zh_y_mo_d);
  62 + }
  63 +
  64 + if (widget.birthdayLunar == 'null' || widget.birthdayLunar == '') {
  65 + birthdayLunar = '';
  66 + } else {
  67 + DateTime time = DateTime.fromMillisecondsSinceEpoch(
  68 + int.parse(widget.birthdayLunar) * 1000);
  69 +
  70 + // 获取当前阴历
  71 + Lunar currentLunarTime = Solar.fromDate(time).getLunar();
  72 + String yearStr = currentLunarTime.getYear().toString();
  73 + String monthStr = currentLunarTime.getMonth().abs().toString();
  74 + String dayStr = currentLunarTime.getDay().toString();
  75 + //转换成农历
  76 +
  77 + birthdayLunar = (yearStr) +
  78 + '年' +
  79 + LunarCalendarUtil.formatLunarDate(
  80 + int.parse(monthStr), int.parse(dayStr));
  81 + }
  82 + }
35 83
36 _item( 84 _item(
37 String title, 85 String title,
@@ -53,15 +101,16 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -53,15 +101,16 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
53 fontSize: font(16), color: MyColours.color_438E93), 101 fontSize: font(16), color: MyColours.color_438E93),
54 ), 102 ),
55 Spacer(), 103 Spacer(),
56 - InkWell(  
57 - onTap: onTapDel,  
58 - child: Padding(  
59 - padding: EdgeInsets.symmetric(horizontal: w(10)),  
60 - child: Image.asset(  
61 - Utils.getImgPath('f_delete_red'),  
62 - width: w(20),  
63 - ),  
64 - )), 104 + if (subTitle != '')
  105 + InkWell(
  106 + onTap: onTapDel,
  107 + child: Padding(
  108 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  109 + child: Image.asset(
  110 + Utils.getImgPath('f_delete_red'),
  111 + width: w(20),
  112 + ),
  113 + )),
65 InkWell( 114 InkWell(
66 onTap: onTapEdit, 115 onTap: onTapEdit,
67 child: Padding( 116 child: Padding(
@@ -73,11 +122,13 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -73,11 +122,13 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
73 )), 122 )),
74 ], 123 ],
75 ), 124 ),
76 - VEmptyView(40),  
77 - Text(  
78 - '(${title})${subTitle}',  
79 - style: TextStyle(fontSize: font(16), color: MyColours.color_000000),  
80 - ), 125 + if (subTitle != '') VEmptyView(40),
  126 + if (subTitle != '')
  127 + Text(
  128 + '(${title})${subTitle}',
  129 + style:
  130 + TextStyle(fontSize: font(16), color: MyColours.color_000000),
  131 + ),
81 VEmptyView(20), 132 VEmptyView(20),
82 Padding( 133 Padding(
83 padding: EdgeInsets.symmetric(horizontal: w(10)), 134 padding: EdgeInsets.symmetric(horizontal: w(10)),
@@ -92,6 +143,35 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -92,6 +143,35 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
92 ); 143 );
93 } 144 }
94 145
  146 + _del(String field) async {
  147 + Map<String, String?> params = {
  148 + 'id': widget.gid,
  149 + '${field}': null,
  150 + };
  151 + bool sucess =
  152 + await customerProvider.setGuestInfo(context, params, showLoading: true);
  153 +
  154 + if (sucess) {
  155 + Utils.showToast('删除成功');
  156 +
  157 + if (field == 'n_day') {
  158 + //农历
  159 + birthdayLunar = '';
  160 + } else {
  161 + //阳历
  162 + birthdaySolar = '';
  163 + }
  164 + setState(() {});
  165 + if (widget.from == 'store') {
  166 + //刷新全店客情详情页
  167 + bus.emit('refresh_guest_info');
  168 + } else {
  169 + //刷新我的客情详情页
  170 + bus.emit('refresh_guest_info_my');
  171 + }
  172 + }
  173 + }
  174 +
95 @override 175 @override
96 Widget build(BuildContext context) { 176 Widget build(BuildContext context) {
97 customerProvider = Provider.of<CustomerProvider>(context, listen: true); 177 customerProvider = Provider.of<CustomerProvider>(context, listen: true);
@@ -103,7 +183,26 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -103,7 +183,26 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
103 child: Column( 183 child: Column(
104 children: [ 184 children: [
105 VEmptyView(40), 185 VEmptyView(40),
106 - _item('公历', '1993年1月3日', onTapDel: () {}, onTapEdit: () { 186 + _item('公历', birthdaySolar, onTapDel: () {
  187 + //删除生日
  188 + //弹框确认是否删除
  189 + DialogUtil.cupertinoAlertDialog(context,
  190 + title: "",
  191 + content: "是否删除公历生日",
  192 + rTitle: "删除", rCallback: () {
  193 + // if (Navigator.canPop(context)) {
  194 + // Navigator.pop(context);
  195 + // }
  196 + _del('c_day');
  197 + });
  198 + }, onTapEdit: () {
  199 + DateTime now = DateTime.now();
  200 + if (widget.birthdaySolar != 'null' &&
  201 + widget.birthdaySolar != '') {
  202 + now = DateTime.fromMillisecondsSinceEpoch(
  203 + int.parse(widget.birthdaySolar) * 1000);
  204 + }
  205 +
107 DatePicker.showDatePicker( 206 DatePicker.showDatePicker(
108 context, 207 context,
109 lunarPicker: false, 208 lunarPicker: false,
@@ -120,11 +219,37 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -120,11 +219,37 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
120 doneStyle: TextStyle( 219 doneStyle: TextStyle(
121 color: MyColours.color_438E93, fontSize: font(16))), 220 color: MyColours.color_438E93, fontSize: font(16))),
122 dateInitTime: DateInitTime( 221 dateInitTime: DateInitTime(
123 - currentTime: DateTime.now(), 222 + currentTime: now,
124 maxTime: DateTime(2050, 12, 12), 223 maxTime: DateTime(2050, 12, 12),
125 minTime: DateTime(1900, 1, 1)), 224 minTime: DateTime(1900, 1, 1)),
126 - onConfirm: (time, lunar) { 225 + onConfirm: (time, lunar) async {
127 debugPrint(time.toString()); 226 debugPrint(time.toString());
  227 + //保存
  228 +
  229 + print(time.millisecondsSinceEpoch);
  230 + // 请求接口,设置生日
  231 + String from =
  232 + '${time.year}-${Utils.addZeroNumber(time.month)}-${Utils.addZeroNumber(time.day)}' +
  233 + ' 00:00:00';
  234 + Map<String, String?> params = {
  235 + 'id': widget.gid,
  236 + 'c_day':
  237 + '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}',
  238 + };
  239 + bool sucess = await customerProvider
  240 + .setGuestInfo(context, params, showLoading: true);
  241 + if (sucess) {
  242 + Utils.showToast('保存成功');
  243 + birthdaySolar = '${time.year}年${time.month}月${time.day}日';
  244 + setState(() {});
  245 + if (widget.from == 'store') {
  246 + //刷新全店客情详情页
  247 + bus.emit('refresh_guest_info');
  248 + } else {
  249 + //刷新我的客情详情页
  250 + bus.emit('refresh_guest_info_my');
  251 + }
  252 + }
128 }, 253 },
129 onChanged: (time, lunar) { 254 onChanged: (time, lunar) {
130 debugPrint("change:${time.toString()}"); 255 debugPrint("change:${time.toString()}");
@@ -168,7 +293,26 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -168,7 +293,26 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
168 // }); 293 // });
169 }), 294 }),
170 VEmptyView(40), 295 VEmptyView(40),
171 - _item('农历', '1969年三月廿五', onTapDel: () {}, onTapEdit: () { 296 + _item('农历', birthdayLunar, onTapDel: () {
  297 + //删除生日
  298 +
  299 + //弹框确认是否删除
  300 + DialogUtil.cupertinoAlertDialog(context,
  301 + title: "",
  302 + content: "是否删除农历生日",
  303 + rTitle: "删除", rCallback: () {
  304 + // if (Navigator.canPop(context)) {
  305 + // Navigator.pop(context);
  306 + // }
  307 + _del('n_day');
  308 + });
  309 + }, onTapEdit: () {
  310 + DateTime now = DateTime.now();
  311 + if (widget.birthdayLunar != 'null' &&
  312 + widget.birthdayLunar != '') {
  313 + now = DateTime.fromMillisecondsSinceEpoch(
  314 + int.parse(widget.birthdayLunar) * 1000);
  315 + }
172 DatePicker.showDatePicker( 316 DatePicker.showDatePicker(
173 context, 317 context,
174 lunarPicker: true, 318 lunarPicker: true,
@@ -185,11 +329,49 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> { @@ -185,11 +329,49 @@ class _SetBirthdayPageState extends State<SetBirthdayPage> {
185 doneStyle: TextStyle( 329 doneStyle: TextStyle(
186 color: MyColours.color_438E93, fontSize: font(16))), 330 color: MyColours.color_438E93, fontSize: font(16))),
187 dateInitTime: DateInitTime( 331 dateInitTime: DateInitTime(
188 - currentTime: DateTime.now(), 332 + currentTime: now,
189 maxTime: DateTime(2050, 12, 12), 333 maxTime: DateTime(2050, 12, 12),
190 minTime: DateTime(1900, 1, 1)), 334 minTime: DateTime(1900, 1, 1)),
191 - onConfirm: (time, lunar) { 335 + onConfirm: (time, lunar) async {
192 debugPrint(time.toString()); 336 debugPrint(time.toString());
  337 +
  338 + print(time.millisecondsSinceEpoch);
  339 + // 请求接口,设置生日
  340 + String from =
  341 + '${time.year}-${Utils.addZeroNumber(time.month)}-${Utils.addZeroNumber(time.day)}' +
  342 + ' 00:00:00';
  343 + Map<String, String?> params = {
  344 + 'id': widget.gid,
  345 + 'n_day':
  346 + '${(DateUtil.getDateMsByTimeStr(from)! / 1000).floor()}',
  347 + };
  348 + bool sucess = await customerProvider
  349 + .setGuestInfo(context, params, showLoading: true);
  350 +
  351 + if (sucess) {
  352 + Utils.showToast('保存成功');
  353 +
  354 + // 获取当前阴历
  355 + Lunar currentLunarTime = Solar.fromDate(time).getLunar();
  356 + String yearStr = currentLunarTime.getYear().toString();
  357 + String monthStr =
  358 + currentLunarTime.getMonth().abs().toString();
  359 + String dayStr = currentLunarTime.getDay().toString();
  360 + //转换成农历
  361 +
  362 + birthdayLunar = (yearStr) +
  363 + '年' +
  364 + LunarCalendarUtil.formatLunarDate(
  365 + int.parse(monthStr), int.parse(dayStr));
  366 + setState(() {});
  367 + if (widget.from == 'store') {
  368 + //刷新全店客情详情页
  369 + bus.emit('refresh_guest_info');
  370 + } else {
  371 + //刷新我的客情详情页
  372 + bus.emit('refresh_guest_info_my');
  373 + }
  374 + }
193 }, 375 },
194 onChanged: (time, lunar) { 376 onChanged: (time, lunar) {
195 debugPrint("change:${time.toString()}"); 377 debugPrint("change:${time.toString()}");
@@ -3583,7 +3583,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -3583,7 +3583,7 @@ class TableManagerPageState extends State<TableManagerPage> {
3583 } 3583 }
3584 */ 3584 */
3585 Guest guest = Guest(null, null, null, null, null, null, null, null, null, 3585 Guest guest = Guest(null, null, null, null, null, null, null, null, null,
3586 - null, null, null, null, null, null, null, null, null, null); 3586 + null, null, null, null, null, null, null, null, null, null,null);
3587 // if (widget.guest == null) { 3587 // if (widget.guest == null) {
3588 3588
3589 guest.phone = 3589 guest.phone =
@@ -176,7 +176,7 @@ class _MyCustomerDetailEditPageSimState extends State<MyCustomerDetailEditPageSi @@ -176,7 +176,7 @@ class _MyCustomerDetailEditPageSimState extends State<MyCustomerDetailEditPageSi
176 await customerProvider.setGuestInfo(context, params, showLoading: true); 176 await customerProvider.setGuestInfo(context, params, showLoading: true);
177 if (sucess) { 177 if (sucess) {
178 Utils.showToast('保存成功'); 178 Utils.showToast('保存成功');
179 - bus.emit('refresh_guest_info'); 179 + bus.emit('refresh_guest_info_my');
180 bus.emit('refresh_guest_list_my'); 180 bus.emit('refresh_guest_list_my');
181 if (Navigator.canPop(context)) { 181 if (Navigator.canPop(context)) {
182 Navigator.pop(context); 182 Navigator.pop(context);
@@ -49,14 +49,14 @@ class _MyCustomerDetailPageSimState extends State<MyCustomerDetailPageSim> { @@ -49,14 +49,14 @@ class _MyCustomerDetailPageSimState extends State<MyCustomerDetailPageSim> {
49 WidgetsBinding.instance.addPostFrameCallback((_) async { 49 WidgetsBinding.instance.addPostFrameCallback((_) async {
50 _getGuestInfo(); 50 _getGuestInfo();
51 }); 51 });
52 - bus.on("refresh_guest_info", (arg) { 52 + bus.on("refresh_guest_info_my", (arg) {
53 _getGuestInfo(); 53 _getGuestInfo();
54 }); 54 });
55 } 55 }
56 56
57 @override 57 @override
58 void dispose() { 58 void dispose() {
59 - bus.off('refresh_guest_info'); 59 + bus.off('refresh_guest_info_my');
60 super.dispose(); 60 super.dispose();
61 } 61 }
62 62
@@ -3239,7 +3239,7 @@ class TableManagerPageSimState extends State<TableManagerPageSim> { @@ -3239,7 +3239,7 @@ class TableManagerPageSimState extends State<TableManagerPageSim> {
3239 } 3239 }
3240 */ 3240 */
3241 Guest guest = Guest(null, null, null, null, null, null, null, null, null, 3241 Guest guest = Guest(null, null, null, null, null, null, null, null, null,
3242 - null, null, null, null, null, null, null, null, null, null); 3242 + null, null, null, null, null, null, null, null, null, null,null);
3243 // if (widget.guest == null) { 3243 // if (widget.guest == null) {
3244 3244
3245 guest.phone = 3245 guest.phone =
@@ -2459,12 +2459,12 @@ class NavigatorUtil { @@ -2459,12 +2459,12 @@ class NavigatorUtil {
2459 2459
2460 2460
2461 2461
2462 - ///客户生日  
2463 static Future<dynamic> goSetBirthdayPage( 2462 static Future<dynamic> goSetBirthdayPage(
2464 - BuildContext context,String? gid, { 2463 + BuildContext context,String? gid, String? lunar, String? solar, {
2465 replace = false, 2464 replace = false,
  2465 + String from = 'store'
2466 }) { 2466 }) {
2467 - return _navigateTo(context, "${Routes.set_birthday_page}?gid=$gid", 2467 + return _navigateTo(context, "${Routes.set_birthday_page}?gid=$gid&lunar=$lunar&solar=$solar&from=$from",
2468 replace: replace); 2468 replace: replace);
2469 } 2469 }
2470 2470
@@ -4262,6 +4262,11 @@ var vipRecordDetailPageHandle = new Handler( @@ -4262,6 +4262,11 @@ var vipRecordDetailPageHandle = new Handler(
4262 var setBirthdayPageHandle = new Handler( 4262 var setBirthdayPageHandle = new Handler(
4263 handlerFunc: (BuildContext? context, Map<String, List<Object>> params) { 4263 handlerFunc: (BuildContext? context, Map<String, List<Object>> params) {
4264 String? gid = params["gid"]!.first as String; 4264 String? gid = params["gid"]!.first as String;
  4265 +
  4266 + String? solar = params["solar"]!.first as String;
  4267 + String? lunar = params["lunar"]!.first as String;
  4268 +
  4269 + String? from = params["from"]!.first as String;
4265 // String status = params["status"]!.first as String; 4270 // String status = params["status"]!.first as String;
4266 // bool isMine = 4271 // bool isMine =
4267 // FluroConvertUtils.string2bool(params["isMine"]!.first as String); 4272 // FluroConvertUtils.string2bool(params["isMine"]!.first as String);
@@ -4273,7 +4278,13 @@ var setBirthdayPageHandle = new Handler( @@ -4273,7 +4278,13 @@ var setBirthdayPageHandle = new Handler(
4273 // } 4278 // }
4274 4279
4275 return ChangeNotifierProvider<CustomerProvider>( 4280 return ChangeNotifierProvider<CustomerProvider>(
4276 - create: (_) => CustomerProvider(), child: SetBirthdayPage(gid:gid)); 4281 + create: (_) => CustomerProvider(),
  4282 + child: SetBirthdayPage(
  4283 + gid: gid,
  4284 + birthdayLunar: lunar,
  4285 + birthdaySolar: solar,
  4286 + from:from
  4287 + ));
4277 }); 4288 });
4278 4289
4279 ///支付返券 4290 ///支付返券