Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
bfac3c99
提交
bfac3c99
authored
5月 23, 2019
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
response from auto deduct & change auto-deduct behavoir
上级
86f4940e
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
79 行增加
和
8 行删除
+79
-8
FluwxAutoDeductHandler.kt
...kotlin/com/jarvan/fluwx/handler/FluwxAutoDeductHandler.kt
+2
-1
FluwxResponseHandler.kt
...n/kotlin/com/jarvan/fluwx/handler/FluwxResponseHandler.kt
+19
-0
project.pbxproj
example/ios/Runner.xcodeproj/project.pbxproj
+5
-4
Info.plist
example/ios/Runner/Info.plist
+1
-1
FluwxAutoDeductHandler.m
ios/Classes/handler/FluwxAutoDeductHandler.m
+5
-2
WXApiObject.h
ios/Classes/public/WXApiObject.h
+0
-0
FluwxResponseHandler.m
ios/Classes/wechat/FluwxResponseHandler.m
+14
-0
fluwx_iml.dart
lib/src/fluwx_iml.dart
+12
-0
wechat_response.dart
lib/src/models/wechat_response.dart
+21
-0
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxAutoDeductHandler.kt
浏览文件 @
bfac3c99
...
...
@@ -20,6 +20,7 @@ class FluwxAutoDeductHandler {
val
sign
=
call
.
argument
<
String
>(
"sign"
)
?:
""
val
timestamp
=
call
.
argument
<
String
>(
"timestamp"
)
?:
""
val
returnApp
=
call
.
argument
<
String
>(
"return_app"
)
?:
""
val
businessType
=
call
.
argument
<
Int
>(
"businessType"
)
?:
12
val
map
=
HashMap
<
String
,
String
>()
map
[
"appid"
]
=
appId
...
...
@@ -36,7 +37,7 @@ class FluwxAutoDeductHandler {
val
req
=
WXOpenBusinessWebview
.
Req
()
req
.
businessType
=
12
req
.
businessType
=
businessType
req
.
queryInfo
=
map
val
b
=
WXAPiHandler
.
wxApi
?.
sendReq
(
req
)
result
.
success
(
b
)
...
...
android/src/main/kotlin/com/jarvan/fluwx/handler/FluwxResponseHandler.kt
浏览文件 @
bfac3c99
...
...
@@ -20,6 +20,7 @@ import com.jarvan.fluwx.constant.WechatPluginKeys
import
com.tencent.mm.opensdk.modelbase.BaseResp
import
com.tencent.mm.opensdk.modelbiz.SubscribeMessage
import
com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram
import
com.tencent.mm.opensdk.modelbiz.WXOpenBusinessWebview
import
com.tencent.mm.opensdk.modelmsg.SendAuth
import
com.tencent.mm.opensdk.modelmsg.SendMessageToWX
import
com.tencent.mm.opensdk.modelpay.PayResp
...
...
@@ -46,6 +47,7 @@ object FluwxResponseHandler {
is
PayResp
->
handlePayResp
(
response
)
is
WXLaunchMiniProgram
.
Resp
->
handleLaunchMiniProgramResponse
(
response
)
is
SubscribeMessage
.
Resp
->
handleSubscribeMessage
(
response
)
is
WXOpenBusinessWebview
.
Resp
->
handlerWXOpenBusinessWebviewResponse
(
response
)
}
}
...
...
@@ -131,4 +133,20 @@ object FluwxResponseHandler {
}
private
fun
handlerWXOpenBusinessWebviewResponse
(
response
:
WXOpenBusinessWebview
.
Resp
){
val
result
=
mapOf
(
WechatPluginKeys
.
PLATFORM
to
WechatPluginKeys
.
ANDROID
,
errCode
to
response
.
errCode
,
"businessType"
to
response
.
businessType
,
"resultInfo"
to
response
.
resultInfo
,
errStr
to
response
.
errStr
,
openId
to
response
.
openId
,
type
to
response
.
type
,
WechatPluginKeys
.
TRANSACTION
to
response
.
transaction
)
channel
?.
invokeMethod
(
"onAutoDeductResponse"
,
result
)
}
}
\ No newline at end of file
example/ios/Runner.xcodeproj/project.pbxproj
浏览文件 @
bfac3c99
...
...
@@ -183,6 +183,7 @@
TargetAttributes
=
{
97C146ED1CF9000F007C117D
=
{
CreatedOnToolsVersion
=
7.3.1
;
DevelopmentTeam
=
8JJXUFV6F7
;
SystemCapabilities
=
{
com.apple.BackgroundModes
=
{
enabled
=
1
;
...
...
@@ -437,7 +438,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
=
YES
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
""
;
DEVELOPMENT_TEAM
=
8JJXUFV6F7
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -450,7 +451,7 @@
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
"com.jarvanmo.fluwx-example3"
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.jarvanmo.fluwxexample
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
TARGETED_DEVICE_FAMILY
=
1
;
USER_HEADER_SEARCH_PATHS
=
"\"${PROJECT_DIR}/../..\"/** \"${PROJECT_DIR}/../..\"/**"
;
...
...
@@ -465,7 +466,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES
=
YES
;
CURRENT_PROJECT_VERSION
=
1
;
DEVELOPMENT_TEAM
=
""
;
DEVELOPMENT_TEAM
=
8JJXUFV6F7
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
(
"$(inherited)"
,
...
...
@@ -478,7 +479,7 @@
"$(inherited)"
,
"$(PROJECT_DIR)/Flutter"
,
);
PRODUCT_BUNDLE_IDENTIFIER
=
"com.jarvanmo.fluwx-example3"
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.jarvanmo.fluwxexample
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
TARGETED_DEVICE_FAMILY
=
1
;
USER_HEADER_SEARCH_PATHS
=
"\"${PROJECT_DIR}/../..\"/** \"${PROJECT_DIR}/../..\"/**"
;
...
...
example/ios/Runner/Info.plist
浏览文件 @
bfac3c99
...
...
@@ -5,7 +5,7 @@
<
k
e
y
>
CFBundleDevelopmentRegion
<
/k
e
y
>
<
string
>
en
<
/string
>
<
k
e
y
>
CFBundleDisplayName
<
/k
e
y
>
<
string
>
Fluwx
<
/string
>
<
string
>
Fluwx
Demo
<
/string
>
<
k
e
y
>
CFBundleExecutable
<
/k
e
y
>
<
string
>
$
(
EXECUTABLE_NAME
)<
/string
>
<
k
e
y
>
CFBundleIdentifier
<
/k
e
y
>
...
...
ios/Classes/handler/FluwxAutoDeductHandler.m
浏览文件 @
bfac3c99
...
...
@@ -21,9 +21,12 @@
-
(
void
)
handleAutoDeductWithCall
:
(
FlutterMethodCall
*
)
call
result
:
(
FlutterResult
)
result
{
NSDictionary
*
params
=
call
.
arguments
;
NSMutableDictionary
*
paramsFromDart
=
[
NSMutableDictionary
dictionaryWithDictionary
:
call
.
arguments
];
[
paramsFromDart
removeObjectForKey
:
@"businessType"
];
WXOpenBusinessWebViewReq
*
req
=
[[
WXOpenBusinessWebViewReq
alloc
]
init
];
req
.
businessType
=
12
;
req
.
queryInfoDic
=
params
;
NSNumber
*
businessType
=
call
.
arguments
[
@"businessType"
];
req
.
businessType
=
[
businessType
unsignedIntValue
];
req
.
queryInfoDic
=
paramsFromDart
;
BOOL
b
=
[
WXApi
sendReq
:
req
];
result
(
@
(
b
));
...
...
ios/Classes/public/WXApiObject.h
浏览文件 @
bfac3c99
ios/Classes/wechat/FluwxResponseHandler.m
浏览文件 @
bfac3c99
...
...
@@ -179,6 +179,20 @@ FlutterMethodChannel *fluwxMethodChannel = nil;
fluwxKeyPlatform:
fluwxKeyIOS
,
};
[
fluwxMethodChannel
invokeMethod
:
@"onPayResponse"
arguments
:
result
];
}
else
if
([
resp
isKindOfClass
:[
WXOpenBusinessWebViewResp
class
]]){
WXOpenBusinessWebViewResp
*
businessResp
=
(
WXOpenBusinessWebViewResp
*
)
resp
;
NSDictionary
*
result
=
@{
description:
[
StringUtil
nilToEmpty
:
businessResp
.
description
],
errStr:
[
StringUtil
nilToEmpty
:
resp
.
errStr
],
errCode:
@
(
businessResp
.
errCode
),
type:
businessResp
.
type
==
nil
?
@5
:
@
(
businessResp
.
type
),
@"resultInfo"
:
businessResp
.
result
,
@"businessType"
:
@
(
businessResp
.
businessType
),
fluwxKeyPlatform:
fluwxKeyIOS
,
};
[
fluwxMethodChannel
invokeMethod
:
@"onAutoDeductResponse"
arguments
:
result
];
}
}
...
...
lib/src/fluwx_iml.dart
浏览文件 @
bfac3c99
...
...
@@ -78,6 +78,14 @@ StreamController _onQRCodeScannedController = new StreamController();
///after uer scanned the QRCode you just received
Stream
get
onQRCodeScanned
=>
_onQRCodeScannedController
.
stream
;
StreamController
<
WeChatAutoDeductResponse
>
_responseAutoDeductController
=
new
StreamController
.
broadcast
();
/// Response from AutoDeduct
Stream
<
WeChatAutoDeductResponse
>
get
responseFromAutoDeduct
=>
_responseAutoDeductController
.
stream
;
final
MethodChannel
_channel
=
const
MethodChannel
(
'com.jarvanmo/fluwx'
)
..
setMethodCallHandler
(
_handler
);
...
...
@@ -103,6 +111,8 @@ Future<dynamic> _handler(MethodCall methodCall) {
_onAuthGotQRCodeController
.
add
(
methodCall
.
arguments
);
}
else
if
(
"onQRCodeScanned"
==
methodCall
.
method
)
{
_onQRCodeScannedController
.
add
(
null
);
}
else
if
(
"onAutoDeductResponse"
==
methodCall
.
method
){
_responseAutoDeductController
.
add
(
WeChatAutoDeductResponse
.
fromMap
(
methodCall
.
arguments
));
}
return
Future
.
value
(
true
);
...
...
@@ -313,6 +323,7 @@ Future autoDeDuct({
@required
String
sign
,
@required
String
timestamp
,
String
returnApp
=
'3'
,
int
businessType
=
12
})
async
{
return
await
_channel
.
invokeMethod
(
"autoDeduct"
,
{
'appid'
:
appId
,
...
...
@@ -326,6 +337,7 @@ Future autoDeDuct({
'sign'
:
sign
,
'timestamp'
:
timestamp
,
'return_app'
:
returnApp
,
"businessType"
:
businessType
});
}
...
...
lib/src/models/wechat_response.dart
浏览文件 @
bfac3c99
...
...
@@ -130,3 +130,24 @@ class WeChatSubscribeMsgResp {
reserved
=
map
[
"reserved"
],
scene
=
map
[
"scene"
];
}
class
WeChatAutoDeductResponse
{
final
String
errStr
;
final
int
type
;
final
String
platform
;
final
int
errCode
;
final
int
businessType
;
final
String
resultInfo
;
final
String
androidTransaction
;
final
String
androidOpenId
;
WeChatAutoDeductResponse
.
fromMap
(
Map
map
)
:
platform
=
map
[
"platform"
],
errStr
=
map
[
"errStr"
],
androidTransaction
=
map
[
"transaction"
],
type
=
map
[
"type"
],
errCode
=
map
[
"errCode"
],
androidOpenId
=
map
[
"openId"
],
businessType
=
map
[
"businessType"
],
resultInfo
=
map
[
"resultInfo"
];
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论