Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-app
Commits
23886fc0
Commit
23886fc0
authored
Feb 26, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了充值
parent
62106c9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
54 deletions
+61
-54
recharge.vue
pagesme/goldCoin/recharge.vue
+61
-54
No files found.
pagesme/goldCoin/recharge.vue
View file @
23886fc0
...
...
@@ -96,61 +96,68 @@ export default {
payGoldCoins
(
params
).
then
(
res
=>
{
if
(
res
.
data
.
code
===
200
)
{
const
orderId
=
res
.
data
.
data
.
businessId
// 支付
const
payquery
=
{
orderId
:
orderId
,
type
:
'1'
,
activityId
:
0
if
(
res
.
data
.
data
.
price
>
0
){
// 支付
const
payquery
=
{
orderId
:
orderId
,
type
:
'1'
,
activityId
:
0
}
pay
(
payquery
).
then
(
res
=>
{
console
.
log
(
"支付参数"
,
res
)
console
.
log
(
"测试支付"
,
res
.
data
.
errMsg
)
if
(
res
.
data
.
errMsg
===
'OK'
)
{
if
(
!
res
.
data
.
data
.
nonceStr
)
{
uni
.
showToast
({
title
:
'下单失败,请稍后重试'
,
icon
:
'none'
})
}
else
{
// 调取微信支付窗口
uni
.
requestPayment
({
provider
:
"wxpay"
,
appId
:
res
.
data
.
appid
,
// 微信小程序appid
timeStamp
:
res
.
data
.
timeStamp
,
// 时间戳
nonceStr
:
res
.
data
.
nonceStr
,
// 随机字符串
package
:
res
.
data
.
package
,
signType
:
"MD5"
,
// 签名算法
paySign
:
res
.
data
.
paySign
,
// 签名
success
(
res
)
{
uni
.
showToast
({
title
:
'支付成功'
,
icon
:
'success'
})
this
.
show
=
false
uni
.
navigateTo
({
url
:
'/my/myorder/index'
})
},
fail
(
e
)
{
console
.
log
(
"支付失败"
,
e
)
uni
.
showToast
({
title
:
'支付已取消'
,
icon
:
'none'
})
const
orderStatus
=
{
orderId
:
orderId
,
activityId
:
activityId
}
}
});
}
}
else
{
uni
.
showToast
({
title
:
'下单失败'
,
icon
:
'none'
})
}
})
}
else
{
uni
.
showToast
({
title
:
'充值成功!'
,
icon
:
'success'
})
}
// pay(payquery).then(res => {
// console.log("支付参数", res)
// console.log("测试支付", res.data.errMsg)
// if (res.data.errMsg === 'OK') {
// if (!res.data.data.nonceStr) {
// uni.showToast({
// title: '下单失败,请稍后重试',
// icon: 'none'
// })
// } else {
// // 调取微信支付窗口
// uni.requestPayment({
// provider: "wxpay",
// appId: res.data.appid, // 微信小程序appid
// timeStamp: res.data.timeStamp, // 时间戳
// nonceStr: res.data.nonceStr, // 随机字符串
// package: res.data.package,
// signType: "MD5", // 签名算法
// paySign: res.data.paySign, // 签名
// success(res) {
// uni.showToast({
// title: '支付成功',
// icon: 'success'
// })
// this.show = false
// uni.navigateTo({
// url:'/my/myorder/index'
// })
// },
// fail(e) {
// console.log("支付失败", e)
// uni.showToast({
// title: '支付已取消',
// icon: 'none'
// })
// const orderStatus = {
// orderId: orderId,
// activityId: activityId
// }
// }
// });
// }
// } else {
// uni.showToast({
// title: '下单失败',
// icon: 'none'
// })
// }
// })
}
else
if
(
res
.
data
.
code
!==
200
){
uni
.
showToast
({
title
:
res
.
data
.
message
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment