diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 2edbecd..9cade79 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -2,20 +2,24 @@ "version" : "1.0", "configurations" : [ { - "app-plus" : { - "launchtype" : "local" - }, - "default" : { - "launchtype" : "local" - }, - "h5" : { - "launchtype" : "local" - }, - "mp-weixin" : { - "launchtype" : "local" - }, - "provider" : "aliyun", - "type" : "uniCloud" + "app-plus" : + { + "launchtype" : "local" + }, + "default" : + { + "launchtype" : "local" + }, + "h5" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "provider" : "aliyun", + "type" : "uniCloud" }, { "playground" : "custom", diff --git a/components/payPopus/payPopus.vue b/components/payPopus/payPopus.vue index ea06143..9c3cbab 100644 --- a/components/payPopus/payPopus.vue +++ b/components/payPopus/payPopus.vue @@ -3,7 +3,7 @@ 购买后继续观看 - + + - + - + - + @@ -132,6 +132,10 @@ type: Boolean, default: true }, + orderId: { + type: Number, + default: null + }, //需要支付的金豆 payPrice: { type: Number, @@ -176,55 +180,61 @@ // #endif // #ifdef APP-PLUS if (plus.os.name.toLowerCase() === 'android') { - this.openLists = [{ - image: '/static/images/pay/weixin.png', - text: '微信', - id: 2 - }, { - image: '/static/images/pay/zhifubao.png', - text: '支付宝', - id: 1 - }]; - this.openWay = 2; - let syPaySel = this.$queue.getData('syPaySel') - if (syPaySel === '是') { - let openListsItem = { - image: '/static/images/pay/shouyi.png', - text: '收益余额', - id: 4 - }; - this.openLists.push(openListsItem) - } - } else { - let checkIosPay = this.$queue.getData('checkIosPay'); - if (checkIosPay === '是') { - this.openLists = [{ - image: '/static/images/pay/weixin.png', - text: '苹果', - id: 3 - }]; - this.openWay = 3; - } else { - this.openLists = [{ - image: '/static/images/pay/weixin.png', - text: '微信', - id: 2 - }, { + this.openLists = [ + // { + // image: '/static/images/pay/weixin.png', + // text: '微信', + // id: 2 + // }, + { image: '/static/images/pay/zhifubao.png', text: '支付宝', id: 1 - }]; - this.openWay = 2; - let syPaySel = this.$queue.getData('syPaySel') - if (syPaySel === '是') { - let openListsItem = { - image: '/static/images/pay/shouyi.png', - text: '收益余额', - id: 4 - }; - this.openLists.push(openListsItem) } - } + ]; + this.openWay = 1; + let syPaySel = this.$queue.getData('syPaySel') + // if (syPaySel === '是') { + // let openListsItem = { + // image: '/static/images/pay/shouyi.png', + // text: '收益余额', + // id: 4 + // }; + // this.openLists.push(openListsItem) + // } + } else { + let checkIosPay = this.$queue.getData('checkIosPay'); + // if (checkIosPay === '是') { + // this.openLists = [{ + // image: '/static/images/pay/weixin.png', + // text: '苹果', + // id: 3 + // }]; + // this.openWay = 3; + // } else { + this.openLists = [ + // { + // image: '/static/images/pay/weixin.png', + // text: '微信', + // id: 2 + // }, + { + image: '/static/images/pay/zhifubao.png', + text: '支付宝', + id: 1 + } + ]; + this.openWay = 1; + let syPaySel = this.$queue.getData('syPaySel') + // if (syPaySel === '是') { + // let openListsItem = { + // image: '/static/images/pay/shouyi.png', + // text: '收益余额', + // id: 4 + // }; + // this.openLists.push(openListsItem) + // } + // } } // #endif @@ -240,31 +250,31 @@ // #ifdef H5 let ua = navigator.userAgent.toLowerCase(); - if (ua.indexOf('micromessenger') !== -1) { - this.openLists = [{ - image: '/static/images/pay/weixin.png', - text: '微信', - id: 2 - }]; - this.openWay = 2; - } else { + // if (ua.indexOf('micromessenger') !== -1) { + // this.openLists = [{ + // image: '/static/images/pay/weixin.png', + // text: '微信', + // id: 2 + // }]; + // this.openWay = 2; + // } else { this.openLists = [{ image: '/static/images/pay/zhifubao.png', text: '支付宝', id: 1 }]; this.openWay = 1; - } + // } let syPaySel = this.$queue.getData('syPaySel') - if (syPaySel === '是') { - let openListsItem = { - image: '/static/images/pay/shouyi.png', - text: '收益余额', - id: 4 - }; - this.openLists.push(openListsItem) - } + // if (syPaySel === '是') { + // let openListsItem = { + // image: '/static/images/pay/shouyi.png', + // text: '收益余额', + // id: 4 + // }; + // this.openLists.push(openListsItem) + // } // #endif }, methods: { @@ -562,28 +572,28 @@ // #endif } else if (this.openWay == 1) { + console.log(this.orderId) // APP支付宝支付 // #ifdef APP - this.$Request.postT("/app/aliPay/payMoney", { - classify: 1, - payClassifyId: this.wallet[this.current].payClassifyId, - }).then(ret => { + this.$Request.getT("/app/wuyou/payOrder/"+this.orderId, {}).then(ret => { console.log(ret) - this.isCheckPay(ret.code, 'alipay', ret.data); + // this.isCheckPay(ret.code, 'alipay', ret.data); + that.$emit('paySuccess', ret.data) }); // #endif // #ifdef H5 let data = { - classify: 2, - payClassifyId: this.wallet[this.current].payClassifyId, + orderId: this.orderId, } - this.$Request.postT('/app/aliPay/payMoney', data).then( + this.$Request.getT("/app/wuyou/payOrder/"+this.orderId, {}).then( res => { if (res.code === 0) { - const div = document.createElement('div') - div.innerHTML = res.data //此处form就是后台返回接收到的数据 - document.body.appendChild(div) - document.forms[0].submit() + console.log(res) + that.$emit('paySuccess', res.data) + // const div = document.createElement('div') + // div.innerHTML = res.data //此处form就是后台返回接收到的数据 + // document.body.appendChild(div) + // document.forms[0].submit() } else { uni.showToast({ icon: 'none', @@ -601,7 +611,7 @@ this.$Request.postT("/app/ios/insertPayMoneyOrders", data).then(res => { if (res.code === 0) { this.iosPayId = res.data.orderId; - this.iphonepay(); + // this.iphonepay(); } else { uni.showToast({ icon: 'none', diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index 8ea75ad..8981d84 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -144,15 +144,15 @@ - + - {{countPrice}}金币解锁单集视频 + {{countPrice}}元解锁单集视频 - + - + @@ -449,25 +449,28 @@ this.moneyTips = uni.getStorageSync('moneyTips') // #ifdef APP-PLUS if (plus.os.name.toLowerCase() === 'android') { - this.openLists = [{ - image: '/static/images/pay/weixin.png', - text: '微信', - id: 2 - }, { - image: '/static/images/pay/zhifubao.png', - text: '支付宝', - id: 1 - }]; - this.openWay = 2; + this.openLists = [ + // { + // image: '/static/images/pay/weixin.png', + // text: '微信', + // id: 2 + // }, + { + image: '/static/images/pay/zhifubao.png', + text: '支付宝', + id: 1 + }, + ]; + this.openWay = 1; let syPaySel = uni.getStorageSync('syPaySel') - if (syPaySel === '是') { - let openListsItem = { - image: '/static/images/pay/shouyi.png', - text: '收益余额', - id: 4 - }; - this.openLists.push(openListsItem) - } + // if (syPaySel === '是') { + // let openListsItem = { + // image: '/static/images/pay/shouyi.png', + // text: '收益余额', + // id: 4 + // }; + // this.openLists.push(openListsItem) + // } } else { let checkIosPay = uni.getStorageSync('checkIosPay'); if (checkIosPay === '是') { @@ -478,29 +481,38 @@ }]; this.openWay = 3; } else { - this.openLists = [{ - image: '/static/images/pay/weixin.png', - text: '微信', - id: 2 - }, { - image: '/static/images/pay/zhifubao.png', - text: '支付宝', - id: 1 - }]; - this.openWay = 2; + this.openLists = [ + // { + // image: '/static/images/pay/weixin.png', + // text: '微信', + // id: 2 + // }, + { + image: '/static/images/pay/zhifubao.png', + text: '支付宝', + id: 1 + }, + ]; + this.openWay = 1; let syPaySel = uni.getStorageSync('syPaySel') - if (syPaySel === '是') { - let openListsItem = { - image: '/static/images/pay/shouyi.png', - text: '收益余额', - id: 4 - }; - this.openLists.push(openListsItem) - } + // if (syPaySel === '是') { + // let openListsItem = { + // image: '/static/images/pay/shouyi.png', + // text: '收益余额', + // id: 4 + // }; + // this.openLists.push(openListsItem) + // } } } // #endif + this.$nextTick(()=>{ + this.closePopusPay() + }) + if(this.courseId){ + this.getDataList(this.courseId, this.courseDetailsId); + } }, onLoad(e) { //是开启整部购买 @@ -528,7 +540,6 @@ if (e.courseDetailsId && e.courseDetailsId != 'null') { this.courseDetailsId = e.courseDetailsId } - this.getDataList(this.courseId, this.courseDetailsId); this.getMyLoveStatus() this.getMoneyList() this.getMyMoney() @@ -698,15 +709,12 @@ payClassifyId: this.wallet[this.wallCurr].payClassifyId, }).then(ret => { this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data)); - }); + }) } else if (this.openWay == 1) { // APP支付宝支付 - httpsRequest.postT("/app/aliPay/payMoney", { - classify: 1, - payClassifyId: this.wallet[this.wallCurr].payClassifyId, - }).then(ret => { - console.log(ret) - this.isCheckPay(ret.code, 'alipay', ret.data); + httpsRequest.getT("/app/wuyou/payOrder/"+this.ordersId, {}).then(ret => { + plus.runtime.openURL(ret.data.h5Url) + // this.isCheckPay(ret.code, 'wxpay', JSON.stringify(ret.data)); }); } else if (this.openWay == 3) { let userId = uni.getStorageSync('userId'); @@ -931,7 +939,11 @@ if (res.code == 0) { this.ordersId = res.data.orders.ordersId //记录订单id this.payMoney = res.data.orders.payMoney //记录订单价格 - this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney) + + this.closePay() //关闭购买选择弹窗 + this.payPrice = res.data.orders.payMoney //需要支付的价格 + this.openPopusPay() //显示充值弹窗 + // this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney) } else { uni.showToast({ title: res.msg, diff --git a/me/detail/detail.vue b/me/detail/detail.vue index 1f8c45c..20e8b15 100644 --- a/me/detail/detail.vue +++ b/me/detail/detail.vue @@ -194,36 +194,32 @@ 当前视频 没有播放权限 - + - (解锁后永久有效) - + #ifdef MP-TOUTIAO || MP-WEIXIN--> + + - {{countPrice}}金豆解锁单集视频 + {{countPrice}}元解锁单集视频 (解锁后永久有效) -