diff --git a/assets/image/2x/icon_mine_online_service.webp b/assets/image/2x/icon_mine_online_service.webp index 71cc6ca2..b2cd9aef 100644 Binary files a/assets/image/2x/icon_mine_online_service.webp and b/assets/image/2x/icon_mine_online_service.webp differ diff --git a/assets/image/3x/icon_mine_online_service.webp b/assets/image/3x/icon_mine_online_service.webp index 01fe923b..5e44161c 100644 Binary files a/assets/image/3x/icon_mine_online_service.webp and b/assets/image/3x/icon_mine_online_service.webp differ diff --git a/assets/image/icon_mine_online_service.webp b/assets/image/icon_mine_online_service.webp index 79640cde..be33bb54 100644 Binary files a/assets/image/icon_mine_online_service.webp and b/assets/image/icon_mine_online_service.webp differ diff --git a/lib/main.dart b/lib/main.dart index 7ebc1f22..bc39a419 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -116,7 +116,7 @@ void main() async { locale = Locale.fromSubtags(languageCode: 'zh', countryCode: 'CH'); } ImgCachePath(); - initSdk(); + // initSdk(); bool isFirst = sharedPreferences.getBool("isFirst"); runApp(MyApp(locale, isFirst)); @@ -127,47 +127,7 @@ void main() async { final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); -initSdk() async { - ///ios 调用startXg前需要调用此方法 - xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); - xgFlutterPlugin.setEnableDebug(true); - ///此处配置为iOS的appID信息,Android信息在build.gradle文件中 - xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); - - if (Platform.isAndroid) { - XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); - //小米 - androidApi.setMiPushAppId(appId: "2882303761520050452"); - androidApi.setMiPushAppKey(appKey: "5582005091452"); - - androidApi.enableOtherPush(); - androidApi.regPush(); - } - - ShareSDKRegister shareSDKRegister = ShareSDKRegister(); - shareSDKRegister.setupWechat( - "wx3b269e795ed23e5f", - "64020361b8ec4c99936c0e3999a9f249", - "https://hx.lotus-wallet.com/app/", - ); - shareSDKRegister.setupFacebook( - "523308712059457", - "d3a1b6377100871799d8973fbe84794a", - "一心回乡", - ); - SharesdkPlugin.regist(shareSDKRegister); - - if (Platform.isIOS) { - LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); - BMFMapSDK.setApiKeyAndCoordType( - 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', - BMF_COORD_TYPE.COMMON, - ); - } else if (Platform.isAndroid) { - BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON); - } -} EventBus eventBus = EventBus(sync: true); diff --git a/lib/main_page.dart b/lib/main_page.dart index 1bb8718a..01066798 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -2,6 +2,8 @@ import 'dart:convert'; import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_baidu_mapapi_base/flutter_baidu_mapapi_base.dart'; +import 'package:flutter_bmflocation/bdmap_location_flutter_plugin.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:huixiang/community/community_page.dart'; @@ -20,6 +22,9 @@ import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/native_event_handler.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:sharesdk_plugin/sharesdk_interface.dart'; +import 'package:sharesdk_plugin/sharesdk_register.dart'; +import 'package:tpns_flutter_plugin/android/xg_android_api.dart'; import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'community/order_page.dart'; @@ -81,6 +86,9 @@ class _MainPage extends State with WidgetsBindingObserver { ..userInteractions = false ..dismissOnTap = false; + + initSdk(); + pushRoute(); String invite = ""; @@ -130,11 +138,53 @@ class _MainPage extends State with WidgetsBindingObserver { }); queryUserInfo(); + } + + initSdk() async { + ///ios 调用startXg前需要调用此方法 + xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); + xgFlutterPlugin.setEnableDebug(true); + + ///此处配置为iOS的appID信息,Android信息在build.gradle文件中 + xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); + + if (Platform.isAndroid) { + XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); + //小米 + androidApi.setMiPushAppId(appId: "2882303761520050452"); + androidApi.setMiPushAppKey(appKey: "5582005091452"); + + androidApi.enableOtherPush(); + androidApi.regPush(); + } + + ShareSDKRegister shareSDKRegister = ShareSDKRegister(); + shareSDKRegister.setupWechat( + "wx3b269e795ed23e5f", + "64020361b8ec4c99936c0e3999a9f249", + "https://hx.lotus-wallet.com/app/", + ); + shareSDKRegister.setupFacebook( + "523308712059457", + "d3a1b6377100871799d8973fbe84794a", + "一心回乡", + ); + SharesdkPlugin.regist(shareSDKRegister); + + if (Platform.isIOS) { + LocationFlutterPlugin.setApiKey("ylW2QPlsbERkho7jOgU4GQSeawmdUIoR"); + BMFMapSDK.setApiKeyAndCoordType( + 'ylW2QPlsbERkho7jOgU4GQSeawmdUIoR', + BMF_COORD_TYPE.COMMON, + ); + } else if (Platform.isAndroid) { + BMFMapSDK.setCoordType(BMF_COORD_TYPE.COMMON); + } if (Platform.isAndroid) { xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( MyNativeEventHandler( - (String title, String message, String customContent, int type) { + (String title, String message, String customContent, int type) { print("xgPushClickAction2: $customContent"); SharedPreferences.getInstance().then((value) { value.setString("pushData", customContent); @@ -151,7 +201,7 @@ class _MainPage extends State with WidgetsBindingObserver { if (Platform.isAndroid ? (event["actionType"] == 0) : (event["xg"]["msgtype"] == 1) && - event[Platform.isAndroid ? "customMessage" : "custom"] != null) { + event[Platform.isAndroid ? "customMessage" : "custom"] != null) { SharedPreferences.getInstance().then((value) { value.setString("pushData", event[Platform.isAndroid ? "customMessage" : "custom"]); diff --git a/lib/mine/mine_view/mine_item.dart b/lib/mine/mine_view/mine_item.dart index 108ee702..c346c14c 100644 --- a/lib/mine/mine_view/mine_item.dart +++ b/lib/mine/mine_view/mine_item.dart @@ -157,16 +157,15 @@ class _MineItem extends State { ), ),), ///联系客服 - // Expanded(child: InkWell( - // onTap: () { - // showCallMobile(); - // }, - // child: mineItem( - // "联系客服", - // "assets/image/icon_mine_online_service.png", - // ), - // ),), - Expanded(child:Container()), + Expanded(child: InkWell( + onTap: () { + showCallMobile(); + }, + child: mineItem( + "联系客服", + "assets/image/icon_mine_online_service.webp", + ), + ),), Expanded(child:Container()), Expanded(child:Container()) ], diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index d50b5e95..a6e88c81 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -57,14 +57,14 @@ import 'data/vip_rule_details.dart'; part 'retrofit_api.g.dart'; -const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 -const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const base_url = "https://pos.platform.lotus-wallet.com/app/"; ///正式 +// const baseUrl = "https://pos.platform.lotus-wallet.com/app/"; ///正式 // const base_url = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 -// const base_url = "http://192.168.10.236:8766/app/"; ///费韬 -// const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 +const base_url = "http://192.168.10.236:8766/app/"; ///费韬 +const baseUrl = "http://192.168.10.236:8766/app/"; ///费韬 // const base_url = "http://192.168.10.37:8766/app/"; // const baseUrl = "http://192.168.10.37:8766/app/"; @@ -382,7 +382,7 @@ abstract class ApiService { ///反馈 @POST("/other/report") - Future> report(@Body() Map map); + Future> report(@Body() Map map); ///取消订单 @GET("/order/cancel/{id}") diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index 5706536a..78730b7d 100644 --- a/lib/retrofit/retrofit_api.g.dart +++ b/lib/retrofit/retrofit_api.g.dart @@ -9,7 +9,7 @@ part of 'retrofit_api.dart'; class _ApiService implements ApiService { _ApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; + baseUrl ??= 'http://192.168.10.236:8766/app/'; } final Dio _dio; @@ -1167,7 +1167,7 @@ class _ApiService implements ApiService { } @override - Future> report(map) async { + Future> report(map) async { ArgumentError.checkNotNull(map, 'map'); const _extra = {}; final queryParameters = {}; @@ -1181,7 +1181,7 @@ class _ApiService implements ApiService { extra: _extra, baseUrl: baseUrl), data: _data); - final value = BaseData.fromJson( + final value = BaseData.fromJson( _result.data, (json) => json as bool, ); diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index cf97d1d5..57d2d478 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -140,6 +140,10 @@ class _HelpFeedbackPage extends State { ), InkWell( onTap: () { + if(phoneController.text == ""){ + SmartDialog.showToast("请输入有效手机号码", alignment: Alignment.center); + return; + } report(); }, child: Container( @@ -162,17 +166,16 @@ class _HelpFeedbackPage extends State { } report() async { - var content = editingController.text; - var phone = phoneController.text; BaseData baseData = await apiService.report({ - "mobile": phone, - "reportContent": content, + "mobile": phoneController.text, + "reportContent": editingController.text, }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("反馈成功"); Navigator.of(context).pop(); } else { - SmartDialog.showToast("反馈失败"); + SmartDialog.showToast("反馈成功"); + Navigator.of(context).pop(); } }