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' 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
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
<view class="gardenCon" v-for="(item1,index1) in item.List" :key="index1" id="img"> <view class="gardenCon" v-for="(item1,index1) in item.List" :key="index1" id="img">
<image :src="item1.Img" mode="aspectFill" <image :src="item1.Img" mode="aspectFill"
style="width: 100%;height:100%;border-radius: 24rpx 24rpx 0 0;"></image> 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"> <view class="gardenTitle one_line">
{{item1.Title}} {{item1.Title}}
</view> </view>
...@@ -192,11 +192,14 @@ ...@@ -192,11 +192,14 @@
proxy.$request("/AppletIndex/GetIndexInfo_V2", {}).then(res => { proxy.$request("/AppletIndex/GetIndexInfo_V2", {}).then(res => {
data.pageData = res.Data data.pageData = res.Data
if(data.pageData.LearningGardenList.length>0){ if(data.pageData.LearningGardenList.length>0){
data.pageData.LearningGardenList.forEach(x=>{ data.pageData.LearningGardenList.forEach((x,y)=>{
if(x.List.length>0){ if(x.List.length>0){
x.List.forEach((item,index)=>{ x.List.forEach((item,index)=>{
this.getColor(item.Img).then(v=>{ this.getColor(item.Img,index,y).then(v=>{
item.bgcolor = v; console.log(v)
// item.bgcolor = v;
data.pageData.LearningGardenList[v.y].List[v.index].bgcolor = v.formatres;
}) })
}) })
} }
...@@ -204,11 +207,15 @@ ...@@ -204,11 +207,15 @@
} }
}) })
}, },
async getColor(src) {
async getColor(src,index,y) {
let res = await getImageColor('myCanvas', 'img', src) 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) // console.log(168, formatres)
return formatres return obj
}, },
againdata() { againdata() {
data.pageData = uni.getStorageSync("userInfo"); data.pageData = uni.getStorageSync("userInfo");
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
} }
.Course_Bottom { .Course_Bottom {
min-height: 80vh; min-height: 89vh;
background-color: #FFFFFF; background-color: #FFFFFF;
border-radius: 24rpx; border-radius: 24rpx;
margin-top: 32rpx; margin-top: 32rpx;
...@@ -91,14 +91,15 @@ ...@@ -91,14 +91,15 @@
<view class="Course_List" v-for="(item,index) in ChapterList" :key="index"> <view class="Course_List" v-for="(item,index) in ChapterList" :key="index">
<view class="CourseList_One" @click="getReview(index)"> <view class="CourseList_One" @click="getReview(index)">
<view> <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>
<view class="Course_SeName"> <view class="Course_SeName">
<view class="Course_Name">{{item.ChapterTree.ChapterName}}</view> <view class="Course_Name">{{item.ChapterTree.ChapterName}}</view>
<view class="Course_Index">{{item.ChapterTree.ChapterNo}}</view> <view class="Course_Index">{{item.ChapterTree.ChapterNo}}</view>
</view> </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> </view>
<view class="Course_Two" v-if="item.isShow"> <view class="Course_Two" v-if="item.isShow">
...@@ -138,9 +139,6 @@ ...@@ -138,9 +139,6 @@
onMounted, onMounted,
provide, provide,
} from "vue"; } from "vue";
import {
GetMyStudyCourseChapterList, //课程列表
} from "../../api/study.js";
export default { export default {
components: {}, components: {},
onLoad(options) { onLoad(options) {
...@@ -160,11 +158,10 @@ ...@@ -160,11 +158,10 @@
} }
}, },
setup(props) { setup(props) {
let { proxy } = getCurrentInstance();
let data = reactive({ let data = reactive({
ChapterList: [], //课程列表 ChapterList: [], //课程列表
statusBarHeight: 0, statusBarHeight: 0,
currentRate: 90,
value:2,
msg:{ msg:{
ClassId:0, ClassId:0,
CourseId:0 CourseId:0
...@@ -174,14 +171,14 @@ ...@@ -174,14 +171,14 @@
}) })
let methods = { let methods = {
async getChapterList() { async getChapterList() {
let res = await GetMyStudyCourseChapterList(data.msg); proxy.$request("/AppletIndex/GetMyStudyCourseChapterList", data.msg).then((res) => {
if (res.Code == 1) { if(res.Code==1){
console.log(res)
data.ChapterList = res.Data; data.ChapterList = res.Data;
data.ChapterList.forEach(x=>{ data.ChapterList.forEach(x=>{
x.isShow=false x.isShow=false
}) })
} }
});
}, },
getSpeed(score){ getSpeed(score){
if(score<100){ if(score<100){
...@@ -201,7 +198,6 @@ ...@@ -201,7 +198,6 @@
} }
} }
onMounted(() => { onMounted(() => {
that.getChapterList() //我的课程章节列表
data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; data.statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
}) })
let that = methods; let that = methods;
......
...@@ -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,29 +439,34 @@ ...@@ -442,29 +439,34 @@
}) })
let methods = { let methods = {
async getCourseList() { getCourseList() {
let res = await getMyStudyCourseList({}); proxy.$request("/AppletIndex/GetMyStudyCourseList", {}).then(res => {
if (res.Code == 1) {
data.CourseList = res.Data if (res.Code == 1) {
if(data.CourseList.length>0){ data.CourseList = res.Data
data.CourseInfoMsg.ClassId = data.CourseList[0].ClassId; if(data.CourseList.length>0){
data.CourseInfoMsg.GuestId = data.CourseList[0].GuestId; data.CourseInfoMsg.ClassId = data.CourseList[0].ClassId;
that.getCourseInfo() data.CourseInfoMsg.GuestId = data.CourseList[0].GuestId;
} 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){
data.InfoData.Review.forEach(x=>{ data.InfoData.Review.forEach(x=>{
x.videolist = [] x.videolist = []
}) })
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});
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) 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