增加金币解锁

This commit is contained in:
GaoHao
2024-12-07 18:26:08 +08:00
parent d5aa9080b6
commit 51d60f2dcb
5 changed files with 110 additions and 55 deletions

View File

@@ -147,13 +147,13 @@
{{getRedEnvelopeTips}}
</text>
<view class="pay-content">
<!-- <view class="pay-content-item" @click="payVideo(1)" v-if="zhengbu === '是'">
<view class="pay-content-item" @click="payVideo(1)">
<image class="pay-content-item-icon" src="../../static/images/me/rmIcon.png" mode=""></image>
<text class="pay-content-items">
{{zongPrice}}金解锁整部视频
{{countPrice*scale}}金解锁整部视频
</text>
</view> -->
<view class="pay-content-item" @click="payVideo(2)" v-if="danbu === '是'">
</view>
<view class="pay-content-item" @click="payVideo(2)">
<text class="pay-content-items">
{{countPrice}}元解锁单集视频
</text>
@@ -365,6 +365,7 @@
isCollect: false,
playFlag: false,
getRedEnvelopeTips: ''
scale: 1,
};
},
@@ -474,6 +475,8 @@
this.getRedEnvelopeTips= res.data
}
})
this.getScale()
},
onLoad(e) {
let that = this
@@ -504,6 +507,16 @@
}
},
methods: {
/**
* 获取金币比例
*/
getScale () {
httpsRequest.getT("app/common/type/914", {}).then(res => {
if (res.code == 0) {
this.scale = Number(res.data.value)
}
});
},
//播放时的回掉
videoPlay(videoId,courseDetailsId) {
this.courseDetailsId = courseDetailsId
@@ -915,17 +928,23 @@
let data = {
courseId: this.courseId
}
if (type != 1) { //购买单集
data.courseDetailsId = this.videoList[this.current].courseDetailsId
}
data.courseDetailsId = this.videoList[this.current].courseDetailsId
httpsRequest.getT('/app/order/insertCourseOrders', data).then(res => {
if (res.code == 0) {
this.ordersId = res.data.orders.ordersId //记录订单id
this.payMoney = res.data.orders.payMoney //记录订单价格
this.closePay() //关闭购买选择弹窗
this.payPrice = res.data.orders.payMoney //需要支付的价格
this.openPopusPay() //显示充值弹窗
if (type == 1) { //金币
this.showPay = false
this.showMoney = false
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
} else if(type == 2){ //支付宝
this.closePay() //关闭购买选择弹窗
this.payPrice = res.data.orders.payMoney //需要支付的价格
this.openPopusPay() //显示充值弹窗
}
// this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
} else {
@@ -944,13 +963,15 @@
if (res.code == 0) {
uni.hideLoading()
uni.showToast({
title: '已解锁,支付' + payMoney + '金',
title: '已解锁,支付' + payMoney + '金',
icon: 'none'
})
this.closePopusPay()
this.closePay()
that.showPay = false
that.showMoney = false
that.noBuyVideoIndex = null
setTimeout(() => {
that.getDataList(that.courseId, that.videoList[that.current].courseDetailsId,
true);