Commit a793cd1a authored by liwei's avatar liwei

修改了报名活动

parent 25fb6660
......@@ -112,60 +112,67 @@ import {activityDetail, addApplication, pay} from "../api/activity/index.js"
const activityId = this.activityId
const orderId = res.data.data.businessId
// 支付
const payquery = {
orderId: orderId,
activityId: this.activityId,
type:'0'
}
pay(payquery).then(res => {
console.log("支付参数", res)
console.log("测试支付", res.data.errMsg)
if (res.data.errMsg === 'OK') {
if (!res.data.data.nonceStr) {
if (res.data.data.price != 0){
const payquery = {
orderId: orderId,
activityId: this.activityId,
type:'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: '下单失败,请稍后重试',
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: 'none'
})
}
} else if(res.data.code !== 200){
uni.showToast({
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