From 01dd1bbadd63c63fd8501c164e4c41a8d8d1ac03 Mon Sep 17 00:00:00 2001 From: fmk Date: Mon, 7 Mar 2022 15:24:50 +0800 Subject: [PATCH] =?UTF-8?q?ios,=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner.xcodeproj/project.pbxproj | 12 +++++----- ios/Runner/AppDelegate.mm | 2 ++ lib/address/edit_address_page.dart | 4 ++-- lib/home/home_page.dart | 2 +- lib/home/home_view/coupon.dart | 2 +- lib/home/points_mall_page.dart | 2 +- lib/mine/fans_page.dart | 2 +- lib/mine/manage_address_page.dart | 2 +- lib/mine/mine_vip/binding_assistant_card.dart | 2 +- lib/mine/mine_vip/legal_right_details.dart | 2 +- lib/mine/mine_vip/mine_vip_core.dart | 22 ++++++++++++------- lib/mine/mine_vip_level_page.dart | 2 +- lib/mine/recharge_page.dart | 15 ++++++++----- lib/mine/vip_detail_page.dart | 2 +- lib/order/exchange_order_page.dart | 14 +++++++----- lib/order/order_detail_page.dart | 2 +- lib/order/order_history_page.dart | 2 +- lib/order/order_utils.dart | 14 +++++++----- lib/retrofit/min_api.dart | 8 +++---- lib/retrofit/min_api.g.dart | 2 +- lib/retrofit/retrofit_api.dart | 8 +++---- lib/retrofit/retrofit_api.g.dart | 2 +- lib/setting/help_feedback_page.dart | 2 +- lib/settlement/settlement.dart | 17 ++++++++------ .../activity_coupon_remarks.dart | 2 +- lib/union/union_details_page.dart | 15 ++++++++----- lib/view_widget/hot_item.dart | 2 +- lib/view_widget/new_people_reward.dart | 2 +- lib/web/web_page.dart | 2 +- 29 files changed, 97 insertions(+), 70 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 617a7f3f..f1f65acc 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -616,7 +616,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 75; + CURRENT_PROJECT_VERSION = 78; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -666,7 +666,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.75; + MARKETING_VERSION = 1.0.78; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -816,7 +816,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 75; + CURRENT_PROJECT_VERSION = 78; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -866,7 +866,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.75; + MARKETING_VERSION = 1.0.78; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", @@ -907,7 +907,7 @@ CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; - CURRENT_PROJECT_VERSION = 75; + CURRENT_PROJECT_VERSION = 78; DEVELOPMENT_TEAM = YF3Q8DVP52; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -957,7 +957,7 @@ "$(PROJECT_DIR)/baidu", "$(PROJECT_DIR)/Runner/baidu", ); - MARKETING_VERSION = 1.0.75; + MARKETING_VERSION = 1.0.78; ONLY_ACTIVE_ARCH = YES; OTHER_LDFLAGS = ( "$(inherited)", diff --git a/ios/Runner/AppDelegate.mm b/ios/Runner/AppDelegate.mm index ebfd6726..d7a1f2e5 100644 --- a/ios/Runner/AppDelegate.mm +++ b/ios/Runner/AppDelegate.mm @@ -9,8 +9,10 @@ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GeneratedPluginRegistrant registerWithRegistry:self]; // Override point for customization after application launch. + return [super application:application didFinishLaunchingWithOptions:launchOptions]; + } diff --git a/lib/address/edit_address_page.dart b/lib/address/edit_address_page.dart index a89c5c57..cbe3e17c 100644 --- a/lib/address/edit_address_page.dart +++ b/lib/address/edit_address_page.dart @@ -65,8 +65,8 @@ class _EditAddressPage extends State { child: Column( children: [ Container( - margin: EdgeInsets.only(bottom: 26.h), - padding: EdgeInsets.only(top: 16.h, bottom: 16.h), + margin: EdgeInsets.only(bottom: 23.h), + padding: EdgeInsets.only(top: 16.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, boxShadow: [ diff --git a/lib/home/home_page.dart b/lib/home/home_page.dart index 52e69705..699f988c 100644 --- a/lib/home/home_page.dart +++ b/lib/home/home_page.dart @@ -283,7 +283,7 @@ class HomePageState extends State with AutomaticKeepAliveClientMixin { token: value.getString("token"), ); } - BaseData baseData = await apiService.wiped(memberCouponId); + BaseData baseData = await apiService.wiped(memberCouponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("核销成功", alignment: Alignment.center); } else { diff --git a/lib/home/home_view/coupon.dart b/lib/home/home_view/coupon.dart index 7114a1d7..4eabcbf3 100644 --- a/lib/home/home_view/coupon.dart +++ b/lib/home/home_view/coupon.dart @@ -277,7 +277,7 @@ class _CouponView extends State { } receiveCoupon(couponId) async { - BaseData baseData = await apiService.receiveCoupon(couponId); + BaseData baseData = await apiService.receiveCoupon(couponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { queryCoupon(); showAlertDialog(); diff --git a/lib/home/points_mall_page.dart b/lib/home/points_mall_page.dart index 4e18c64f..e3c86fba 100644 --- a/lib/home/points_mall_page.dart +++ b/lib/home/points_mall_page.dart @@ -72,7 +72,7 @@ class _PointsMallPage extends State queryUser() async { BaseData> banner = await client.queryBanner({ "model": {"type": "CREDIT_INDEX"}, - }); + }).catchError((onError) {}); if (banner != null && banner.isSuccess && diff --git a/lib/mine/fans_page.dart b/lib/mine/fans_page.dart index 65df75bc..d73f6595 100644 --- a/lib/mine/fans_page.dart +++ b/lib/mine/fans_page.dart @@ -83,7 +83,7 @@ class _FansPage extends State { //关注/取关会员 _vipFollow(followId,isFollow) async { - BaseData baseData = await apiService.follow(followId); + BaseData baseData = await apiService.follow(followId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { widget.refresh(); _queryFollowList(); diff --git a/lib/mine/manage_address_page.dart b/lib/mine/manage_address_page.dart index b432cc10..b4bd7968 100644 --- a/lib/mine/manage_address_page.dart +++ b/lib/mine/manage_address_page.dart @@ -271,7 +271,7 @@ class _ManageAddressPage extends State { return AlertDialog( content: Container( width: MediaQuery.of(context).size.width - 84, - height: 110.h, + height: 120.h, child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, diff --git a/lib/mine/mine_vip/binding_assistant_card.dart b/lib/mine/mine_vip/binding_assistant_card.dart index 2dca7b69..fd774a30 100644 --- a/lib/mine/mine_vip/binding_assistant_card.dart +++ b/lib/mine/mine_vip/binding_assistant_card.dart @@ -45,7 +45,7 @@ class _BindingAssistantCard extends State { token: value.getString("token"), ); } - BaseData baseData = await apiService.bindSecondCard(phone); + BaseData baseData = await apiService.bindSecondCard(phone).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("绑定成功", alignment: Alignment.center); Navigator.of(context).pop(true); diff --git a/lib/mine/mine_vip/legal_right_details.dart b/lib/mine/mine_vip/legal_right_details.dart index 21a2ae9d..e1498099 100644 --- a/lib/mine/mine_vip/legal_right_details.dart +++ b/lib/mine/mine_vip/legal_right_details.dart @@ -88,7 +88,7 @@ class _LegalRightDetails extends State { token: value.getString("token"), ); } - BaseData baseData = await apiService.unbindSecondCard(phone); + BaseData baseData = await apiService.unbindSecondCard(phone).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { querySecondCardList(); SmartDialog.showToast("解绑成功", alignment: Alignment.center); diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 5e357a41..6d2546d4 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:dio/dio.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,6 +17,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/mine_vip_view.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -80,7 +83,7 @@ class _MineVipCore extends State { } queryVipLevel() async { - BaseData> rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList().catchError((onError) {}); if (rankData != null && rankData.isSuccess) { ranks.clear(); ranks.addAll(rankData.data); @@ -120,15 +123,18 @@ class _MineVipCore extends State { ///购买会员等级 buyRank() async { - // if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - // await Min.initialize(); - // } + + if(Platform.isAndroid) { + if (!(await Min.isInitialize())) { + //小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + //然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + //故而在此初始化一下 + await Min.initialize(); + } + } BaseData baseData = await apiService - .rankBuy({"buyType": 2, "rankId": ranks[checkIndex].id}); + .rankBuy({"buyType": 2, "rankId": ranks[checkIndex].id}).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { WxPay wxPay = WxPay.fromJson(baseData.data); await registerWxApi( diff --git a/lib/mine/mine_vip_level_page.dart b/lib/mine/mine_vip_level_page.dart index 59690df6..f52db033 100644 --- a/lib/mine/mine_vip_level_page.dart +++ b/lib/mine/mine_vip_level_page.dart @@ -42,7 +42,7 @@ class _MineVipLevelPage extends State { } queryVipLevel() async { - BaseData> rankData = await apiService.rankList(); + BaseData> rankData = await apiService.rankList().catchError((onError) {}); if (rankData != null && rankData.isSuccess) { ranks.clear(); ranks.addAll(rankData.data); diff --git a/lib/mine/recharge_page.dart b/lib/mine/recharge_page.dart index e44217cc..863a5f7a 100644 --- a/lib/mine/recharge_page.dart +++ b/lib/mine/recharge_page.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:dio/dio.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -50,10 +52,10 @@ class _RechargePage extends State { Navigator.of(context).pop(); SmartDialog.showToast("充值成功", alignment: Alignment.center); } - else{ - SmartDialog.showToast("充值失败", alignment: Alignment.center); - return; - } + // else{ + // SmartDialog.showToast("充值失败", alignment: Alignment.center); + // return; + // } }); } @@ -387,15 +389,16 @@ class _RechargePage extends State { return; } + if(Platform.isAndroid){ if (!(await Min.isInitialize())) { // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, // 故而在此初始化一下 await Min.initialize(); - } + }} BaseData baseData = - await apiService.recharge({"amount": amount, "rechargeType": 2}); + await apiService.recharge({"amount": amount, "rechargeType": 2}).catchError((error) {}); if (baseData != null && baseData.isSuccess) { WxPay wxPay = WxPay.fromJson(baseData.data); await registerWxApi( diff --git a/lib/mine/vip_detail_page.dart b/lib/mine/vip_detail_page.dart index 6635bf06..9eff68e3 100644 --- a/lib/mine/vip_detail_page.dart +++ b/lib/mine/vip_detail_page.dart @@ -83,7 +83,7 @@ class _VipDetailPage extends State { "id": widget.arguments["id"], "latitude": "$latitude", "longitude": "$longitude", - }); + }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { vipCard = baseData.data; refreshController.loadComplete(); diff --git a/lib/order/exchange_order_page.dart b/lib/order/exchange_order_page.dart index ccf80c64..d2857d10 100644 --- a/lib/order/exchange_order_page.dart +++ b/lib/order/exchange_order_page.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -12,6 +13,7 @@ import 'package:huixiang/retrofit/data/wx_pay.dart'; import 'package:huixiang/retrofit/min_api.dart'; import 'package:huixiang/retrofit/retrofit_api.dart'; import 'package:huixiang/utils/font_weight.dart'; +import 'package:huixiang/utils/min.dart'; import 'package:huixiang/view_widget/custom_image.dart'; import 'package:huixiang/view_widget/my_appbar.dart'; import 'package:huixiang/view_widget/receiving_method_dialog.dart'; @@ -1084,11 +1086,13 @@ class _ExchangeOrderPage extends State { (widget.arguments["payType"] == 2 && widget.arguments["money"] != "0.00")) && checkIndex == 3) { - // if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - // await Min.initialize(); + // if(Platform.isAndroid){ + // if (!(await Min.isInitialize())) { + // // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // // 故而在此初始化一下 + // await Min.initialize(); + // } // } WxPay wxPay = WxPay.fromJson(baseDate.data); await registerWxApi( diff --git a/lib/order/order_detail_page.dart b/lib/order/order_detail_page.dart index 807fcdfa..18cec76c 100644 --- a/lib/order/order_detail_page.dart +++ b/lib/order/order_detail_page.dart @@ -497,7 +497,7 @@ class _OrderDetailPage extends State { } _orderCancel() async { - BaseData baseData = await apiService.orderCancel(widget.arguments["id"]); + BaseData baseData = await apiService.orderCancel(widget.arguments["id"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); Future.delayed(Duration(milliseconds: 300), () { diff --git a/lib/order/order_history_page.dart b/lib/order/order_history_page.dart index 94172cf1..6196998f 100644 --- a/lib/order/order_history_page.dart +++ b/lib/order/order_history_page.dart @@ -536,7 +536,7 @@ class _OrderHistoryList extends State } orderCancel(String orderId) async { - BaseData baseData = await apiService.orderCancel(orderId); + BaseData baseData = await apiService.orderCancel(orderId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("订单取消成功"); _onRefresh(); diff --git a/lib/order/order_utils.dart b/lib/order/order_utils.dart index 743b21f5..e8ae5452 100644 --- a/lib/order/order_utils.dart +++ b/lib/order/order_utils.dart @@ -1,3 +1,5 @@ +import 'dart:io'; + import 'package:fluwx/fluwx.dart'; import 'package:huixiang/retrofit/data/base_data.dart'; import 'package:huixiang/retrofit/data/order_info.dart'; @@ -37,11 +39,13 @@ class OrderUtils { placeOrderFirst.tableId = orderInfo.tableId; if (placeOrderFirst.payChannel == 1) { - if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - await Min.initialize(); + if(Platform.isAndroid){ + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } } BaseData baseData = await minService .settlementWx(placeOrderFirst.toJson()) diff --git a/lib/retrofit/min_api.dart b/lib/retrofit/min_api.dart index d27c7d0b..d0ac5bec 100644 --- a/lib/retrofit/min_api.dart +++ b/lib/retrofit/min_api.dart @@ -21,8 +21,8 @@ import 'data/shoppingCart.dart'; part 'min_api.g.dart'; -// const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 -// const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 +const base_url = "https://pos.api.lotus-wallet.com/app/"; ///正式 +const baseUrl = "https://pos.api.lotus-wallet.com/app/"; ///正式 // const base_url = "http://user.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -32,8 +32,8 @@ part 'min_api.g.dart'; // const baseUrl = "http://192.168.10.236:8765/app/";///费韬 -const base_url = "http://192.168.10.88:8765/app/";///詹云久 -const baseUrl = "http://192.168.10.88:8765/app/";///詹云久 +// const base_url = "http://192.168.10.143:8765/app/";///詹云久 +// const baseUrl = "http://192.168.10.143:8765/app/";///詹云久 // const base_url = "http://192.168.10.37:8766/app/"; diff --git a/lib/retrofit/min_api.g.dart b/lib/retrofit/min_api.g.dart index 856ae6e1..02d9988a 100644 --- a/lib/retrofit/min_api.g.dart +++ b/lib/retrofit/min_api.g.dart @@ -9,7 +9,7 @@ part of 'min_api.dart'; class _MinApiService implements MinApiService { _MinApiService(this._dio, {this.baseUrl}) { ArgumentError.checkNotNull(_dio, '_dio'); - baseUrl ??= 'http://192.168.10.88:8765/app/'; + baseUrl ??= 'https://pos.api.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index 7206d070..51015734 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -56,8 +56,8 @@ 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://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 // const baseUrl = "http://platform.prod.kunqi.lotus-wallet.com/app/"; ///222 @@ -69,8 +69,8 @@ part 'retrofit_api.g.dart'; // const baseUrl = "http://192.168.10.37:8766/app/"; -const base_url = "http://192.168.10.88:8766/app/";///詹云久 -const baseUrl = "http://192.168.10.88:8766/app/";///詹云久 +// const base_url = "http://192.168.10.143:8766/app/";///詹云久 +// const baseUrl = "http://192.168.10.143:8766/app/";///詹云久 @RestApi(baseUrl: baseUrl) abstract class ApiService { diff --git a/lib/retrofit/retrofit_api.g.dart b/lib/retrofit/retrofit_api.g.dart index aac9c038..7483afa9 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 ??= 'http://192.168.10.88:8766/app/'; + baseUrl ??= 'https://pos.platform.lotus-wallet.com/app/'; } final Dio _dio; diff --git a/lib/setting/help_feedback_page.dart b/lib/setting/help_feedback_page.dart index 8bfc9949..b45d46b1 100644 --- a/lib/setting/help_feedback_page.dart +++ b/lib/setting/help_feedback_page.dart @@ -167,7 +167,7 @@ class _HelpFeedbackPage extends State { BaseData baseData = await apiService.report({ "mobile": phone, "reportContent": content, - }); + }).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("反馈成功"); Navigator.of(context).pop(); diff --git a/lib/settlement/settlement.dart b/lib/settlement/settlement.dart index 60bc4a6c..c3ebabf6 100644 --- a/lib/settlement/settlement.dart +++ b/lib/settlement/settlement.dart @@ -284,8 +284,9 @@ class _Settlement extends State { this.downOrder = baseData.data; querySettlement(); } else { - SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center); - // SmartDialog.showToast(baseData.msg, alignment: Alignment.center); + baseData?.isSuccess ?? false ? + SmartDialog.showToast("下单失败:订单实付金额不能为0", alignment: Alignment.center) : + SmartDialog.showToast(baseData.msg, alignment: Alignment.center); } } else { ///火锅店下单, 等待结算 @@ -333,11 +334,13 @@ class _Settlement extends State { ? minOrderInfo.orderProductVOList : downOrder.orderProductVOList; if (placeOrderFirst.payChannel == 1) { - if (!(await Min.isInitialize())) { - // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, - // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, - // 故而在此初始化一下 - await Min.initialize(); + if(Platform.isAndroid){ + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } } BaseData baseData = await minService .settlementWx(placeOrderFirst.toJson()) diff --git a/lib/settlement/settlement_view/activity_coupon_remarks.dart b/lib/settlement/settlement_view/activity_coupon_remarks.dart index 2eab3dbf..1d112d39 100644 --- a/lib/settlement/settlement_view/activity_coupon_remarks.dart +++ b/lib/settlement/settlement_view/activity_coupon_remarks.dart @@ -200,7 +200,7 @@ class _ActivityCouponRemarks extends State { ), Expanded( child: Text( - widget.remark != ""? widget.remark:"口味、面包硬度等", + widget.remark != "" ? widget.remark:"点击添加备注", textAlign: TextAlign.end, style: TextStyle( fontSize: 14.sp, diff --git a/lib/union/union_details_page.dart b/lib/union/union_details_page.dart index 0dd1def7..bf0798d7 100644 --- a/lib/union/union_details_page.dart +++ b/lib/union/union_details_page.dart @@ -170,7 +170,7 @@ class _UnionDetailsPage extends State { ///领取优惠券 _receiveCoupon(couponId) async { - BaseData baseData = await apiService.receiveCoupon(couponId); + BaseData baseData = await apiService.receiveCoupon(couponId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { queryStoreInfo(); showAlertDialog(); @@ -192,7 +192,7 @@ class _UnionDetailsPage extends State { ///领取VIP _receiveVip() async { - BaseData baseData = await apiService.minLogin(storeInfo.id); + BaseData baseData = await apiService.minLogin(storeInfo.id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast(S.of(context).lingquchenggong, alignment: Alignment.center); @@ -217,7 +217,7 @@ class _UnionDetailsPage extends State { alignment: Alignment.center); return; } - BaseData baseData = await apiService.minLogin(storeInfo.id); + BaseData baseData = await apiService.minLogin(storeInfo.id).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { UserEntity userEntity = UserEntity.fromJson(baseData.data); startMin(userEntity.token, userEntity.userId); @@ -227,8 +227,13 @@ class _UnionDetailsPage extends State { startMin(token, userId) async { if (storeInfo == null) return; if (storeInfo.mini == null) return; - if (!(await Min.isInitialize())) { - await Min.initialize(); + if(Platform.isAndroid){ + if (!(await Min.isInitialize())) { + // 小程序的微信支付和app的充值支付使用同一个WXPayEntryActivity回调, + // 然而充值时小程序未初始化会导致回调内部代码调用getPackage空指针, + // 故而在此初始化一下 + await Min.initialize(); + } } printMin(); String miniAppId = storeInfo.mini.miniAppId; diff --git a/lib/view_widget/hot_item.dart b/lib/view_widget/hot_item.dart index 6a8bb590..ea02621b 100644 --- a/lib/view_widget/hot_item.dart +++ b/lib/view_widget/hot_item.dart @@ -38,7 +38,7 @@ class _HotArticleItem extends State { ///关注/取关会员 _vipFollow(followId) async { - BaseData baseData = await apiService.follow(followId); + BaseData baseData = await apiService.follow(followId).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { SmartDialog.showToast("关注成功"); } diff --git a/lib/view_widget/new_people_reward.dart b/lib/view_widget/new_people_reward.dart index d2f89108..6fb311ec 100644 --- a/lib/view_widget/new_people_reward.dart +++ b/lib/view_widget/new_people_reward.dart @@ -108,7 +108,7 @@ class _NewPeopleReward extends State { Widget rewardItem(FirstLoginCouponList firstLoginCouponList) { return Container( - height:90.h, + // height:90.h, width: double.infinity, decoration: BoxDecoration( image: DecorationImage( diff --git a/lib/web/web_page.dart b/lib/web/web_page.dart index 5b0463ba..0e137ec9 100644 --- a/lib/web/web_page.dart +++ b/lib/web/web_page.dart @@ -318,7 +318,7 @@ class _WebPage extends State with WidgetsBindingObserver { ///删除评论 delComment() async { BaseData baseData = await apiService.delComment( - widget.arguments["activityId"] ?? widget.arguments["articleId"]); + widget.arguments["activityId"] ?? widget.arguments["articleId"]).catchError((onError) {}); if (baseData != null && baseData.isSuccess) { CommentListState _commentList = commentKey.currentState; _commentList.queryMemberCommentList();