|
|
|
|
|
|
|
import 'dart:async';
|
|
|
|
import 'dart:convert';
|
|
|
|
import 'dart:io';
|
|
...
|
...
|
@@ -140,7 +139,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
// 'https://qn.colorcun.com/template/heilanguodu-6.png');
|
|
|
|
FlutterBugly.init(androidAppId: "f71a313f42", iOSAppId: "3089e4587e");
|
|
|
|
needRefreshTemp = widget.needReresh;
|
|
|
|
_channel.setMethodCallHandler(platformCallHandler as Future Function(MethodCall call)?); //设置监听
|
|
|
|
_channel.setMethodCallHandler(
|
|
|
|
platformCallHandler as Future Function(MethodCall call)?); //设置监听
|
|
|
|
|
|
|
|
AzhonAppUpdate.listener((map) {
|
|
|
|
// needUpdate = false;
|
|
...
|
...
|
@@ -335,9 +335,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
}
|
|
|
|
|
|
|
|
if (showData != null && showData.length > 0) {
|
|
|
|
|
|
|
|
DateTime edate =
|
|
|
|
DateTime.fromMillisecondsSinceEpoch(int.parse(showData[0].edate!) * 1000);
|
|
|
|
DateTime edate = DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
int.parse(showData[0].edate!) * 1000);
|
|
|
|
DialogUtil.cupertinoAlertSellerEdateDialogSim(
|
|
|
|
context,
|
|
|
|
title: '温馨提示',
|
|
...
|
...
|
@@ -360,7 +359,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
// //店铺过期日期
|
|
|
|
// _edateShow();
|
|
|
|
// });
|
|
|
|
if (widget.initialIndex == 0 ||
|
|
|
|
if (widget.initialIndex == 0 ||
|
|
|
|
widget.initialIndex == 1 && needRefreshTemp == false) return;
|
|
|
|
_initNotification();
|
|
|
|
return true;
|
|
...
|
...
|
@@ -383,7 +382,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
NavigatorUtil.goHomePageSim(context, initialIndex: _currIndex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (widget.initialIndex == 0 ||
|
|
|
|
if (widget.initialIndex == 0 ||
|
|
|
|
widget.initialIndex == 1 && needRefreshTemp == false) return;
|
|
|
|
_initNotification();
|
|
|
|
|
|
...
|
...
|
@@ -578,7 +577,6 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
//店铺过期日期
|
|
|
|
DateTime edate = DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
int.parse(sellerVersionSunModel.edate!) * 1000);
|
|
|
|
|
|
|
|
|
|
|
|
//当前日期
|
|
|
|
final datenow = DateTime.now();
|
|
...
|
...
|
@@ -816,7 +814,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
}
|
|
|
|
|
|
|
|
_initNotification() async {
|
|
|
|
Map? param = await Tools().getIntent() ;
|
|
|
|
Map? param = await Tools().getIntent();
|
|
|
|
_getIntent(param);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -894,7 +892,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
NavigatorUtil.goOnlineCheckDetailPage(context,
|
|
|
|
rid: notifyParam["rid"], fromNotify: true);
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"sid":
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"id": notifyParam['mid'],
|
|
|
|
"status": "is_read"
|
|
|
|
};
|
|
...
|
...
|
@@ -907,7 +906,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
NavigatorUtil.goInvoiceDetailPage(context,
|
|
|
|
rid: '${notifyParam["rid"]}', fromNotify: true);
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"sid":
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"id": notifyParam['mid'],
|
|
|
|
"status": "is_read"
|
|
|
|
};
|
|
...
|
...
|
@@ -926,7 +926,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
.millisecondsSinceEpoch,
|
|
|
|
solt: notifyParam['ddate_solt']);
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"sid":
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"id": notifyParam['mid'],
|
|
|
|
"status": "is_read"
|
|
|
|
};
|
|
...
|
...
|
@@ -950,7 +951,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
Provider.of<MessageDialogModel>(context, listen: false);
|
|
|
|
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"sid":
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"id": notifyParam['mid'],
|
|
|
|
"status": "is_read"
|
|
|
|
};
|
|
...
|
...
|
@@ -1002,7 +1004,8 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
// bus.emit("remove_untreated_message_order", notifyParam["rid"]);
|
|
|
|
|
|
|
|
Map<String, String?> params = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"sid":
|
|
|
|
Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"id": notifyParam['mid'],
|
|
|
|
"status": "is_read"
|
|
|
|
};
|
|
...
|
...
|
@@ -1086,6 +1089,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// App.sp.setBool("h_notification", true);
|
|
|
|
if (!mounted) return;
|
|
|
|
|
|
|
|
/// 开启DEBUG
|
|
|
|
tpush.setEnableDebug(false);
|
|
...
|
...
|
@@ -1195,12 +1199,14 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
// /// 在此可设置应用角标
|
|
|
|
// tpush.setAppBadge(0);
|
|
|
|
},
|
|
|
|
/// V1.2.8开始返回类型由String->Map,新增code及type标识!
|
|
|
|
|
|
|
|
/// V1.2.8开始返回类型由String->Map,新增code及type标识!
|
|
|
|
xgPushDidBindWithIdentifier: (Map<String, dynamic> result) async {
|
|
|
|
print("flutter xgPushDidBindWithIdentifier: $result");
|
|
|
|
// _showAlert(result["msg"]);
|
|
|
|
},
|
|
|
|
/// V1.2.8开始返回类型由String->Map,新增code及type标识!
|
|
|
|
|
|
|
|
/// V1.2.8开始返回类型由String->Map,新增code及type标识!
|
|
|
|
xgPushDidUnbindWithIdentifier: (Map<String, dynamic> result) async {
|
|
|
|
print("flutter xgPushDidUnbindWithIdentifier: $result");
|
|
|
|
// _showAlert(result["msg"]);
|
|
...
|
...
|
@@ -1211,6 +1217,7 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
print("flutter xgPushDidUpdatedBindedIdentifier: $result");
|
|
|
|
// _showAlert(result["msg"]);
|
|
|
|
},
|
|
|
|
|
|
|
|
/// V1.2.8开始返回类型由String->Map,新增code及type标识!
|
|
|
|
xgPushDidClearAllIdentifiers: (Map<String, dynamic> result) async {
|
|
|
|
print("flutter xgPushDidClearAllIdentifiers: $result");
|
|
...
|
...
|
@@ -1477,7 +1484,12 @@ class HomePageSimState extends State<HomePageSim> with WidgetsBindingObserver { |
|
|
|
|
|
|
|
/// 启动TPNS服务
|
|
|
|
LogUtil.v("register:${xgCount.toString()}");
|
|
|
|
tpush.startXg("1600012876", "INUIMFK21WGH");
|
|
|
|
// tpush.startXg("1600012876", "INUIMFK21WGH");
|
|
|
|
if (Platform.isIOS) {
|
|
|
|
tpush.startXg("1600012876", "INUIMFK21WGH");
|
|
|
|
} else {
|
|
|
|
tpush.startXg("1500012875", "AVR2GJERH0HC");
|
|
|
|
}
|
|
|
|
xgCount++;
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|