修改未登录可以看两级的功能

This commit is contained in:
duan 2025-01-08 13:25:17 +08:00
parent 6284515bad
commit 9fb3e0e16c
5 changed files with 74 additions and 30 deletions

View File

@ -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 = {

View File

@ -61,9 +61,20 @@ const install = (Vue, vm) => {
let help = (params = {}) => vm.$u.get('app/helpWord/selectHelpList', params); //帮助中心
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 = {
@ -124,4 +135,4 @@ const install = (Vue, vm) => {
export default {
install
}
}

View File

@ -852,11 +852,17 @@ export default {
console.log('has this.courseId getDataList()');
this.getDataList(this.courseId, this.courseDetailsId);
}
this.$Request.getT('/app/course/getRedEnvelopeTips').then((res) => {
if (res.code == 0) {
this.getRedEnvelopeTips = res.data;
}
});
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 {
//
this.zongPrice = this.info.price;
this.countPrice = this.videoList[this.current].price;
this.showPay = true;
this.noBuyVideoIndex = 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'
})
}
}
},
//

View File

@ -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

View File

@ -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'
// })
// }
},
}