Commit 3c8d19f3 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/xiangwei/educationstu into master

parents dadbd96b 4468ec30
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
......@@ -116,7 +116,7 @@
<view class="gardenCon" v-for="(item1,index1) in item.List" :key="index1" id="img">
<image :src="item1.Img" mode="aspectFill"
style="width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"></image>
<view class="gardenTextBox" :style="{background:'linear-gradient(to bottom,0deg,'+item1.bgcolor+')'}">
<view class="gardenTextBox" :style="{'background':`linear-gradient(to bottom, rgb(255,255,255,0.3), ${item1.bgcolor})` }">
<view class="gardenTitle one_line">
{{item1.Title}}
</view>
......@@ -192,11 +192,14 @@
proxy.$request("/AppletIndex/GetIndexInfo_V2", {}).then(res => {
data.pageData = res.Data
if(data.pageData.LearningGardenList.length>0){
data.pageData.LearningGardenList.forEach(x=>{
data.pageData.LearningGardenList.forEach((x,y)=>{
if(x.List.length>0){
x.List.forEach((item,index)=>{
this.getColor(item.Img).then(v=>{
item.bgcolor = v;
this.getColor(item.Img,index,y).then(v=>{
console.log(v)
// item.bgcolor = v;
data.pageData.LearningGardenList[v.y].List[v.index].bgcolor = v.formatres;
})
})
}
......@@ -204,11 +207,15 @@
}
})
},
async getColor(src) {
async getColor(src,index,y) {
let res = await getImageColor('myCanvas', 'img', src)
const formatres = `rgba(${res.r},${res.g},${res.b},1)`
let obj={}
obj.formatres = `rgba(${res.r},${res.g},${res.b},1)`
obj.index = index
obj.y = y
// console.log(168, formatres)
return formatres
return obj
},
againdata() {
data.pageData = uni.getStorageSync("userInfo");
......
......@@ -24,7 +24,7 @@
}
.Course_Bottom {
min-height: 80vh;
min-height: 89vh;
background-color: #FFFFFF;
border-radius: 24rpx;
margin-top: 32rpx;
......@@ -91,14 +91,15 @@
<view class="Course_List" v-for="(item,index) in ChapterList" :key="index">
<view class="CourseList_One" @click="getReview(index)">
<view>
<van-circle v-model="currentRate" layer-color="#E4E5FB" :size="70" color="#4C50E7" :rate="100" :speed="100" :text="getSpeed(currentRate)" />
<van-circle :value="item.StudyProgress" layer-color="#E4E5FB" :size="75" color="#4C50E7" :rate="100" :speed="100" :text="getSpeed(item.StudyProgress)" />
</view>
<view class="Course_SeName">
<view class="Course_Name">{{item.ChapterTree.ChapterName}}</view>
<view class="Course_Index">{{item.ChapterTree.ChapterNo}}</view>
</view>
<view>
<van-rate v-model="value" :size="20" :disabled="true" color="#ffd21e" :count="3" void-icon="star" void-color="#eee" />
<van-rate :value="item.Score" :size="20" readonly color="#FAC217"
void-color="#b2b2b2" void-icon="star" icon="star" :count="3" />
</view>
</view>
<view class="Course_Two" v-if="item.isShow">
......@@ -138,9 +139,6 @@
onMounted,
provide,
} from "vue";
import {
GetMyStudyCourseChapterList, //课程列表
} from "../../api/study.js";
export default {
components: {},
onLoad(options) {
......@@ -160,11 +158,10 @@
}
},
setup(props) {
let { proxy } = getCurrentInstance();
let data = reactive({
ChapterList: [], //课程列表
statusBarHeight: 0,
currentRate: 90,
value:2,
msg:{
ClassId:0,
CourseId:0
......@@ -174,14 +171,14 @@
})
let methods = {
async getChapterList() {
let res = await GetMyStudyCourseChapterList(data.msg);
if (res.Code == 1) {
console.log(res)
proxy.$request("/AppletIndex/GetMyStudyCourseChapterList", data.msg).then((res) => {
if(res.Code==1){
data.ChapterList = res.Data;
data.ChapterList.forEach(x=>{
x.isShow=false
})
}
});
},
getSpeed(score){
if(score<100){
......@@ -201,7 +198,6 @@
}
}
onMounted(() => {
that.getChapterList() //我的课程章节列表
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
})
let that = methods;
......
......@@ -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