Commit 18d31f24 authored by Mac's avatar Mac

接口修改

parent 276e6eea
import request from '../utils/request.js'
/**
* 获取我的课程列表
* @param {JSON参数} data
*/
export function getMyStudyCourseList(data) {
return request({
url: '/AppletIndex/GetMyStudyCourseList',
method: 'post',
data
})
}
/**
* 获取我的课程章节列表
......@@ -22,37 +12,3 @@ export function GetMyStudyCourseChapterList(data) {
data
})
}
/**
* 获取学习中心详情
* @param {JSON参数} data
*/
export function getMyStudyCourseInfo(data) {
return request({
url: '/AppletIndex/GetMyStudyCourseInfo',
method: 'post',
data
})
}
/**
* 获取视频地址id
* @param {JSON参数} data
*/
export function getVideoPlayAuth(data) {
return request({
url: '/Video/GetVideoPlayAuth',
method: 'post',
data
})
}
/**
* 获取视频地址
* @param {JSON参数} data
*/
export function getPlayInfo(data) {
return request({
url: '/Video/GetPlayInfo',
method: 'post',
data
})
}
\ No newline at end of file
......@@ -416,12 +416,6 @@
import carousel from './components/vear-carousel/vear-carousel.vue'
import bottom from '../../components/bottom.vue'
import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide,} from "vue";
import {
getMyStudyCourseList,//课程列表
getMyStudyCourseInfo,//详情
getVideoPlayAuth,//视频id
getPlayInfo,//视频地址
} from "../../api/study.js";
export default {
components: {
indexNo,
......@@ -429,6 +423,9 @@
carousel
},
setup(props) {
let {
proxy
} = getCurrentInstance();
let data = reactive({
CourseList:[],//课程列表
statusBarHeight: 0,
......@@ -442,29 +439,34 @@
})
let methods = {
async getCourseList() {
let res = await getMyStudyCourseList({});
if (res.Code == 1) {
data.CourseList = res.Data
if(data.CourseList.length>0){
data.CourseInfoMsg.ClassId = data.CourseList[0].ClassId;
data.CourseInfoMsg.GuestId = data.CourseList[0].GuestId;
that.getCourseInfo()
}
}
getCourseList() {
proxy.$request("/AppletIndex/GetMyStudyCourseList", {}).then(res => {
if (res.Code == 1) {
data.CourseList = res.Data
if(data.CourseList.length>0){
data.CourseInfoMsg.ClassId = data.CourseList[0].ClassId;
data.CourseInfoMsg.GuestId = data.CourseList[0].GuestId;
that.getCourseInfo()
}
}
})
},
async getCourseInfo() {//详情
let res = await getMyStudyCourseInfo(data.CourseInfoMsg);
if (res.Code == 1) {
getCourseInfo() {//详情
proxy.$request("/AppletIndex/GetMyStudyCourseInfo", data.CourseInfoMsg).then(res => {
if (res.Code == 1) {
data.InfoData = res.Data
if(res.Data && res.Data.Review.length>0){
data.InfoData.Review.forEach(x=>{
x.videolist = []
})
that.getvideo()
}
}
}
}
})
},
selectedBanner(index){//切换轮播图的时候 调取接口
data.CourseInfoMsg.ClassId = data.CourseList[index].ClassId;
......@@ -486,26 +488,29 @@
}
}
},
async getvideoId(x,y) {//获取视频id
getvideoId(x,y) {//获取视频id
if(x.VideoUrl){//判断是否有视频id
let res = await getVideoPlayAuth({strVid:x.VideoUrl});
if (res.Code == 1) {
that.getvideourl(res.Data,y)
}
proxy.$request("/Video/GetVideoPlayAuth", {strVid:x.VideoUrl}).then(res => {
if (res.Code == 1) {
that.getvideourl(res.Data,y)
}
})
}else{
data.loading = false
}
},
async getvideourl(x,y) {//获取视频地址
let res = await getPlayInfo({strVid:x.VideoMeta.VideoId});
if (res.Code == 1) {//地址赋值
proxy.$request("/Video/GetPlayInfo", {strVid:x.VideoMeta.VideoId}).then(res => {
if (res.Code == 1) {//地址赋值
data.InfoData.Review[data.current].videolist.push(res.Data)
if(y+1 == data.InfoData.Review[data.current].List.length){
data.loading = false
}
}
}
})
},
swiperChange(){//当前选择视频全部暂停
let trailer = data.InfoData.Review[data.current].videolist // 获取视频列表
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment