Showing
10 changed files
with
243 additions
and
103 deletions
| @@ -109,7 +109,7 @@ class Guest extends Object { | @@ -109,7 +109,7 @@ class Guest extends Object { | ||
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | String get sexStr { | 111 | String get sexStr { |
| 112 | - if (sex == null || sex == '' ||sex == '0') return "先生"; | 112 | + if (sex == null || sex == '' || sex == '0') return "先生"; |
| 113 | switch (sex.toString()) { | 113 | switch (sex.toString()) { |
| 114 | case "1": //先生 | 114 | case "1": //先生 |
| 115 | case "男": | 115 | case "男": |
| @@ -165,12 +165,17 @@ class Cday extends Object { | @@ -165,12 +165,17 @@ class Cday extends Object { | ||
| 165 | @JsonKey(name: 'cdate') | 165 | @JsonKey(name: 'cdate') |
| 166 | String cdate; | 166 | String cdate; |
| 167 | 167 | ||
| 168 | - Cday( | ||
| 169 | - this.id, | ||
| 170 | - this.gid, | ||
| 171 | - this.content, | ||
| 172 | - this.cdate, | ||
| 173 | - ); | 168 | + @JsonKey(name: 'desc') |
| 169 | + String desc; | ||
| 170 | + | ||
| 171 | + @JsonKey(name: 'type') | ||
| 172 | + String type; | ||
| 173 | + | ||
| 174 | + @JsonKey(name: 'dtime') | ||
| 175 | + String dtime; | ||
| 176 | + | ||
| 177 | + Cday(this.id, this.gid, this.content, this.cdate, this.desc, this.type, | ||
| 178 | + this.dtime); | ||
| 174 | 179 | ||
| 175 | factory Cday.fromJson(Map<String, dynamic> srcJson) => | 180 | factory Cday.fromJson(Map<String, dynamic> srcJson) => |
| 176 | _$CdayFromJson(srcJson); | 181 | _$CdayFromJson(srcJson); |
| @@ -261,7 +266,7 @@ class Last extends Object { | @@ -261,7 +266,7 @@ class Last extends Object { | ||
| 261 | @JsonSerializable() | 266 | @JsonSerializable() |
| 262 | class Count extends Object { | 267 | class Count extends Object { |
| 263 | @JsonKey(name: 'leiji') | 268 | @JsonKey(name: 'leiji') |
| 264 | - String leiji; | 269 | + dynamic leiji; |
| 265 | 270 | ||
| 266 | @JsonKey(name: 'quxiao') | 271 | @JsonKey(name: 'quxiao') |
| 267 | dynamic quxiao; | 272 | dynamic quxiao; |
| @@ -288,10 +293,7 @@ class Store extends Object { | @@ -288,10 +293,7 @@ class Store extends Object { | ||
| 288 | 293 | ||
| 289 | @JsonKey(name: 'id') | 294 | @JsonKey(name: 'id') |
| 290 | dynamic id; | 295 | dynamic id; |
| 291 | - Store( | ||
| 292 | - this.storeDay, | ||
| 293 | - this.id | ||
| 294 | - ); | 296 | + Store(this.storeDay, this.id); |
| 295 | 297 | ||
| 296 | factory Store.fromJson(Map<String, dynamic> srcJson) => | 298 | factory Store.fromJson(Map<String, dynamic> srcJson) => |
| 297 | _$StoreFromJson(srcJson); | 299 | _$StoreFromJson(srcJson); |
| @@ -106,6 +106,9 @@ Cday _$CdayFromJson(Map<String, dynamic> json) { | @@ -106,6 +106,9 @@ Cday _$CdayFromJson(Map<String, dynamic> json) { | ||
| 106 | json['gid'] as String, | 106 | json['gid'] as String, |
| 107 | json['content'] as String, | 107 | json['content'] as String, |
| 108 | json['cdate'] as String, | 108 | json['cdate'] as String, |
| 109 | + json['desc'] as String, | ||
| 110 | + json['type'] as String, | ||
| 111 | + json['dtime'] as String, | ||
| 109 | ); | 112 | ); |
| 110 | } | 113 | } |
| 111 | 114 | ||
| @@ -114,6 +117,9 @@ Map<String, dynamic> _$CdayToJson(Cday instance) => <String, dynamic>{ | @@ -114,6 +117,9 @@ Map<String, dynamic> _$CdayToJson(Cday instance) => <String, dynamic>{ | ||
| 114 | 'gid': instance.gid, | 117 | 'gid': instance.gid, |
| 115 | 'content': instance.content, | 118 | 'content': instance.content, |
| 116 | 'cdate': instance.cdate, | 119 | 'cdate': instance.cdate, |
| 120 | + 'desc': instance.cdate, | ||
| 121 | + 'type': instance.cdate, | ||
| 122 | + 'dtime': instance.cdate, | ||
| 117 | }; | 123 | }; |
| 118 | 124 | ||
| 119 | Last _$LastFromJson(Map<String, dynamic> json) { | 125 | Last _$LastFromJson(Map<String, dynamic> json) { |
| @@ -145,7 +151,7 @@ Map<String, dynamic> _$LastToJson(Last instance) => <String, dynamic>{ | @@ -145,7 +151,7 @@ Map<String, dynamic> _$LastToJson(Last instance) => <String, dynamic>{ | ||
| 145 | 151 | ||
| 146 | Count _$CountFromJson(Map<String, dynamic> json) { | 152 | Count _$CountFromJson(Map<String, dynamic> json) { |
| 147 | return Count( | 153 | return Count( |
| 148 | - json['leiji'] as String, | 154 | + json['leiji'] as dynamic, |
| 149 | json['quxiao'], | 155 | json['quxiao'], |
| 150 | json['create_time'], | 156 | json['create_time'], |
| 151 | ); | 157 | ); |
| @@ -94,6 +94,7 @@ class MessageUntreatedPageState extends State<MessageUntreatedPage> { | @@ -94,6 +94,7 @@ class MessageUntreatedPageState extends State<MessageUntreatedPage> { | ||
| 94 | // _getUnMsgNum(); | 94 | // _getUnMsgNum(); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | + | ||
| 97 | _cancelMessage() async { | 98 | _cancelMessage() async { |
| 98 | String messageids = ''; //超过24小时 | 99 | String messageids = ''; //超过24小时 |
| 99 | for (NewUnmessage item in messageModel.messagesUn) { | 100 | for (NewUnmessage item in messageModel.messagesUn) { |
| @@ -879,13 +879,24 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | @@ -879,13 +879,24 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { | ||
| 879 | : 0, | 879 | : 0, |
| 880 | controller: controller, | 880 | controller: controller, |
| 881 | itemBuilder: (BuildContext context, int index) { | 881 | itemBuilder: (BuildContext context, int index) { |
| 882 | + Cday cday = customerProvider | ||
| 883 | + .guestInfoSunModel.guest.cDay[index]; | ||
| 884 | + String show = cday.content; | ||
| 885 | + if (cday.desc != null && cday.desc != '') { | ||
| 886 | + //新数据 | ||
| 887 | + // 组展示文本 | ||
| 888 | + | ||
| 889 | + show = cday.desc + | ||
| 890 | + ':' + | ||
| 891 | + cday.dtime + | ||
| 892 | + (cday.type == '1' ? '公历' : '农历'); | ||
| 893 | + } | ||
| 882 | return Center( | 894 | return Center( |
| 883 | child: Padding( | 895 | child: Padding( |
| 884 | padding: EdgeInsets.symmetric( | 896 | padding: EdgeInsets.symmetric( |
| 885 | vertical: ScreenUtil().setWidth(10)), | 897 | vertical: ScreenUtil().setWidth(10)), |
| 886 | child: Text( | 898 | child: Text( |
| 887 | - customerProvider.guestInfoSunModel.guest | ||
| 888 | - .cDay[index].content, | 899 | + show, |
| 889 | style: TextStyle( | 900 | style: TextStyle( |
| 890 | fontSize: ScreenUtil().setSp(26), | 901 | fontSize: ScreenUtil().setSp(26), |
| 891 | color: MyColours.color_333333), | 902 | color: MyColours.color_333333), |
| @@ -43,8 +43,13 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -43,8 +43,13 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 43 | // await customerProvider.searchData(customerProvider.controller.text); | 43 | // await customerProvider.searchData(customerProvider.controller.text); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | - _setGuestInfocDay(String id, String cday) async { | ||
| 47 | - Map<String, String> params = {"gid": widget.guest.id, 'content': cday}; | 46 | + _setGuestInfocDay(String id, Map content) async { |
| 47 | + Map<String, String> params = { | ||
| 48 | + "gid": widget.guest.id, | ||
| 49 | + 'desc': content['desc'], | ||
| 50 | + 'type': content['type'], | ||
| 51 | + 'dtime': content['dtime'], | ||
| 52 | + }; | ||
| 48 | if (id != '') { | 53 | if (id != '') { |
| 49 | params["id"] = id; | 54 | params["id"] = id; |
| 50 | } | 55 | } |
| @@ -113,9 +118,25 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -113,9 +118,25 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 113 | shrinkWrap: true, | 118 | shrinkWrap: true, |
| 114 | itemCount: model.cday.length, | 119 | itemCount: model.cday.length, |
| 115 | itemBuilder: (BuildContext context, int index) { | 120 | itemBuilder: (BuildContext context, int index) { |
| 121 | + Cday cday = model.cday[index]; | ||
| 122 | + String show = ''; | ||
| 123 | + if (cday.desc != null && cday.desc != '') { | ||
| 124 | + //新数据 | ||
| 125 | + // 组展示文本 | ||
| 126 | + | ||
| 127 | + show = cday.desc + | ||
| 128 | + ':' + | ||
| 129 | + cday.dtime + | ||
| 130 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 131 | + } | ||
| 116 | return InkWell( | 132 | return InkWell( |
| 117 | onTap: () { | 133 | onTap: () { |
| 118 | - String str = model.cday[index].content; | 134 | + String str = cday.content; |
| 135 | + String yearStr = '选填'; | ||
| 136 | + String monthStr = ''; | ||
| 137 | + String dayStr = ''; | ||
| 138 | + bool gongli = true; | ||
| 139 | + String content = ''; | ||
| 119 | // str += '${name}:'; | 140 | // str += '${name}:'; |
| 120 | // if (yearStr != '' && | 141 | // if (yearStr != '' && |
| 121 | // yearStr != null && | 142 | // yearStr != null && |
| @@ -125,37 +146,68 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -125,37 +146,68 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 125 | // str += '${monthStr}月'; | 146 | // str += '${monthStr}月'; |
| 126 | // str += '${dayStr}日'; | 147 | // str += '${dayStr}日'; |
| 127 | // str += '(${gongli ? '公历' : '农历'})'; | 148 | // str += '(${gongli ? '公历' : '农历'})'; |
| 128 | - String yearStr = '选填'; | ||
| 129 | - String monthStr = ''; | ||
| 130 | - String dayStr = ''; | ||
| 131 | - bool gongli = true; | ||
| 132 | - String content = str.substring(0, str.indexOf(':')); | ||
| 133 | - String tempStr = str.substring(str.indexOf(':'), str.length); | ||
| 134 | - if (tempStr.contains('年')) { | ||
| 135 | - yearStr = tempStr.substring( | ||
| 136 | - tempStr.indexOf(':') + 1, tempStr.indexOf('年')); | ||
| 137 | - } | ||
| 138 | - if (tempStr.contains('月')) { | 149 | + |
| 150 | + if (cday.desc != null && cday.desc != '') { | ||
| 151 | + //新数据 | ||
| 152 | + content = cday.desc; | ||
| 153 | + List<String> ymd = cday.dtime.split('-'); | ||
| 154 | + if (ymd.length == 3) { | ||
| 155 | + //含有年 | ||
| 156 | + yearStr = ymd[0]; | ||
| 157 | + monthStr = ymd[1]; | ||
| 158 | + dayStr = ymd[2]; | ||
| 159 | + } else if (ymd.length == 2) { | ||
| 160 | + //没有年 | ||
| 161 | + monthStr = ymd[0]; | ||
| 162 | + dayStr = ymd[1]; | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + if (monthStr.startsWith('0')) { | ||
| 166 | + monthStr = | ||
| 167 | + monthStr.substring(1, monthStr.length); | ||
| 168 | + } | ||
| 169 | + if (dayStr.startsWith('0')) { | ||
| 170 | + dayStr = dayStr.substring(1, dayStr.length); | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + print(monthStr); | ||
| 174 | + print(dayStr); | ||
| 175 | + | ||
| 176 | + gongli = cday.type == '1' ? true : false; | ||
| 177 | + } else { | ||
| 178 | + content = str.substring(0, str.indexOf(':')); | ||
| 179 | + String tempStr = | ||
| 180 | + str.substring(str.indexOf(':'), str.length); | ||
| 139 | if (tempStr.contains('年')) { | 181 | if (tempStr.contains('年')) { |
| 140 | - monthStr = tempStr.substring( | ||
| 141 | - tempStr.indexOf('年') + 1, tempStr.indexOf('月')); | ||
| 142 | - } else { | ||
| 143 | - monthStr = tempStr.substring( | ||
| 144 | - tempStr.indexOf(':') + 1, tempStr.indexOf('月')); | 182 | + yearStr = tempStr.substring( |
| 183 | + tempStr.indexOf(':') + 1, | ||
| 184 | + tempStr.indexOf('年')); | ||
| 185 | + } | ||
| 186 | + if (tempStr.contains('月')) { | ||
| 187 | + if (tempStr.contains('年')) { | ||
| 188 | + monthStr = tempStr.substring( | ||
| 189 | + tempStr.indexOf('年') + 1, | ||
| 190 | + tempStr.indexOf('月')); | ||
| 191 | + } else { | ||
| 192 | + monthStr = tempStr.substring( | ||
| 193 | + tempStr.indexOf(':') + 1, | ||
| 194 | + tempStr.indexOf('月')); | ||
| 195 | + } | ||
| 196 | + } | ||
| 197 | + if (tempStr.contains('日')) { | ||
| 198 | + dayStr = tempStr.substring( | ||
| 199 | + tempStr.indexOf('月') + 1, | ||
| 200 | + tempStr.indexOf('日')); | ||
| 201 | + } | ||
| 202 | + if (tempStr.contains('农历')) { | ||
| 203 | + gongli = false; | ||
| 145 | } | 204 | } |
| 146 | - } | ||
| 147 | - if (tempStr.contains('日')) { | ||
| 148 | - dayStr = tempStr.substring( | ||
| 149 | - tempStr.indexOf('月') + 1, tempStr.indexOf('日')); | ||
| 150 | - } | ||
| 151 | - if (tempStr.contains('农历')) { | ||
| 152 | - gongli = false; | ||
| 153 | } | 205 | } |
| 154 | 206 | ||
| 155 | DialogUtil.festivalAlertDialog( | 207 | DialogUtil.festivalAlertDialog( |
| 156 | - context, content, 520, rCallback: (name) { | ||
| 157 | - print(name); | ||
| 158 | - _setGuestInfocDay(model.cday[index].id, name); | 208 | + context, content, 520, rCallback: (content) { |
| 209 | + print(content); | ||
| 210 | + _setGuestInfocDay(model.cday[index].id, content); | ||
| 159 | // _addCookbookClass(name, showLoading: true); | 211 | // _addCookbookClass(name, showLoading: true); |
| 160 | }, delCallback: () { | 212 | }, delCallback: () { |
| 161 | //弹框确认是否删除 | 213 | //弹框确认是否删除 |
| @@ -181,7 +233,7 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -181,7 +233,7 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 181 | children: [ | 233 | children: [ |
| 182 | Expanded( | 234 | Expanded( |
| 183 | child: Text( | 235 | child: Text( |
| 184 | - model.cday[index].content, | 236 | + cday.content == null ? show : cday.content, |
| 185 | overflow: TextOverflow.ellipsis, | 237 | overflow: TextOverflow.ellipsis, |
| 186 | style: TextStyle( | 238 | style: TextStyle( |
| 187 | fontSize: ScreenUtil().setSp(26), | 239 | fontSize: ScreenUtil().setSp(26), |
| @@ -213,9 +265,9 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | @@ -213,9 +265,9 @@ class _MyFestivalEditPageState extends State<MyFestivalEditPage> { | ||
| 213 | context, | 265 | context, |
| 214 | '', | 266 | '', |
| 215 | 520, | 267 | 520, |
| 216 | - rCallback: (name) { | ||
| 217 | - print(name); | ||
| 218 | - _setGuestInfocDay('', name); | 268 | + rCallback: (content) { |
| 269 | + print(content); | ||
| 270 | + _setGuestInfocDay('', content); | ||
| 219 | // _addCookbookClass(name, showLoading: true); | 271 | // _addCookbookClass(name, showLoading: true); |
| 220 | }, | 272 | }, |
| 221 | ); | 273 | ); |
| @@ -890,13 +890,25 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | @@ -890,13 +890,25 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { | ||
| 890 | : 0, | 890 | : 0, |
| 891 | controller: controller, | 891 | controller: controller, |
| 892 | itemBuilder: (BuildContext context, int index) { | 892 | itemBuilder: (BuildContext context, int index) { |
| 893 | + Cday cday = customerProvider | ||
| 894 | + .guestInfoSunModel.guest.cDay[index]; | ||
| 895 | + String show = cday.content; | ||
| 896 | + if (cday.content == null) { | ||
| 897 | + //新数据 | ||
| 898 | + // 组展示文本 | ||
| 899 | + | ||
| 900 | + show = | ||
| 901 | + cday.desc + ':' + cday.dtime +( cday.type == | ||
| 902 | + '1' | ||
| 903 | + ? '(公历)' | ||
| 904 | + : '(农历)'); | ||
| 905 | + } | ||
| 893 | return Center( | 906 | return Center( |
| 894 | child: Padding( | 907 | child: Padding( |
| 895 | padding: EdgeInsets.symmetric( | 908 | padding: EdgeInsets.symmetric( |
| 896 | vertical: ScreenUtil().setWidth(10)), | 909 | vertical: ScreenUtil().setWidth(10)), |
| 897 | child: Text( | 910 | child: Text( |
| 898 | - customerProvider.guestInfoSunModel.guest | ||
| 899 | - .cDay[index].content, | 911 | + show, |
| 900 | style: TextStyle( | 912 | style: TextStyle( |
| 901 | fontSize: ScreenUtil().setSp(26), | 913 | fontSize: ScreenUtil().setSp(26), |
| 902 | color: MyColours.color_333333), | 914 | color: MyColours.color_333333), |
| @@ -43,8 +43,14 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -43,8 +43,14 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 43 | // await customerProvider.searchData(customerProvider.controller.text); | 43 | // await customerProvider.searchData(customerProvider.controller.text); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | - _setGuestInfocDay(String id, String cday) async { | ||
| 47 | - Map<String, String> params = {"gid": widget.guest.id, 'content': cday}; | 46 | + _setGuestInfocDay(String id, Map content) async { |
| 47 | + Map<String, String> params = { | ||
| 48 | + "gid": widget.guest.id, | ||
| 49 | + 'desc': content['desc'], | ||
| 50 | + 'type': content['type'], | ||
| 51 | + 'dtime': content['dtime'], | ||
| 52 | + }; | ||
| 53 | + | ||
| 48 | if (id != '') { | 54 | if (id != '') { |
| 49 | params["id"] = id; | 55 | params["id"] = id; |
| 50 | } | 56 | } |
| @@ -113,9 +119,25 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -113,9 +119,25 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 113 | shrinkWrap: true, | 119 | shrinkWrap: true, |
| 114 | itemCount: model.cday.length, | 120 | itemCount: model.cday.length, |
| 115 | itemBuilder: (BuildContext context, int index) { | 121 | itemBuilder: (BuildContext context, int index) { |
| 122 | + Cday cday = model.cday[index]; | ||
| 123 | + String show = ''; | ||
| 124 | + if (cday.desc != null && cday.desc != '') { | ||
| 125 | + //新数据 | ||
| 126 | + // 组展示文本 | ||
| 127 | + | ||
| 128 | + show = cday.desc + | ||
| 129 | + ':' + | ||
| 130 | + cday.dtime + | ||
| 131 | + (cday.type == '1' ? '(公历)' : '(农历)'); | ||
| 132 | + } | ||
| 116 | return InkWell( | 133 | return InkWell( |
| 117 | onTap: () { | 134 | onTap: () { |
| 118 | - String str = model.cday[index].content; | 135 | + String str = cday.content; |
| 136 | + String yearStr = '选填'; | ||
| 137 | + String monthStr = ''; | ||
| 138 | + String dayStr = ''; | ||
| 139 | + bool gongli = true; | ||
| 140 | + String content = ''; | ||
| 119 | // str += '${name}:'; | 141 | // str += '${name}:'; |
| 120 | // if (yearStr != '' && | 142 | // if (yearStr != '' && |
| 121 | // yearStr != null && | 143 | // yearStr != null && |
| @@ -125,43 +147,68 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -125,43 +147,68 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 125 | // str += '${monthStr}月'; | 147 | // str += '${monthStr}月'; |
| 126 | // str += '${dayStr}日'; | 148 | // str += '${dayStr}日'; |
| 127 | // str += '(${gongli ? '公历' : '农历'})'; | 149 | // str += '(${gongli ? '公历' : '农历'})'; |
| 128 | - String yearStr = '选填'; | ||
| 129 | - String monthStr = ''; | ||
| 130 | - String dayStr = ''; | ||
| 131 | - bool gongli = true; | ||
| 132 | - String content = str.substring(0, str.indexOf(':')); | ||
| 133 | - | ||
| 134 | - String tempStr = | ||
| 135 | - str.substring(str.indexOf(':'), str.length); | ||
| 136 | - if (tempStr.contains('年')) { | ||
| 137 | - yearStr = tempStr.substring( | ||
| 138 | - tempStr.indexOf(':') + 1, | ||
| 139 | - tempStr.indexOf('年')); | ||
| 140 | - } | ||
| 141 | - if (tempStr.contains('月')) { | 150 | + |
| 151 | + if (cday.desc != null && cday.desc != '') { | ||
| 152 | + //新数据 | ||
| 153 | + content = cday.desc; | ||
| 154 | + List<String> ymd = cday.dtime.split('-'); | ||
| 155 | + if (ymd.length == 3) { | ||
| 156 | + //含有年 | ||
| 157 | + yearStr = ymd[0]; | ||
| 158 | + monthStr = ymd[1]; | ||
| 159 | + dayStr = ymd[2]; | ||
| 160 | + } else if (ymd.length == 2) { | ||
| 161 | + //没有年 | ||
| 162 | + monthStr = ymd[0]; | ||
| 163 | + dayStr = ymd[1]; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + if (monthStr.startsWith('0')) { | ||
| 167 | + monthStr = | ||
| 168 | + monthStr.substring(1, monthStr.length); | ||
| 169 | + } | ||
| 170 | + if (dayStr.startsWith('0')) { | ||
| 171 | + dayStr = dayStr.substring(1, dayStr.length); | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + print(monthStr); | ||
| 175 | + print(dayStr); | ||
| 176 | + | ||
| 177 | + gongli = cday.type == '1' ? true : false; | ||
| 178 | + } else { | ||
| 179 | + content = str.substring(0, str.indexOf(':')); | ||
| 180 | + String tempStr = | ||
| 181 | + str.substring(str.indexOf(':'), str.length); | ||
| 142 | if (tempStr.contains('年')) { | 182 | if (tempStr.contains('年')) { |
| 143 | - monthStr = tempStr.substring( | ||
| 144 | - tempStr.indexOf('年') + 1, | ||
| 145 | - tempStr.indexOf('月')); | ||
| 146 | - } else { | ||
| 147 | - monthStr = tempStr.substring( | 183 | + yearStr = tempStr.substring( |
| 148 | tempStr.indexOf(':') + 1, | 184 | tempStr.indexOf(':') + 1, |
| 149 | - tempStr.indexOf('月')); | 185 | + tempStr.indexOf('年')); |
| 186 | + } | ||
| 187 | + if (tempStr.contains('月')) { | ||
| 188 | + if (tempStr.contains('年')) { | ||
| 189 | + monthStr = tempStr.substring( | ||
| 190 | + tempStr.indexOf('年') + 1, | ||
| 191 | + tempStr.indexOf('月')); | ||
| 192 | + } else { | ||
| 193 | + monthStr = tempStr.substring( | ||
| 194 | + tempStr.indexOf(':') + 1, | ||
| 195 | + tempStr.indexOf('月')); | ||
| 196 | + } | ||
| 197 | + } | ||
| 198 | + if (tempStr.contains('日')) { | ||
| 199 | + dayStr = tempStr.substring( | ||
| 200 | + tempStr.indexOf('月') + 1, | ||
| 201 | + tempStr.indexOf('日')); | ||
| 202 | + } | ||
| 203 | + if (tempStr.contains('农历')) { | ||
| 204 | + gongli = false; | ||
| 150 | } | 205 | } |
| 151 | - } | ||
| 152 | - if (tempStr.contains('日')) { | ||
| 153 | - dayStr = tempStr.substring( | ||
| 154 | - tempStr.indexOf('月') + 1, | ||
| 155 | - tempStr.indexOf('日')); | ||
| 156 | - } | ||
| 157 | - if (tempStr.contains('农历')) { | ||
| 158 | - gongli = false; | ||
| 159 | } | 206 | } |
| 160 | 207 | ||
| 161 | DialogUtil.festivalAlertDialog( | 208 | DialogUtil.festivalAlertDialog( |
| 162 | - context, content, 520, rCallback: (name) { | ||
| 163 | - print(name); | ||
| 164 | - _setGuestInfocDay(model.cday[index].id, name); | 209 | + context, content, 520, rCallback: (content) { |
| 210 | + print(content); | ||
| 211 | + _setGuestInfocDay(model.cday[index].id, content); | ||
| 165 | // _addCookbookClass(name, showLoading: true); | 212 | // _addCookbookClass(name, showLoading: true); |
| 166 | }, delCallback: () { | 213 | }, delCallback: () { |
| 167 | //弹框确认是否删除 | 214 | //弹框确认是否删除 |
| @@ -187,7 +234,7 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -187,7 +234,7 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 187 | children: [ | 234 | children: [ |
| 188 | Expanded( | 235 | Expanded( |
| 189 | child: Text( | 236 | child: Text( |
| 190 | - model.cday[index].content, | 237 | + cday.content == null ? show : cday.content, |
| 191 | overflow: TextOverflow.ellipsis, | 238 | overflow: TextOverflow.ellipsis, |
| 192 | style: TextStyle( | 239 | style: TextStyle( |
| 193 | fontSize: ScreenUtil().setSp(26), | 240 | fontSize: ScreenUtil().setSp(26), |
| @@ -216,9 +263,9 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | @@ -216,9 +263,9 @@ class _FestivalEditPageState extends State<FestivalEditPage> { | ||
| 216 | isBold: false, | 263 | isBold: false, |
| 217 | onPressed: () { | 264 | onPressed: () { |
| 218 | DialogUtil.festivalAlertDialog(context, '', 520, | 265 | DialogUtil.festivalAlertDialog(context, '', 520, |
| 219 | - rCallback: (name) { | ||
| 220 | - print(name); | ||
| 221 | - _setGuestInfocDay('', name); | 266 | + rCallback: (content) { |
| 267 | + print(content); | ||
| 268 | + _setGuestInfocDay('', content); | ||
| 222 | // _addCookbookClass(name, showLoading: true); | 269 | // _addCookbookClass(name, showLoading: true); |
| 223 | }); | 270 | }); |
| 224 | }, | 271 | }, |
| @@ -218,6 +218,9 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -218,6 +218,9 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 218 | DateTime datenow = DateUtil.getDateTime(from); | 218 | DateTime datenow = DateUtil.getDateTime(from); |
| 219 | //比较相差的天数 | 219 | //比较相差的天数 |
| 220 | int day = edate.difference(datenow).inDays; | 220 | int day = edate.difference(datenow).inDays; |
| 221 | + | ||
| 222 | + // difference < 0 || (difference == 0 && differenceSeconds <= 0 | ||
| 223 | + | ||
| 221 | outDay = day < 0 ? '0' : day.toString(); | 224 | outDay = day < 0 ? '0' : day.toString(); |
| 222 | // print(outDay); | 225 | // print(outDay); |
| 223 | } else { | 226 | } else { |
| @@ -123,12 +123,14 @@ class CollectStoreProvider with ChangeNotifier { | @@ -123,12 +123,14 @@ class CollectStoreProvider with ChangeNotifier { | ||
| 123 | element == '1' || | 123 | element == '1' || |
| 124 | element == '2' || | 124 | element == '2' || |
| 125 | element == '3' || | 125 | element == '3' || |
| 126 | - element == '4'); | 126 | + element == '4' || |
| 127 | + element == '13'); | ||
| 127 | sellerVersionList.forEach((element) { | 128 | sellerVersionList.forEach((element) { |
| 128 | if (element.vid == '1' || | 129 | if (element.vid == '1' || |
| 129 | element.vid == '2' || | 130 | element.vid == '2' || |
| 130 | element.vid == '3' || | 131 | element.vid == '3' || |
| 131 | - element.vid == '4') { | 132 | + element.vid == '4' || |
| 133 | + element.vid == '13') { | ||
| 132 | sellerNormalEdate = element.edate; | 134 | sellerNormalEdate = element.edate; |
| 133 | } | 135 | } |
| 134 | }); | 136 | }); |
| @@ -140,9 +142,9 @@ class CollectStoreProvider with ChangeNotifier { | @@ -140,9 +142,9 @@ class CollectStoreProvider with ChangeNotifier { | ||
| 140 | App.sp.remove("sellerEdate"); | 142 | App.sp.remove("sellerEdate"); |
| 141 | } | 143 | } |
| 142 | } | 144 | } |
| 143 | - }else{ | ||
| 144 | - //超能版或者标准版过期 | ||
| 145 | - App.sp.setStringList("sellerEdate", ['-1']); | 145 | + } else { |
| 146 | + //超能版或者标准版过期 | ||
| 147 | + App.sp.setStringList("sellerEdate", ['-1']); | ||
| 146 | } | 148 | } |
| 147 | 149 | ||
| 148 | return true; | 150 | return true; |
| @@ -3838,10 +3838,7 @@ class DialogUtil { | @@ -3838,10 +3838,7 @@ class DialogUtil { | ||
| 3838 | // //跳转到被合并桌位展示页面 | 3838 | // //跳转到被合并桌位展示页面 |
| 3839 | Map object = | 3839 | Map object = |
| 3840 | await NavigatorUtil.goAreasSelectPage( | 3840 | await NavigatorUtil.goAreasSelectPage( |
| 3841 | - context, | ||
| 3842 | - table.rid, | ||
| 3843 | - table.name | ||
| 3844 | - ); | 3841 | + context, table.rid, table.name); |
| 3845 | if (object != null) { | 3842 | if (object != null) { |
| 3846 | state(() { | 3843 | state(() { |
| 3847 | rid = object['rid']; | 3844 | rid = object['rid']; |
| @@ -8509,16 +8506,23 @@ class DialogUtil { | @@ -8509,16 +8506,23 @@ class DialogUtil { | ||
| 8509 | 8506 | ||
| 8510 | Navigator.of(context).pop(); | 8507 | Navigator.of(context).pop(); |
| 8511 | String str = ''; | 8508 | String str = ''; |
| 8512 | - str += '${name}:'; | 8509 | + |
| 8513 | if (yearStr != '' && | 8510 | if (yearStr != '' && |
| 8514 | yearStr != null && | 8511 | yearStr != null && |
| 8515 | yearStr != '选填') { | 8512 | yearStr != '选填') { |
| 8516 | - str += '${yearStr}年'; | 8513 | + str += '${yearStr}-'; |
| 8517 | } | 8514 | } |
| 8518 | - str += '${monthStr}月'; | ||
| 8519 | - str += '${dayStr}日'; | ||
| 8520 | - str += '(${gongli ? '公历' : '农历'})'; | ||
| 8521 | - rCallback(str); | 8515 | + str += |
| 8516 | + '${Utils.addZeroNumber(int.parse(monthStr))}-'; | ||
| 8517 | + str += | ||
| 8518 | + '${Utils.addZeroNumber(int.parse(dayStr))}'; | ||
| 8519 | + | ||
| 8520 | + print('ggsgsg'); | ||
| 8521 | + rCallback({ | ||
| 8522 | + 'desc': name, | ||
| 8523 | + 'type': gongli ? '1' : '2', | ||
| 8524 | + 'dtime': str | ||
| 8525 | + }); | ||
| 8522 | }, | 8526 | }, |
| 8523 | ), | 8527 | ), |
| 8524 | ], | 8528 | ], |
-
Please register or login to post a comment