Showing
10 changed files
with
537 additions
and
65 deletions
| @@ -15,17 +15,19 @@ if (flutterRoot == null) { | @@ -15,17 +15,19 @@ if (flutterRoot == null) { | ||
| 15 | 15 | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | -def flutterVersionCode = "489" | 18 | + |
| 19 | +def flutterVersionCode = "490" | ||
| 19 | if (flutterVersionCode == null) { | 20 | if (flutterVersionCode == null) { |
| 20 | - flutterVersionCode = '489' | 21 | + flutterVersionCode = '490' |
| 21 | } | 22 | } |
| 22 | 23 | ||
| 23 | 24 | ||
| 24 | 25 | ||
| 25 | 26 | ||
| 26 | -def flutterVersionName = "4.8.9" | 27 | +def flutterVersionName = "4.9.0" |
| 27 | if (flutterVersionName == null) { | 28 | if (flutterVersionName == null) { |
| 28 | - flutterVersionName = '4.8.9' | 29 | + flutterVersionName = '4.9.0' |
| 30 | + | ||
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | 33 |
| @@ -162,47 +162,52 @@ class Data extends Object { | @@ -162,47 +162,52 @@ class Data extends Object { | ||
| 162 | @JsonKey(name: 'real_address') | 162 | @JsonKey(name: 'real_address') |
| 163 | String realAddress; | 163 | String realAddress; |
| 164 | 164 | ||
| 165 | + @JsonKey(name: 'edate') | ||
| 166 | + String edate; | ||
| 167 | + | ||
| 165 | Data( | 168 | Data( |
| 166 | - this.id, | ||
| 167 | - this.pid, | ||
| 168 | - this.openid, | ||
| 169 | - this.sellername, | ||
| 170 | - this.selleralias, | ||
| 171 | - this.slogan, | ||
| 172 | - this.sellerdesc, | ||
| 173 | - this.sellerLogo, | ||
| 174 | - this.sellerImage, | ||
| 175 | - this.sellerTel, | ||
| 176 | - this.phone, | ||
| 177 | - this.mapAddress, | ||
| 178 | - this.long, | ||
| 179 | - this.lat, | ||
| 180 | - this.discountType, | ||
| 181 | - this.lastNum, | ||
| 182 | - this.ispass, | ||
| 183 | - this.disIspass, | ||
| 184 | - this.accountMoney, | ||
| 185 | - this.isopenDc, | ||
| 186 | - this.isopenMd, | ||
| 187 | - this.dcAdduserCode, | ||
| 188 | - this.average, | ||
| 189 | - this.isOnlineReserve, | ||
| 190 | - this.isTele, | ||
| 191 | - this.daily, | ||
| 192 | - this.dailyTime, | ||
| 193 | - this.scale, | ||
| 194 | - this.score, | ||
| 195 | - this.isAuth, | ||
| 196 | - this.isCallTel, | ||
| 197 | - this.recStime, | ||
| 198 | - this.recEtime, | ||
| 199 | - this.status, | ||
| 200 | - this.cdate, | ||
| 201 | - this.proCode, | ||
| 202 | - this.cityCode, | ||
| 203 | - this.disCode, | ||
| 204 | - this.sellerCode, | ||
| 205 | - this.realAddress); | 169 | + this.id, |
| 170 | + this.pid, | ||
| 171 | + this.openid, | ||
| 172 | + this.sellername, | ||
| 173 | + this.selleralias, | ||
| 174 | + this.slogan, | ||
| 175 | + this.sellerdesc, | ||
| 176 | + this.sellerLogo, | ||
| 177 | + this.sellerImage, | ||
| 178 | + this.sellerTel, | ||
| 179 | + this.phone, | ||
| 180 | + this.mapAddress, | ||
| 181 | + this.long, | ||
| 182 | + this.lat, | ||
| 183 | + this.discountType, | ||
| 184 | + this.lastNum, | ||
| 185 | + this.ispass, | ||
| 186 | + this.disIspass, | ||
| 187 | + this.accountMoney, | ||
| 188 | + this.isopenDc, | ||
| 189 | + this.isopenMd, | ||
| 190 | + this.dcAdduserCode, | ||
| 191 | + this.average, | ||
| 192 | + this.isOnlineReserve, | ||
| 193 | + this.isTele, | ||
| 194 | + this.daily, | ||
| 195 | + this.dailyTime, | ||
| 196 | + this.scale, | ||
| 197 | + this.score, | ||
| 198 | + this.isAuth, | ||
| 199 | + this.isCallTel, | ||
| 200 | + this.recStime, | ||
| 201 | + this.recEtime, | ||
| 202 | + this.status, | ||
| 203 | + this.cdate, | ||
| 204 | + this.proCode, | ||
| 205 | + this.cityCode, | ||
| 206 | + this.disCode, | ||
| 207 | + this.sellerCode, | ||
| 208 | + this.realAddress, | ||
| 209 | + this.edate | ||
| 210 | + ); | ||
| 206 | 211 | ||
| 207 | factory Data.fromJson(Map<String, dynamic> srcJson) => | 212 | factory Data.fromJson(Map<String, dynamic> srcJson) => |
| 208 | _$DataFromJson(srcJson); | 213 | _$DataFromJson(srcJson); |
| @@ -76,6 +76,7 @@ Data _$DataFromJson(Map<String, dynamic> json) { | @@ -76,6 +76,7 @@ Data _$DataFromJson(Map<String, dynamic> json) { | ||
| 76 | json['dis_code'] as String, | 76 | json['dis_code'] as String, |
| 77 | json['seller_code'] as String, | 77 | json['seller_code'] as String, |
| 78 | json['real_address'] as String, | 78 | json['real_address'] as String, |
| 79 | + json['edate'] as String, | ||
| 79 | ); | 80 | ); |
| 80 | } | 81 | } |
| 81 | 82 | ||
| @@ -119,5 +120,6 @@ Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{ | @@ -119,5 +120,6 @@ Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{ | ||
| 119 | 'city_code': instance.cityCode, | 120 | 'city_code': instance.cityCode, |
| 120 | 'dis_code': instance.disCode, | 121 | 'dis_code': instance.disCode, |
| 121 | 'seller_code': instance.sellerCode, | 122 | 'seller_code': instance.sellerCode, |
| 122 | - 'real_address': instance.realAddress | 123 | + 'real_address': instance.realAddress, |
| 124 | + 'edate': instance.edate | ||
| 123 | }; | 125 | }; |
| @@ -22,6 +22,7 @@ class User { | @@ -22,6 +22,7 @@ class User { | ||
| 22 | String userphone; //角色电话 | 22 | String userphone; //角色电话 |
| 23 | String token; //token | 23 | String token; //token |
| 24 | String nickName; // 昵称 | 24 | String nickName; // 昵称 |
| 25 | + String edate; //店铺过期日期 | ||
| 25 | 26 | ||
| 26 | User( | 27 | User( |
| 27 | this.openid, | 28 | this.openid, |
| @@ -41,7 +42,8 @@ class User { | @@ -41,7 +42,8 @@ class User { | ||
| 41 | this.night, | 42 | this.night, |
| 42 | this.userphone, | 43 | this.userphone, |
| 43 | this.token, | 44 | this.token, |
| 44 | - this.nickName); | 45 | + this.nickName, |
| 46 | + this.edate); | ||
| 45 | 47 | ||
| 46 | factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json); | 48 | factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json); |
| 47 | 49 | ||
| @@ -49,6 +51,6 @@ class User { | @@ -49,6 +51,6 @@ class User { | ||
| 49 | 51 | ||
| 50 | @override | 52 | @override |
| 51 | String toString() { | 53 | String toString() { |
| 52 | - return 'User{openid: $openid, account: $account, role_name: $role_name, sellerid: $sellerid, sellercode: $sellercode, sellername: $sellername,sellerimage:$sellerimage, sellerphone: $sellerphone, sellerAddr: $sellerAddr, scatter: $scatter, room: $room, cassette: $cassette, morning: $morning, noon: $noon, night: $night ,userphone:$userphone},token:$token},nickName:$nickName}'; | 54 | + return 'User{openid: $openid, account: $account, role_name: $role_name, sellerid: $sellerid, sellercode: $sellercode, sellername: $sellername,sellerimage:$sellerimage, sellerphone: $sellerphone, sellerAddr: $sellerAddr, scatter: $scatter, room: $room, cassette: $cassette, morning: $morning, noon: $noon, night: $night ,userphone:$userphone,token:$token,nickName:$nickName,edate:$edate}'; |
| 53 | } | 55 | } |
| 54 | } | 56 | } |
| @@ -26,6 +26,7 @@ User _$UserFromJson(Map<String, dynamic> json) { | @@ -26,6 +26,7 @@ User _$UserFromJson(Map<String, dynamic> json) { | ||
| 26 | json['userphone'] as String, | 26 | json['userphone'] as String, |
| 27 | json['token'] as String, | 27 | json['token'] as String, |
| 28 | json['nickname'] as String, | 28 | json['nickname'] as String, |
| 29 | + json['edate'] as String, | ||
| 29 | ); | 30 | ); |
| 30 | } | 31 | } |
| 31 | 32 | ||
| @@ -47,5 +48,6 @@ Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{ | @@ -47,5 +48,6 @@ Map<String, dynamic> _$UserToJson(User instance) => <String, dynamic>{ | ||
| 47 | 'night': instance.night, | 48 | 'night': instance.night, |
| 48 | 'userphone': instance.userphone, | 49 | 'userphone': instance.userphone, |
| 49 | 'token': instance.token, | 50 | 'token': instance.token, |
| 50 | - 'nickname': instance.nickName | 51 | + 'nickname': instance.nickName, |
| 52 | + 'edate': instance.edate | ||
| 51 | }; | 53 | }; |
| @@ -40,7 +40,12 @@ import 'package:one_key/models/message.dart'; | @@ -40,7 +40,12 @@ import 'package:one_key/models/message.dart'; | ||
| 40 | 40 | ||
| 41 | import '../../constant/state.dart'; | 41 | import '../../constant/state.dart'; |
| 42 | import '../../models/customer_by_seller_model.dart'; | 42 | import '../../models/customer_by_seller_model.dart'; |
| 43 | + | ||
| 44 | +import '../../app.dart'; | ||
| 45 | + | ||
| 46 | +import '../../models/get_seller_info_model.dart'; | ||
| 43 | import '../../provider/feast_model.dart'; | 47 | import '../../provider/feast_model.dart'; |
| 48 | +import '../../provider/store_base_info_provider.dart'; | ||
| 44 | import '../feast/feast_page.dart'; | 49 | import '../feast/feast_page.dart'; |
| 45 | 50 | ||
| 46 | class HomePage extends StatefulWidget { | 51 | class HomePage extends StatefulWidget { |
| @@ -75,6 +80,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -75,6 +80,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 75 | 80 | ||
| 76 | Timer timer; | 81 | Timer timer; |
| 77 | Timer timerSeller; | 82 | Timer timerSeller; |
| 83 | + Timer timerSellerEdate; //店铺过期时间提醒 | ||
| 78 | 84 | ||
| 79 | int xgCount = 1; //注册信鸽次数,最多5次 | 85 | int xgCount = 1; //注册信鸽次数,最多5次 |
| 80 | 86 | ||
| @@ -84,6 +90,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -84,6 +90,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 84 | bool needRefreshTemp = true; | 90 | bool needRefreshTemp = true; |
| 85 | static const MethodChannel _channel = MethodChannel("com.naji/book"); | 91 | static const MethodChannel _channel = MethodChannel("com.naji/book"); |
| 86 | 92 | ||
| 93 | + GetSellerInfoSunModel sellerInfoSunModel; | ||
| 94 | + | ||
| 87 | //实现监听 | 95 | //实现监听 |
| 88 | Future<dynamic> platformCallHandler(MethodCall call) async { | 96 | Future<dynamic> platformCallHandler(MethodCall call) async { |
| 89 | switch (call.method) { | 97 | switch (call.method) { |
| @@ -116,6 +124,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -116,6 +124,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 116 | WidgetsBinding.instance.addObserver(this); | 124 | WidgetsBinding.instance.addObserver(this); |
| 117 | 125 | ||
| 118 | _currIndex = widget.initialIndex; | 126 | _currIndex = widget.initialIndex; |
| 127 | + if (App.sp.containsKey('sellerEdate')) { | ||
| 128 | + List<String> data = App.sp.getStringList('sellerEdate'); | ||
| 129 | + if (data.contains('0')) { | ||
| 130 | + //已经弹过过期弹窗,默认我的 | ||
| 131 | + _currIndex = 4; | ||
| 132 | + } | ||
| 133 | + } | ||
| 119 | _pageController = PageController(initialPage: _currIndex); | 134 | _pageController = PageController(initialPage: _currIndex); |
| 120 | pages | 135 | pages |
| 121 | // ..add(ChangeNotifierProvider<HomeEnterModel>( | 136 | // ..add(ChangeNotifierProvider<HomeEnterModel>( |
| @@ -158,6 +173,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -158,6 +173,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 158 | WidgetsBinding.instance.addPostFrameCallback((_) { | 173 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 159 | initPlatformState(); | 174 | initPlatformState(); |
| 160 | _getTableList(); | 175 | _getTableList(); |
| 176 | + _getSellerById(); | ||
| 161 | 177 | ||
| 162 | List<PullMarketingByUidSunModel> data = | 178 | List<PullMarketingByUidSunModel> data = |
| 163 | Provider.of<UserModel>(context, listen: false) | 179 | Provider.of<UserModel>(context, listen: false) |
| @@ -204,6 +220,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -204,6 +220,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 204 | timer = Timer.periodic(Duration(minutes: 3), (_) { | 220 | timer = Timer.periodic(Duration(minutes: 3), (_) { |
| 205 | _getAllUnMessages(); | 221 | _getAllUnMessages(); |
| 206 | }); | 222 | }); |
| 223 | + | ||
| 207 | _getUnMsgNum(); | 224 | _getUnMsgNum(); |
| 208 | }); | 225 | }); |
| 209 | } | 226 | } |
| @@ -217,6 +234,120 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -217,6 +234,120 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 217 | ); | 234 | ); |
| 218 | } | 235 | } |
| 219 | 236 | ||
| 237 | + _edateShow() { | ||
| 238 | + //店铺过期提醒 | ||
| 239 | + // 计算时间差 | ||
| 240 | + //店铺过期日期 | ||
| 241 | + DateTime edate = DateTime.fromMillisecondsSinceEpoch( | ||
| 242 | + int.parse(sellerInfoSunModel.data.edate) * 1000); | ||
| 243 | + //当前日期 | ||
| 244 | + final datenow = DateTime.now(); | ||
| 245 | + //比较相差的天数 | ||
| 246 | + int difference = edate.difference(datenow).inDays; | ||
| 247 | + if (difference == 7) { | ||
| 248 | + _showSellerAlert('7', edate); | ||
| 249 | + } else if (difference == 3) { | ||
| 250 | + //过期差3天,提醒一次 | ||
| 251 | + _showSellerAlert('3', edate); | ||
| 252 | + } else if (difference == 2) { | ||
| 253 | + //过期差2天,提醒一次 | ||
| 254 | + _showSellerAlert('2', edate); | ||
| 255 | + } else if (difference == 1) { | ||
| 256 | + //过期差1天,提醒一次 | ||
| 257 | + _showSellerAlert('1', edate); | ||
| 258 | + } else if (difference <= 0) { | ||
| 259 | + //已到期 | ||
| 260 | + _showSellerAlert('0', edate); | ||
| 261 | + } | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + ///获取店铺过期时间 | ||
| 265 | + _getSellerById() async { | ||
| 266 | + StoreBaseIndoProvider storeBaseIndoProvider = | ||
| 267 | + Provider.of<StoreBaseIndoProvider>(context, listen: false); | ||
| 268 | + sellerInfoSunModel = await storeBaseIndoProvider.getSellerById(context); | ||
| 269 | + if (sellerInfoSunModel != null) { | ||
| 270 | + //获取到店铺过期时间 | ||
| 271 | + //店铺过期提醒 | ||
| 272 | + // 计算时间差 | ||
| 273 | + //店铺过期日期 | ||
| 274 | + _edateShow(); | ||
| 275 | + timerSellerEdate = Timer.periodic(Duration(days: 1), (_) { | ||
| 276 | + //店铺过期提醒 | ||
| 277 | + // 计算时间差 | ||
| 278 | + //店铺过期日期 | ||
| 279 | + _edateShow(); | ||
| 280 | + }); | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + | ||
| 284 | + _showSellerAlert(String day, DateTime edate) { | ||
| 285 | + if (App.sp.containsKey('sellerEdate')) { | ||
| 286 | + //已经存进去过数据 | ||
| 287 | + List<String> data = App.sp.getStringList('sellerEdate'); | ||
| 288 | + if (!data.contains(day)) { | ||
| 289 | + data.add(day); | ||
| 290 | + App.sp.setStringList("sellerEdate", data); | ||
| 291 | + //过期差ji天,提醒一次s | ||
| 292 | + if (day == '0') { | ||
| 293 | + DialogUtil.cupertinoAlertSellerHasEdateDialog( | ||
| 294 | + context, | ||
| 295 | + title: '温馨提示', | ||
| 296 | + isBold: true, | ||
| 297 | + lCallback: () { | ||
| 298 | + NavigatorUtil.goHomePage(context, initialIndex: 4); | ||
| 299 | + }, | ||
| 300 | + rCallback: () { | ||
| 301 | + //立即续费 | ||
| 302 | + }, | ||
| 303 | + ); | ||
| 304 | + } else { | ||
| 305 | + DialogUtil.cupertinoAlertSellerEdateDialog( | ||
| 306 | + context, | ||
| 307 | + title: '温馨提示', | ||
| 308 | + isBold: true, | ||
| 309 | + content: DateUtil.formatDate( | ||
| 310 | + edate, | ||
| 311 | + format: DateFormats.full, | ||
| 312 | + ), | ||
| 313 | + rCallback: () { | ||
| 314 | + //立即续费 | ||
| 315 | + }, | ||
| 316 | + ); | ||
| 317 | + } | ||
| 318 | + } | ||
| 319 | + } else { | ||
| 320 | + App.sp.setStringList("sellerEdate", [day]); | ||
| 321 | + //过期差ji天,提醒一次s | ||
| 322 | + if (day == '0') { | ||
| 323 | + DialogUtil.cupertinoAlertSellerHasEdateDialog( | ||
| 324 | + context, | ||
| 325 | + title: '温馨提示', | ||
| 326 | + isBold: true, | ||
| 327 | + lCallback: () { | ||
| 328 | + NavigatorUtil.goHomePage(context, initialIndex: 4); | ||
| 329 | + }, | ||
| 330 | + rCallback: () { | ||
| 331 | + //立即续费 | ||
| 332 | + }, | ||
| 333 | + ); | ||
| 334 | + } else { | ||
| 335 | + DialogUtil.cupertinoAlertSellerEdateDialog( | ||
| 336 | + context, | ||
| 337 | + title: '温馨提示', | ||
| 338 | + isBold: true, | ||
| 339 | + content: DateUtil.formatDate( | ||
| 340 | + edate, | ||
| 341 | + format: DateFormats.full, | ||
| 342 | + ), | ||
| 343 | + rCallback: () { | ||
| 344 | + //立即续费 | ||
| 345 | + }, | ||
| 346 | + ); | ||
| 347 | + } | ||
| 348 | + } | ||
| 349 | + } | ||
| 350 | + | ||
| 220 | _initNotification() async { | 351 | _initNotification() async { |
| 221 | Map param = await Tools().getIntent(); | 352 | Map param = await Tools().getIntent(); |
| 222 | _getIntent(param); | 353 | _getIntent(param); |
| @@ -777,9 +908,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -777,9 +908,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 777 | case AppLifecycleState.resumed: //应用前台可见 | 908 | case AppLifecycleState.resumed: //应用前台可见 |
| 778 | // if (widget.initialIndex == 1 && needRefreshTemp == false) { | 909 | // if (widget.initialIndex == 1 && needRefreshTemp == false) { |
| 779 | // } else { | 910 | // } else { |
| 780 | - _clearBadge(() { | ||
| 781 | - // _getAllUnMessages(); | ||
| 782 | - }); | 911 | + _clearBadge(() { |
| 912 | + // _getAllUnMessages(); | ||
| 913 | + }); | ||
| 783 | // } | 914 | // } |
| 784 | 915 | ||
| 785 | break; | 916 | break; |
| @@ -863,7 +994,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -863,7 +994,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 863 | }; | 994 | }; |
| 864 | await messageModel.getNewGetUntreatedMsgNum(context, params, | 995 | await messageModel.getNewGetUntreatedMsgNum(context, params, |
| 865 | showLoading: false); | 996 | showLoading: false); |
| 866 | - setState(() {}); | 997 | + if (mounted) { |
| 998 | + setState(() {}); | ||
| 999 | + } | ||
| 867 | } | 1000 | } |
| 868 | 1001 | ||
| 869 | // 系统窗口相关改变回调 | 1002 | // 系统窗口相关改变回调 |
| @@ -1083,10 +1216,30 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1083,10 +1216,30 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1083 | currentIndex: _currIndex, | 1216 | currentIndex: _currIndex, |
| 1084 | onTap: (int index) { | 1217 | onTap: (int index) { |
| 1085 | if (_currIndex != index) { | 1218 | if (_currIndex != index) { |
| 1086 | - setState(() { | ||
| 1087 | - _currIndex = index; | ||
| 1088 | - _pageController.jumpToPage(index); | ||
| 1089 | - }); | 1219 | + if (App.sp.containsKey('sellerEdate')) { |
| 1220 | + List<String> data = App.sp.getStringList('sellerEdate'); | ||
| 1221 | + if (data.contains('0')) { | ||
| 1222 | + DialogUtil.cupertinoAlertSellerHasEdateDialog( | ||
| 1223 | + context, | ||
| 1224 | + title: '温馨提示', | ||
| 1225 | + isBold: true, | ||
| 1226 | + lCallback: () { | ||
| 1227 | + NavigatorUtil.goHomePage(context, initialIndex: 4); | ||
| 1228 | + }, | ||
| 1229 | + rCallback: () { | ||
| 1230 | + //立即续费 | ||
| 1231 | + }, | ||
| 1232 | + ); | ||
| 1233 | + return; | ||
| 1234 | + } | ||
| 1235 | + } | ||
| 1236 | + | ||
| 1237 | + if (mounted) { | ||
| 1238 | + setState(() { | ||
| 1239 | + _currIndex = index; | ||
| 1240 | + _pageController.jumpToPage(index); | ||
| 1241 | + }); | ||
| 1242 | + } | ||
| 1090 | if (_currIndex == 4) { | 1243 | if (_currIndex == 4) { |
| 1091 | Utils.changeStatusColor(color: MyColours.color_199095); | 1244 | Utils.changeStatusColor(color: MyColours.color_199095); |
| 1092 | } else { | 1245 | } else { |
| @@ -1173,9 +1326,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1173,9 +1326,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1173 | controller: _pageController, | 1326 | controller: _pageController, |
| 1174 | children: pages, | 1327 | children: pages, |
| 1175 | onPageChanged: (index) { | 1328 | onPageChanged: (index) { |
| 1176 | - setState(() { | ||
| 1177 | - _currIndex = index; | ||
| 1178 | - }); | 1329 | + if (mounted) { |
| 1330 | + setState(() { | ||
| 1331 | + _currIndex = index; | ||
| 1332 | + }); | ||
| 1333 | + } | ||
| 1179 | }, | 1334 | }, |
| 1180 | physics: NeverScrollableScrollPhysics(), //禁止底部滑动 | 1335 | physics: NeverScrollableScrollPhysics(), //禁止底部滑动 |
| 1181 | )), | 1336 | )), |
| @@ -1204,6 +1359,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1204,6 +1359,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1204 | if (timerSeller != null) { | 1359 | if (timerSeller != null) { |
| 1205 | timerSeller.cancel(); | 1360 | timerSeller.cancel(); |
| 1206 | } | 1361 | } |
| 1362 | + if (timerSellerEdate != null) { | ||
| 1363 | + timerSellerEdate.cancel(); | ||
| 1364 | + } | ||
| 1207 | WidgetsBinding.instance.removeObserver(this); | 1365 | WidgetsBinding.instance.removeObserver(this); |
| 1208 | } | 1366 | } |
| 1209 | } | 1367 | } |
| @@ -92,6 +92,7 @@ class UserModel with ChangeNotifier { | @@ -92,6 +92,7 @@ class UserModel with ChangeNotifier { | ||
| 92 | 'userphone': user['phone'], | 92 | 'userphone': user['phone'], |
| 93 | 'token': baseResp.data[0]["token"]['token'], | 93 | 'token': baseResp.data[0]["token"]['token'], |
| 94 | 'nickname': user['nick_name'], | 94 | 'nickname': user['nick_name'], |
| 95 | + 'edate':seller['edate'] | ||
| 95 | }; | 96 | }; |
| 96 | await saveUserInfo(User.fromJson(userMap)); | 97 | await saveUserInfo(User.fromJson(userMap)); |
| 97 | 98 |
| @@ -258,12 +258,14 @@ var homeHandler = new Handler( | @@ -258,12 +258,14 @@ var homeHandler = new Handler( | ||
| 258 | int.parse(params["dateTime"].first)); | 258 | int.parse(params["dateTime"].first)); |
| 259 | return ChangeNotifierProvider<TableManagerModel>( | 259 | return ChangeNotifierProvider<TableManagerModel>( |
| 260 | create: (_) => TableManagerModel(), | 260 | create: (_) => TableManagerModel(), |
| 261 | - child: HomePage( | ||
| 262 | - initialIndex: int.parse(initialIndex), | ||
| 263 | - needReresh: needRefresh, | ||
| 264 | - mine: mine, | ||
| 265 | - date: dateTime, | ||
| 266 | - solt: solt)); | 261 | + child: ChangeNotifierProvider<StoreBaseIndoProvider>( |
| 262 | + create: (_) => StoreBaseIndoProvider(), | ||
| 263 | + child: HomePage( | ||
| 264 | + initialIndex: int.parse(initialIndex), | ||
| 265 | + needReresh: needRefresh, | ||
| 266 | + mine: mine, | ||
| 267 | + date: dateTime, | ||
| 268 | + solt: solt))); | ||
| 267 | }); | 269 | }); |
| 268 | 270 | ||
| 269 | // 跳转预订详情页 | 271 | // 跳转预订详情页 |
| @@ -6337,6 +6337,300 @@ class DialogUtil { | @@ -6337,6 +6337,300 @@ class DialogUtil { | ||
| 6337 | ); | 6337 | ); |
| 6338 | } | 6338 | } |
| 6339 | 6339 | ||
| 6340 | + ///店铺临近过期弹窗 | ||
| 6341 | + static cupertinoAlertSellerEdateDialog(BuildContext context, | ||
| 6342 | + {String title = "", | ||
| 6343 | + String content = "内容", | ||
| 6344 | + String lTitle = "我知道了", | ||
| 6345 | + String rTitle = "立即续费", | ||
| 6346 | + Color rColor = MyColours.color_438E93, | ||
| 6347 | + bool isBold = false, | ||
| 6348 | + bool isBoldContent = false, | ||
| 6349 | + Color contentColor = MyColours.color_99000000, | ||
| 6350 | + VoidCallback lCallback, | ||
| 6351 | + VoidCallback rCallback}) async { | ||
| 6352 | + // bool isRed = content != '' ? false : true; | ||
| 6353 | + final action = await showDialog( | ||
| 6354 | + context: context, | ||
| 6355 | + barrierDismissible: false, | ||
| 6356 | + builder: (BuildContext context) { | ||
| 6357 | + return StatefulBuilder(builder: (context, state) { | ||
| 6358 | + return Scaffold( | ||
| 6359 | + backgroundColor: Colors.transparent, | ||
| 6360 | + body: Center( | ||
| 6361 | + child: Container( | ||
| 6362 | + padding: EdgeInsets.symmetric( | ||
| 6363 | + horizontal: ScreenUtil().setWidth(50)), | ||
| 6364 | + // height: ScreenUtil().setWidth(421 * 2), | ||
| 6365 | + decoration: BoxDecoration( | ||
| 6366 | + borderRadius: | ||
| 6367 | + BorderRadius.circular(ScreenUtil().setWidth(16))), | ||
| 6368 | + child: SingleChildScrollView( | ||
| 6369 | + child: Card( | ||
| 6370 | + shape: RoundedRectangleBorder( | ||
| 6371 | + borderRadius: BorderRadius.all( | ||
| 6372 | + Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 6373 | + child: Container( | ||
| 6374 | + child: Column( | ||
| 6375 | + children: [ | ||
| 6376 | + VEmptyView(64), | ||
| 6377 | + Container( | ||
| 6378 | + alignment: Alignment.center, | ||
| 6379 | + child: Text(title, | ||
| 6380 | + style: TextStyle( | ||
| 6381 | + fontWeight: FontWeight.bold, | ||
| 6382 | + fontSize: ScreenUtil().setSp(32), | ||
| 6383 | + color: MyColours.color_E5000000)), | ||
| 6384 | + ), | ||
| 6385 | + VEmptyView(16), | ||
| 6386 | + Text( | ||
| 6387 | + '您的店铺即将在', | ||
| 6388 | + style: TextStyle( | ||
| 6389 | + fontSize: ScreenUtil().setSp(32), | ||
| 6390 | + color: MyColours.color_515151), | ||
| 6391 | + ), | ||
| 6392 | + VEmptyView(24), | ||
| 6393 | + Text( | ||
| 6394 | + '$content 过期', | ||
| 6395 | + style: TextStyle( | ||
| 6396 | + fontSize: ScreenUtil().setSp(32), | ||
| 6397 | + color: MyColours.color_E34D59), | ||
| 6398 | + ), | ||
| 6399 | + VEmptyView(24), | ||
| 6400 | + Text( | ||
| 6401 | + '请联系您的服务商或拨打', | ||
| 6402 | + style: TextStyle( | ||
| 6403 | + fontSize: ScreenUtil().setSp(32), | ||
| 6404 | + color: MyColours.color_515151), | ||
| 6405 | + ), | ||
| 6406 | + VEmptyView(24), | ||
| 6407 | + Text( | ||
| 6408 | + '400-000-9690 及时续费', | ||
| 6409 | + style: TextStyle( | ||
| 6410 | + fontSize: ScreenUtil().setSp(32), | ||
| 6411 | + color: MyColours.color_515151), | ||
| 6412 | + ), | ||
| 6413 | + VEmptyView(24), | ||
| 6414 | + Text( | ||
| 6415 | + '以免影响您的正常使用', | ||
| 6416 | + style: TextStyle( | ||
| 6417 | + fontSize: ScreenUtil().setSp(32), | ||
| 6418 | + color: MyColours.color_515151), | ||
| 6419 | + ), | ||
| 6420 | + VEmptyView(66), | ||
| 6421 | + MyDivider(double.infinity, ScreenUtil().setWidth(2), | ||
| 6422 | + color: MyColours.color_f3f3f3), | ||
| 6423 | + RoundButton( | ||
| 6424 | + text: lTitle, | ||
| 6425 | + width: (ScreenUtil().screenWidth - | ||
| 6426 | + ScreenUtil().setWidth(62) * 2) / | ||
| 6427 | + 2, | ||
| 6428 | + height: ScreenUtil().setWidth(112), | ||
| 6429 | + // radius: ScreenUtil().setWidth(10), | ||
| 6430 | + gradientStart: Colors.transparent, | ||
| 6431 | + gradientEnd: Colors.transparent, | ||
| 6432 | + textColor: MyColours.color_E6000000, | ||
| 6433 | + isBold: false, | ||
| 6434 | + fontSize: 32, | ||
| 6435 | + onPressed: () { | ||
| 6436 | + Navigator.pop(context); | ||
| 6437 | + }), | ||
| 6438 | + // Row( | ||
| 6439 | + // // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 6440 | + // children: [ | ||
| 6441 | + // RoundButton( | ||
| 6442 | + // text: lTitle, | ||
| 6443 | + // width: (ScreenUtil().screenWidth - | ||
| 6444 | + // ScreenUtil().setWidth(62) * 2) / | ||
| 6445 | + // 2, | ||
| 6446 | + // height: ScreenUtil().setWidth(112), | ||
| 6447 | + // // radius: ScreenUtil().setWidth(10), | ||
| 6448 | + // gradientStart: Colors.transparent, | ||
| 6449 | + // gradientEnd: Colors.transparent, | ||
| 6450 | + // textColor: MyColours.color_E6000000, | ||
| 6451 | + // isBold: false, | ||
| 6452 | + // fontSize: 32, | ||
| 6453 | + // onPressed: () { | ||
| 6454 | + // Navigator.pop(context); | ||
| 6455 | + // }), | ||
| 6456 | + // MyDivider(ScreenUtil().setWidth(2), | ||
| 6457 | + // ScreenUtil().setWidth(112), | ||
| 6458 | + // color: MyColours.color_f3f3f3), | ||
| 6459 | + // RoundButton( | ||
| 6460 | + // text: rTitle, | ||
| 6461 | + // width: (ScreenUtil().screenWidth - | ||
| 6462 | + // ScreenUtil().setWidth(62) * 2) / | ||
| 6463 | + // 2, | ||
| 6464 | + // height: ScreenUtil().setWidth(112), | ||
| 6465 | + // // radius: ScreenUtil().setWidth(10), | ||
| 6466 | + // gradientStart: Colors.transparent, | ||
| 6467 | + // gradientEnd: Colors.transparent, | ||
| 6468 | + // textColor: MyColours.color_438E93, | ||
| 6469 | + // fontSize: 32, | ||
| 6470 | + // onPressed: () { | ||
| 6471 | + // rCallback(); | ||
| 6472 | + // Navigator.pop( | ||
| 6473 | + // context, | ||
| 6474 | + // ); | ||
| 6475 | + // }), | ||
| 6476 | + // ], | ||
| 6477 | + // ) | ||
| 6478 | + ], | ||
| 6479 | + ), | ||
| 6480 | + ), | ||
| 6481 | + )), | ||
| 6482 | + ), | ||
| 6483 | + )); | ||
| 6484 | + }); | ||
| 6485 | + }, | ||
| 6486 | + ); | ||
| 6487 | + } | ||
| 6488 | + | ||
| 6489 | + ///店铺临近过期弹窗 | ||
| 6490 | + static cupertinoAlertSellerHasEdateDialog(BuildContext context, | ||
| 6491 | + {String title = "", | ||
| 6492 | + String content = "内容", | ||
| 6493 | + String lTitle = "我知道了", | ||
| 6494 | + String rTitle = "立即续费", | ||
| 6495 | + Color rColor = MyColours.color_438E93, | ||
| 6496 | + bool isBold = false, | ||
| 6497 | + bool isBoldContent = false, | ||
| 6498 | + Color contentColor = MyColours.color_99000000, | ||
| 6499 | + VoidCallback lCallback, | ||
| 6500 | + VoidCallback rCallback}) async { | ||
| 6501 | + // bool isRed = content != '' ? false : true; | ||
| 6502 | + final action = await showDialog( | ||
| 6503 | + context: context, | ||
| 6504 | + barrierDismissible: false, | ||
| 6505 | + builder: (BuildContext context) { | ||
| 6506 | + return StatefulBuilder(builder: (context, state) { | ||
| 6507 | + return Scaffold( | ||
| 6508 | + backgroundColor: Colors.transparent, | ||
| 6509 | + body: Center( | ||
| 6510 | + child: Container( | ||
| 6511 | + padding: EdgeInsets.symmetric( | ||
| 6512 | + horizontal: ScreenUtil().setWidth(50)), | ||
| 6513 | + // height: ScreenUtil().setWidth(421 * 2), | ||
| 6514 | + decoration: BoxDecoration( | ||
| 6515 | + borderRadius: | ||
| 6516 | + BorderRadius.circular(ScreenUtil().setWidth(16))), | ||
| 6517 | + child: SingleChildScrollView( | ||
| 6518 | + child: Card( | ||
| 6519 | + shape: RoundedRectangleBorder( | ||
| 6520 | + borderRadius: BorderRadius.all( | ||
| 6521 | + Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 6522 | + child: Container( | ||
| 6523 | + // padding: EdgeInsets.symmetric(horizontal: w(20)), | ||
| 6524 | + child: Column( | ||
| 6525 | + children: [ | ||
| 6526 | + VEmptyView(64), | ||
| 6527 | + Container( | ||
| 6528 | + alignment: Alignment.center, | ||
| 6529 | + child: Text(title, | ||
| 6530 | + style: TextStyle( | ||
| 6531 | + fontWeight: FontWeight.bold, | ||
| 6532 | + fontSize: ScreenUtil().setSp(32), | ||
| 6533 | + color: MyColours.color_E5000000)), | ||
| 6534 | + ), | ||
| 6535 | + VEmptyView(16), | ||
| 6536 | + Text( | ||
| 6537 | + '您的店铺已过期', | ||
| 6538 | + style: TextStyle( | ||
| 6539 | + fontSize: ScreenUtil().setSp(32), | ||
| 6540 | + color: MyColours.color_E34D59), | ||
| 6541 | + ), | ||
| 6542 | + VEmptyView(24), | ||
| 6543 | + Text( | ||
| 6544 | + '请联系您的服务商或拨打', | ||
| 6545 | + style: TextStyle( | ||
| 6546 | + fontSize: ScreenUtil().setSp(32), | ||
| 6547 | + color: MyColours.color_515151), | ||
| 6548 | + ), | ||
| 6549 | + VEmptyView(24), | ||
| 6550 | + Text( | ||
| 6551 | + '400-000-9690 及时续费', | ||
| 6552 | + style: TextStyle( | ||
| 6553 | + fontSize: ScreenUtil().setSp(32), | ||
| 6554 | + color: MyColours.color_515151), | ||
| 6555 | + ), | ||
| 6556 | + VEmptyView(24), | ||
| 6557 | + Text( | ||
| 6558 | + '以免影响您的正常使用', | ||
| 6559 | + style: TextStyle( | ||
| 6560 | + fontSize: ScreenUtil().setSp(32), | ||
| 6561 | + color: MyColours.color_515151), | ||
| 6562 | + ), | ||
| 6563 | + VEmptyView(66), | ||
| 6564 | + MyDivider(double.infinity, ScreenUtil().setWidth(2), | ||
| 6565 | + color: MyColours.color_f3f3f3), | ||
| 6566 | + RoundButton( | ||
| 6567 | + text: lTitle, | ||
| 6568 | + width: (ScreenUtil().screenWidth - | ||
| 6569 | + ScreenUtil().setWidth(62) * 2) / | ||
| 6570 | + 2, | ||
| 6571 | + height: ScreenUtil().setWidth(112), | ||
| 6572 | + // radius: ScreenUtil().setWidth(10), | ||
| 6573 | + gradientStart: Colors.transparent, | ||
| 6574 | + gradientEnd: Colors.transparent, | ||
| 6575 | + textColor: MyColours.color_E6000000, | ||
| 6576 | + isBold: false, | ||
| 6577 | + fontSize: 32, | ||
| 6578 | + onPressed: () { | ||
| 6579 | + Navigator.pop(context); | ||
| 6580 | + lCallback(); | ||
| 6581 | + }), | ||
| 6582 | + // Row( | ||
| 6583 | + // // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 6584 | + // children: [ | ||
| 6585 | + // RoundButton( | ||
| 6586 | + // text: lTitle, | ||
| 6587 | + // width: (ScreenUtil().screenWidth - | ||
| 6588 | + // ScreenUtil().setWidth(62) * 2) / | ||
| 6589 | + // 2, | ||
| 6590 | + // height: ScreenUtil().setWidth(112), | ||
| 6591 | + // // radius: ScreenUtil().setWidth(10), | ||
| 6592 | + // gradientStart: Colors.transparent, | ||
| 6593 | + // gradientEnd: Colors.transparent, | ||
| 6594 | + // textColor: MyColours.color_E6000000, | ||
| 6595 | + // isBold: false, | ||
| 6596 | + // fontSize: 32, | ||
| 6597 | + // onPressed: () { | ||
| 6598 | + // Navigator.pop(context); | ||
| 6599 | + // lCallback(); | ||
| 6600 | + // }), | ||
| 6601 | + // MyDivider(ScreenUtil().setWidth(2), | ||
| 6602 | + // ScreenUtil().setWidth(112), | ||
| 6603 | + // color: MyColours.color_f3f3f3), | ||
| 6604 | + // RoundButton( | ||
| 6605 | + // text: rTitle, | ||
| 6606 | + // width: (ScreenUtil().screenWidth - | ||
| 6607 | + // ScreenUtil().setWidth(62) * 2) / | ||
| 6608 | + // 2, | ||
| 6609 | + // height: ScreenUtil().setWidth(112), | ||
| 6610 | + // // radius: ScreenUtil().setWidth(10), | ||
| 6611 | + // gradientStart: Colors.transparent, | ||
| 6612 | + // gradientEnd: Colors.transparent, | ||
| 6613 | + // textColor: MyColours.color_438E93, | ||
| 6614 | + // fontSize: 32, | ||
| 6615 | + // onPressed: () { | ||
| 6616 | + // rCallback(); | ||
| 6617 | + // Navigator.pop( | ||
| 6618 | + // context, | ||
| 6619 | + // ); | ||
| 6620 | + // }), | ||
| 6621 | + // ], | ||
| 6622 | + // ) | ||
| 6623 | + ], | ||
| 6624 | + ), | ||
| 6625 | + ), | ||
| 6626 | + )), | ||
| 6627 | + ), | ||
| 6628 | + )); | ||
| 6629 | + }); | ||
| 6630 | + }, | ||
| 6631 | + ); | ||
| 6632 | + } | ||
| 6633 | + | ||
| 6340 | ///时段设置提示弹框 | 6634 | ///时段设置提示弹框 |
| 6341 | static Future confirmTimeAlertDialog(BuildContext context, String morning, | 6635 | static Future confirmTimeAlertDialog(BuildContext context, String morning, |
| 6342 | String noon, String night, VoidCallback callback) async { | 6636 | String noon, String night, VoidCallback callback) async { |
| @@ -6560,6 +6854,8 @@ class DialogUtil { | @@ -6560,6 +6854,8 @@ class DialogUtil { | ||
| 6560 | ); | 6854 | ); |
| 6561 | } | 6855 | } |
| 6562 | 6856 | ||
| 6857 | + // static Future cupertinoAlertDialogOnly(BuildContext context, | ||
| 6858 | + | ||
| 6563 | static Future cupertinoAlertDialogOnly(BuildContext context, | 6859 | static Future cupertinoAlertDialogOnly(BuildContext context, |
| 6564 | {String title = "", | 6860 | {String title = "", |
| 6565 | String content = "内容", | 6861 | String content = "内容", |
-
Please register or login to post a comment