Commit a574b1fa3dabee733fce7892305447a09ad6c440

Authored by wdn127929
1 parent 31765f5a

0、1、2、3、7提醒

... ... @@ -54,8 +54,9 @@ class SellerVersionSunModel {
vtype = json['vtype'];
vname = json['vname'];
rdate = json['rdate'];
edate = '1694830573';
// edate = json['edate'];
// edate = '1695437146';
// edate = json['vid'] == '4' ? '1695005146' : '1695437146';
edate = json['edate'];
cdate = json['cdate'];
}
... ...
... ... @@ -104,7 +104,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
CollectStoreProvider collectStoreProvider;
Map dataSp = Map();
Map<String, dynamic> dataSp = Map();
//实现监听
Future<dynamic> platformCallHandler(MethodCall call) async {
... ... @@ -284,13 +284,23 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
//店铺过期日期
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);
App.sp.setString("sellerEdateModule", json.encode(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) {});
}
... ... @@ -355,14 +365,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
}
_setSpSellerModule(String day, SellerVersionSunModel sellerVersionSunModel) {
Map data = Map();
Map<String, dynamic> data = Map();
List days = [];
//已经存进去过数据
if (App.sp.containsKey('sellerEdateModule')) {
data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
days = data[sellerVersionSunModel.vid] ?? [];
if (dataSp.containsKey(sellerVersionSunModel.vid)) {
days = dataSp[sellerVersionSunModel.vid];
}
//已经存进去过数据
// if (App.sp.containsKey('sellerEdateModule')) {
// data = json.decode(App.sp.getString('sellerEdateModule'));
// days = data[sellerVersionSunModel.vid] ?? [];
// }
days.add(day);
print(data);
... ... @@ -390,8 +404,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
//已经存进去过数据
if (App.sp.containsKey('sellerEdateModule')) {
Map data = {};
data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
data = json.decode(App.sp.getString('sellerEdateModule'));
data.removeWhere((key, value) => key == sellerVersionSunModel.vid);
dataSp.removeWhere((key, value) => key == sellerVersionSunModel.vid);
if (data != null && data.length == 0) {
App.sp.remove("sellerEdateModule");
} else {
... ... @@ -400,8 +416,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
}
}
_edateSellerModuleShow(List<SellerVersionSunModel> showData,
SellerVersionSunModel sellerVersionSunModel, Map dataSp) async {
_edateSellerModuleShow(
List<SellerVersionSunModel> showData,
SellerVersionSunModel sellerVersionSunModel,
Map<String, dynamic> dataSp) async {
//店铺过期提醒
// 计算时间差
//店铺过期日期
... ... @@ -419,18 +437,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
if (App.sp.containsKey('sellerEdateModule')) {
//已经存进去过数据
Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
Map data = json.decode(App.sp.getString('sellerEdateModule'));
List days = data[sellerVersionSunModel.vid] ?? [];
if (!days.contains('7')) {
//7天没有提醒过
showData.add(sellerVersionSunModel); //7天已经提醒过了
_setSpSellerModule('7', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('7', sellerVersionSunModel));
}
} else {
//7天没有提醒过
showData.add(sellerVersionSunModel); //7天已经提醒过了
_setSpSellerModule('7', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('7', sellerVersionSunModel));
}
// _showSellerAlert('7', edate);
... ... @@ -441,17 +459,17 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
if (App.sp.containsKey('sellerEdateModule')) {
//已经存进去过数据
Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
Map data = json.decode(App.sp.getString('sellerEdateModule'));
List days = data[sellerVersionSunModel.vid] ?? [];
if (!days.contains('3')) {
//3天没有提醒过
showData.add(sellerVersionSunModel); //3天已经提醒过了
_setSpSellerModule('3', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('3', sellerVersionSunModel));
}
} else {
//3天没有提醒过
showData.add(sellerVersionSunModel); //3天已经提醒过了
_setSpSellerModule('3', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('3', sellerVersionSunModel));
}
} else if (difference == 2) {
//过期差2天,提醒一次
... ... @@ -459,18 +477,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
if (App.sp.containsKey('sellerEdateModule')) {
//已经存进去过数据
Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
Map data = json.decode(App.sp.getString('sellerEdateModule'));
List days = data[sellerVersionSunModel.vid] ?? [];
if (!days.contains('2')) {
//2天没有提醒过
showData.add(sellerVersionSunModel); //2天已经提醒过了
// _showSellerAlert('2', edate);
_setSpSellerModule('2', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('2', sellerVersionSunModel));
}
} else {
//2天没有提醒过
showData.add(sellerVersionSunModel); //3天已经提醒过了
_setSpSellerModule('2', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('2', sellerVersionSunModel));
}
} else if (difference == 1) {
//过期差1天,提醒一次
... ... @@ -478,19 +496,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
if (App.sp.containsKey('sellerEdateModule')) {
//已经存进去过数据
Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
Map data = json.decode(App.sp.getString('sellerEdateModule'));
List days = data[sellerVersionSunModel.vid] ?? [];
if (!days.contains('1')) {
//1天没有提醒过
showData.add(sellerVersionSunModel); //1天已经提醒过了
// _showSellerAlert('1', edate);
_setSpSellerModule('1', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('1', sellerVersionSunModel));
}
} else {
//1天没有提醒过
showData.add(sellerVersionSunModel); //1天已经提醒过了
// _showSellerAlert('1', edate);
_setSpSellerModule('1', sellerVersionSunModel);
dataSp.addAll(_setSpSellerModule('1', sellerVersionSunModel));
}
} else if (difference == 0 && differenceSeconds > 0) {
//剩余不足一天
... ... @@ -498,7 +516,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
if (App.sp.containsKey('sellerEdateModule')) {
//已经存进去过数据
Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};
Map data = json.decode(App.sp.getString('sellerEdateModule'));
List days = data[sellerVersionSunModel.vid] ?? [];
if (!days.contains('0')) {
//0天没有提醒过
... ...
... ... @@ -301,6 +301,8 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> {
'pro_code': proCode,
'city_code': cityCode,
'dis_code': disCode,
'lat': lat.toString(),
'long': lng.toString()
};
bool success = await collectStoreProvider.setSellerCollect(
context, params);
... ...
... ... @@ -61,6 +61,7 @@ class DialogUtil {
List<SellerVersionSunModel> showData, CustomCallBack callback,
{GestureTapCallback onTapLeft, GestureTapCallback onTapRight}) {
List<String> names = showData.map((e) => e.vname).toList();
ScrollController controller = ScrollController();
return showDialog(
context: context,
barrierDismissible: true,
... ... @@ -70,7 +71,7 @@ class DialogUtil {
return Material(
color: Colors.transparent,
child: Container(
width: double.infinity,
// width: double.infinity,
margin: EdgeInsets.symmetric(horizontal: w(37)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
... ... @@ -83,85 +84,99 @@ class DialogUtil {
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(50),
Container(
child: Text('您的:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(60),
ListView.builder(
itemCount: showData.length,
shrinkWrap: true,
itemBuilder:
(BuildContext context, int index) {
SellerVersionSunModel
sellerVersionSunModel =
showData[index];
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
child: Text(
'${sellerVersionSunModel.vname}功能即将在:',
style: TextStyle(
color: MyColours
.color_515151,
fontSize:
font(14)))),
VEmptyView(10),
Container(
child: Text(
DateUtil.formatDate(
DateTime.fromMillisecondsSinceEpoch(
int.parse(sellerVersionSunModel
.edate) *
1000),
format:
DateFormats.full,
),
style: TextStyle(
color: MyColours
.color_E34D59,
fontSize:
font(14)))),
]);
}),
Container(
child: Text('您可以:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(60),
Container(
child: Text('点击“前往续费” ',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(20),
Container(
child: Text('或者',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(20),
Container(
child: Text('联系您的服务商续费 ${names.toString()}功能;',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(60),
Container(
child: Text('*您可以通过开通超能版获得全部软件功能。',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(50),
])),
child: SingleChildScrollView(
controller: controller,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
VEmptyView(50),
Container(
child: Text('您的:',
style: TextStyle(
color:
MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(50),
ListView.builder(
itemCount: showData.length,
shrinkWrap: true,
controller: controller,
itemBuilder: (BuildContext context,
int index) {
SellerVersionSunModel
sellerVersionSunModel =
showData[index];
return Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Container(
child: Text(
'${sellerVersionSunModel.vname}功能即将在:',
style: TextStyle(
color: MyColours
.color_515151,
fontSize:
font(14)))),
VEmptyView(5),
Container(
child: Text(
DateUtil.formatDate(
DateTime.fromMillisecondsSinceEpoch(
int.parse(sellerVersionSunModel
.edate) *
1000),
format:
DateFormats
.full,
),
style: TextStyle(
color: MyColours
.color_E34D59,
fontSize:
font(14)))),
VEmptyView(20),
]);
}),
VEmptyView(20),
Container(
child: Text('您可以:',
style: TextStyle(
color:
MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(60),
Container(
child: Text('点击“前往续费” ',
style: TextStyle(
color:
MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(20),
Container(
child: Text('或者',
style: TextStyle(
color:
MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(20),
Container(
child: Text(
'联系您的服务商续费 ${names.toString()}功能;',
style: TextStyle(
color:
MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(60),
Container(
child: Text('*您可以通过开通超能版获得全部软件功能。',
style: TextStyle(
color:
MyColours.color_515151,
fontSize: font(14)))),
VEmptyView(50),
]))),
MyDivider(double.infinity, w(1),
color: MyColours.color_DBDBDB),
Row(
... ... @@ -190,7 +205,7 @@ class DialogUtil {
Expanded(
flex: 1,
child: RoundButton(
text: '前往开通',
text: '前往续费',
// width: (ScreenUtil().screenWidth -
// ScreenUtil().setWidth(62) * 2) /
// 2,
... ...