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
01dbaaa7
提交
01dbaaa7
authored
8月 21, 2018
作者:
王进
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改支付bug
上级
85db121b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
28 行删除
+12
-28
SDK.ts
20180821/SDK.ts
+12
-28
没有找到文件。
20180821/SDK.ts
浏览文件 @
01dbaaa7
...
@@ -184,17 +184,19 @@ class WechatSDK {
...
@@ -184,17 +184,19 @@ class WechatSDK {
if
(
res
.
data
.
order_type
==
1
)
{
// 新订单
if
(
res
.
data
.
order_type
==
1
)
{
// 新订单
that
.
MidasPaymentParams
.
buyQuantity
=
<
number
>
(
Params
.
money
/
100
)
*
<
number
>
res
.
data
.
weixin_proportion
// 充值金额
that
.
MidasPaymentParams
.
buyQuantity
=
<
number
>
(
Params
.
money
/
100
)
*
<
number
>
res
.
data
.
weixin_proportion
// 充值金额
this
.
printf
(
"SDK -> 发起支付参数:"
,
0
)
this
.
printf
(
"SDK -> 发起支付参数:"
,
0
)
this
.
printf
(
that
.
MidasPaymentParams
,
0
)
this
.
printf
(
that
.
MidasPaymentParams
,
0
)
;
// 调微信米大师支付接口
// 调微信米大师支付接口
that
.
pay
(
that
.
MidasPaymentParams
)
(
wx
as
any
).
requestMidasPayment
(
that
.
deepCopy
({},
that
.
MidasPaymentParams
,
{
.
then
(()
=>
{
// 支付成功
success
:
function
(
res
)
{
th
is
.
printf
(
"SDK -> 支付成功:"
,
0
)
th
at
.
printf
(
"SDK -> 支付成功:"
,
0
)
th
is
.
printf
(
res
,
0
)
th
at
.
printf
(
res
,
0
)
that
.
getCoins
(
that
.
deepCopy
({},
that
.
sdkParams
,
{
order_num
:
res
.
data
.
order_num
}))
that
.
getCoins
(
that
.
deepCopy
({},
that
.
sdkParams
,
{
order_num
:
res
.
data
.
order_num
}))
},
err
=>
{
// 支付失败
},
this
.
printf
(
"SDK -> 支付失败:"
,
0
)
fail
:
function
(
err
)
{
this
.
printf
(
err
,
0
)
that
.
printf
(
"SDK -> 支付失败:"
,
0
)
})
that
.
printf
(
err
,
0
)
}
}));
}
else
{
// 已有未完成订单,弹窗提示
}
else
{
// 已有未完成订单,弹窗提示
const
params
=
{
const
params
=
{
title
:
SDKConfig
.
shareTitle
,
title
:
SDKConfig
.
shareTitle
,
...
@@ -405,7 +407,7 @@ class WechatSDK {
...
@@ -405,7 +407,7 @@ class WechatSDK {
// 米大师支付参数
// 米大师支付参数
private
MidasPaymentParams
=
{
private
MidasPaymentParams
=
{
mode
:
'game'
,
// 支付的类型
mode
:
'game'
,
// 支付的类型
env
:
'
1
'
,
// 米大师环境配置, 0:正式环境, 1:沙盒模式
env
:
'
0
'
,
// 米大师环境配置, 0:正式环境, 1:沙盒模式
offerId
:
null
,
// 在米大师侧申请的应用id
offerId
:
null
,
// 在米大师侧申请的应用id
currencyType
:
'CNY'
,
// 币种
currencyType
:
'CNY'
,
// 币种
platform
:
'android'
,
platform
:
'android'
,
...
@@ -501,24 +503,6 @@ class WechatSDK {
...
@@ -501,24 +503,6 @@ class WechatSDK {
console
.
log
(
error
)
console
.
log
(
error
)
})
})
}
}
private
async
pay
(
params
):
Promise
<
any
>
{
const
that
=
this
return
new
Promise
((
resolve
,
reject
)
=>
{
(
wx
as
any
).
requestMidasPayment
(
that
.
deepCopy
(
params
,
{
success
:
function
(
res
)
{
resolve
(
res
)
},
fail
:
function
(
res
)
{
reject
(
res
)
},
complete
:
function
()
{
console
.
log
(
"Rechare"
)
}
}))
}).
catch
((
error
)
=>
{
console
.
log
(
error
)
})
}
private
shareInit
()
{
private
shareInit
()
{
(
wx
as
any
).
showShareMenu
({
(
wx
as
any
).
showShareMenu
({
withShareTicket
:
true
,
withShareTicket
:
true
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论