Commit 18d31f24 authored by Mac's avatar Mac

接口修改

parent 276e6eea
import request from '../utils/request.js' 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) { ...@@ -22,37 +12,3 @@ export function GetMyStudyCourseChapterList(data) {
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 @@ ...@@ -416,12 +416,6 @@
import carousel from './components/vear-carousel/vear-carousel.vue' import carousel from './components/vear-carousel/vear-carousel.vue'
import bottom from '../../components/bottom.vue' import bottom from '../../components/bottom.vue'
import {ref,reactive,toRefs,toRef,getCurrentInstance,watch,computed,onMounted,provide,} from "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 { export default {
components: { components: {
indexNo, indexNo,
...@@ -429,6 +423,9 @@ ...@@ -429,6 +423,9 @@
carousel carousel
}, },
setup(props) { setup(props) {
let {
proxy
} = getCurrentInstance();
let data = reactive({ let data = reactive({
CourseList:[],//课程列表 CourseList:[],//课程列表
statusBarHeight: 0, statusBarHeight: 0,
...@@ -442,8 +439,9 @@ ...@@ -442,8 +439,9 @@
}) })
let methods = { let methods = {
async getCourseList() { getCourseList() {
let res = await getMyStudyCourseList({}); proxy.$request("/AppletIndex/GetMyStudyCourseList", {}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
data.CourseList = res.Data data.CourseList = res.Data
if(data.CourseList.length>0){ if(data.CourseList.length>0){
...@@ -452,9 +450,12 @@ ...@@ -452,9 +450,12 @@
that.getCourseInfo() that.getCourseInfo()
} }
} }
})
}, },
async getCourseInfo() {//详情 getCourseInfo() {//详情
let res = await getMyStudyCourseInfo(data.CourseInfoMsg); proxy.$request("/AppletIndex/GetMyStudyCourseInfo", data.CourseInfoMsg).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
data.InfoData = res.Data data.InfoData = res.Data
if(res.Data && res.Data.Review.length>0){ if(res.Data && res.Data.Review.length>0){
...@@ -463,8 +464,9 @@ ...@@ -463,8 +464,9 @@
}) })
that.getvideo() that.getvideo()
} }
} }
})
}, },
selectedBanner(index){//切换轮播图的时候 调取接口 selectedBanner(index){//切换轮播图的时候 调取接口
data.CourseInfoMsg.ClassId = data.CourseList[index].ClassId; data.CourseInfoMsg.ClassId = data.CourseList[index].ClassId;
...@@ -486,26 +488,29 @@ ...@@ -486,26 +488,29 @@
} }
} }
}, },
async getvideoId(x,y) {//获取视频id getvideoId(x,y) {//获取视频id
if(x.VideoUrl){//判断是否有视频id if(x.VideoUrl){//判断是否有视频id
let res = await getVideoPlayAuth({strVid:x.VideoUrl}); proxy.$request("/Video/GetVideoPlayAuth", {strVid:x.VideoUrl}).then(res => {
if (res.Code == 1) { if (res.Code == 1) {
that.getvideourl(res.Data,y) that.getvideourl(res.Data,y)
} }
})
}else{ }else{
data.loading = false data.loading = false
} }
}, },
async getvideourl(x,y) {//获取视频地址 async getvideourl(x,y) {//获取视频地址
let res = await getPlayInfo({strVid:x.VideoMeta.VideoId});
proxy.$request("/Video/GetPlayInfo", {strVid:x.VideoMeta.VideoId}).then(res => {
if (res.Code == 1) {//地址赋值 if (res.Code == 1) {//地址赋值
data.InfoData.Review[data.current].videolist.push(res.Data) data.InfoData.Review[data.current].videolist.push(res.Data)
if(y+1 == data.InfoData.Review[data.current].List.length){ if(y+1 == data.InfoData.Review[data.current].List.length){
data.loading = false data.loading = false
} }
} }
})
}, },
swiperChange(){//当前选择视频全部暂停 swiperChange(){//当前选择视频全部暂停
let trailer = data.InfoData.Review[data.current].videolist // 获取视频列表 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