Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dxw_sdk_release
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
JIRA
JIRA
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
open
dxw_sdk_release
Commits
afb99301
提交
afb99301
authored
6月 27, 2019
作者:
王进
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
客服切支付增加返回值2
上级
3178ff6b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
10 行删除
+16
-10
SDK.ts
20190627/SDK.ts
+16
-10
没有找到文件。
20190
514
/SDK.ts
→
20190
627
/SDK.ts
浏览文件 @
afb99301
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* @time: 2018-09-19
* @time: 2018-09-19
*/
*/
class
WechatSDK
{
class
WechatSDK
{
private
sdkVersion
:
string
=
'2.
0
'
private
sdkVersion
:
string
=
'2.
1
'
public
constructor
()
{
public
constructor
()
{
this
.
sdkInit
()
this
.
sdkInit
()
this
.
timerInit
();
this
.
timerInit
();
...
@@ -36,7 +36,7 @@ class WechatSDK {
...
@@ -36,7 +36,7 @@ class WechatSDK {
const
options
=
_selt
.
getOptionsInfo
();
// 返回参数对象
const
options
=
_selt
.
getOptionsInfo
();
// 返回参数对象
_selt
.
ReportParams
.
from
=
options
.
from
||
0
;
_selt
.
ReportParams
.
from
=
options
.
from
||
0
;
_selt
.
ReportParams
.
tag
=
options
.
tag
||
0
;
_selt
.
ReportParams
.
tag
=
options
.
tag
||
0
;
_selt
.
ReportParams
.
passthroughParams
=
options
.
tag
||
''
;
_selt
.
ReportParams
.
passthroughParams
=
options
.
passthroughParams
||
''
;
_selt
.
ReportParams
.
fromOpenId
=
options
.
fromOpenId
||
''
;
_selt
.
ReportParams
.
fromOpenId
=
options
.
fromOpenId
||
''
;
_selt
.
actId
=
options
.
actId
||
''
;
_selt
.
actId
=
options
.
actId
||
''
;
await
_selt
.
getNetworkType
();
await
_selt
.
getNetworkType
();
...
@@ -176,6 +176,7 @@ class WechatSDK {
...
@@ -176,6 +176,7 @@ class WechatSDK {
}
}
}
}
_selt
.
showModal
(
params
);
_selt
.
showModal
(
params
);
return
2
;
}
else
{
}
else
{
// 根据返回的用户订单状态判断是新订单还是未完成订单
// 根据返回的用户订单状态判断是新订单还是未完成订单
if
(
res
.
data
.
order_type
==
1
)
{
// 新订单
if
(
res
.
data
.
order_type
==
1
)
{
// 新订单
...
@@ -251,7 +252,7 @@ class WechatSDK {
...
@@ -251,7 +252,7 @@ class WechatSDK {
}
}
if
(
res
.
dialog
==
1
)
_selt
.
showModal
(
params
);
if
(
res
.
dialog
==
1
)
_selt
.
showModal
(
params
);
return
3023
;
return
3023
;
}
else
{
// 输出订单失败消息
}
else
{
// 输出订单失败消息
const
errmsg
=
res
.
msg
||
'支付失败..'
const
errmsg
=
res
.
msg
||
'支付失败..'
if
(
showSDKAlert
)
_selt
.
sdkAlert
(
errmsg
);
if
(
showSDKAlert
)
_selt
.
sdkAlert
(
errmsg
);
return
0
;
return
0
;
...
@@ -820,8 +821,9 @@ class WechatSDK {
...
@@ -820,8 +821,9 @@ class WechatSDK {
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
let
ShareParams
=
{
let
ShareParams
=
{
title
:
shareInfo
.
share_title
?
shareInfo
.
share_title
:
SDKConfig
.
shareTitle
,
title
:
shareInfo
.
title
?
shareInfo
.
title
:
SDKConfig
.
shareTitle
,
imageUrl
:
shareInfo
.
share_image
?
shareInfo
.
share_image
:
SDKConfig
.
shareImageUrl
,
imageUrl
:
shareInfo
.
image
?
shareInfo
.
image
:
SDKConfig
.
shareImageUrl
,
imageId
:
shareInfo
.
imageId
?
shareInfo
.
imageId
:
SDKConfig
.
shareImageId
,
query
:
'fromOpenId='
+
_self
.
ReportParams
.
openId
+
'&from=share&tag=0&actId='
+
actId
query
:
'fromOpenId='
+
_self
.
ReportParams
.
openId
+
'&from=share&tag=0&actId='
+
actId
}
}
console
.
log
(
"^^SDK::ShareParams"
,
ShareParams
);
console
.
log
(
"^^SDK::ShareParams"
,
ShareParams
);
...
@@ -835,7 +837,7 @@ class WechatSDK {
...
@@ -835,7 +837,7 @@ class WechatSDK {
}
}
private
shareInit
()
{
private
shareInit
()
{
(
wx
as
any
).
showShareMenu
({
(
wx
as
any
).
showShareMenu
({
withShareTicket
:
'true'
,
withShareTicket
:
true
,
success
:
()
=>
{
},
success
:
()
=>
{
},
fail
:
()
=>
{
},
fail
:
()
=>
{
},
complete
:
()
=>
{
}
complete
:
()
=>
{
}
...
@@ -849,6 +851,7 @@ class WechatSDK {
...
@@ -849,6 +851,7 @@ class WechatSDK {
const
ShareParams
=
{
const
ShareParams
=
{
title
:
shareInfo
.
title
?
shareInfo
.
title
:
SDKConfig
.
shareTitle
,
title
:
shareInfo
.
title
?
shareInfo
.
title
:
SDKConfig
.
shareTitle
,
imageUrl
:
shareInfo
.
image
?
shareInfo
.
image
:
SDKConfig
.
shareImageUrl
,
imageUrl
:
shareInfo
.
image
?
shareInfo
.
image
:
SDKConfig
.
shareImageUrl
,
imageUrlId
:
shareInfo
.
imageId
?
shareInfo
.
imageId
:
SDKConfig
.
shareImageId
,
query
:
'fromOpenId='
+
that
.
ReportParams
.
openId
+
'&from=share&tag=0&'
+
(
shareInfo
.
query
?
shareInfo
.
query
:
''
),
query
:
'fromOpenId='
+
that
.
ReportParams
.
openId
+
'&from=share&tag=0&'
+
(
shareInfo
.
query
?
shareInfo
.
query
:
''
),
withShareTicket
:
true
,
withShareTicket
:
true
,
success
:
shareInfo
.
success
,
success
:
shareInfo
.
success
,
...
@@ -865,17 +868,19 @@ class WechatSDK {
...
@@ -865,17 +868,19 @@ class WechatSDK {
const
ShareParams
=
{
const
ShareParams
=
{
title
:
SDKConfig
.
shareTitle
,
title
:
SDKConfig
.
shareTitle
,
imageUrl
:
SDKConfig
.
shareImageUrl
,
imageUrl
:
SDKConfig
.
shareImageUrl
,
imageId
:
SDKConfig
.
shareImageId
,
query
:
'fromOpenId='
+
that
.
ReportParams
.
openId
+
'&from=share&tag=0&'
+
(
params
?
params
:
''
)
query
:
'fromOpenId='
+
that
.
ReportParams
.
openId
+
'&from=share&tag=0&'
+
(
params
?
params
:
''
)
}
}
return
this
.
share
(
ShareParams
)
return
this
.
share
(
ShareParams
)
}
}
public
ShareGameInfo
(
share
Obj
?)
{
public
ShareGameInfo
(
share
Info
?)
{
const
that
=
this
const
that
=
this
// 参数,记录分享的用户openid
// 参数,记录分享的用户openid
const
ShareParams
=
{
const
ShareParams
=
{
title
:
shareObj
&&
shareObj
.
title
?
shareObj
.
title
:
SDKConfig
.
shareTitle
,
title
:
shareInfo
&&
shareInfo
.
title
?
shareInfo
.
title
:
SDKConfig
.
shareTitle
,
imageUrl
:
shareObj
&&
shareObj
.
image
?
shareObj
.
image
:
SDKConfig
.
shareImageUrl
,
imageUrl
:
shareInfo
&&
shareInfo
.
image
?
shareInfo
.
image
:
SDKConfig
.
shareImageUrl
,
query
:
'fromOpenId='
+
that
.
ReportParams
.
openId
+
'&from=share&tag=0&'
+
(
shareObj
.
extraData
?
shareObj
.
extraData
:
''
)
imageId
:
shareInfo
&&
shareInfo
.
imageId
?
shareInfo
.
imageId
:
SDKConfig
.
shareImageId
,
query
:
'fromOpenId='
+
that
.
ReportParams
.
openId
+
'&from=share&tag=0&'
+
(
shareInfo
.
extraData
?
shareInfo
.
extraData
:
''
)
}
}
return
this
.
share
(
ShareParams
)
return
this
.
share
(
ShareParams
)
}
}
...
@@ -943,6 +948,7 @@ const Links = {
...
@@ -943,6 +948,7 @@ const Links = {
class
shareInfo
{
class
shareInfo
{
title
?:
string
title
?:
string
image
?:
string
image
?:
string
imageId
?
:
string
query
?:
string
query
?:
string
success
:
any
success
:
any
fail
:
any
fail
:
any
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论