mirror of
https://github.com/little-snow-fox/react-native-wechat-lib.git
synced 2026-01-22 23:52:04 +08:00
fix 修复多余调用代码导致的报错
This commit is contained in:
parent
23fb934cf0
commit
c3209151a1
@ -498,26 +498,26 @@ RCT_EXPORT_METHOD(launchMiniProgram:(NSDictionary *)data
|
|||||||
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
|
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
|
||||||
}
|
}
|
||||||
|
|
||||||
RCT_EXPORT_METHOD(pay:(NSDictionary *)data
|
//RCT_EXPORT_METHOD(pay:(NSDictionary *)data
|
||||||
:(RCTResponseSenderBlock)callback)
|
// :(RCTResponseSenderBlock)callback)
|
||||||
{
|
//{
|
||||||
PayReq* req = [PayReq new];
|
// PayReq* req = [PayReq new];
|
||||||
req.partnerId = data[@"partnerId"];
|
// req.partnerId = data[@"partnerId"];
|
||||||
req.prepayId = data[@"prepayId"];
|
// req.prepayId = data[@"prepayId"];
|
||||||
req.nonceStr = data[@"nonceStr"];
|
// req.nonceStr = data[@"nonceStr"];
|
||||||
req.timeStamp = [data[@"timeStamp"] unsignedIntValue];
|
// req.timeStamp = [data[@"timeStamp"] unsignedIntValue];
|
||||||
req.package = data[@"package"];
|
// req.package = data[@"package"];
|
||||||
req.sign = data[@"sign"];
|
// req.sign = data[@"sign"];
|
||||||
void ( ^ completion )( BOOL );
|
// void ( ^ completion )( BOOL );
|
||||||
completion = ^( BOOL success )
|
// completion = ^( BOOL success )
|
||||||
{
|
// {
|
||||||
callback(@[success ? [NSNull null] : INVOKE_FAILED]);
|
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
|
||||||
return;
|
// return;
|
||||||
};
|
// };
|
||||||
[WXApi sendReq:req completion:completion];
|
// [WXApi sendReq:req completion:completion];
|
||||||
// BOOL success = [WXApi sendReq:req];
|
// // BOOL success = [WXApi sendReq:req];
|
||||||
// callback(@[success ? [NSNull null] : INVOKE_FAILED]);
|
// // callback(@[success ? [NSNull null] : INVOKE_FAILED]);
|
||||||
}
|
//}
|
||||||
|
|
||||||
#pragma mark - wx callback
|
#pragma mark - wx callback
|
||||||
|
|
||||||
@ -566,14 +566,14 @@ RCT_EXPORT_METHOD(pay:(NSDictionary *)data
|
|||||||
else {
|
else {
|
||||||
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
|
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
|
||||||
}
|
}
|
||||||
} else if ([resp isKindOfClass:[PayResp class]]) {
|
// } else if ([resp isKindOfClass:[PayResp class]]) {
|
||||||
PayResp *r = (PayResp *)resp;
|
// PayResp *r = (PayResp *)resp;
|
||||||
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
|
// NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
|
||||||
body[@"errStr"] = r.errStr;
|
// body[@"errStr"] = r.errStr;
|
||||||
body[@"type"] = @(r.type);
|
// body[@"type"] = @(r.type);
|
||||||
body[@"returnKey"] =r.returnKey;
|
// body[@"returnKey"] =r.returnKey;
|
||||||
body[@"type"] = @"PayReq.Resp";
|
// body[@"type"] = @"PayReq.Resp";
|
||||||
[self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
|
// [self.bridge.eventDispatcher sendDeviceEventWithName:RCTWXEventName body:body];
|
||||||
} else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]){
|
} else if ([resp isKindOfClass:[WXLaunchMiniProgramResp class]]){
|
||||||
WXLaunchMiniProgramResp *r = (WXLaunchMiniProgramResp *)resp;
|
WXLaunchMiniProgramResp *r = (WXLaunchMiniProgramResp *)resp;
|
||||||
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
|
NSMutableDictionary *body = @{@"errCode":@(r.errCode)}.mutableCopy;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "react-native-wechat-lib",
|
"name": "react-native-wechat-lib",
|
||||||
"version": "1.1.18",
|
"version": "1.1.19-notpay",
|
||||||
"description": "react-native library for wechat app. 支持分享和拉起小程序。",
|
"description": "react-native library for wechat app. 支持分享和拉起小程序。",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
1
react-native-wechat-lib
Symbolic link
1
react-native-wechat-lib
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
react-native-wechat-lib
|
||||||
Loading…
x
Reference in New Issue
Block a user