修复转盘跳转问题,金币支付不出现支付宝确认弹窗

This commit is contained in:
2025-01-14 14:09:44 +08:00
parent 8a5658681c
commit 1167ff6513
3 changed files with 26 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
"version" : "1.0",
"configurations" : [
{
"playground" : "standard",
"playground" : "custom",
"type" : "uni-app:app-android"
},
{

View File

@@ -345,7 +345,7 @@
async function payOrder(data) {
const res = await Api.payOrder(data)
if (res) {
uni.setStorageSync('nobuyCourseId', popup.data.courseId)
uni.setStorageSync('nobuyCourseId', popup.data.courseDetailsId)
// #ifdef APP
uni.navigateTo({
url: '/pages/pays/pays?orderId=' + data.orderId + '&url=' + res.h5Url
@@ -375,10 +375,13 @@
}
//确认支付
async function payConfirm() {
if (!isAgree.value) {
return infoBox.showToast('请阅读并同意 《付费须知说明》')
}
const [type, num] = popup.payType.split('-');
if(type!='gold'){
if (!isAgree.value) {
return infoBox.showToast('请阅读并同意 《付费须知说明》')
}
}
console.log(type, num);
let data = {
courseId: popup.data.courseId
@@ -388,6 +391,13 @@
}
const res = num == '10' ? await Api.buyTenVideo(data) : await Api.buyVideo(data)
console.log(res);
if(!res.orders){
return uni.showToast({
title:'创建订单失败',
icon:'none'
})
}
if (res) {
if (type == 'gold') {
goldPay({
@@ -409,6 +419,9 @@
function payBtnClick(type, num) {
console.log(type, num);
popup.payType = `${type}-${num}`
if(type=='gold'){
return payConfirm()
}
popupClose('show')
popupShow('payTips')
}

View File

@@ -81,12 +81,15 @@
const nobuyCourseId = uni.getStorageSync('nobuyCourseId')
const item = state.list.find(v => v.courseId == nobuyCourseId)
uni.removeStorageSync('nobuyCourseId')
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
.videoUrl) {
uni.navigateTo({
url: '/pages/me/prizeDraw'
})
if(item){
if (drawRes.count * 1 > 0 && nobuyCourseId !== null && nobuyCourseId !== undefined && item
.videoUrl) {
uni.navigateTo({
url: '/pages/me/prizeDraw'
})
}
}
}
})
</script>