Showing
4 changed files
with
97 additions
and
91 deletions
| @@ -27,7 +27,6 @@ import 'package:one_key/provider/my_model.dart'; | @@ -27,7 +27,6 @@ import 'package:one_key/provider/my_model.dart'; | ||
| 27 | import 'package:one_key/provider/notebook_model.dart'; | 27 | import 'package:one_key/provider/notebook_model.dart'; |
| 28 | import 'package:one_key/provider/table_manage_model_or_reserve.dart'; | 28 | import 'package:one_key/provider/table_manage_model_or_reserve.dart'; |
| 29 | 29 | ||
| 30 | - | ||
| 31 | import 'package:one_key/provider/tools.dart'; | 30 | import 'package:one_key/provider/tools.dart'; |
| 32 | import 'package:one_key/provider/update_model.dart'; | 31 | import 'package:one_key/provider/update_model.dart'; |
| 33 | import 'package:one_key/provider/user_model.dart'; | 32 | import 'package:one_key/provider/user_model.dart'; |
| @@ -118,8 +117,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -118,8 +117,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 118 | 117 | ||
| 119 | final XgFlutterPlugin tpush = new XgFlutterPlugin(); | 118 | final XgFlutterPlugin tpush = new XgFlutterPlugin(); |
| 120 | 119 | ||
| 121 | - | ||
| 122 | - | ||
| 123 | //实现监听 | 120 | //实现监听 |
| 124 | Future<dynamic> platformCallHandler(MethodCall call) async { | 121 | Future<dynamic> platformCallHandler(MethodCall call) async { |
| 125 | switch (call.method) { | 122 | switch (call.method) { |
| @@ -139,7 +136,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -139,7 +136,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 139 | // TODO: implement initState | 136 | // TODO: implement initState |
| 140 | super.initState(); | 137 | super.initState(); |
| 141 | 138 | ||
| 142 | - | ||
| 143 | LogUtil.v("home_initState"); | 139 | LogUtil.v("home_initState"); |
| 144 | // CachedNetworkImage.evictFromCache( | 140 | // CachedNetworkImage.evictFromCache( |
| 145 | // 'https://qn.colorcun.com/template/heilanguodu-6.png'); | 141 | // 'https://qn.colorcun.com/template/heilanguodu-6.png'); |
| @@ -162,7 +158,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -162,7 +158,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 162 | // needUpdate = false; | 158 | // needUpdate = false; |
| 163 | // // print(map['type']); | 159 | // // print(map['type']); |
| 164 | // } | 160 | // } |
| 165 | - | ||
| 166 | 161 | ||
| 167 | WidgetsBinding.instance.addObserver(this); | 162 | WidgetsBinding.instance.addObserver(this); |
| 168 | 163 | ||
| @@ -224,9 +219,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -224,9 +219,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 224 | create: (_) => MarketingCenterProvider(), | 219 | create: (_) => MarketingCenterProvider(), |
| 225 | child: ChangeNotifierProvider<SmsModel>( | 220 | child: ChangeNotifierProvider<SmsModel>( |
| 226 | create: (_) => SmsModel(), | 221 | create: (_) => SmsModel(), |
| 227 | - child:ChangeNotifierProvider<PersonnelProvider>( | ||
| 228 | - create: (_) => PersonnelProvider(), | ||
| 229 | - child: TableManagerPage()))))))), | 222 | + child: ChangeNotifierProvider< |
| 223 | + PersonnelProvider>( | ||
| 224 | + create: (_) => PersonnelProvider(), | ||
| 225 | + child: TableManagerPage()))))))), | ||
| 230 | ))) | 226 | ))) |
| 231 | ..add( | 227 | ..add( |
| 232 | ChangeNotifierProvider<FeastModel>( | 228 | ChangeNotifierProvider<FeastModel>( |
| @@ -249,7 +245,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -249,7 +245,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 249 | // }); | 245 | // }); |
| 250 | getSellerVersion(); | 246 | getSellerVersion(); |
| 251 | 247 | ||
| 252 | - | ||
| 253 | initPlatformState(); | 248 | initPlatformState(); |
| 254 | // _getTableList(); | 249 | // _getTableList(); |
| 255 | _getSellerById(); | 250 | _getSellerById(); |
| @@ -286,7 +281,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -286,7 +281,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 286 | } | 281 | } |
| 287 | if (widget.initialIndex == 0 || | 282 | if (widget.initialIndex == 0 || |
| 288 | widget.initialIndex == 1 && needRefreshTemp == false) return; | 283 | widget.initialIndex == 1 && needRefreshTemp == false) return; |
| 289 | - _initNotification(); | 284 | + // _initNotification(); |
| 290 | Future.delayed(Duration(minutes: 3), () { | 285 | Future.delayed(Duration(minutes: 3), () { |
| 291 | //30000 | 286 | //30000 |
| 292 | // ContactModel.getInstance().uploadLocalContact(context); | 287 | // ContactModel.getInstance().uploadLocalContact(context); |
| @@ -310,12 +305,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -310,12 +305,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 310 | }); | 305 | }); |
| 311 | } | 306 | } |
| 312 | 307 | ||
| 313 | - | ||
| 314 | - | ||
| 315 | - | ||
| 316 | - | ||
| 317 | getSellerVersion() async { | 308 | getSellerVersion() async { |
| 318 | - await collectStoreProvider.getSellerVersion(context,showLoading: false); | 309 | + await collectStoreProvider.getSellerVersion(context, showLoading: false); |
| 310 | + | ||
| 319 | if (Constant.normalApp) { | 311 | if (Constant.normalApp) { |
| 320 | _version(); | 312 | _version(); |
| 321 | } else { | 313 | } else { |
| @@ -328,6 +320,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -328,6 +320,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 328 | _version(); | 320 | _version(); |
| 329 | } | 321 | } |
| 330 | } | 322 | } |
| 323 | + if (widget.initialIndex == 0 || | ||
| 324 | + widget.initialIndex == 1 && needRefreshTemp == false) return; | ||
| 325 | + _initNotification(); | ||
| 331 | } | 326 | } |
| 332 | 327 | ||
| 333 | _version() { | 328 | _version() { |
| @@ -617,7 +612,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -617,7 +612,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 617 | _getSellerById() async { | 612 | _getSellerById() async { |
| 618 | StoreBaseIndoProvider storeBaseIndoProvider = | 613 | StoreBaseIndoProvider storeBaseIndoProvider = |
| 619 | Provider.of<StoreBaseIndoProvider>(context, listen: false); | 614 | Provider.of<StoreBaseIndoProvider>(context, listen: false); |
| 620 | - sellerInfoSunModel = await storeBaseIndoProvider.getSellerById(context,showLoading: false); | 615 | + sellerInfoSunModel = |
| 616 | + await storeBaseIndoProvider.getSellerById(context, showLoading: false); | ||
| 621 | if (sellerInfoSunModel != null) { | 617 | if (sellerInfoSunModel != null) { |
| 622 | // if (sellerInfoSunModel.data.edate != null) { | 618 | // if (sellerInfoSunModel.data.edate != null) { |
| 623 | // //获取到店铺过期时间 | 619 | // //获取到店铺过期时间 |
| @@ -724,8 +720,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -724,8 +720,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 724 | 720 | ||
| 725 | BaseIndoProvider _baseIndoProvider = | 721 | BaseIndoProvider _baseIndoProvider = |
| 726 | Provider.of<BaseIndoProvider>(context, listen: false); | 722 | Provider.of<BaseIndoProvider>(context, listen: false); |
| 727 | - bool success = | ||
| 728 | - await _baseIndoProvider.getCustomerActivityBaseinfo(context, params,isShowLoading: false); | 723 | + bool success = await _baseIndoProvider |
| 724 | + .getCustomerActivityBaseinfo(context, params, isShowLoading: false); | ||
| 729 | if (success) {} | 725 | if (success) {} |
| 730 | } | 726 | } |
| 731 | 727 | ||
| @@ -1566,7 +1562,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -1566,7 +1562,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 1566 | collectStoreProvider = | 1562 | collectStoreProvider = |
| 1567 | Provider.of<CollectStoreProvider>(context, listen: true); | 1563 | Provider.of<CollectStoreProvider>(context, listen: true); |
| 1568 | 1564 | ||
| 1569 | - | ||
| 1570 | return new WillPopScope( | 1565 | return new WillPopScope( |
| 1571 | child: Scaffold( | 1566 | child: Scaffold( |
| 1572 | bottomNavigationBar: BottomNavigationBar( | 1567 | bottomNavigationBar: BottomNavigationBar( |
| @@ -93,13 +93,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -93,13 +93,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 93 | // ///获取短信余量 | 93 | // ///获取短信余量 |
| 94 | // _getSmsInfo(context); | 94 | // _getSmsInfo(context); |
| 95 | 95 | ||
| 96 | - | ||
| 97 | - | ||
| 98 | ///获取积分 | 96 | ///获取积分 |
| 99 | // _getMyIntegral(context); | 97 | // _getMyIntegral(context); |
| 100 | 98 | ||
| 101 | // _getSellerById(); | 99 | // _getSellerById(); |
| 102 | -getMyPageCountData(); | 100 | + getMyPageCountData(); |
| 101 | + | ||
| 103 | ///apk版本检测 | 102 | ///apk版本检测 |
| 104 | checkUpdate(); | 103 | checkUpdate(); |
| 105 | }); | 104 | }); |
| @@ -175,19 +174,20 @@ getMyPageCountData(); | @@ -175,19 +174,20 @@ getMyPageCountData(); | ||
| 175 | // } | 174 | // } |
| 176 | // } | 175 | // } |
| 177 | 176 | ||
| 178 | -getMyPageCountData()async{ | ||
| 179 | - Map<String, String> params = { | 177 | + getMyPageCountData() async { |
| 178 | + Map<String, String> params = { | ||
| 180 | 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid, | 179 | 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid, |
| 181 | - | ||
| 182 | }; | 180 | }; |
| 183 | // if (Utils.getAuthority(context, '全店-月订单量')) { | 181 | // if (Utils.getAuthority(context, '全店-月订单量')) { |
| 184 | - | ||
| 185 | - // } else | 182 | + |
| 183 | + // } else | ||
| 186 | if (Utils.getAuthority(context, '个人-月订单量')) { | 184 | if (Utils.getAuthority(context, '个人-月订单量')) { |
| 187 | - params['uid'] = Provider.of<UserModel>(context,listen: false).user.openid ; | 185 | + params['uid'] = |
| 186 | + Provider.of<UserModel>(context, listen: false).user.openid; | ||
| 188 | } | 187 | } |
| 189 | - | ||
| 190 | - await collectStoreProvider.getMyPageCountData(context,params,showLoading: false); | 188 | + |
| 189 | + await collectStoreProvider.getMyPageCountData(context, params, | ||
| 190 | + showLoading: false); | ||
| 191 | if (Constant.normalApp) { | 191 | if (Constant.normalApp) { |
| 192 | if (collectStoreProvider.sellerNormal) { | 192 | if (collectStoreProvider.sellerNormal) { |
| 193 | if (collectStoreProvider.sellerNormalEdate != null) { | 193 | if (collectStoreProvider.sellerNormalEdate != null) { |
| @@ -197,10 +197,14 @@ getMyPageCountData()async{ | @@ -197,10 +197,14 @@ getMyPageCountData()async{ | ||
| 197 | edate = DateTime.fromMillisecondsSinceEpoch( | 197 | edate = DateTime.fromMillisecondsSinceEpoch( |
| 198 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); | 198 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); |
| 199 | 199 | ||
| 200 | - String from = | ||
| 201 | - DateUtil.formatDate(DateTime.now(), format: DateFormats.y_mo_d) + | ||
| 202 | - ' 00:00:00'; | ||
| 203 | - DateTime datenow = DateUtil.getDateTime(from); | 200 | + // String from = |
| 201 | + // DateUtil.formatDate(DateTime.now(), format: DateFormats.y_mo_d) + | ||
| 202 | + // ' 00:00:00'; | ||
| 203 | + // DateTime datenow = DateUtil.getDateTime(from); | ||
| 204 | + DateTime datenow = DateTime.now(); | ||
| 205 | + | ||
| 206 | + //当前日期 | ||
| 207 | + // final datenow = DateTime.now(); | ||
| 204 | 208 | ||
| 205 | //比较相差的天数 | 209 | //比较相差的天数 |
| 206 | int difference = edate.difference(datenow).inDays; | 210 | int difference = edate.difference(datenow).inDays; |
| @@ -210,6 +214,8 @@ getMyPageCountData()async{ | @@ -210,6 +214,8 @@ getMyPageCountData()async{ | ||
| 210 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { | 214 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { |
| 211 | //过期 | 215 | //过期 |
| 212 | outDay = '0'; | 216 | outDay = '0'; |
| 217 | + } else if (difference == 0 && differenceSeconds > 0) { | ||
| 218 | + outDay = '1'; | ||
| 213 | } else { | 219 | } else { |
| 214 | outDay = difference.toString(); | 220 | outDay = difference.toString(); |
| 215 | } | 221 | } |
| @@ -239,10 +245,8 @@ getMyPageCountData()async{ | @@ -239,10 +245,8 @@ getMyPageCountData()async{ | ||
| 239 | edate = DateTime.fromMillisecondsSinceEpoch( | 245 | edate = DateTime.fromMillisecondsSinceEpoch( |
| 240 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); | 246 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); |
| 241 | 247 | ||
| 242 | - String from = DateUtil.formatDate(DateTime.now(), | ||
| 243 | - format: DateFormats.y_mo_d) + | ||
| 244 | - ' 00:00:00'; | ||
| 245 | - DateTime datenow = DateUtil.getDateTime(from); | 248 | + |
| 249 | + DateTime datenow = DateTime.now(); | ||
| 246 | 250 | ||
| 247 | //比较相差的天数 | 251 | //比较相差的天数 |
| 248 | int difference = edate.difference(datenow).inDays; | 252 | int difference = edate.difference(datenow).inDays; |
| @@ -252,6 +256,8 @@ getMyPageCountData()async{ | @@ -252,6 +256,8 @@ getMyPageCountData()async{ | ||
| 252 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { | 256 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { |
| 253 | //过期 | 257 | //过期 |
| 254 | outDay = '0'; | 258 | outDay = '0'; |
| 259 | + } else if (difference == 0 && differenceSeconds > 0) { | ||
| 260 | + outDay = '1'; | ||
| 255 | } else { | 261 | } else { |
| 256 | outDay = difference.toString(); | 262 | outDay = difference.toString(); |
| 257 | } | 263 | } |
| @@ -267,8 +273,7 @@ getMyPageCountData()async{ | @@ -267,8 +273,7 @@ getMyPageCountData()async{ | ||
| 267 | setState(() {}); | 273 | setState(() {}); |
| 268 | } | 274 | } |
| 269 | } | 275 | } |
| 270 | - | ||
| 271 | -} | 276 | + } |
| 272 | 277 | ||
| 273 | _getSellerCountsListByMonth( | 278 | _getSellerCountsListByMonth( |
| 274 | {isShowLoading = false, VoidCallback callback}) async { | 279 | {isShowLoading = false, VoidCallback callback}) async { |
| @@ -295,7 +300,7 @@ getMyPageCountData()async{ | @@ -295,7 +300,7 @@ getMyPageCountData()async{ | ||
| 295 | ///获取短信余量 | 300 | ///获取短信余量 |
| 296 | _getSmsInfo(context) async { | 301 | _getSmsInfo(context) async { |
| 297 | myModel = Provider.of<MyModel>(context, listen: false); | 302 | myModel = Provider.of<MyModel>(context, listen: false); |
| 298 | - SmsInfoData smsInfoData = await myModel.getSmsInfo(context); | 303 | + SmsInfoData smsInfoData = await myModel.getSmsInfo(context); |
| 299 | 304 | ||
| 300 | setState(() { | 305 | setState(() { |
| 301 | if (smsInfoData != null) { | 306 | if (smsInfoData != null) { |
| @@ -331,7 +336,7 @@ getMyPageCountData()async{ | @@ -331,7 +336,7 @@ getMyPageCountData()async{ | ||
| 331 | } | 336 | } |
| 332 | 337 | ||
| 333 | getSellerVersion() async { | 338 | getSellerVersion() async { |
| 334 | - await collectStoreProvider.getSellerVersion(context,showLoading: false); | 339 | + await collectStoreProvider.getSellerVersion(context, showLoading: false); |
| 335 | 340 | ||
| 336 | if (Constant.normalApp) { | 341 | if (Constant.normalApp) { |
| 337 | if (collectStoreProvider.sellerNormal) { | 342 | if (collectStoreProvider.sellerNormal) { |
| @@ -342,22 +347,24 @@ getMyPageCountData()async{ | @@ -342,22 +347,24 @@ getMyPageCountData()async{ | ||
| 342 | edate = DateTime.fromMillisecondsSinceEpoch( | 347 | edate = DateTime.fromMillisecondsSinceEpoch( |
| 343 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); | 348 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); |
| 344 | 349 | ||
| 345 | - String from = | ||
| 346 | - DateUtil.formatDate(DateTime.now(), format: DateFormats.y_mo_d) + | ||
| 347 | - ' 00:00:00'; | ||
| 348 | - DateTime datenow = DateUtil.getDateTime(from); | 350 | + // String from = |
| 351 | + // DateUtil.formatDate(DateTime.now(), format: DateFormats.y_mo_d) + | ||
| 352 | + // ' 00:00:00'; | ||
| 353 | + DateTime datenow = DateTime.now(); | ||
| 349 | 354 | ||
| 350 | //比较相差的天数 | 355 | //比较相差的天数 |
| 351 | int difference = edate.difference(datenow).inDays; | 356 | int difference = edate.difference(datenow).inDays; |
| 352 | 357 | ||
| 353 | int differenceSeconds = edate.difference(datenow).inSeconds; | 358 | int differenceSeconds = edate.difference(datenow).inSeconds; |
| 354 | 359 | ||
| 355 | - if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { | ||
| 356 | - //过期 | ||
| 357 | - outDay = '0'; | ||
| 358 | - } else { | ||
| 359 | - outDay = difference.toString(); | ||
| 360 | - } | 360 | + if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { |
| 361 | + //过期 | ||
| 362 | + outDay = '0'; | ||
| 363 | + } else if (difference == 0 && differenceSeconds > 0) { | ||
| 364 | + outDay = '1'; | ||
| 365 | + } else { | ||
| 366 | + outDay = difference.toString(); | ||
| 367 | + } | ||
| 361 | 368 | ||
| 362 | // print(outDay); | 369 | // print(outDay); |
| 363 | } else { | 370 | } else { |
| @@ -384,19 +391,18 @@ getMyPageCountData()async{ | @@ -384,19 +391,18 @@ getMyPageCountData()async{ | ||
| 384 | edate = DateTime.fromMillisecondsSinceEpoch( | 391 | edate = DateTime.fromMillisecondsSinceEpoch( |
| 385 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); | 392 | int.parse(collectStoreProvider.sellerNormalEdate) * 1000); |
| 386 | 393 | ||
| 387 | - String from = DateUtil.formatDate(DateTime.now(), | ||
| 388 | - format: DateFormats.y_mo_d) + | ||
| 389 | - ' 00:00:00'; | ||
| 390 | - DateTime datenow = DateUtil.getDateTime(from); | 394 | + DateTime datenow = DateTime.now(); |
| 391 | 395 | ||
| 392 | //比较相差的天数 | 396 | //比较相差的天数 |
| 393 | int difference = edate.difference(datenow).inDays; | 397 | int difference = edate.difference(datenow).inDays; |
| 394 | 398 | ||
| 395 | int differenceSeconds = edate.difference(datenow).inSeconds; | 399 | int differenceSeconds = edate.difference(datenow).inSeconds; |
| 396 | 400 | ||
| 397 | - if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { | 401 | + if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { |
| 398 | //过期 | 402 | //过期 |
| 399 | outDay = '0'; | 403 | outDay = '0'; |
| 404 | + } else if (difference == 0 && differenceSeconds > 0) { | ||
| 405 | + outDay = '1'; | ||
| 400 | } else { | 406 | } else { |
| 401 | outDay = difference.toString(); | 407 | outDay = difference.toString(); |
| 402 | } | 408 | } |
| @@ -574,7 +580,7 @@ getMyPageCountData()async{ | @@ -574,7 +580,7 @@ getMyPageCountData()async{ | ||
| 574 | '员工编号:' + | 580 | '员工编号:' + |
| 575 | model.user.account + | 581 | model.user.account + |
| 576 | " " + | 582 | " " + |
| 577 | - (model.user.role_name_addition??'') , | 583 | + (model.user.role_name_addition ?? ''), |
| 578 | TextStyle( | 584 | TextStyle( |
| 579 | fontWeight: FontWeight.bold, | 585 | fontWeight: FontWeight.bold, |
| 580 | color: MyColours.color_ffffff, | 586 | color: MyColours.color_ffffff, |
| @@ -751,7 +757,8 @@ getMyPageCountData()async{ | @@ -751,7 +757,8 @@ getMyPageCountData()async{ | ||
| 751 | Row( | 757 | Row( |
| 752 | children: [ | 758 | children: [ |
| 753 | Text( | 759 | Text( |
| 754 | - collectStoreProvider.reserveTotal, | 760 | + collectStoreProvider |
| 761 | + .reserveTotal, | ||
| 755 | style: TextStyle( | 762 | style: TextStyle( |
| 756 | fontWeight: FontWeight.bold, | 763 | fontWeight: FontWeight.bold, |
| 757 | color: | 764 | color: |
| @@ -792,9 +799,7 @@ getMyPageCountData()async{ | @@ -792,9 +799,7 @@ getMyPageCountData()async{ | ||
| 792 | return; | 799 | return; |
| 793 | } | 800 | } |
| 794 | if (Utils.getAuthority(context, '充值短信')) { | 801 | if (Utils.getAuthority(context, '充值短信')) { |
| 795 | - NavigatorUtil.goSmsManagePage(context | ||
| 796 | - ); | ||
| 797 | - | 802 | + NavigatorUtil.goSmsManagePage(context); |
| 798 | } | 803 | } |
| 799 | }, | 804 | }, |
| 800 | child: Container( | 805 | child: Container( |
| @@ -807,7 +812,8 @@ getMyPageCountData()async{ | @@ -807,7 +812,8 @@ getMyPageCountData()async{ | ||
| 807 | Row( | 812 | Row( |
| 808 | children: [ | 813 | children: [ |
| 809 | Text( | 814 | Text( |
| 810 | - collectStoreProvider.smsInfo.isNotEmpty | 815 | + collectStoreProvider |
| 816 | + .smsInfo.isNotEmpty | ||
| 811 | ? '${collectStoreProvider.smsInfo}' | 817 | ? '${collectStoreProvider.smsInfo}' |
| 812 | : '0', | 818 | : '0', |
| 813 | style: TextStyle( | 819 | style: TextStyle( |
| @@ -862,8 +868,8 @@ getMyPageCountData()async{ | @@ -862,8 +868,8 @@ getMyPageCountData()async{ | ||
| 862 | if (Utils.getAuthority( | 868 | if (Utils.getAuthority( |
| 863 | context, '充值短信')) { | 869 | context, '充值短信')) { |
| 864 | NavigatorUtil.goSmsManagePage( | 870 | NavigatorUtil.goSmsManagePage( |
| 865 | - context, | ||
| 866 | - ); | 871 | + context, |
| 872 | + ); | ||
| 867 | } | 873 | } |
| 868 | }) | 874 | }) |
| 869 | ], | 875 | ], |
| @@ -279,7 +279,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { | @@ -279,7 +279,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { | ||
| 279 | // } | 279 | // } |
| 280 | if (widget.initialIndex == 0 || | 280 | if (widget.initialIndex == 0 || |
| 281 | widget.initialIndex == 1 && needRefreshTemp == false) return; | 281 | widget.initialIndex == 1 && needRefreshTemp == false) return; |
| 282 | - _initNotification(); | 282 | + // _initNotification(); |
| 283 | Future.delayed(Duration(minutes: 3), () { | 283 | Future.delayed(Duration(minutes: 3), () { |
| 284 | //30000 | 284 | //30000 |
| 285 | // ContactModel.getInstance().uploadLocalContact(context); | 285 | // ContactModel.getInstance().uploadLocalContact(context); |
| @@ -357,6 +357,9 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { | @@ -357,6 +357,9 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { | ||
| 357 | // //店铺过期日期 | 357 | // //店铺过期日期 |
| 358 | // _edateShow(); | 358 | // _edateShow(); |
| 359 | // }); | 359 | // }); |
| 360 | + if (widget.initialIndex == 0 || | ||
| 361 | + widget.initialIndex == 1 && needRefreshTemp == false) return; | ||
| 362 | + _initNotification(); | ||
| 360 | return true; | 363 | return true; |
| 361 | } else { | 364 | } else { |
| 362 | if (collectStoreProvider.sellerVersionList != null && | 365 | if (collectStoreProvider.sellerVersionList != null && |
| @@ -377,6 +380,9 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { | @@ -377,6 +380,9 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { | ||
| 377 | NavigatorUtil.goHomePageSim(context, initialIndex: _currIndex); | 380 | NavigatorUtil.goHomePageSim(context, initialIndex: _currIndex); |
| 378 | } | 381 | } |
| 379 | } | 382 | } |
| 383 | + if (widget.initialIndex == 0 || | ||
| 384 | + widget.initialIndex == 1 && needRefreshTemp == false) return; | ||
| 385 | + _initNotification(); | ||
| 380 | 386 | ||
| 381 | return false; | 387 | return false; |
| 382 | } | 388 | } |
| @@ -118,7 +118,8 @@ class MyPageSimState extends State<MyPageSim> with WidgetsBindingObserver { | @@ -118,7 +118,8 @@ class MyPageSimState extends State<MyPageSim> with WidgetsBindingObserver { | ||
| 118 | // _getMyIntegral(context); | 118 | // _getMyIntegral(context); |
| 119 | 119 | ||
| 120 | // _getSellerById(); | 120 | // _getSellerById(); |
| 121 | -getMyPageCountData(); | 121 | + getMyPageCountData(); |
| 122 | + | ||
| 122 | ///apk版本检测 | 123 | ///apk版本检测 |
| 123 | checkUpdate(); | 124 | checkUpdate(); |
| 124 | }); | 125 | }); |
| @@ -126,7 +127,7 @@ getMyPageCountData(); | @@ -126,7 +127,7 @@ getMyPageCountData(); | ||
| 126 | Utils.changeStatusColor(color: MyColours.color_438E93); | 127 | Utils.changeStatusColor(color: MyColours.color_438E93); |
| 127 | }); | 128 | }); |
| 128 | EventBus().on('refreshMySms', (arg) { | 129 | EventBus().on('refreshMySms', (arg) { |
| 129 | - getMyPageCountData(); | 130 | + getMyPageCountData(); |
| 130 | }); | 131 | }); |
| 131 | } | 132 | } |
| 132 | 133 | ||
| @@ -165,20 +166,20 @@ getMyPageCountData(); | @@ -165,20 +166,20 @@ getMyPageCountData(); | ||
| 165 | } | 166 | } |
| 166 | } | 167 | } |
| 167 | 168 | ||
| 168 | - getMyPageCountData()async{ | ||
| 169 | - Map<String, String> params = { | 169 | + getMyPageCountData() async { |
| 170 | + Map<String, String> params = { | ||
| 170 | 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid, | 171 | 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid, |
| 171 | - | ||
| 172 | }; | 172 | }; |
| 173 | // if (Utils.getAuthority(context, '全店-月订单量')) { | 173 | // if (Utils.getAuthority(context, '全店-月订单量')) { |
| 174 | - | ||
| 175 | - // } else | 174 | + |
| 175 | + // } else | ||
| 176 | if (Utils.getAuthority(context, '个人-月订单量')) { | 176 | if (Utils.getAuthority(context, '个人-月订单量')) { |
| 177 | - params['uid'] = Provider.of<UserModel>(context,listen: false).user.openid ; | 177 | + params['uid'] = |
| 178 | + Provider.of<UserModel>(context, listen: false).user.openid; | ||
| 178 | } | 179 | } |
| 179 | - | ||
| 180 | - await collectStoreProvider.getMyPageCountData(context,params); | ||
| 181 | - if (collectStoreProvider.sellerSimple) { | 180 | + |
| 181 | + await collectStoreProvider.getMyPageCountData(context, params); | ||
| 182 | + if (collectStoreProvider.sellerSimple) { | ||
| 182 | //极速版 | 183 | //极速版 |
| 183 | //店铺过期提醒 | 184 | //店铺过期提醒 |
| 184 | // 计算时间差 | 185 | // 计算时间差 |
| @@ -189,10 +190,7 @@ getMyPageCountData(); | @@ -189,10 +190,7 @@ getMyPageCountData(); | ||
| 189 | edate = | 190 | edate = |
| 190 | DateTime.fromMillisecondsSinceEpoch(int.parse(temp[0].edate) * 1000); | 191 | DateTime.fromMillisecondsSinceEpoch(int.parse(temp[0].edate) * 1000); |
| 191 | 192 | ||
| 192 | - String from = | ||
| 193 | - DateUtil.formatDate(DateTime.now(), format: DateFormats.y_mo_d) + | ||
| 194 | - ' 00:00:00'; | ||
| 195 | - DateTime datenow = DateUtil.getDateTime(from); | 193 | + DateTime datenow = DateTime.now(); |
| 196 | 194 | ||
| 197 | //比较相差的天数 | 195 | //比较相差的天数 |
| 198 | int difference = edate.difference(datenow).inDays; | 196 | int difference = edate.difference(datenow).inDays; |
| @@ -202,6 +200,8 @@ getMyPageCountData(); | @@ -202,6 +200,8 @@ getMyPageCountData(); | ||
| 202 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { | 200 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { |
| 203 | //过期 | 201 | //过期 |
| 204 | outDay = '0'; | 202 | outDay = '0'; |
| 203 | + } else if (difference == 0 && differenceSeconds > 0) { | ||
| 204 | + outDay = '1'; | ||
| 205 | } else { | 205 | } else { |
| 206 | outDay = difference.toString(); | 206 | outDay = difference.toString(); |
| 207 | } | 207 | } |
| @@ -218,8 +218,7 @@ getMyPageCountData(); | @@ -218,8 +218,7 @@ getMyPageCountData(); | ||
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | setState(() {}); | 220 | setState(() {}); |
| 221 | - | ||
| 222 | -} | 221 | + } |
| 223 | 222 | ||
| 224 | ///获取店铺过期时间 | 223 | ///获取店铺过期时间 |
| 225 | // _getSellerById() async { | 224 | // _getSellerById() async { |
| @@ -395,10 +394,7 @@ getMyPageCountData(); | @@ -395,10 +394,7 @@ getMyPageCountData(); | ||
| 395 | edate = | 394 | edate = |
| 396 | DateTime.fromMillisecondsSinceEpoch(int.parse(temp[0].edate) * 1000); | 395 | DateTime.fromMillisecondsSinceEpoch(int.parse(temp[0].edate) * 1000); |
| 397 | 396 | ||
| 398 | - String from = | ||
| 399 | - DateUtil.formatDate(DateTime.now(), format: DateFormats.y_mo_d) + | ||
| 400 | - ' 00:00:00'; | ||
| 401 | - DateTime datenow = DateUtil.getDateTime(from); | 397 | + DateTime datenow = DateTime.now(); |
| 402 | 398 | ||
| 403 | //比较相差的天数 | 399 | //比较相差的天数 |
| 404 | int difference = edate.difference(datenow).inDays; | 400 | int difference = edate.difference(datenow).inDays; |
| @@ -408,6 +404,8 @@ getMyPageCountData(); | @@ -408,6 +404,8 @@ getMyPageCountData(); | ||
| 408 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { | 404 | if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) { |
| 409 | //过期 | 405 | //过期 |
| 410 | outDay = '0'; | 406 | outDay = '0'; |
| 407 | + } else if (difference == 0 && differenceSeconds > 0) { | ||
| 408 | + outDay = '1'; | ||
| 411 | } else { | 409 | } else { |
| 412 | outDay = difference.toString(); | 410 | outDay = difference.toString(); |
| 413 | } | 411 | } |
| @@ -763,7 +761,8 @@ getMyPageCountData(); | @@ -763,7 +761,8 @@ getMyPageCountData(); | ||
| 763 | Row( | 761 | Row( |
| 764 | children: [ | 762 | children: [ |
| 765 | Text( | 763 | Text( |
| 766 | - collectStoreProvider.reserveTotal, | 764 | + collectStoreProvider |
| 765 | + .reserveTotal, | ||
| 767 | style: TextStyle( | 766 | style: TextStyle( |
| 768 | fontWeight: FontWeight.bold, | 767 | fontWeight: FontWeight.bold, |
| 769 | color: | 768 | color: |
| @@ -804,8 +803,7 @@ getMyPageCountData(); | @@ -804,8 +803,7 @@ getMyPageCountData(); | ||
| 804 | return; | 803 | return; |
| 805 | } | 804 | } |
| 806 | if (Utils.getAuthority(context, '充值短信')) { | 805 | if (Utils.getAuthority(context, '充值短信')) { |
| 807 | - NavigatorUtil.goSmsManagePage(context | ||
| 808 | - ); | 806 | + NavigatorUtil.goSmsManagePage(context); |
| 809 | } | 807 | } |
| 810 | }, | 808 | }, |
| 811 | child: Container( | 809 | child: Container( |
| @@ -818,7 +816,8 @@ getMyPageCountData(); | @@ -818,7 +816,8 @@ getMyPageCountData(); | ||
| 818 | Row( | 816 | Row( |
| 819 | children: [ | 817 | children: [ |
| 820 | Text( | 818 | Text( |
| 821 | - collectStoreProvider.smsInfo.isNotEmpty | 819 | + collectStoreProvider |
| 820 | + .smsInfo.isNotEmpty | ||
| 822 | ? '${collectStoreProvider.smsInfo}' | 821 | ? '${collectStoreProvider.smsInfo}' |
| 823 | : '0', | 822 | : '0', |
| 824 | style: TextStyle( | 823 | style: TextStyle( |
-
Please register or login to post a comment