Browse Source

更新后的问题修改

dart3
fff 10 months ago
parent
commit
fee560fa7e
  1. 70
      android/app/agconnect-services.json
  2. 11
      android/app/build.gradle
  3. 13
      android/app/proguard-rules.pro
  4. 3
      android/gradle.properties
  5. 5
      android/settings.gradle
  6. 2
      lib/integral/integral_detailed_page.dart
  7. 97
      lib/main.dart
  8. 215
      lib/main_page.dart
  9. 10
      lib/mine/mine_vip/mine_vip_core.dart
  10. 9
      lib/retrofit/retrofit_api.dart
  11. 9
      lib/utils/push_event.dart

70
android/app/agconnect-services.json

@ -0,0 +1,70 @@
{
"agcgw":{
"backurl":"connect-drcn.dbankcloud.cn",
"url":"connect-drcn.hispace.hicloud.com",
"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.cn",
"websocketurl":"connect-ws-drcn.hispace.dbankcloud.com"
},
"agcgw_all":{
"CN":"connect-drcn.hispace.hicloud.com",
"CN_back":"connect-drcn.dbankcloud.cn",
"DE":"connect-dre.hispace.hicloud.com",
"DE_back":"connect-dre.dbankcloud.cn",
"RU":"connect-drru.hispace.hicloud.com",
"RU_back":"connect-drru.dbankcloud.cn",
"SG":"connect-dra.hispace.hicloud.com",
"SG_back":"connect-dra.dbankcloud.cn"
},
"client":{
"cp_id":"56568071",
"product_id":"736430079245898772",
"client_id":"682378372344464128",
"client_secret":"23E8E33A66A41E524F393520B1ADD32BE20D071AC6BBD3BFD3A3711B19DF1832",
"project_id":"736430079245898772",
"app_id":"104575849",
"api_key":"CgB6e3x9vFGyCWpfisYh0nwJ+hORXbgXieLZGG4mBDz5pjZB32ahJmqyl49+Qn2noEiMEcvm8jAU42jr3sQmjsXZ",
"package_name":"com.zsw.huixiang"
},
"oauth_client":{
"client_id":"104575849",
"client_type":1
},
"app_info":{
"app_id":"104575849",
"package_name":"com.zsw.huixiang"
},
"service":{
"analytics":{
"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
"resource_id":"p1",
"channel_id":""
},
"search":{
"url":"https://search-drcn.cloud.huawei.com"
},
"cloudstorage":{
"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn"
},
"ml":{
"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
}
},
"region":"CN",
"configuration_version":"3.0",
"appInfos":[
{
"package_name":"com.zsw.huixiang",
"client":{
"app_id":"104575849"
},
"app_info":{
"package_name":"com.zsw.huixiang",
"app_id":"104575849"
},
"oauth_client":{
"client_type":1,
"client_id":"104575849"
}
}
]
}

11
android/app/build.gradle

@ -2,7 +2,8 @@ plugins {
id "com.android.application" id "com.android.application"
id "kotlin-android" id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin" id "dev.flutter.flutter-gradle-plugin"
id 'com.mob.sdk' id "com.mob.sdk"
// id "com.huawei.agconnect"
} }
def localProperties = new Properties() def localProperties = new Properties()
@ -24,9 +25,8 @@ if (flutterVersionName == null) {
} }
def mfph = [ def mfph = [
//宿
"apk.applicationId" : "com.zsw.huixiang", "apk.applicationId" : "com.zsw.huixiang",
XG_ACCESS_ID : "1580005689", // ACCESS_ID XG_ACCESS_ID : "1580005689",
XG_ACCESS_KEY : "A1HKKUUWI7WI", XG_ACCESS_KEY : "A1HKKUUWI7WI",
] ]
@ -99,7 +99,10 @@ flutter {
} }
dependencies { dependencies {
// classpath 'com.mob.sdk:MobSDK:+' implementation("com.tencent.tpns:xiaomi:1.4.3.6-release")
implementation("com.tencent.tpns:huawei:1.4.3.6-release")
implementation("com.huawei.hms:push:6.7.0.300")
} }
MobSDK { MobSDK {

13
android/app/proguard-rules.pro vendored

@ -59,3 +59,16 @@
# "R.string.mobdemo_authorize_*", # "R.string.mobdemo_authorize_*",
# ] # ]
#} #}
-keep class com.xiaomi.**{*;}
-keep public class * extends com.xiaomi.mipush.sdk.PushMessageReceiver
-ignorewarnings
-keepattributes *Annotation*
-keepattributes Exceptions
-keepattributes InnerClasses
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable
-keep class com.hianalytics.android.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}

3
android/gradle.properties

@ -1,4 +1,5 @@
org.gradle.jvmargs=-Xmx4G org.gradle.jvmargs=-Xmx4G
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=true android.enableJetifier=true
MobSDK.spEdition=IZNAO MobSDK.spEdition=IZNAO

5
android/settings.gradle

@ -32,9 +32,10 @@ pluginManagement {
plugins { plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false id "com.android.application" version "7.4.2" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false id "org.jetbrains.kotlin.android" version "1.9.0" apply false
id "com.mob.sdk" version "+" apply false id "com.mob.sdk" version "+" apply false
// id "com.huawei.agconnect" version "1.9.0.300" apply false
} }
include ":app" include ":app"

2
lib/integral/integral_detailed_page.dart

@ -74,7 +74,7 @@ class _IntegralDetailedPage extends State<IntegralDetailedPage>
apiService = ApiService(Dio(), apiService = ApiService(Dio(),
context: context, token: value.getString("token")), context: context, token: value.getString("token")),
userInfo = UserInfo.fromJson(jsonDecode(value.getString('user') ?? "")), userInfo = UserInfo.fromJson(jsonDecode(value.getString('user') ?? "")),
queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""), queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get", widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""),
}); });
} }

97
lib/main.dart

@ -1,3 +1,4 @@
import 'dart:convert';
import 'dart:io'; import 'dart:io';
import 'package:event_bus/event_bus.dart'; import 'package:event_bus/event_bus.dart';
@ -75,6 +76,8 @@ import 'package:huixiang/test_page.dart';
import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/location_map_page.dart';
import 'package:huixiang/union/union_select_city.dart'; import 'package:huixiang/union/union_select_city.dart';
import 'package:huixiang/utils/ImgCachePath.dart'; import 'package:huixiang/utils/ImgCachePath.dart';
import 'package:huixiang/utils/native_event_handler.dart';
import 'package:huixiang/utils/push_event.dart';
import 'package:huixiang/vip/user_vip_service_page.dart'; import 'package:huixiang/vip/user_vip_service_page.dart';
import 'package:huixiang/web/web_page.dart'; import 'package:huixiang/web/web_page.dart';
@ -84,6 +87,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/web/web_turntable_activity.dart'; import 'package:huixiang/web/web_turntable_activity.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'community/community_view/class_details.dart'; import 'community/community_view/class_details.dart';
import 'community/headlines/headlines_column_details.dart'; import 'community/headlines/headlines_column_details.dart';
@ -148,12 +152,101 @@ void main() async {
// initSdk(); // initSdk();
bool? isFirst = sharedPreferences.getBool("isFirst"); bool? isFirst = sharedPreferences.getBool("isFirst");
addPushHandler();
runApp(MyApp(locale, isFirst)); runApp(MyApp(locale, isFirst));
// FlutterBugly.postCatchedException((){ // FlutterBugly.postCatchedException((){});
// });
// FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6"); // FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6");
} }
addPushHandler() {
// if (Platform.isAndroid) {
// xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler(
// MyNativeEventHandler((String title, String message, String customContent, int type) {
// print("xgPushClickAction2: $customContent");
// SharedPreferences.getInstance().then((value) {
// value.setString("pushData", customContent);
// });
// },
// ),
// );
// }
/// @typed: ARTICLE(1) ACTIVITY(2) SHOP(3)
/// CREDIT_GOODS(4) ORDER(5) TREND(6) MEMBER(7)
/// WALLET(8)/ WELFARE(9) COUPON(12)
/// CATE_BEAN(13)
xgFlutterPlugin.addEventHandler(
onReceiveMessage: (Map<String, dynamic> event) async {
print("onReceiveMessage: ${event.toString()}");
return true;
},
onReceiveNotificationResponse: (Map<String, dynamic> event) async {
print("onReceiveNotificationResponse: ${event.toString()}");
try {
if (jsonDecode(event["customMessage"])["typed"] == 6) {
eventBus.fire(PushEvent(1));
}
} catch (ex) {}
return true;
},
xgPushClickAction: (Map<String, dynamic> event) async {
print("xgPushClickAction1: $event");
if (event["actionType"] == 2) return event;
if (Platform.isAndroid
? (event["actionType"] == 0)
: (event["xg"]?["msgtype"] == 1) &&
event[Platform.isAndroid ? "customMessage" : "custom"] != null) {
SharedPreferences.getInstance().then((value) {
value.setString("pushData",
event[Platform.isAndroid ? "customMessage" : "custom"]);
});
eventBus.fire(PushEvent(0));
}
return true;
},
xgPushDidBindWithIdentifier: (Map<String, dynamic> event) async {
print("xgPushDidBindWithIdentifier: ${event.toString()}");
return true;
},
xgPushDidUnbindWithIdentifier: (Map<String, dynamic> event) async {
print("xgPushDidUnbindWithIdentifier: ${event.toString()}");
return true;
},
xgPushDidUpdatedBindedIdentifier: (Map<String, dynamic> event) async {
print("xgPushDidUpdatedBindedIdentifier: ${event.toString()}");
return true;
},
xgPushDidClearAllIdentifiers: (Map<String, dynamic> event) async {
print("xgPushDidClearAllIdentifiers: ${event.toString()}");
return true;
},
onRegisteredDeviceToken: (String res) async {
print("onRegisteredDeviceToken: ${res}");
return true;
},
onRegisteredDone: (String res) async {
print("onRegisteredDone: ${res}");
return true;
},
unRegistered: (String res) async {
print("unRegistered: ${res}");
return true;
},
xgPushNetworkConnected: (String res) async {
print("xgPushNetworkConnected: ${res}");
return true;
},
xgPushDidSetBadge: (String res) async {
print("xgPushDidSetBadge: ${res}");
return true;
},
);
}
XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
EventBus eventBus = EventBus(sync: true); EventBus eventBus = EventBus(sync: true);
Route? lastRoutePage; Route? lastRoutePage;

215
lib/main_page.dart

