Browse Source

[modify]去除微信sdk

Destiny 1 year ago
parent
commit
a1740e5f6b

BIN
assets/images/icon_store_alipay.webp


BIN
assets/images/icon_store_wechat_pay.webp


+ 0 - 12
ios/Podfile.lock

@@ -104,14 +104,6 @@ PODS:
   - webview_flutter_wkwebview (0.0.1):
     - Flutter
     - FlutterMacOS
-  - wechat_kit (6.0.2):
-    - Flutter
-    - wechat_kit/no_pay (= 6.0.2)
-    - wechat_kit/vendor (= 6.0.2)
-  - wechat_kit/no_pay (6.0.2):
-    - Flutter
-  - wechat_kit/vendor (6.0.2):
-    - Flutter
 
 DEPENDENCIES:
   - app_links (from `.symlinks/plugins/app_links/ios`)
@@ -142,7 +134,6 @@ DEPENDENCIES:
   - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
   - wakelock_plus (from `.symlinks/plugins/wakelock_plus/ios`)
   - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/darwin`)
-  - wechat_kit (from `.symlinks/plugins/wechat_kit/ios`)
 
 SPEC REPOS:
   trunk:
@@ -211,8 +202,6 @@ EXTERNAL SOURCES:
     :path: ".symlinks/plugins/wakelock_plus/ios"
   webview_flutter_wkwebview:
     :path: ".symlinks/plugins/webview_flutter_wkwebview/darwin"
-  wechat_kit:
-    :path: ".symlinks/plugins/wechat_kit/ios"
 
 SPEC CHECKSUMS:
   app_links: e7a6750a915a9e161c58d91bc610e8cd1d4d0ad0
@@ -250,7 +239,6 @@ SPEC CHECKSUMS:
   video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
   wakelock_plus: 78ec7c5b202cab7761af8e2b2b3d0671be6c4ae1
   webview_flutter_wkwebview: 0982481e3d9c78fd5c6f62a002fcd24fc791f1e4
-  wechat_kit: b6853fe0933b9a60a008a508e709c14f6ed2dc70
 
 PODFILE CHECKSUM: 7caf336f823524274eee12d7eeb37414067cfdfd
 

+ 5 - 5
lib/module/store/view.dart

@@ -576,11 +576,11 @@ class StorePage extends BasePage<StoreController> {
 extension on PaymentWay {
   get _icon {
     switch (payMethod) {
-      case PayMethod.alipay:
-        return Assets.images.iconStoreAlipay.image(width: 20.w, height: 20.w);
-      case PayMethod.wechat:
-        return Assets.images.iconStoreWechatPay
-            .image(width: 20.w, height: 20.w);
+      // case PayMethod.alipay:
+      //   return Assets.images.iconStoreAlipay.image(width: 20.w, height: 20.w);
+      // case PayMethod.wechat:
+      //   return Assets.images.iconStoreWechatPay
+      //       .image(width: 20.w, height: 20.w);
       default:
         return Container();
     }

+ 4 - 3
lib/sdk/pay/agile_pay.dart

@@ -23,9 +23,10 @@ class AgilePay {
     // if (payInfo is AliPayInfo) {
     //   iAgilePay = Alipay(payInfo);
     // } else
-    if (payInfo is WechatPayInfo) {
-      iAgilePay = WechatPay(payInfo);
-    } else if (payInfo is ApplePayInfo) {
+    // if (payInfo is WechatPayInfo) {
+    //   iAgilePay = WechatPay(payInfo);
+    // } else
+    if (payInfo is ApplePayInfo) {
       iAgilePay = ApplePay(payInfo);
     } else if (payInfo is GooglePayInfo) {
       iAgilePay = GooglePay(payInfo);

+ 78 - 78
lib/sdk/pay/wxpay/wechat_pay.dart

@@ -1,88 +1,88 @@
-import 'dart:async';
+// import 'dart:async';
 
-import 'package:electronic_assistant/sdk/pay/wxpay/wechat_pay_info.dart';
-import 'package:flutter/widgets.dart';
-import 'package:wechat_kit/wechat_kit.dart';
+// import 'package:electronic_assistant/sdk/pay/wxpay/wechat_pay_info.dart';
+// import 'package:flutter/widgets.dart';
+// import 'package:wechat_kit/wechat_kit.dart';
 
-import '../assist/agile_pay_state_info.dart';
-import '../code/agile_pay_code.dart';
-import '../listener/i_agile_pay.dart';
+// import '../assist/agile_pay_state_info.dart';
+// import '../code/agile_pay_code.dart';
+// import '../listener/i_agile_pay.dart';
 
-class WechatPay extends AgilePayStateInfo implements IAgilePay {
-  late final StreamSubscription<WechatResp> _respSubs;
+// class WechatPay extends AgilePayStateInfo implements IAgilePay {
+//   late final StreamSubscription<WechatResp> _respSubs;
 
-  final WechatPayInfo _payInfo;
+//   final WechatPayInfo _payInfo;
 
-  WechatPay(this._payInfo) {
-    _respSubs = WechatKitPlatform.instance.respStream().listen(_listenResp);
-  }
+//   WechatPay(this._payInfo) {
+//     _respSubs = WechatKitPlatform.instance.respStream().listen(_listenResp);
+//   }
 
-  void _listenResp(WechatResp resp) {
-    try {
-      if (resp is WechatPayResp) {
-        final String content = 'pay: ${resp.errorCode} ${resp.errorMsg}';
-        debugPrint('agilePay-wechat---> $content');
-        if (resp.errorCode == WechatResp.kErrorCodeSuccess) {
-          sendPaySuccess(resp.returnKey);
-        } else if (resp.errorCode == WechatResp.kErrorCodeUserCancel) {
-          sendError(AgilePayCode.payCodeCancelError,
-              AgilePayCode.getMessageByCode(AgilePayCode.payCodeCancelError));
-        } else {
-          sendError(resp.errorCode, resp.errorMsg);
-        }
-      }
-    } catch (e) {
-      sendError(AgilePayCode.payCodeOtherError,
-          AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
-    } finally {
-      dispose();
-    }
-  }
+//   void _listenResp(WechatResp resp) {
+//     try {
+//       if (resp is WechatPayResp) {
+//         final String content = 'pay: ${resp.errorCode} ${resp.errorMsg}';
+//         debugPrint('agilePay-wechat---> $content');
+//         if (resp.errorCode == WechatResp.kErrorCodeSuccess) {
+//           sendPaySuccess(resp.returnKey);
+//         } else if (resp.errorCode == WechatResp.kErrorCodeUserCancel) {
+//           sendError(AgilePayCode.payCodeCancelError,
+//               AgilePayCode.getMessageByCode(AgilePayCode.payCodeCancelError));
+//         } else {
+//           sendError(resp.errorCode, resp.errorMsg);
+//         }
+//       }
+//     } catch (e) {
+//       sendError(AgilePayCode.payCodeOtherError,
+//           AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
+//     } finally {
+//       dispose();
+//     }
+//   }
 
-  Future<bool> isInstalled() {
-    return WechatKitPlatform.instance.isInstalled();
-  }
+//   Future<bool> isInstalled() {
+//     return WechatKitPlatform.instance.isInstalled();
+//   }
 
-  @override
-  void pay() async {
-    sendPayBefore();
-    try {
-      await WechatKitPlatform.instance.registerApp(
-          appId: _payInfo.appId, universalLink: _payInfo.universalLink);
-      if (await check()) {
-        if (await isInstalled()) {
-          try {
-            WechatKitPlatform.instance.pay(
-                appId: _payInfo.appId,
-                partnerId: _payInfo.partnerId,
-                prepayId: _payInfo.prepayId,
-                package: _payInfo.package,
-                nonceStr: _payInfo.noncestr,
-                timeStamp: _payInfo.timestamp,
-                sign: _payInfo.sign);
-          } catch (e) {
-            sendError(AgilePayCode.payCodePayError,
-                AgilePayCode.getMessageByCode(AgilePayCode.payCodePayError));
-          }
-        } else {
-          sendError(AgilePayCode.payCodeWxEnvError,
-              AgilePayCode.getMessageByCode(AgilePayCode.payCodeWxEnvError));
-        }
-      } else {
-        sendError(AgilePayCode.payCodeWxEnvError,
-            AgilePayCode.getMessageByCode(AgilePayCode.payCodeWxEnvError));
-      }
-    } catch (e) {
-      sendError(AgilePayCode.payCodeOtherError,
-          AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
-    }
-  }
+//   @override
+//   void pay() async {
+//     sendPayBefore();
+//     try {
+//       await WechatKitPlatform.instance.registerApp(
+//           appId: _payInfo.appId, universalLink: _payInfo.universalLink);
+//       if (await check()) {
+//         if (await isInstalled()) {
+//           try {
+//             WechatKitPlatform.instance.pay(
+//                 appId: _payInfo.appId,
+//                 partnerId: _payInfo.partnerId,
+//                 prepayId: _payInfo.prepayId,
+//                 package: _payInfo.package,
+//                 nonceStr: _payInfo.noncestr,
+//                 timeStamp: _payInfo.timestamp,
+//                 sign: _payInfo.sign);
+//           } catch (e) {
+//             sendError(AgilePayCode.payCodePayError,
+//                 AgilePayCode.getMessageByCode(AgilePayCode.payCodePayError));
+//           }
+//         } else {
+//           sendError(AgilePayCode.payCodeWxEnvError,
+//               AgilePayCode.getMessageByCode(AgilePayCode.payCodeWxEnvError));
+//         }
+//       } else {
+//         sendError(AgilePayCode.payCodeWxEnvError,
+//             AgilePayCode.getMessageByCode(AgilePayCode.payCodeWxEnvError));
+//       }
+//     } catch (e) {
+//       sendError(AgilePayCode.payCodeOtherError,
+//           AgilePayCode.getMessageByCode(AgilePayCode.payCodeOtherError));
+//     }
+//   }
 
-  Future<bool> check() async {
-    return WechatKitPlatform.instance.isSupportApi();
-  }
+//   Future<bool> check() async {
+//     return WechatKitPlatform.instance.isSupportApi();
+//   }
 
-  void dispose() {
-    _respSubs.cancel();
-  }
-}
+//   void dispose() {
+//     _respSubs.cancel();
+//   }
+// }

+ 1 - 1
pubspec.yaml

@@ -105,7 +105,7 @@ dependencies:
     path: plugin/atmob_channel_reader
 
   #支付
-  wechat_kit: ^6.0.1
+  # wechat_kit: ^6.0.1
   in_app_purchase: ^3.2.0
 
   #并发