|
|
|
@ -57,7 +57,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
|
|
|
|
|
final GlobalKey vipPageKey = GlobalKey(); |
|
|
|
|
// List<String> iconn; |
|
|
|
|
ApiService apiService; |
|
|
|
|
|
|
|
|
|
int lastTime = DateTime.now().millisecondsSinceEpoch; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void dispose() { |
|
|
|
@ -73,8 +73,11 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
|
|
|
|
|
break; |
|
|
|
|
case AppLifecycleState.resumed: //从后台切换前台,界面可见 |
|
|
|
|
pushRoute(); |
|
|
|
|
if(DateTime.now().millisecondsSinceEpoch - lastTime > 300000) |
|
|
|
|
Navigator.of(context).popAndPushNamed('/router/main_page'); |
|
|
|
|
break; |
|
|
|
|
case AppLifecycleState.paused: // 界面不可见,后台 |
|
|
|
|
lastTime = DateTime.now().millisecondsSinceEpoch; |
|
|
|
|
break; |
|
|
|
|
case AppLifecycleState.detached: // APP结束时调用 |
|
|
|
|
break; |
|
|
|
@ -224,7 +227,7 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// @typed: 1文章 2活动 3店铺 4积分商品 5订单 6动态 7用户 8平台余额/钱包 9福利中心 |
|
|
|
|
/// @typed: ARTICLE(1)文章 ACTIVITY(2)活动 SHOP(3)店铺 CREDIT_GOODS(4)积分商品 ORDER(5)订单 TREND(6)动态 MEMBER(7)用户 WALLET(8)平台余额/钱包 WELFARE(9)福利中心 |
|
|
|
|
xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async { |
|
|
|
|
print("xgPushClickAction1: $event"); |
|
|
|
|
if (event["actionType"] == 2) return event; |
|
|
|
@ -288,38 +291,38 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
|
|
|
|
|
if (pushMap != null) { |
|
|
|
|
String routeName = ""; |
|
|
|
|
Map<String, dynamic> params = {}; |
|
|
|
|
switch (pushMap["typed"]) { |
|
|
|
|
case 1: |
|
|
|
|
switch (pushMap["typed"].toString()) { |
|
|
|
|
case "1":case "ARTICLE": |
|
|
|
|
routeName = "/router/web_page"; |
|
|
|
|
params["articleId"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
case "2":case "ACTIVITY": |
|
|
|
|
routeName = "/router/web_page"; |
|
|
|
|
params["activityId"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
case "3":case "SHOP": |
|
|
|
|
routeName = "/router/store_order"; |
|
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
|
params["tenant"] = pushMap["tenant"]; |
|
|
|
|
params["storeName"] = pushMap["storeName"]; |
|
|
|
|
break; |
|
|
|
|
case 4: |
|
|
|
|
case "4":case "CREDIT_GOODS": |
|
|
|
|
routeName = "/router/integral_store_page"; |
|
|
|
|
params["goodsId"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|
case 5: |
|
|
|
|
case "5":case "ORDER": |
|
|
|
|
routeName = "/router/order_details"; |
|
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|
case 6: |
|
|
|
|
case "6":case "MEMBER": |
|
|
|
|
routeName = "/router/community_details"; |
|
|
|
|
params["businessId"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|
case 8: |
|
|
|
|
case "8":case "WALLET": |
|
|
|
|
routeName = "/router/mine_wallet"; |
|
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|
case 9: |
|
|
|
|
case "9":case "WELFARE": |
|
|
|
|
routeName = "/router/welfare_page"; |
|
|
|
|
params["id"] = pushMap["info"]; |
|
|
|
|
break; |
|
|
|
|