@ -24,6 +24,7 @@ import 'package:huixiang/utils/event_type.dart';
import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/flutter_utils.dart';
import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/utils/native_event_handler.dart'; import 'package:huixiang/utils/native_event_handler.dart';
import 'package:huixiang/utils/push_event.dart';
import 'package:huixiang/view_widget/update_dialog.dart'; import 'package:huixiang/view_widget/update_dialog.dart';
import 'package:huixiang/vip/vip_page.dart'; import 'package:huixiang/vip/vip_page.dart';
import 'package:package_info_plus/package_info_plus.dart'; import 'package:package_info_plus/package_info_plus.dart';
@ -120,6 +121,15 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
pushRoute(); pushRoute();
eventBus.on<PushEvent>().listen((PushEvent event) {
if (event.eventType == 0) {
pushRoute();
} else if (event.eventType == 1) {
MinePageState? state = minePageKey.currentState as MinePageState?;
state?.queryMsgStats();
}
});
String invite = ""; String invite = "";
var interviewCouponList; var interviewCouponList;
var firstLoginCouponList; var firstLoginCouponList;
@ -191,8 +201,6 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
appAutoUpdate(); appAutoUpdate();
} }
final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin();
// Future<void> initPlatformState() async { // Future<void> initPlatformState() async {
// String? platformVersion; // String? platformVersion;
// try { // try {
@ -214,71 +222,16 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
xgFlutterPlugin.setEnableDebug(true); xgFlutterPlugin.setEnableDebug(true);
///iOS的appID信息Android信息在build.gradle文件中 ///iOS的appID信息Android信息在build.gradle文件中
xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); // xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22");
xgFlutterPlugin.startXg("1580005689", "A1HKKUUWI7WI");
// xgFlutterPlugin.addEventHandler(
// onReceiveMessage: (Map<String, dynamic> event) async {
// print("onReceiveMessage: ${event.toString()}");
// return true;
// },
// onReceiveNotificationResponse: (Map<String, dynamic> event) async {
// print("onReceiveNotificationResponse: ${event.toString()}");
// return true;
// },
// xgPushDidBindWithIdentifier: (Map<String, dynamic> event) async {
// print("xgPushDidBindWithIdentifier: ${event.toString()}");
// return true;
// },
// xgPushDidUnbindWithIdentifier: (Map<String, dynamic> event) async {
// print("xgPushDidUnbindWithIdentifier: ${event.toString()}");
// return true;
// },
// xgPushDidUpdatedBindedIdentifier: (Map<String, dynamic> event) async {
// print("xgPushDidUpdatedBindedIdentifier: ${event.toString()}");
// return true;
// },
// xgPushClickAction: (Map<String, dynamic> event) async {
// print("xgPushClickAction: ${event.toString()}");
// return true;
// },
// xgPushDidClearAllIdentifiers: (Map<String, dynamic> event) async {
// print("xgPushDidClearAllIdentifiers: ${event.toString()}");
// return true;
// },
// onRegisteredDeviceToken: (String res) async {
// print("onRegisteredDeviceToken: ${res}");
// return true;
// },
// onRegisteredDone: (String res) async {
// print("onRegisteredDone: ${res}");
// return true;
// },
// unRegistered: (String res) async {
// print("unRegistered: ${res}");
// return true;
// },
// xgPushNetworkConnected: (String res) async {
// print("xgPushNetworkConnected: ${res}");
// return true;
// },
// xgPushDidSetBadge: (String res) async {
// print("xgPushDidSetBadge: ${res}");
// return true;
// },
// );
if (Platform.isAndroid) { if (Platform.isAndroid) {
XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); XgFlutterPlugin.xgApi.setMiPushAppId(appId: "2882303761520050452");
// XgFlutterPlugin.xgApi.setMiPushAppKey(appKey: "5582005091452");
androidApi.setMiPushAppId(appId: "2882303761520050452"); XgFlutterPlugin.xgApi.enableOtherPush();
androidApi.setMiPushAppKey(appKey: "5582005091452"); XgFlutterPlugin.xgApi.regPush();
androidApi.enableOtherPush();
androidApi.regPush();
} }
// ===========================TPNS====
ShareSDKRegister shareSDKRegister = ShareSDKRegister(); ShareSDKRegister shareSDKRegister = ShareSDKRegister();
shareSDKRegister.setupWechat( shareSDKRegister.setupWechat(
"wx3b269e795ed23e5f", "wx3b269e795ed23e5f",
@ -306,78 +259,76 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL);
} }
if (Platform.isAndroid) { // if (Platform.isAndroid) {
xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( // xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler(
MyNativeEventHandler( // MyNativeEventHandler(
(String title, String message, String customContent, int type) { // (String title, String message, String customContent, int type) {
print("xgPushClickAction2: $customContent"); // print("xgPushClickAction2: $customContent");
SharedPreferences.getInstance().then((value) { // SharedPreferences.getInstance().then((value) {
value.setString("pushData", customContent); // value.setString("pushData", customContent);
}); // });
}, // },
), // ),
); // );
} // }
/// @typed: ARTICLE(1) ACTIVITY(2) SHOP(3)
/// @typed: ARTICLE(1) ACTIVITY(2) SHOP(3) CREDIT_GOODS(4) ORDER(5) TREND(6) MEMBER(7) WALLET(8)/ WELFARE(9) COUPON(12) CATE_BEAN(13) /// CREDIT_GOODS(4) ORDER(5) TREND(6) MEMBER(7)
xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async { /// WALLET(8)/ WELFARE(9) COUPON(12)
print("xgPushClickAction1: $event"); /// CATE_BEAN(13)
if (event["actionType"] == 2) return event; // xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async {
if (Platform.isAndroid // print("xgPushClickAction1: $event");
? (event["actionType"] == 0) // if (event["actionType"] == 2) return event;
: (event["xg"]["msgtype"] == 1) && // if (Platform.isAndroid
event[Platform.isAndroid ? "customMessage" : "custom"] != null) { // ? (event["actionType"] == 0)
SharedPreferences.getInstance().then((value) { // : (event["xg"]?["msgtype"] == 1) &&
value.setString("pushData", // event[Platform.isAndroid ? "customMessage" : "custom"] != null) {
event[Platform.isAndroid ? "customMessage" : "custom"]); // SharedPreferences.getInstance().then((value) {
}); // value.setString("pushData",
if ((ModalRoute.of(context)?.isActive ?? false) // event[Platform.isAndroid ? "customMessage" : "custom"]);
&& (ModalRoute.of(context)?.isCurrent ?? false)) { // });
pushRoute(); // if ((ModalRoute.of(context)?.isActive ?? false)
} else { // && (ModalRoute.of(context)?.isCurrent ?? false)) {
Navigator.of(context) // pushRoute();
.pushNamedAndRemoveUntil('/router/main_page', (route) => false); // } else {
} // Navigator.of(context).pushNamedAndRemoveUntil(
} // '/router/main_page',
return event; // (route) => false,
}, onReceiveNotificationResponse: (event) async { // );
try { // }
if (jsonDecode(event["customMessage"])["typed"] == 6) { // }
// HomePageState state = homePageKey.currentState; // return event;
// state.queryMsgStats(); // }, onReceiveNotificationResponse: (event) async {
MinePageState state = minePageKey.currentState as MinePageState; // try {
state.queryMsgStats(); // if (jsonDecode(event["customMessage"])["typed"] == 6) {
} // // HomePageState state = homePageKey.currentState;
} catch (ex) {} // // state.queryMsgStats();
print("onReceiveNotificationResponse: ${event.toString()}"); // MinePageState state = minePageKey.currentState as MinePageState;
return event; // state.queryMsgStats();
}, onReceiveMessage: (event) async { // }
print("onReceiveMessage: ${event.toString()}"); // } catch (ex) {}
return event; // print("onReceiveNotificationResponse: ${event.toString()}");
}, onRegisteredDone: (event) async { // return event;
print("onRegisteredDone: ${event.toString()}"); // }, onReceiveMessage: (event) async {
return event; // print("onReceiveMessage: ${event.toString()}");
}, xgPushDidBindWithIdentifier: (event) async { // return event;
print("xgPushDidBindWithIdentifier: ${event.toString()}"); // }, onRegisteredDone: (event) async {
return event; // print("onRegisteredDone: ${event.toString()}");
}); // return event;
// }, xgPushDidBindWithIdentifier: (event) async {
// print("xgPushDidBindWithIdentifier: ${event.toString()}");
// return event;
// });
} }
pushRoute() async { pushRoute() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
if (sharedPreferences.getString("token") == null || if (sharedPreferences.getString("token") == null ||
sharedPreferences.getString("token") == "") return; sharedPreferences.getString("token") == "") return;
String? startIntent;
// if (Platform.isAndroid) startIntent = await Bridge.getStartIntent(); // if (Platform.isAndroid) startIntent = await Bridge.getStartIntent();
print("intent:${startIntent}"); String pushData = sharedPreferences.getString("pushData") ?? "";
String pushData = ""; print("intent:${pushData}");
if (startIntent != null && startIntent != "") {
pushData = startIntent; if (pushData.isEmpty) return;
// pushData = """{"typed":1,"info":"1420304936817655808"}""";
} else {
pushData = sharedPreferences.getString("pushData") ?? "";
}
if (pushData == "") return;
Map<String, dynamic> pushMap = jsonDecode(pushData); Map<String, dynamic> pushMap = jsonDecode(pushData);
String routeName = ""; String routeName = "";
Map<String, dynamic> params = {}; Map<String, dynamic> params = {};
@ -437,10 +388,10 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
} }
sharedPreferences.setString("pushData", ""); sharedPreferences.setString("pushData", "");
print("xgPushClickAction: routeName: $routeName"); print("xgPushClickAction: routeName: $routeName");
if (routeName != "") { if (routeName.isNotEmpty) {
Navigator.of(context).pushNamed(routeName, arguments: params); Navigator.of(context).pushNamed(routeName, arguments: params);
} }
} }
queryUserInfo() async { queryUserInfo() async {
SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); SharedPreferences sharedPreferences = await SharedPreferences.getInstance();
@ -450,7 +401,9 @@ class _MainPage extends State<MainPage> with WidgetsBindingObserver {
Dio(), Dio(),
context: context, context: context,
token: sharedPreferences.getString('token') ?? "", token: sharedPreferences.getString('token') ?? "",
).queryInfo().catchError((onError) {}); ).queryInfo().catchError((error) {
print("error: ${error}");
});
sharedPreferences.setString('user', jsonEncode(baseDate.data)); sharedPreferences.setString('user', jsonEncode(baseDate.data));
// //

10
lib/mine/mine_vip/mine_vip_core.dart

@ -109,8 +109,7 @@ class _MineVipCore extends State<MineVipCore> {
/// ///
queryVipLevel() async { queryVipLevel() async {
BaseData<List<Rank>>? rankData = BaseData<List<Rank>>? rankData = await apiService?.rankList().catchError((onError) {
await apiService?.rankList().catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });
@ -136,8 +135,7 @@ class _MineVipCore extends State<MineVipCore> {
/// ///
queryBenefitList() async { queryBenefitList() async {
BaseData<List<VipBenefit>>? baseData = BaseData<List<VipBenefit>>? baseData = await apiService?.benefitList().catchError((onError) {
await apiService?.benefitList().catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });
@ -155,8 +153,8 @@ class _MineVipCore extends State<MineVipCore> {
////// //////
queryRuleDetails() async { queryRuleDetails() async {
BaseData<VipRuleDetails>? baseData = BaseData<VipRuleDetails>? baseData = await apiService?.vipBenefit()
await apiService?.vipBenefit().catchError((onError) { .catchError((onError) {
refreshController.refreshFailed(); refreshController.refreshFailed();
refreshController.loadFailed(); refreshController.loadFailed();
}); });

9
lib/retrofit/retrofit_api.dart

@ -176,14 +176,11 @@ abstract class ApiService {
/// ///
@POST("/file/upload") @POST("/file/upload")
@MultiPart() @MultiPart()
Future<BaseData<UploadResult>> upload(@Part(name: "file") File data, Future<BaseData<UploadResult>> upload(@Part(name: "file") File data, @Part(name: "folderId") int folderId, bool isVideo);
@Part(name: "folderId") int folderId, bool isVideo);
/// ///
@GET( @GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all")
"https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng, @Path("keywords") String keywords, int size, int page);
Future<dynamic> searchPoi(@Path("lat") String lat, @Path("lng") String lng,
@Path("keywords") String keywords, int size, int page);
/// ///
@POST("/auth/platform/memberLogin") @POST("/auth/platform/memberLogin")

9
lib/utils/push_event.dart

@ -0,0 +1,9 @@
class PushEvent {
PushEvent(this.eventType);
int eventType;
}
Loading…
Cancel
Save