diff --git a/android/app/build.gradle b/android/app/build.gradle index be6c78ab..2856cd40 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -190,6 +190,8 @@ dependencies { implementation 'com.github.bumptech.glide:glide:4.12.0' implementation 'com.alibaba:fastjson:1.2.54' + implementation 'com.tencent.tpns:xiaomi:1.2.7.1-release' + implementation 'com.tencent.tpns:huawei:1.2.6.0-release' // HMS Core Push 模块依赖包 implementation 'com.huawei.hms:push:5.3.0.304' diff --git a/android/app/src/main/assets/data/dcloud_control.xml b/android/app/src/main/assets/data/dcloud_control.xml index 9d47b136..0047994b 100644 --- a/android/app/src/main/assets/data/dcloud_control.xml +++ b/android/app/src/main/assets/data/dcloud_control.xml @@ -1,4 +1,4 @@ - + diff --git a/android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt b/android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt index dbf6f7f3..a24157de 100644 --- a/android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt +++ b/android/app/src/main/kotlin/com/zsw/huixiang/MinPlugin.kt @@ -24,7 +24,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler { /// This local reference serves to register the plugin with the Flutter Engine and unregister it /// when the Flutter Engine is detached from the Activity private lateinit var channel : MethodChannel - private lateinit var context : Context; + private lateinit var context : Context override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { context = flutterPluginBinding.applicationContext; @@ -44,7 +44,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler { .setMenuDefFontColor("#000000") .setMenuDefFontWeight("normal") .setMenuActionSheetItems(sheetItems) - .setEnableBackground(true) + .setEnableBackground(false) //后台运行 .build() DCUniMPSDK.getInstance().initialize(context, config) { result.success(it) @@ -60,6 +60,7 @@ class MinPlugin: FlutterPlugin, MethodCallHandler { } DCUniMPSDK.getInstance().setUniMPOnCloseCallBack { Logger.e("用户点击了退出 it: $it") + DCUniMPSDK.getInstance().closeCurrentApp() } } } else if (call.method == "isInitialize") { diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index 13a653c8..63c291b1 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -85,11 +85,12 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { Image image; buildImageInfo(BuildContext context) async { image = Image.asset("assets/image/laoban.png"); + double screenWidth = MediaQuery.of(this.context).size.width; image.image .resolve(ImageConfiguration()) .addListener(ImageStreamListener((ImageInfo info, bool _) { double width = info.image.width.toDouble(); - double screenWidth = 375; + if (!mounted) return; if ((width / screenWidth) < rota) { rota = (screenWidth * 1.04) / width; } @@ -98,22 +99,11 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { })); } - @override - void didChangeDependencies() { - super.didChangeDependencies(); - - - } - @override void initState() { super.initState(); isLogin(); - try { - buildImageInfo(this.context); - } catch(ex) {} - } initController() { @@ -390,6 +380,10 @@ class _MyLoginPageState extends State with TickerProviderStateMixin { @override Widget build(BuildContext context) { + try { + buildImageInfo(this.context); + } catch(ex) {} + if (animatedContainer != null && !animatedContainer.isAnimating) { animatedContainer.forward(); } diff --git a/lib/main.dart b/lib/main.dart index b01f9a15..af44729f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -110,8 +110,9 @@ initSdk() async { if (Platform.isAndroid) { XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); //小米 - // androidApi.setMiPushAppId(appId:"APP_ID"); - // androidApi.setMiPushAppKey(appKey: "APPKEY"); + androidApi.setMiPushAppId(appId:"2882303761520050452"); + androidApi.setMiPushAppKey(appKey: "5582005091452"); + androidApi.enableOtherPush(); androidApi.regPush(); } diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 5545e91d..e070783a 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -37,11 +37,11 @@ import 'data/wx_pay.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://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/"; diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index 4fad9362..1ee9fccc 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -190,6 +190,7 @@ class _SettingPage extends State { if (miniAppids != null && miniAppids.length > 0) { miniAppids.forEach((element) async { print("appid: $element"); + await Min.closeCurrentApp(); String path = await Min.getAppBasePath(element); AppUtils.deleteDirectory(Directory(path)); String filePath = ""; diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 9846ed31..b28747fd 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -265,8 +265,8 @@ class _UnionDetailsPage extends State { "tenantCode": storeInfo.tenantCode, if (latitude != null && longitude != null) "position": "$latitude,$longitude", - "baseURL": "https://pos.api.lotus-wallet.com/app/", - // "baseURL": "http://192.168.10.236:8765/app/", + // "baseURL": "https://pos.api.lotus-wallet.com/app/", + "baseURL": "http://192.168.10.236:8765/app/", "uid": userId, "userInfo": { "nickname": nickname, diff --git a/lib/union/union_view/store_info.dart b/lib/union/union_view/store_info.dart index 64ad292a..f8dc7373 100644 --- a/lib/union/union_view/store_info.dart +++ b/lib/union/union_view/store_info.dart @@ -66,35 +66,37 @@ class _StoreInfos extends State { children: [ Row( children: [ - Text( - widget.storeInfo != null - ? widget.storeInfo.storeName - : "", - style: TextStyle( - fontSize: 16.sp, - color: Colors.black, - fontWeight: MyFontWeight.medium, - ), - ), Expanded( child: Container( alignment: - Alignment.centerRight, + Alignment.centerLeft, child: Text( - S.of(context).ren( - widget.storeInfo != null - ? widget.storeInfo - .perCapitaConsumption - : "", - ), + widget.storeInfo != null + ? widget.storeInfo.storeName + : "", + overflow: TextOverflow.ellipsis, style: TextStyle( - fontSize: 14.sp, - fontWeight: MyFontWeight.regular, - color: Color(0xFF353535), + fontSize: 16.sp, + color: Colors.black, + fontWeight: MyFontWeight.medium, ), ), ), ), + Text( + S.of(context).ren( + widget.storeInfo != null + ? widget.storeInfo + .perCapitaConsumption + : "", + ), + overflow: TextOverflow.ellipsis, + style: TextStyle( + fontSize: 14.sp, + fontWeight: MyFontWeight.regular, + color: Color(0xFF353535), + ), + ), ], ), Text( @@ -117,10 +119,8 @@ class _StoreInfos extends State { ), ), Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: - CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Expanded( child: Text( diff --git a/lib/view_widget/mine_vip_view.dart b/lib/view_widget/mine_vip_view.dart index 713572e8..1aac0318 100644 --- a/lib/view_widget/mine_vip_view.dart +++ b/lib/view_widget/mine_vip_view.dart @@ -312,9 +312,10 @@ class MineVipView extends StatelessWidget { }); } }, - child: (tag == null || tag == "") - ? widget - : Hero(tag: tag, child: widget), + child: widget, + //(tag == null || tag == "") + // ? widget + // : Hero(tag: tag, child: widget) ); } }