From 1167ff651384f4479a6d05a94af0ecd4e858a6b3 Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Tue, 14 Jan 2025 14:09:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BD=AC=E7=9B=98=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98=EF=BC=8C=E9=87=91=E5=B8=81=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E4=B8=8D=E5=87=BA=E7=8E=B0=E6=94=AF=E4=BB=98=E5=AE=9D?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .hbuilderx/launch.json | 2 +- components/my-video-list/my-video-list.vue | 21 +++++++++++++++++---- pages/video/detail.nvue | 13 ++++++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index e466870..15f1188 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,7 +2,7 @@ "version" : "1.0", "configurations" : [ { - "playground" : "standard", + "playground" : "custom", "type" : "uni-app:app-android" }, { diff --git a/components/my-video-list/my-video-list.vue b/components/my-video-list/my-video-list.vue index f02a4d7..5683bf4 100644 --- a/components/my-video-list/my-video-list.vue +++ b/components/my-video-list/my-video-list.vue @@ -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') } diff --git a/pages/video/detail.nvue b/pages/video/detail.nvue index f4289d9..8e55400 100644 --- a/pages/video/detail.nvue +++ b/pages/video/detail.nvue @@ -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' + }) + } } + } })