绑定支付宝,视频解锁生成订单增加限制

This commit is contained in:
GaoHao 2024-12-26 14:07:51 +08:00
parent 646379471f
commit 440811c3fa
6 changed files with 56 additions and 36 deletions

View File

@ -1,13 +1,13 @@
const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; //
const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名
const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "https://dj-api.hnsiyao.cn/czg/"; //
// const ROOTPATH = "https://dj-api.hnsiyao.cn/czg/"; //后台服务域名
// const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
const ROOTPATH1 = "https://video.hnsiyao.cn/czg/"; //
const ROOTPATH = "https://video.hnsiyao.cn/czg/"; //后台服务域名
const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; //
// const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名
// const ROOTPATH1 = "http://192.168.1.5:8100/czg/"; //
// const ROOTPATH = "http://192.168.1.5:8100/czg/"; //后台服务域名
// const ROOTPATH2 = "http://192.168.1.5:8100"; //后台服务域名
module.exports = {

View File

@ -406,7 +406,8 @@
getRedEnvelopeTips: '',
scale: 1,
// 防抖使用的变量
appearTimeout: null
appearTimeout: null,
isOrder: true
};
},
onUnload() {
@ -1041,6 +1042,12 @@
* 2:购买单集视频
*/
payVideo(type, num) {
console.log(this.isOrder)
if(!this.isOrder){
return;
}
console.log(1)
this.isOrder = false
if (uni.getStorageSync('token')) {
this.submitPay(type, num)
} else {
@ -1061,6 +1068,7 @@
}
httpsRequest.getT((num && num == 10) ? '/app/order/insertCourseOrders/limit10' :
'/app/order/insertCourseOrders', data).then(res => {
console.log(3)
if (res.code == 0) {
this.ordersId = res.data.orders.ordersId //记录订单id
this.payMoney = res.data.orders.payMoney //记录订单价格
@ -1077,6 +1085,7 @@
} else {
if (res.status && res.status == 1) {
this.showPay = false //关闭购买选择弹窗
this.isOrder = true
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,
true);
return;
@ -1103,6 +1112,7 @@
this.closePopusPay()
this.closePay()
that.showPay = false
this.isOrder = true
that.showMoney = false
that.noBuyVideoIndex = null
setTimeout(() => {
@ -1291,6 +1301,7 @@
token: uni.getStorageSync('token') ? uni.getStorageSync('token') : ''
};
httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => {
if (res.code == 0) {
console.log(res)
if (res.data.listsDetail) {

View File

@ -433,6 +433,7 @@
playFlag: false,
getRedEnvelopeTips: '',
scale: 1,
isOrder: true,
};
},
onShareAppMessage(res) {
@ -1260,6 +1261,10 @@
* 2:购买单集视频
*/
payVideo(type) {
if(!this.isOrder){
return;
}
this.isOrder = false
if (uni.getStorageSync('token')) {
// #ifdef MP-TOUTIAO
if (!this.checked) {
@ -1310,13 +1315,13 @@
if (res.code == 0) {
this.ordersId = res.data.orders.ordersId //id
this.payMoney = res.data.orders.payMoney //
console.log(type)
if (type == 1) { //
// this.showPay = false
// this.showMoney = false
this.payOrder(res.data.orders.ordersId, res.data.orders.payMoney);
} else if (type == 2) { //
this.showPay = false //
this.isOrder = true
this.payPrice = res.data.orders.payMoney //
this.showMoney = true //
}
@ -1324,6 +1329,7 @@
} else {
if ( res.status && res.status == 1) {
this.showPay = false //
this.isOrder = true
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,
true);
return;
@ -1348,6 +1354,7 @@
icon: 'none'
})
that.showPay = false
this.isOrder = true
that.showMoney = false
that.noBuyVideoIndex = null
setTimeout(() => {
@ -1573,17 +1580,13 @@
let indexs = -1
if (courseDetailsId) { //
console.log(courseDetailsId)
console.log(this.meunList)
this.meunList.map((item, index) => {
if (item.courseDetailsId == courseDetailsId) {
indexs = index
}
})
console.log(indexs)
if (indexs != -1) { //
if (Number(indexs + 1) === this.meunList.length) { //
console.log("最后一条")
if (this.meunList.length == 1) { //
this.videoList = this.meunList.slice(0,
3)
@ -1807,10 +1810,17 @@
}
}
//
console.log(current+"---"+this.current)
if ((current == 0 && this.current == 2) || (current == 0 && this.current ==
0)) { //current0
//courseDetailsId
let courseDetailsId = this.videoList[2].courseDetailsId
console.log(this.videoList)
let courseDetailsId =this.videoList[2].courseDetailsId
// if ( this.videoList.length > 1) {
// courseDetailsId = this.videoList[2].courseDetailsId
// } else {
// courseDetailsId = this.videoList[0].courseDetailsId
// }
indexs = this.meunList.findIndex(item => item.courseDetailsId === courseDetailsId);
//meunList
if (indexs != -1) { //indexs
@ -1906,15 +1916,13 @@
},
//
videoPlay(videoId) {
console.log(courseDetailsId)
console.log(this.playFlag)
// this.courseDetailsId = courseDetailsId
if (!this.playFlag) {
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,true);
this.playFlag = true
httpsRequest.getT('app/course/viewCourse', {
this.$Request.getT('app/course/viewCourse', {
courseId: this.courseId,
courseDetailsId: courseDetailsId,
courseDetailsId: this.videoList[this.current].courseDetailsId,
type: 'start'
}).then(res => {
console.log('播放开始')

View File

@ -245,7 +245,9 @@
}
// h5
// #ifdef H5
this.erweima = config.APIHOST2 + '/?invitation=' + this
// this.erweima = config.APIHOST2 + '/?invitation=' + this
// .invitationCode + '&qdCode=' + this.qdCode
this.erweima = config.APIHOST2 + '/pages/login/registerApp/?invitation=' + this
.invitationCode + '&qdCode=' + this.qdCode
// #endif
// appapp

View File

@ -54,16 +54,9 @@
},
toLogin() {
// console.log(this.zhiFuBao )
// console.log(this.zhiFuBaoName )
// const {
// zhiFuBao,
// zhiFuBaoName
// } = this;
let zhiFuBao = this.zhiFuBao
let zhiFuBaoName = this.zhiFuBaoName
console.log(zhiFuBao)
console.log(zhiFuBaoName)
if (!zhiFuBao) {
uni.showToast({
title: '请设置收款人姓名',
@ -75,8 +68,10 @@
icon: 'none'
})
} else {
this.logining = true
this.$u.post('app/user/updateUser?zhiFuBao=' + zhiFuBao + '&zhiFuBaoName=' + zhiFuBaoName).then(
res => {
this.logining = false
console.log(res);
if(res.code===0){
uni.setStorageSync('zhiFuBao', zhiFuBao)

View File

@ -162,6 +162,17 @@
this.adRewardedVideo = true;
console.log('广告数据加载成功');
},
/**
* 广告加载失败回调
* @param {Object} e
*/
onaderror(e) { // 广
this.$refs.adRewardedVideo.load();
// this.adRewardedVideo = false;
console.log("广告加载失败")
},
/**
* 广告播放成功回调
* @param {Object} e
@ -187,14 +198,7 @@
// 退
}
},
/**
* 广告加载失败回调
* @param {Object} e
*/
onaderror(e) { // 广
this.adRewardedVideo = false;
console.log("广告加载失败")
},
/**
* 获取签到数据
*/