绑定支付宝,视频解锁生成订单增加限制
This commit is contained in:
parent
646379471f
commit
440811c3fa
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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)) { //是否滑动到第一条,虽然刚进入页面current为0,但是首次不触发
|
||||
//拿出当前的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('播放开始')
|
||||
|
|
|
|||
|
|
@ -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
|
||||
// app直接去app注册页面
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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("广告加载失败")
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取签到数据
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue