Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
f254588d
提交
f254588d
authored
3月 08, 2020
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bugs
上级
2b1d8f12
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
22 行增加
和
18 行删除
+22
-18
FluwxShareHandler.kt
...ain/kotlin/com/jarvan/fluwx/handlers/FluwxShareHandler.kt
+4
-10
share_models.dart
lib/src/share/share_models.dart
+18
-8
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/handlers/FluwxShareHandler.kt
浏览文件 @
f254588d
...
...
@@ -3,7 +3,6 @@ package com.jarvan.fluwx.handlers
import
android.Manifest
import
android.content.Context
import
android.content.pm.PackageManager
import
android.util.Log
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.Fragment
import
com.jarvan.fluwx.io.ImagesIO
...
...
@@ -53,14 +52,12 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
}
private
fun
shareText
(
call
:
MethodCall
,
result
:
MethodChannel
.
Result
)
{
val
textObj
=
WXTextObject
()
textObj
.
text
=
call
.
argument
(
"source"
)
val
textObj
=
WXTextObject
(
call
.
argument
<
String
?>(
"source"
))
val
msg
=
WXMediaMessage
()
msg
.
mediaObject
=
textObj
val
req
=
SendMessageToWX
.
Req
()
req
.
message
=
msg
setCommonArguments
(
call
,
req
,
msg
)
req
.
message
=
msg
result
.
success
(
WXAPiHandler
.
wxApi
?.
sendReq
(
req
))
}
...
...
@@ -113,7 +110,6 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
msg
.
mediaObject
=
imageObject
msg
.
thumbData
=
thumbData
msg
.
title
=
call
.
argument
<
String
>(
keyTitle
)
msg
.
description
=
call
.
argument
<
String
>(
keyDescription
)
val
req
=
SendMessageToWX
.
Req
()
...
...
@@ -137,7 +133,6 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
}
val
msg
=
WXMediaMessage
()
msg
.
mediaObject
=
music
msg
.
title
=
call
.
argument
(
keyTitle
)
msg
.
description
=
call
.
argument
(
keyDescription
)
launch
{
...
...
@@ -161,7 +156,6 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
}
val
msg
=
WXMediaMessage
()
msg
.
mediaObject
=
video
msg
.
title
=
call
.
argument
(
keyTitle
)
msg
.
description
=
call
.
argument
(
keyDescription
)
launch
{
...
...
@@ -180,7 +174,6 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
val
msg
=
WXMediaMessage
()
msg
.
mediaObject
=
webPage
msg
.
title
=
call
.
argument
(
keyTitle
)
msg
.
description
=
call
.
argument
(
keyDescription
)
launch
{
...
...
@@ -199,7 +192,6 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
val
msg
=
WXMediaMessage
()
msg
.
mediaObject
=
file
msg
.
title
=
call
.
argument
(
"title"
)
msg
.
description
=
call
.
argument
(
"description"
)
launch
{
...
...
@@ -230,6 +222,8 @@ internal class FluwxShareHandler(private val flutterAssets: FlutterPlugin.Flutte
msg
.
messageAction
=
call
.
argument
<
String
?>(
"messageAction"
)
msg
.
messageExt
=
call
.
argument
<
String
?>(
"messageExt"
)
msg
.
mediaTagName
=
call
.
argument
<
String
?>(
"mediaTagName"
)
msg
.
title
=
call
.
argument
<
String
?>(
keyTitle
)
msg
.
description
=
call
.
argument
<
String
?>(
keyDescription
)
req
.
transaction
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
)
val
sceneIndex
=
call
.
argument
<
Int
?>(
"scene"
)
req
.
scene
=
when
(
sceneIndex
)
{
...
...
lib/src/share/share_models.dart
浏览文件 @
f254588d
...
...
@@ -42,13 +42,19 @@ class WeChatShareTextModel implements WeChatShareBaseModel {
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
final
String
title
;
final
String
description
;
WeChatShareTextModel
(
this
.
source
,
{
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
scene
!=
null
);
this
.
messageExt
,
String
description
,
String
title
})
:
assert
(
scene
!=
null
),
this
.
title
=
title
??
source
,
this
.
description
=
description
??
source
;
@override
Map
toMap
()
{
...
...
@@ -57,7 +63,9 @@ class WeChatShareTextModel implements WeChatShareBaseModel {
_source:
source
,
_messageExt:
messageExt
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
_mediaTagName:
mediaTagName
,
_title:
title
,
_description:
description
};
}
}
...
...
@@ -105,7 +113,7 @@ class WeChatShareMiniProgramModel implements WeChatShareBaseModel {
"userName"
:
userName
,
"path"
:
path
,
"title"
:
title
,
"description"
:
description
,
_description
:
description
,
"withShareTicket"
:
withShareTicket
,
_thumbnail:
thumbnail
?.
toMap
(),
"hdImagePath"
:
hdImagePath
?.
toMap
(),
...
...
@@ -257,15 +265,16 @@ class WeChatShareWebPageModel implements WeChatShareBaseModel {
WeChatShareWebPageModel
(
this
.
webPage
,
{
this
.
title
:
""
,
this
.
description
:
""
,
String
description
,
this
.
thumbnail
,
this
.
scene
=
WeChatScene
.
SESSION
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
})
:
assert
(
webPage
!=
null
),
:
assert
(
webPage
!=
null
&&
webPage
.
isNotEmpty
),
assert
(
thumbnail
!=
null
),
assert
(
scene
!=
null
);
assert
(
scene
!=
null
),
this
.
description
=
description
??
webPage
;
@override
Map
toMap
()
{
...
...
@@ -275,7 +284,8 @@ class WeChatShareWebPageModel implements WeChatShareBaseModel {
_thumbnail:
thumbnail
?.
toMap
(),
_title:
title
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
_mediaTagName:
mediaTagName
,
_description:
description
};
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论