|
...
|
...
|
@@ -14,6 +14,7 @@ import 'package:one_key/models/new_unmessage_model.dart'; |
|
|
|
import 'package:one_key/models/pull_marketing_by_uid_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/pages/message/message_page.dart';
|
|
|
|
import 'package:one_key/pages/my/contant_left_page.dart';
|
|
|
|
import 'package:one_key/pages/my/my_page.dart';
|
|
|
|
import 'package:one_key/pages/notebook/notebook_page.dart';
|
|
|
|
import 'package:one_key/pages/table/table_manager_page.dart';
|
|
...
|
...
|
@@ -40,6 +41,7 @@ import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; |
|
|
|
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
|
|
|
import 'package:one_key/models/message.dart';
|
|
|
|
|
|
|
|
import '../../constant/constant.dart';
|
|
|
|
import '../../constant/state.dart';
|
|
|
|
import '../../models/customer_by_seller_model.dart';
|
|
|
|
|
|
...
|
...
|
@@ -299,64 +301,71 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
|
|
|
|
|
|
getSellerVersion() async {
|
|
|
|
await collectStoreProvider.getSellerVersion(context);
|
|
|
|
if (collectStoreProvider.sellerSimple) {
|
|
|
|
//极速版
|
|
|
|
App.sp.remove('sellerEdate');
|
|
|
|
App.sp.remove('sellerEdateModule');
|
|
|
|
NavigatorUtil.goHomePageSim(context); //跳转到极速版 页面
|
|
|
|
if (Constant.normalApp) {
|
|
|
|
_version();
|
|
|
|
} else {
|
|
|
|
if (collectStoreProvider.sellerVersionList != null &&
|
|
|
|
collectStoreProvider.sellerVersionList.length > 0) {
|
|
|
|
if (collectStoreProvider.sellerSimple) {
|
|
|
|
//极速版
|
|
|
|
App.sp.remove('sellerEdate');
|
|
|
|
App.sp.remove('sellerEdateModule');
|
|
|
|
NavigatorUtil.goHomePageSim(context); //跳转到极速版 页面
|
|
|
|
} else {
|
|
|
|
_version();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_version() {
|
|
|
|
if (collectStoreProvider.sellerVersionList != null &&
|
|
|
|
collectStoreProvider.sellerVersionList.length > 0) {
|
|
|
|
//获取到店铺过期时间
|
|
|
|
//店铺过期提醒
|
|
|
|
// 计算时间差
|
|
|
|
//店铺过期日期
|
|
|
|
List<SellerVersionSunModel> showData = [];
|
|
|
|
// App.sp.remove('sellerEdateModule');
|
|
|
|
if (App.sp.containsKey('sellerEdateModule')) {
|
|
|
|
dataSp = json.decode(App.sp.getString('sellerEdateModule'));
|
|
|
|
}
|
|
|
|
//店铺过期提醒
|
|
|
|
// 计算时间差
|
|
|
|
//店铺过期日期
|
|
|
|
List<SellerVersionSunModel> showData = [];
|
|
|
|
// App.sp.remove('sellerEdateModule');
|
|
|
|
if (App.sp.containsKey('sellerEdateModule')) {
|
|
|
|
dataSp = json.decode(App.sp.getString('sellerEdateModule'));
|
|
|
|
}
|
|
|
|
|
|
|
|
collectStoreProvider.sellerVersionList.forEach((element) {
|
|
|
|
_edateSellerModuleShow(showData, element, dataSp);
|
|
|
|
});
|
|
|
|
print(showData);
|
|
|
|
print(dataSp);
|
|
|
|
if (dataSp.length > 0) {
|
|
|
|
App.sp.setString("sellerEdateModule", json.encode(dataSp));
|
|
|
|
// var data = json.decode(App.sp.getString('sellerEdateModule'));
|
|
|
|
// var str = App.sp.getString('sellerEdateModule');
|
|
|
|
// print(str);
|
|
|
|
// print(data);
|
|
|
|
}
|
|
|
|
collectStoreProvider.sellerVersionList.forEach((element) {
|
|
|
|
_edateSellerModuleShow(showData, element, dataSp);
|
|
|
|
});
|
|
|
|
print(showData);
|
|
|
|
print(dataSp);
|
|
|
|
if (dataSp.length > 0) {
|
|
|
|
App.sp.setString("sellerEdateModule", json.encode(dataSp));
|
|
|
|
// var data = json.decode(App.sp.getString('sellerEdateModule'));
|
|
|
|
// var str = App.sp.getString('sellerEdateModule');
|
|
|
|
// print(str);
|
|
|
|
// print(data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (showData != null && showData.length > 0) {
|
|
|
|
DialogUtil.showSellerVersionEdateDialog(
|
|
|
|
context, showData, (object) {});
|
|
|
|
}
|
|
|
|
//通过showdata 弹窗
|
|
|
|
|
|
|
|
// timerSellerModuleEdate = Timer.periodic(Duration(days: 1), (_) {
|
|
|
|
// //店铺过期提醒
|
|
|
|
// // 计算时间差
|
|
|
|
// //店铺过期日期
|
|
|
|
// _edateShow();
|
|
|
|
// });
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
if (_currIndex != 4) {
|
|
|
|
if (App.sp.containsKey('sellerEdate')) {
|
|
|
|
List<String> data = App.sp.getStringList('sellerEdate');
|
|
|
|
if (data.contains('-1')) {
|
|
|
|
//已经弹过过期弹窗,默认我的
|
|
|
|
_currIndex = 4;
|
|
|
|
}
|
|
|
|
if (showData != null && showData.length > 0) {
|
|
|
|
DialogUtil.showSellerVersionEdateDialog(context, showData, (object) {});
|
|
|
|
}
|
|
|
|
//通过showdata 弹窗
|
|
|
|
|
|
|
|
// timerSellerModuleEdate = Timer.periodic(Duration(days: 1), (_) {
|
|
|
|
// //店铺过期提醒
|
|
|
|
// // 计算时间差
|
|
|
|
// //店铺过期日期
|
|
|
|
// _edateShow();
|
|
|
|
// });
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
if (_currIndex != 4) {
|
|
|
|
if (App.sp.containsKey('sellerEdate')) {
|
|
|
|
List<String> data = App.sp.getStringList('sellerEdate');
|
|
|
|
if (data.contains('-1')) {
|
|
|
|
//已经弹过过期弹窗,默认我的
|
|
|
|
_currIndex = 4;
|
|
|
|
}
|
|
|
|
NavigatorUtil.goHomePage(context, initialIndex: _currIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
NavigatorUtil.goHomePage(context, initialIndex: _currIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|