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' + }) + } } + } })