diff --git a/android/app/build.gradle b/android/app/build.gradle index 0981cf9f..15b3218a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -29,6 +29,8 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" def mfph = [ //宿主包名 "apk.applicationId" : "com.zsw.huixiang", + XG_ACCESS_ID : "1580005689", // 信鸽官网注册所得ACCESS_ID + XG_ACCESS_KEY : "A1HKKUUWI7WI", ] android { @@ -48,6 +50,11 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName + ndk { + /// 选择要添加的对应.so 库。 + abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a' + } + manifestPlaceholders = mfph } @@ -108,4 +115,5 @@ dependencies { implementation "com.facebook.fresco:animated-gif:1.13.0" implementation 'com.github.bumptech.glide:glide:4.12.0' implementation 'com.alibaba:fastjson:1.2.54' + } diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index b4781f76..88d008e7 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -36,6 +36,7 @@ + + = 2.7.5) - Toast (4.0.0) - TOCropViewController (2.6.0) + - TPNS-iOS (1.3.3.0) + - tpns_flutter_plugin (1.1.2): + - Flutter + - TPNS-iOS (= 1.3.3.0) - video_player (0.0.1): - Flutter - wakelock (0.0.1): @@ -59,9 +61,9 @@ DEPENDENCIES: - package_info (from `.symlinks/plugins/package_info/ios`) - path_provider (from `.symlinks/plugins/path_provider/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - - share (from `.symlinks/plugins/share/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - sqflite (from `.symlinks/plugins/sqflite/ios`) + - tpns_flutter_plugin (from `.symlinks/plugins/tpns_flutter_plugin/ios`) - video_player (from `.symlinks/plugins/video_player/ios`) - wakelock (from `.symlinks/plugins/wakelock/ios`) - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) @@ -74,6 +76,7 @@ SPEC REPOS: - FMDB - Toast - TOCropViewController + - TPNS-iOS - WechatOpenSDK EXTERNAL SOURCES: @@ -97,12 +100,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider/ios" permission_handler: :path: ".symlinks/plugins/permission_handler/ios" - share: - :path: ".symlinks/plugins/share/ios" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" sqflite: :path: ".symlinks/plugins/sqflite/ios" + tpns_flutter_plugin: + :path: ".symlinks/plugins/tpns_flutter_plugin/ios" video_player: :path: ".symlinks/plugins/video_player/ios" wakelock: @@ -125,11 +128,12 @@ SPEC CHECKSUMS: package_info: 873975fc26034f0b863a300ad47e7f1ac6c7ec62 path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 - share: 0b2c3e82132f5888bccca3351c504d0003b3b410 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d sqflite: 6d358c025f5b867b29ed92fc697fd34924e11904 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 TOCropViewController: 3105367e808b7d3d886a74ff59bf4804e7d3ab38 + TPNS-iOS: 57a146496858ba2fb5d43e5f240feb19243b69cb + tpns_flutter_plugin: a366649c8ad71f19dfb864d3c994ed0480b69daa video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e wakelock: bfc7955c418d0db797614075aabbc58a39ab5107 webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 7215222f..defdf6be 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -2,10 +2,6 @@ - CFBundleURLSchemes - - wx3b269e795ed23e5f - CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -30,6 +26,10 @@ $(MARKETING_VERSION) CFBundleSignature ???? + CFBundleURLSchemes + + wx3b269e795ed23e5f + CFBundleURLTypes @@ -49,6 +49,7 @@ weixinULAPI weixin + wechat LSRequiresIPhoneOS @@ -59,12 +60,18 @@ NSAppleMusicUsageDescription 是否允许访问媒体 + NSBonjourServices + + _dartobservatory._tcp + NSCalendarsUsageDescription 是否允许访问日历 NSCameraUsageDescription 打开相机拍照 NSContactsUsageDescription 是否允许访问联系人信息 + NSLocalNetworkUsageDescription + NSLocationAlwaysAndWhenInUseUsageDescription 定位 NSLocationAlwaysUsageDescription @@ -81,6 +88,10 @@ 打开相册 NSSpeechRecognitionUsageDescription 是否允许语音识别 + UIBackgroundModes + + remote-notification + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/lib/address/address_map_page.dart b/lib/address/address_map_page.dart index 94eede08..f9c72432 100644 --- a/lib/address/address_map_page.dart +++ b/lib/address/address_map_page.dart @@ -315,7 +315,7 @@ class _AddressMapPage extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - address.cityInfo, + address.cityInfo ?? "", overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16.sp, diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index b1de27fe..ee5fc292 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -131,15 +131,17 @@ class _EditAddressPage extends State { toMap() async { Navigator.of(context).pushNamed('/router/address_map_page').then( (value) => { - addressMap = value, - addressController.text = - "${(value as Map)['province']}${(value as Map)['city']}${(value as Map)['area']}", - if(preAddress != null) { - preAddress.province = addressMap['province'], - preAddress.city = addressMap['city'], - preAddress.area = addressMap['area'], - }, - houseNumberController.text = "${(value as Map)['address']}", + if (value != null) { + addressMap = value, + addressController.text = + "${(value as Map)['province']}${(value as Map)['city']}${(value as Map)['area']}", + if(preAddress != null) { + preAddress.province = addressMap['province'], + preAddress.city = addressMap['city'], + preAddress.area = addressMap['area'], + }, + houseNumberController.text = "${(value as Map)['address']}", + } // setState(() {}) }, ); diff --git a/lib/article/hot_article_details_page.dart b/lib/article/hot_article_details_page.dart index 6d8bc126..15c45128 100644 --- a/lib/article/hot_article_details_page.dart +++ b/lib/article/hot_article_details_page.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:huixiang/generated/l10n.dart'; -import 'package:share/share.dart'; class HotArticleDetailsPage extends StatefulWidget { @override diff --git a/lib/home/huixiang_brand_page.dart b/lib/home/huixiang_brand_page.dart index a681c42f..ec66a456 100644 --- a/lib/home/huixiang_brand_page.dart +++ b/lib/home/huixiang_brand_page.dart @@ -16,7 +16,6 @@ import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:huixiang/view_widget/loading_view.dart'; import 'package:huixiang/view_widget/store_title_tab.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -81,7 +80,6 @@ class _BrandPage extends State if (event.type < 3) { setState(() {}); } - ; }); } diff --git a/lib/home/main_home_page.dart b/lib/home/main_home_page.dart index 98755834..65c67d82 100644 --- a/lib/home/main_home_page.dart +++ b/lib/home/main_home_page.dart @@ -34,7 +34,7 @@ class _MainHomePage extends State print("object: MainHomePage"); if (event.type < 3) { setState(() {}); - }; + } }); } diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 3fbc516f..38e61165 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -1,5 +1,4 @@ import 'dart:convert'; -import 'dart:io'; import 'dart:ui'; import 'package:flutter/cupertino.dart'; @@ -60,7 +59,7 @@ class _PointsMallPage extends State } if (event.type == 3) { refreshUserInfo(); - }; + } }); } diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index 93c825ce..531f8cfd 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; diff --git a/lib/integral_store/integral_store_details_page.dart b/lib/integral_store/integral_store_details_page.dart index 4e90a255..5fa1ae67 100644 --- a/lib/integral_store/integral_store_details_page.dart +++ b/lib/integral_store/integral_store_details_page.dart @@ -3,7 +3,6 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_swiper/flutter_swiper.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/goods.dart'; diff --git a/lib/main.dart b/lib/main.dart index 25c2c3c6..9dabfa61 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -47,12 +47,12 @@ import 'package:huixiang/setting/permission_setting_page.dart'; import 'package:huixiang/setting/setting_page.dart'; import 'package:huixiang/setting/treaty_page.dart'; -// import 'package:huixiang/ui_test.dart'; import 'package:huixiang/union/store_details_page.dart'; import 'package:huixiang/union/union_details_page.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'main_page.dart'; import 'mine/manage_address_page.dart'; @@ -78,6 +78,15 @@ void main() async { runApp(MyApp(locale)); } +initSdk() async { + print("object: initsdk"); + ///ios 调用startXg前需要调用此方法 + XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); + xgFlutterPlugin.configureClusterDomainName("tpns.sh.tencent.com"); + ///此处配置为iOS的appID信息,Android信息在build.gradle文件中 + xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); +} + EventBus eventBus = EventBus(sync: true); class MyApp extends StatelessWidget { diff --git a/lib/main_page.dart b/lib/main_page.dart index 6604c044..8dc519ff 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -31,6 +31,10 @@ class _MainPage extends State { @override void initState() { super.initState(); + + + initSdk(); + _widgetOptions = [ BrandPage(), MainHomePage(), @@ -54,7 +58,7 @@ class _MainPage extends State { eventBus.on().listen((event) { if (event.type < 3) { setState(() {}); - }; + } }); queryUserInfo(); diff --git a/lib/mine/coupons_page.dart b/lib/mine/coupons_page.dart index dcf9815b..a912b91f 100644 --- a/lib/mine/coupons_page.dart +++ b/lib/mine/coupons_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index 018f7454..90ec2e31 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/address.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; diff --git a/lib/mine/mine_card_invalid_page.dart b/lib/mine/mine_card_invalid_page.dart index dc2c677d..585b67b6 100644 --- a/lib/mine/mine_card_invalid_page.dart +++ b/lib/mine/mine_card_invalid_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; diff --git a/lib/mine/mine_page.dart b/lib/mine/mine_page.dart index c8393ad8..ac958cc5 100644 --- a/lib/mine/mine_page.dart +++ b/lib/mine/mine_page.dart @@ -12,7 +12,6 @@ import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/view_widget/classic_header.dart'; import 'package:huixiang/view_widget/custom_image.dart'; -import 'package:huixiang/view_widget/loading_view.dart'; import 'package:huixiang/view_widget/login_tips.dart'; import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:pull_to_refresh/pull_to_refresh.dart'; @@ -64,7 +63,7 @@ class _MinePage extends State with AutomaticKeepAliveClientMixin { } if (event.type == 3) { refreshUserInfo(); - }; + } }); } diff --git a/lib/mine/mine_wallet_page.dart b/lib/mine/mine_wallet_page.dart index 4cc11ea5..f1744b18 100644 --- a/lib/mine/mine_wallet_page.dart +++ b/lib/mine/mine_wallet_page.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/page.dart'; diff --git a/lib/mine/roll_center_page.dart b/lib/mine/roll_center_page.dart index 594258fd..99ed4c66 100644 --- a/lib/mine/roll_center_page.dart +++ b/lib/mine/roll_center_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; diff --git a/lib/mine/vip_balance_page.dart b/lib/mine/vip_balance_page.dart index 5cd8c9ae..1dc53fb7 100644 --- a/lib/mine/vip_balance_page.dart +++ b/lib/mine/vip_balance_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/coupon.dart'; diff --git a/lib/mine/vip_card_page.dart b/lib/mine/vip_card_page.dart index 12c57f10..208e487d 100644 --- a/lib/mine/vip_card_page.dart +++ b/lib/mine/vip_card_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/vip_card.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index e380da02..fd47d13d 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -1,7 +1,6 @@ import 'package:barcode_widget/barcode_widget.dart'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/vip_card.dart'; diff --git a/lib/order/exchange_history_page.dart b/lib/order/exchange_history_page.dart index 691d882b..444f0623 100644 --- a/lib/order/exchange_history_page.dart +++ b/lib/order/exchange_history_page.dart @@ -1,7 +1,6 @@ import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/exchange_order.dart'; diff --git a/lib/order/exchange_order_success_page.dart b/lib/order/exchange_order_success_page.dart index 5e5974a2..25f1ac78 100644 --- a/lib/order/exchange_order_success_page.dart +++ b/lib/order/exchange_order_success_page.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/user_info.dart'; diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 494c576a..2107b6ba 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -1,6 +1,5 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index a4e4f998..5f69c9db 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -1,6 +1,5 @@ import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; diff --git a/lib/retrofit/data/store.dart b/lib/retrofit/data/store.dart index 80dd4143..aa19822a 100644 --- a/lib/retrofit/data/store.dart +++ b/lib/retrofit/data/store.dart @@ -1,4 +1,5 @@ +import 'package:huixiang/retrofit/data/coupon_vo.dart'; import 'package:huixiang/retrofit/data/store_type.dart'; @@ -33,6 +34,7 @@ class Store { String address; String headName; String headMobile; + CouponVo couponVO; dynamic deliveryInfo; String businessType; StoreType posType; @@ -68,6 +70,7 @@ class Store { ..headMobile = json['headMobile'] as String ..deliveryInfo = json['deliveryInfo'] ..businessType = json['businessType'] as String + ..couponVO = json['couponVO'] == null ? null : CouponVo.fromJson(json['couponVO']) ..posType = json['posType'] == null ? null : StoreType.fromJson(json['posType'] as Map); @@ -103,7 +106,10 @@ class Store { 'headMobile': this.headMobile, 'deliveryInfo': this.deliveryInfo, 'businessType': this.businessType, + 'couponVO': this.couponVO.toJson(), 'posType': this.posType, }; } + + diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 80193654..fe5c22f1 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -60,6 +60,7 @@ abstract class ApiService { debugPrint("code = ${response.statusCode}"); p(jsonEncode(response.data)); Map map = response.data; + if (map["code"] == 40005 || map["code"] == 40001) { // Navigator.pushAndRemoveUntil(context, MaterialPageRoute( // builder: (BuildContext context) { @@ -76,7 +77,8 @@ abstract class ApiService { ), clickBgDismissTemp: false, ); - } else if (map["code"] != 0) { + } else if (map["code"] != 0 && response.request.baseUrl == baseUrl) { + ///高德地图的poi服务请求不需要toast SmartDialog.showToast(map["msg"]); } debugPrint("======================= 响应数据结束 =======================\n"); diff --git a/lib/setting/permission_setting_page.dart b/lib/setting/permission_setting_page.dart index 1fbeb301..eb2c8bef 100644 --- a/lib/setting/permission_setting_page.dart +++ b/lib/setting/permission_setting_page.dart @@ -6,8 +6,6 @@ import 'package:huixiang/generated/l10n.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/view_widget/request_permission.dart'; import 'package:permission_handler/permission_handler.dart'; -import 'package:permission_handler/permission_handler.dart'; -import 'package:permission_handler/permission_handler.dart'; class PermissionSettingPage extends StatefulWidget { @override @@ -219,6 +217,7 @@ class _PermissionSettingPage extends State { CupertinoSwitch( value: (permissionSwitch.containsKey(permission) && permissionSwitch[permission]), + onChanged: (boo){}, ), ], ), diff --git a/lib/setting/setting_page.dart b/lib/setting/setting_page.dart index 5f5dd950..8a65f791 100644 --- a/lib/setting/setting_page.dart +++ b/lib/setting/setting_page.dart @@ -11,7 +11,6 @@ import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/round_button.dart'; import 'package:path_provider/path_provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; -import 'package:flutter_cache_manager/flutter_cache_manager.dart'; class SettingPage extends StatefulWidget { @override diff --git a/lib/union/store_details_page.dart b/lib/union/store_details_page.dart index 252fad0c..5c8fc01b 100644 --- a/lib/union/store_details_page.dart +++ b/lib/union/store_details_page.dart @@ -1,16 +1,14 @@ - import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/image_render.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:fluwx/fluwx.dart'; import 'package:huixiang/retrofit/data/activity.dart'; import 'package:huixiang/retrofit/data/article.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; -import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; -import 'package:share/share.dart'; import 'package:shared_preferences/shared_preferences.dart'; class StoreDetailsPage extends StatefulWidget { @@ -25,27 +23,27 @@ class StoreDetailsPage extends StatefulWidget { } class _StoreDetailsPage extends State { - ApiService apiService; - + @override void initState() { super.initState(); - + SharedPreferences.getInstance().then((value) { - apiService = ApiService(Dio(), context: context, token: value.getString("token")); + apiService = + ApiService(Dio(), context: context, token: value.getString("token")); queryHtml(); }); - } Activity activity; Article article; queryHtml() async { - BaseData baseData = await apiService.informationInfo(widget.arguments["activityId"] ?? widget.arguments["articleId"]); + BaseData baseData = await apiService.informationInfo( + widget.arguments["activityId"] ?? widget.arguments["articleId"]); - if(baseData != null && baseData.isSuccess) { + if (baseData != null && baseData.isSuccess) { if (widget.arguments.containsKey("activityId")) { activity = Activity.fromJson(baseData.data); } else if (widget.arguments.containsKey("articleId")) { @@ -53,30 +51,39 @@ class _StoreDetailsPage extends State { } setState(() {}); } - } - + + share2WeChat() async { + await registerWxApi(appId: "wx3b269e795ed23e5f", doOnAndroid: true, universalLink: "https://hx.lotus-wallet.com/app/"); + shareToWeChat(WeChatShareWebPageModel( + "http://share-app.api.lotus-wallet.com/#/share?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}", + scene: WeChatScene.SESSION)); + } + @override Widget build(BuildContext context) { return Scaffold( appBar: MyAppBar( action: Container( - margin: EdgeInsets.only(right: 15), - child: GestureDetector( - onTap: () { - - Share.share('http://share-app.api.lotus-wallet.com/#/share?id=${widget.arguments["activityId"] ?? widget.arguments["articleId"]}'); - }, - child: Icon( - Icons.share, - size: 24, - color: Colors.black, - ), - ), + margin: EdgeInsets.only(right: 15), + child: GestureDetector( + onTap: () { + share2WeChat(); + }, + child: Icon( + Icons.share, + size: 24, + color: Colors.black, ), + ), + ), background: Color(0xFFF7F7F7), leadingColor: Colors.black, - title: activity != null ? activity.mainTitle : article != null ? article.mainTitle : "", + title: activity != null + ? activity.mainTitle + : article != null + ? article.mainTitle + : "", titleSize: 18.sp, titleColor: Colors.black, ), @@ -89,7 +96,11 @@ class _StoreDetailsPage extends State { padding: EdgeInsets.all(12), alignment: Alignment.centerLeft, child: Text( - activity != null ? activity.mainTitle : article != null ? article.mainTitle : "", + activity != null + ? activity.mainTitle + : article != null + ? article.mainTitle + : "", style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, @@ -111,8 +122,9 @@ class _StoreDetailsPage extends State { ), ), onTap: () { - if(activity != null) { - Navigator.of(context).pushNamed('/router/union_detail_page', + if (activity != null) { + Navigator.of(context).pushNamed( + '/router/union_detail_page', arguments: {"id": activity.storeId}); } }, @@ -121,7 +133,11 @@ class _StoreDetailsPage extends State { width: 10, ), Text( - activity != null ? activity.createTime : article != null ? article.createTime : "", + activity != null + ? activity.createTime + : article != null + ? article.createTime + : "", style: TextStyle( fontWeight: FontWeight.normal, fontSize: 12.sp, @@ -132,17 +148,20 @@ class _StoreDetailsPage extends State { ), ), Html( - data: activity != null ? activity.content : article != null ? article.content : "", + data: activity != null + ? activity.content + : article != null + ? article.content + : "", customImageRenders: { base64DataUriMatcher(): base64ImageRender(), assetUriMatcher(): assetImageRender(), - networkSourceMatcher(extension: "svg"): svgNetworkImageRender(), - networkSourceMatcher(): networkImageRender( - loadingWidget: () { - // return Image.asset("assets/image/default_1.png",); - return Container(); - } - ), + networkSourceMatcher(extension: "svg"): + svgNetworkImageRender(), + networkSourceMatcher(): networkImageRender(loadingWidget: () { + // return Image.asset("assets/image/default_1.png",); + return Container(); + }), }, ), ], diff --git a/lib/union/union_page.dart b/lib/union/union_page.dart index 322bdebc..2b8248e3 100644 --- a/lib/union/union_page.dart +++ b/lib/union/union_page.dart @@ -72,7 +72,6 @@ class _UnionPage extends State aMapFlutterLocation.destroy(); refreshController.dispose(); - } bool isKeyBoardShow = false; @@ -142,7 +141,7 @@ class _UnionPage extends State print("object: UnionPage"); if (event.type < 3) { setState(() {}); - }; + } }); } @@ -151,7 +150,8 @@ class _UnionPage extends State onceLocation: true, locationMode: AMapLocationMode.Hight_Accuracy, desiredAccuracy: DesiredAccuracy.HundredMeters, - desiredLocationAccuracyAuthorizationMode: AMapLocationAccuracyAuthorizationMode.FullAndReduceAccuracy, + desiredLocationAccuracyAuthorizationMode: + AMapLocationAccuracyAuthorizationMode.FullAndReduceAccuracy, pausesLocationUpdatesAutomatically: true, )); @@ -176,7 +176,9 @@ class _UnionPage extends State SharedPreferences.getInstance().then( (value) => { apiService = ApiService(Dio(), - context: context, token: value.getString('token'), showLoading: false), + context: context, + token: value.getString('token'), + showLoading: false), if (value.containsKey("latitude") && value.containsKey("longitude") && value.containsKey("province") && @@ -234,8 +236,7 @@ class _UnionPage extends State .toList(); buildMarker(); refreshController.refreshCompleted(); - if(mounted) - setState(() {}); + if (mounted) setState(() {}); } else { refreshController.refreshFailed(); } @@ -265,8 +266,7 @@ class _UnionPage extends State icon: bitmapDescriptor, infoWindowEnable: true, ))); - if(mounted) - setState(() {}); + if (mounted) setState(() {}); } List markers = []; @@ -274,9 +274,6 @@ class _UnionPage extends State @override Widget build(BuildContext context) { super.build(context); - AMapApiKey aMapApiKeys = AMapApiKey( - androidKey: 'f39d1daa020a56f208eb2519f63e9534', - iosKey: 'feaae7986201b571cace1b83728be5bb'); return GestureDetector( onTap: () { FocusScope.of(context).requestFocus(FocusNode()); @@ -696,7 +693,17 @@ class _UnionPage extends State ), Container( child: Text( - S.of(context).manlijiandaijinquan(50, 25), + store.couponVO == null + ? "" + : store.couponVO.bizType == 1 + ? S.of(context).manlijiandaijinquan( + double.tryParse(store.couponVO.fullAmount) + .toInt(), + double.tryParse(store.couponVO.discountAmount) + .toInt()) + : S + .of(context) + .quanchangzhe(store.couponVO.discountPercent), style: TextStyle( color: Color(0xFFFF7A1A), fontSize: 10.sp, diff --git a/lib/view_widget/login_tips.dart b/lib/view_widget/login_tips.dart index 0b295688..e0f2b124 100644 --- a/lib/view_widget/login_tips.dart +++ b/lib/view_widget/login_tips.dart @@ -1,13 +1,9 @@ - - - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; -import 'package:shared_preferences/shared_preferences.dart'; class LoginTips extends StatelessWidget { diff --git a/pubspec.lock b/pubspec.lock index c4312d4c..9fcca84d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -735,13 +735,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.26.0" - share: - dependency: "direct main" - description: - name: share - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.4+5" shared_preferences: dependency: "direct main" description: @@ -887,6 +880,15 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.1+3" + tpns_flutter_plugin: + dependency: "direct main" + description: + path: "." + ref: "V1.1.2" + resolved-ref: b814d62f4b82422459f786671f23dd535062d503 + url: "https://github.com/TencentCloud/TPNS-Flutter-Plugin" + source: git + version: "1.1.2" transformer_page_view: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 405b0528..76a0e108 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -30,6 +30,12 @@ dependencies: keframe: ^2.0.2 #滑动组件卡顿优化 + tpns_flutter_plugin: + git: + url: https://github.com/TencentCloud/TPNS-Flutter-Plugin + ref: V1.1.2 +# tpns_flutter_plugin: ^1.1.0 + barcode_widget: ^2.0.1 cupertino_icons: ^1.0.2 # flutter_swiper_null_safety: ^1.0.2 @@ -41,8 +47,6 @@ dependencies: permission_handler: ^5.0.1+1 amap_flutter_map: ^1.0.0 amap_flutter_location: ^2.0.0 # Null safety - share_plus: ^2.1.4 - sharesdk_plugin: ^1.3.0 # flutter_baidu_mapapi_search: ^2.0.1 # flutter_baidu_mapapi_map: ^2.0.1