Commit 23886fc0 authored by liwei's avatar liwei

修改了充值

parent 62106c9a
...@@ -96,61 +96,68 @@ export default { ...@@ -96,61 +96,68 @@ export default {
payGoldCoins(params).then(res => { payGoldCoins(params).then(res => {
if (res.data.code === 200) { if (res.data.code === 200) {
const orderId = res.data.data.businessId const orderId = res.data.data.businessId
if (res.data.data.price > 0){
// 支付 // 支付
const payquery = { const payquery = {
orderId: orderId, orderId: orderId,
type:'1', type:'1',
activityId: 0 activityId: 0
} }
// pay(payquery).then(res => { pay(payquery).then(res => {
// console.log("支付参数", res) console.log("支付参数", res)
// console.log("测试支付", res.data.errMsg) console.log("测试支付", res.data.errMsg)
// if (res.data.errMsg === 'OK') { if (res.data.errMsg === 'OK') {
// if (!res.data.data.nonceStr) { if (!res.data.data.nonceStr) {
// uni.showToast({ uni.showToast({
// title: '下单失败,请稍后重试', title: '下单失败,请稍后重试',
// icon: 'none' icon: 'none'
// }) })
// } else { } else {
// // 调取微信支付窗口 // 调取微信支付窗口
// uni.requestPayment({ uni.requestPayment({
// provider: "wxpay", provider: "wxpay",
// appId: res.data.appid, // 微信小程序appid appId: res.data.appid, // 微信小程序appid
// timeStamp: res.data.timeStamp, // 时间戳 timeStamp: res.data.timeStamp, // 时间戳
// nonceStr: res.data.nonceStr, // 随机字符串 nonceStr: res.data.nonceStr, // 随机字符串
// package: res.data.package, package: res.data.package,
// signType: "MD5", // 签名算法 signType: "MD5", // 签名算法
// paySign: res.data.paySign, // 签名 paySign: res.data.paySign, // 签名
// success(res) { success(res) {
// uni.showToast({ uni.showToast({
// title: '支付成功', title: '支付成功',
// icon: 'success' icon: 'success'
// }) })
// this.show = false this.show = false
// uni.navigateTo({ uni.navigateTo({
// url:'/my/myorder/index' url:'/my/myorder/index'
// }) })
// }, },
// fail(e) { fail(e) {
// console.log("支付失败", e) console.log("支付失败", e)
// uni.showToast({ uni.showToast({
// title: '支付已取消', title: '支付已取消',
// icon: 'none' icon: 'none'
// }) })
// const orderStatus = { const orderStatus = {
// orderId: orderId, orderId: orderId,
// activityId: activityId activityId: activityId
// } }
// } }
// }); });
// } }
// } else { } else {
// uni.showToast({ uni.showToast({
// title: '下单失败', title: '下单失败',
// icon: 'none' icon: 'none'
// }) })
// } }
// }) })
} else {
uni.showToast({
title: '充值成功!',
icon: 'success'
})
}
} else if(res.data.code !== 200){ } else if(res.data.code !== 200){
uni.showToast({ uni.showToast({
title: res.data.message, title: res.data.message,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment