修改未登录可以看两级的功能
This commit is contained in:
parent
6284515bad
commit
9fb3e0e16c
|
|
@ -1,6 +1,6 @@
|
|||
// 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://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/"; //后台服务域名
|
||||
|
|
@ -13,9 +13,9 @@
|
|||
// const ROOTPATH1 = "http://192.168.1.41:8100/czg"; //
|
||||
// const ROOTPATH = "http://192.168.1.41:8100/czg"; //后台服务域名
|
||||
// 测试
|
||||
const ROOTPATH1 = "https://web-api.hnsiyao.cn/czg"; //
|
||||
const ROOTPATH = "https://web-api.hnsiyao.cn/czg"; //后台服务域名
|
||||
const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
||||
// const ROOTPATH1 = "https://web-api.hnsiyao.cn/czg"; //
|
||||
// const ROOTPATH = "https://web-api.hnsiyao.cn/czg"; //后台服务域名
|
||||
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
|
||||
|
||||
|
||||
module.exports = {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,18 @@ const install = (Vue, vm) => {
|
|||
let helpDet = (params = {}) => vm.$u.get('app/helpWord/selectHelpWordDetails', params); //帮助中心 详情
|
||||
|
||||
//获取视频
|
||||
let selectCourseDetailsById = (params = {}) => vm.$u.get('app/course/selectCourseDetailsById', params);
|
||||
let selectCourseDetailsById = (params = {}) => {
|
||||
let obj = {}
|
||||
if (params.token) {
|
||||
obj = params
|
||||
} else {
|
||||
obj = {
|
||||
id:params.id,
|
||||
token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNDI5NSIsImlhdCI6MTczNjMwNDUzMCwiZXhwIjoxNzM2OTA5MzMwfQ.kCnqu3S23kOog8OBA2GUwRWhC-dmBsYmPz5mHdaCIvaoJstm0KmYnZFxssHjx562ziFOfENXDg_OQWyzBIC5xg'
|
||||
}
|
||||
}
|
||||
return vm.$u.get('app/course/selectCourseDetailsById', obj)
|
||||
};
|
||||
|
||||
// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
|
||||
vm.$u.api = {
|
||||
|
|
|
|||
|
|
@ -852,11 +852,17 @@ export default {
|
|||
console.log('has this.courseId getDataList()');
|
||||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
}
|
||||
|
||||
if( uni.getStorageSync('token')){
|
||||
this.$Request.getT('/app/course/getRedEnvelopeTips').then((res) => {
|
||||
if (res.code == 0) {
|
||||
this.getRedEnvelopeTips = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// uni.$on('back', (data) => {
|
||||
// if (data.flag == true) {
|
||||
|
|
@ -971,14 +977,19 @@ export default {
|
|||
},
|
||||
//点击封面打开弹窗
|
||||
openShowPay(val, inx, url) {
|
||||
console.log(val);
|
||||
console.log(inx);
|
||||
console.log(url);
|
||||
console.log(this.videoList[this.current]);
|
||||
if( uni.getStorageSync('token')){
|
||||
this.zongPrice = this.info.price;
|
||||
this.countPrice = this.videoList[this.current].price;
|
||||
this.showPay = true;
|
||||
this.noBuyVideoIndex = this.current;
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 获取收藏状态
|
||||
getMyLoveStatus() {
|
||||
|
|
@ -986,7 +997,18 @@ export default {
|
|||
id: this.courseId,
|
||||
token: uni.getStorageSync('token')
|
||||
};
|
||||
this.$Request.getT('/app/course/selectCourseDetailsById', data).then((res) => {
|
||||
let obj ={}
|
||||
if ( uni.getStorageSync('token')) {
|
||||
obj = data
|
||||
} else {
|
||||
obj = {
|
||||
id: this.courseId,
|
||||
token:'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxNDI5NSIsImlhdCI6MTczNjMwNDUzMCwiZXhwIjoxNzM2OTA5MzMwfQ.kCnqu3S23kOog8OBA2GUwRWhC-dmBsYmPz5mHdaCIvaoJstm0KmYnZFxssHjx562ziFOfENXDg_OQWyzBIC5xg'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.$Request.getT('/app/course/selectCourseDetailsById', obj).then((res) => {
|
||||
if (res.code == 0) {
|
||||
if (res.data && res.data.isCollect && res.data.isCollect > 0) {
|
||||
this.isCollect = true;
|
||||
|
|
@ -1995,11 +2017,21 @@ export default {
|
|||
});
|
||||
}
|
||||
} else {
|
||||
|
||||
if( uni.getStorageSync('token')){
|
||||
//没有视频链接则表示没有权限,需要购买 弹出购买弹窗
|
||||
this.zongPrice = this.info.price;
|
||||
this.countPrice = this.videoList[this.current].price;
|
||||
this.showPay = true;
|
||||
this.noBuyVideoIndex = this.current;
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
//播放时的回掉
|
||||
|
|
|
|||
|
|
@ -473,6 +473,7 @@
|
|||
this.getDataList(this.courseId, this.courseDetailsId);
|
||||
|
||||
}
|
||||
console.log(11111)
|
||||
httpsRequest.getT('/app/course/getRedEnvelopeTips').then(res => {
|
||||
if (res.code === 0) {
|
||||
this.getRedEnvelopeTips = res.data
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
//查看视频
|
||||
seVideo(item) {
|
||||
console.log(uni.getStorageSync('token'))
|
||||
if(uni.getStorageSync('token')){
|
||||
// if(uni.getStorageSync('token')){
|
||||
const time = 100;
|
||||
// #ifdef H5
|
||||
if (returnIsSafari()) {
|
||||
|
|
@ -75,11 +75,11 @@
|
|||
})
|
||||
// #endif
|
||||
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:'/pages/login/login'
|
||||
})
|
||||
}
|
||||
// }else{
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/login/login'
|
||||
// })
|
||||
// }
|
||||
},
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue