增加金币解锁

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

@@ -196,21 +196,15 @@
</view>
<view class="" style="font-size: 24rpx;color: #999;padding: 0 34rpx;margin-bottom: 20rpx;">{{getRedEnvelopeTips}}</view>
<!-- <view class="list-item" v-if="zhengbu === '是' && isWxIosPay == true">
<view class="list-item" v-if="zhengbu === '是' && isWxIosPay == true">
<view class="list-item-box flex align-center justify-center" @click="payVideo(1)">
<image src="../../static/images/me/rmIcon.png" mode=""></image>
{{zongPrice}}解锁整部视频
#ifdef MP-TOUTIAO || MP-WEIXIN-->
<!-- (解锁后永久有效) -->
<!-- #endif
{{countPrice*scale}}解锁单集视频
</view>
</view> -->
</view>
<view class="list-item" v-if="danbu === '是' && isWxIosPay == true">
<view class="list-item-box" @click="payVideo(2)">
{{countPrice}}元解锁单集视频
<!-- #ifdef MP-TOUTIAO || MP-WEIXIN-->
(解锁后永久有效)
<!-- #endif -->
</view>
</view>
<!-- <view class="list-item" v-if="isVips == '是' && isWxIosPay == true">
@@ -429,7 +423,8 @@
countPrice: 0, //单集价格
isWxIosPay: true,
playFlag: false,
getRedEnvelopeTips: ''
getRedEnvelopeTips: '',
scale: 1,
};
},
onShareAppMessage(res) {
@@ -693,6 +688,7 @@
// that.getDataList(that.courseId, that.courseDetailsId, true);
// }
// })
this.getScale()
},
onReady() {
// #ifdef MP-WEIXIN || MP-KUAISHOU
@@ -740,6 +736,16 @@
},
},
methods: {
/**
* 获取金币比例
*/
getScale () {
this.$Request.getT("app/common/type/914", {}).then(res => {
if (res.code == 0) {
this.scale = Number(res.data.value)
}
});
},
onDone(index) {
const prize = this.prizeList[index]
uni.showModal({
@@ -1209,18 +1215,23 @@
let data = {
courseId: this.courseId
}
if (type != 1) { //购买单集
data.courseDetailsId = this.videoList[this.current].courseDetailsId
}
data.courseDetailsId = this.videoList[this.current].courseDetailsId
this.$Request.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.showPay = false //关闭购买选择弹窗
this.payPrice = res.data.orders.payMoney //需要支付的价格
this.showMoney = true //显示充值弹窗
// this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney)
console.log(type)
if (type == 1) { //金币
this.showPay = false
this.showMoney = false
this.payOrder(this.courseId, this.videoList[this.current].courseDetailsId);
} else if(type == 2){ //支付宝
this.showPay = false //关闭购买选择弹窗
this.payPrice = res.data.orders.payMoney //需要支付的价格
this.showMoney = true //显示充值弹窗
}
} else {
uni.showToast({
title: res.msg,
@@ -1237,11 +1248,12 @@
if (res.code == 0) {
uni.hideLoading()
uni.showToast({
title: '已解锁,支付' + payMoney + '金',
title: '已解锁,支付' + payMoney + '金',
icon: 'none'
})
that.showPay = false
that.showMoney = false
that.noBuyVideoIndex = null
setTimeout(() => {
that.getDataList(that.courseId, that.videoList[that.current].courseDetailsId,
true);