mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-11 20:06:48 +08:00
提交合并后的所有文件
This commit is contained in:
2001
pages/study/courseStudy.vue
Normal file
2001
pages/study/courseStudy.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -217,11 +217,11 @@
|
||||
item.options.forEach(it =>{
|
||||
if(it.answer){ //正确答案
|
||||
if(item.userAnswer.indexOf(it.id)==-1){
|
||||
allRight=false;
|
||||
allRight=false;
|
||||
}
|
||||
}else{
|
||||
if(item.userAnswer.indexOf(it.id)>-1){
|
||||
allRight=false;
|
||||
allRight=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -292,15 +292,18 @@
|
||||
},
|
||||
confirmFinish(){
|
||||
//这里应该是返回课程的页面
|
||||
if(this.ctype==10){
|
||||
uni.redirectTo({
|
||||
url:'/pages/resource/microDetail?id='+this.info.courseId + '&exam=1'
|
||||
})
|
||||
}else if(this.ctype==20){
|
||||
uni.redirectTo({
|
||||
url:'/pages/study/onlineCourse?id='+this.info.courseId
|
||||
})
|
||||
}
|
||||
uni.redirectTo({
|
||||
url:'/pages/study/courseStudy?id='+this.info.courseId + '&contentId='+this.examId
|
||||
})
|
||||
// if(this.ctype==10){
|
||||
// uni.redirectTo({
|
||||
// url:'/pages/resource/microDetail?id='+this.info.courseId + '&exam=1'
|
||||
// })
|
||||
// }else if(this.ctype==20){
|
||||
// uni.redirectTo({
|
||||
// url:'/pages/study/onlineCourse?id='+this.info.courseId
|
||||
// })
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,107 +1,89 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="tabbar">
|
||||
<view class="tabbar-item" @click="clicktab(0)" :class="{'active':tabIndex===0}">
|
||||
<u-badge :type="type" max="99" :value="value" class="tabber-co"></u-badge>
|
||||
学习任务
|
||||
<view style="background-color: #fff;">
|
||||
<view class="listbox-top" style="background-color: #fff;">
|
||||
<!-- <view class="top-ten" style="margin-top: 21px;margin-left: 13px;">
|
||||
<text class="textbtn" @click="loadstatusSelecShow=!loadstatusSelecShow">状态</text>
|
||||
</view> -->
|
||||
<view class="searchView" v-show="tabIndex===0">
|
||||
<u-search :clearabled="true" @search="loadBoeData(true)" @clear="loadBoeData(true)"
|
||||
placeholder="搜索关键字" v-model="loadkeyword" :showAction="false" shape="square" bgColor="##F2F5F7">
|
||||
</u-search>
|
||||
</view>
|
||||
<view class="searchView" v-show="tabIndex===1">
|
||||
<u-search :clearabled="true" @search="searchData()" @clear="searchData()"
|
||||
placeholder="搜索关键字" v-model="autonomy.keyword" :showAction="false" shape="square" bgColor="##F2F5F7">
|
||||
</u-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="tabbar" style="position: relative;padding-bottom: 20upx;">
|
||||
<view class="tabbar-item" style="text-align: right;margin-right: 26upx;" @click="clicktab(0)" :class="{'active':tabIndex===0}">
|
||||
<u-badge :type="type" max="99" :value="value" class="tabber-co"></u-badge>学习任务
|
||||
<view class="border-bottom-one"></view>
|
||||
</view>
|
||||
<view class="tabbar-item" style="text-align: left;margin-left: 26upx;" @click="clicktab(1)" :class="{'active':tabIndex===1}">
|
||||
我报名的<view class="border-bottom-two"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 筛选状态 -->
|
||||
<view class="addition" v-show="tabIndex===0">
|
||||
<view class="textbtn" style="color:#666;font-size: 28upx;" @click="statusSelectShow = !statusSelectShow">
|
||||
<text>筛选</text>
|
||||
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
|
||||
</view>
|
||||
<view class="sea-show" v-show="statusSelectShow">
|
||||
<view v-for="(status,index) in statustList" :key="index" :class="[boeStatus === status.value? 'sea-active':'','sea-index']" @click="taskStatus(status.value)">
|
||||
{{status.name}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="addition" v-show="tabIndex===1">
|
||||
<view class="textbtn" style="color:#666;font-size: 28upx;" @click="statusSelectShow = !statusSelectShow">
|
||||
<text>筛选</text>
|
||||
<u-icon style="margin-left: 18upx;" name="arrow-down"></u-icon>
|
||||
</view>
|
||||
<view class="sea-show" v-show="statusSelectShow">
|
||||
<view v-for="(status,index) in autonomyStatustList" :key="index" :class="[Applistatus === status.value? 'sea-active':'','sea-index']" @click="autonomyStatus(status.value)">
|
||||
{{status.name}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="tabber-item" @click="clicktab(1)" :class="{'active':tabIndex===1}">我报名的</view>
|
||||
<!-- <view class="tabbar-item" @click="clicktab(2)" :class="{'active':tabIndex===2}">历史记录</view> -->
|
||||
</view>
|
||||
<!-- 学习任务 -->
|
||||
<view class="listbox" v-show="tabIndex===0">
|
||||
<view class="listbox-top">
|
||||
<view class="top-ten" style="margin-top: 21px;margin-left: 13px;">
|
||||
<!-- <u-picker v-model="loadstatus" :show="loadstatusSelecShow" @cancel="loadstatusSelecShow = false"
|
||||
@confirm="loadchooseStatust" :columns="statustList" keyName="name"></u-picker> -->
|
||||
<!-- <text class="textbtn" @click="loadstatusSelecShow = !loadstatusSelecShow">状态</text> -->
|
||||
<text class="textbtn" @click="loadstatusSelecShow=!loadstatusSelecShow">状态</text>
|
||||
</view>
|
||||
<view class="searchView">
|
||||
<u-search :clearabled="true" @search="loadBoeData(true)" @clear="loadBoeData(true)"
|
||||
placeholder="搜索关键字" v-model="loadkeyword" :showAction="false" shape="square" bgColor="#ffffff">
|
||||
</u-search>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="sea-show" v-show="loadstatusSelecShow">
|
||||
<text v-for="(item,index) in statustList" :key="index"
|
||||
:class="[item.value === boeStatus?'sea-active':'','sea-index' ]"
|
||||
@click="loadchooseStatust(item.value)">{{item.name}}</text>
|
||||
</view>
|
||||
<!-- <view class="sea-show" v-show="loadstatusSelecShow">
|
||||
<text v-for="(item,index) in statustList" :class="[item.value == boeStatus?'sea-active':'','sea-index' ]" @click="loadchooseStatust(item.value)">{{item.name}}</text>
|
||||
</view> -->
|
||||
<view class="course content" v-for="(task,idx) in couresList" :key="idx" @click="loaddetail(task)">
|
||||
<view class="course-info">
|
||||
<!-- <view class="course-title two-line-ellipsis" style="margin-bottom: 20upx;"><text
|
||||
style="font-size: 32upx;color: #343434; font-weight: bold;" v-html="task.cmtask_name"></text></view> -->
|
||||
<view class="course-info-left">
|
||||
<!-- <img :src="task.cmtask_imgurl" style="width: 152upx;height: 88upx; border-radius: 8upx;"> -->
|
||||
<!-- <view class="courseimage" style="width: 152rpx;height: 88rpx;"> -->
|
||||
<course-image :course="task" width="265upx" height="154upx"></course-image>
|
||||
<!-- </view> -->
|
||||
<course-image :course="task" width="256upx" height="148upx"></course-image>
|
||||
<view class="course-text">
|
||||
<!-- <view class="course">
|
||||
<u-line-progress inactiveColor="#e2e2e2" :percentage="task.percentage" :showText="false"
|
||||
height="5" activeColor="#18C6FB"></u-line-progress>
|
||||
</view> -->
|
||||
<view class="course-title one-line-ellipsis" style="margin-bottom: auto"><text
|
||||
style="font-size: 32upx; font-weight: bold;" v-html="task.cmtask_name"></text>
|
||||
style="font-size: 32upx; font-weight: 500;" v-html="task.cmtask_name"></text>
|
||||
</view>
|
||||
<view class="course-btn">
|
||||
<view style="font-size: 24upx;color: #BFBFBF;margin-top: 14upx;margin-bottom: 6upx">
|
||||
推送时间:
|
||||
{{task.created_at}}
|
||||
<view class="task-bottom">
|
||||
<!-- <view class="course-aut">
|
||||
<author-info :avatar="task.avatar" :name="task.authorName" :info="task.orgInfo" :sex="task.sex"></author-info>
|
||||
</view> -->
|
||||
<view class="coures-staus">
|
||||
<text v-if="task.cmtask_status == 0">未开始</text>
|
||||
<text v-if="task.cmtask_status == 1">进行中</text>
|
||||
<text v-if="task.cmtask_status == 2">已完成</text>
|
||||
</view>
|
||||
<!-- <view class="" style="font-weight: 600;margin-left: 25px;">{{task.percentage}}%</view> -->
|
||||
</view>
|
||||
<view class="coures-staus">
|
||||
<text v-if="task.cmtask_status == 0">未开始</text>
|
||||
<text v-if="task.cmtask_status == 1">进行中</text>
|
||||
<text v-if="task.cmtask_status == 2">已完成</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view style="margin-top: 60upx;">
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 自主学习 -->
|
||||
<view class="listbox" v-show="tabIndex===1">
|
||||
<view class="listbox-top">
|
||||
<!-- 自主学习状态查询 -->
|
||||
<!-- <view class="top-ten">
|
||||
<u-picker v-model="classType" :show="statusSelectShow" @cancel="statusSelectShow = false"
|
||||
@confirm="chooseStatus" :columns="statustList" keyName="name"></u-picker>
|
||||
<text class="textbtn" @click="statusSelectShow = true">{{statusBtnName}}</text>
|
||||
</view> -->
|
||||
<!-- 自主学习类型查询 -->
|
||||
<view class="top-ten" style="margin-top: 21px;margin-left: 13px;">
|
||||
<!-- <u-picker v-model="statust" :show="statusSelecShow" @cancel="statusSelecShow = false"
|
||||
@confirm="chooseStatust" :columns="typeArray" keyName="name"></u-picker>
|
||||
<text class="textbtn" @click="statusSelecShow = true">{{statusBtns}}</text> -->
|
||||
<text class="textbtn" @click="statusSelecShow=!statusSelecShow;autonomyStatusShow=false">类型</text>
|
||||
<text class="textbtn" style="margin:0 20upx;"
|
||||
@click="autonomyStatusShow=!autonomyStatusShow;statusSelecShow=false">进度</text>
|
||||
</view>
|
||||
<view class="searchView" style="margin-left: 0;">
|
||||
<u-search :clearabled="true" @search="searchData()" @clear="searchData()" placeholder="搜索关键字"
|
||||
v-model="autonomy.keyword" :showAction="false" shape="square" bgColor="#ffffff"></u-search>
|
||||
</view>
|
||||
</view>
|
||||
<view class="sea-show" v-show="statusSelecShow">
|
||||
<text v-for="(item,tidx) in typeArray" :key="tidx"
|
||||
:class="[item.value == classType ?'sea-active':'','sea-index' ]"
|
||||
@click="Application(item.value)">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="sea-show" v-show="autonomyStatusShow">
|
||||
<text :class="[autonomy.status == 0?'sea-active':'','sea-index']" @click="autonomyStatus(0)">全部</text>
|
||||
<text :class="[autonomy.status == 1?'sea-active':'','sea-index']" @click="autonomyStatus(1)">未开始</text>
|
||||
<text :class="[autonomy.status == 2?'sea-active':'','sea-index']" @click="autonomyStatus(2)">进行中</text>
|
||||
<text :class="[autonomy.status == 9?'sea-active':'','sea-index']" @click="autonomyStatus(9)">已完成</text>
|
||||
</view>
|
||||
|
||||
<view v-if="studyList.length == 0 && couresList.length == 0 && isOne" class="zan-wu">
|
||||
您还没有学习课程,快去学习吧~
|
||||
</view>
|
||||
@@ -112,53 +94,32 @@
|
||||
<view style="position: relative;">
|
||||
<course-image class="uc-course-type" :course="c" width="265upx" height="154upx">
|
||||
</course-image>
|
||||
<text class="uc-course-type-text" v-if="c.courseType == 10">录播</text>
|
||||
<!-- <text class="uc-course-type-text" v-if="c.courseType == 10">录播</text>
|
||||
<text class="uc-course-type-text" v-if="c.courseType == 20">录播</text>
|
||||
<text class="uc-course-type-text" v-if="c.courseType == 'online-course'">录播</text>
|
||||
<text class="uc-course-type-text" v-if="c.courseType == 'face-course'">线下课</text>
|
||||
<text v-if="c.courseType == 'project'" class="uc-course-type-text">学习项目</text>
|
||||
<text v-if="c.courseType == 'project'" class="uc-course-type-text">学习项目</text> -->
|
||||
</view>
|
||||
|
||||
<view class="course-text" style="justify-content: space-between;position: relative;">
|
||||
<view class="course-title one-line-ellipsis" style="width: 90%;">
|
||||
<text style="font-size: 30upx; font-weight: bold;"
|
||||
v-html="$keywordActiveShow(c.courseName, autonomy.keyword)"></text>
|
||||
<text style="font-size: 30upx; font-weight: bold;" v-html="$keywordActiveShow(c.courseName, autonomy.keyword)"></text>
|
||||
</view>
|
||||
<view class="coures-midd">
|
||||
<view class="course-author">
|
||||
{{c.teacherName}}
|
||||
</view>
|
||||
<!-- <view class="coures-button"> -->
|
||||
<!-- <text class="toStudyText">
|
||||
<u-icon v-if="c.progress==100" @click.native.stop="toStudy(c)" :size="16" label="回顾"
|
||||
:bold="true" :labelSize="11" labelColor="#FF8E00" color="#FF8E00" name="reload">
|
||||
</u-icon>
|
||||
<u-icon v-else @click.native.stop="toStudy(c)" :size="16" label="播放" :bold="true"
|
||||
:labelSize="11" labelColor="#FF8E00" color="#FF8E00" name="play-right"></u-icon>
|
||||
</text> -->
|
||||
<!-- </view> -->
|
||||
</view>
|
||||
<view class="rowbtn">
|
||||
<image @click.native.stop="rowbtn(c)" style="width: 100%;height: 100%;"
|
||||
<view class="rowbtn" >
|
||||
<image @click.native.stop="removecour(c)" style="width: 100%;height: 100%;position: relative"
|
||||
src="../../static/images/icon/more.png" alt="">
|
||||
<view class="delcoures" v-show="c.delcour" @click.native.stop="rowbtn(c)">
|
||||
<u-icon style="line-height: 90upx;" name="trash" label="删除课程"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view class="coures-bottom coures-midd">
|
||||
<view v-if="c.teacherName" class="course-author">
|
||||
{{c.teacherName}}
|
||||
</view>
|
||||
<view class="coures-staus">
|
||||
<text v-html="displayWord(c)"></text>
|
||||
</view>
|
||||
<view class="coures-button">
|
||||
<text class="toStudyText">
|
||||
<u-icon v-if="c.progress==100" @click.native.stop="toStudy(c)" :size="16"
|
||||
label="回顾" :bold="true" :labelSize="11" labelColor="#FF8E00" color="#FF8E00"
|
||||
name="reload">
|
||||
</u-icon>
|
||||
<u-icon v-else @click.native.stop="toStudy(c)" :size="16" label="播放"
|
||||
:bold="true" :labelSize="11" labelColor="#FF8E00" color="#FF8E00"
|
||||
name="play-right"></u-icon>
|
||||
</text>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -199,7 +160,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
<view style="margin-top: 60upx;">
|
||||
<uni-load-more :status="loadStatus"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
@@ -247,11 +208,12 @@
|
||||
ref="uModal" :asyncClose="true">
|
||||
您确定要重新学习吗?
|
||||
</u-modal>
|
||||
<u-popup :show="btnsShow" @close="closeBtns">
|
||||
<u-modal :show="btnsShow" @confirm="del()" @cancel="closeBtns()" :showCancelButton="true" confirmText="删除" ref="uModal" content='您确认要删除此课程吗'></u-modal>
|
||||
<!-- <u-popup :show="btnsShow" @close="closeBtns">
|
||||
<view>
|
||||
<view @click="del()" class="big-button" style="color: #db0000;">删除</view>
|
||||
<view @click="closeBtns()" class="big-button">取消</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</u-popup>
|
||||
<u-overlay :show="overlayShow && isOneStady === 0">
|
||||
<view class="warp">
|
||||
@@ -292,24 +254,22 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-overlay>
|
||||
<gonggao></gonggao>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import apicourseStudy from "../../api/modules/courseStudy.js"
|
||||
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
import {formatDate} from '@/utils/tools.js';
|
||||
import { formatDate } from '@/utils/tools.js';
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import {mapGetters} from 'vuex'
|
||||
import gonggao from '@/components/gonggao/index.vue'
|
||||
import { mapGetters } from 'vuex'
|
||||
export default {
|
||||
components:{gonggao},
|
||||
computed: {
|
||||
...mapGetters(['userInfo', 'isOneStady'])
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
Applistatus:'',
|
||||
autonomyStatusShow: false,
|
||||
delData: {},
|
||||
btnsShow: false, // 我报名的删除弹出
|
||||
@@ -336,7 +296,7 @@
|
||||
couresList: '',
|
||||
switch: '',
|
||||
hisswitch: '',
|
||||
classType: 0,
|
||||
classType: '',
|
||||
hisclassType: '',
|
||||
historyList: '',
|
||||
studyList: [],
|
||||
@@ -374,6 +334,12 @@
|
||||
{name: '进行中',value: 1},
|
||||
{name: '已完成',value: 2}
|
||||
],
|
||||
autonomyStatustList: [
|
||||
{name: '全部',value: 0},
|
||||
{name: '未开始',value: 1},
|
||||
{name: '进行中',value: 2},
|
||||
{name: '已完成',value: 9}
|
||||
],
|
||||
statustArray: [
|
||||
[{name: '在线课',value: 'online-course'},
|
||||
{name: '面授班',value: 'face-course'},
|
||||
@@ -436,6 +402,9 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('click',this.reSetList);
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.onReachBottom();
|
||||
},
|
||||
@@ -454,6 +423,15 @@
|
||||
}, 500);
|
||||
},
|
||||
methods: {
|
||||
reSetList() {
|
||||
this.studyList.forEach(item=>{
|
||||
item.delcour = false;
|
||||
})
|
||||
},
|
||||
removecour(item){
|
||||
this.reSetList();
|
||||
item.delcour = !item.delcour
|
||||
},
|
||||
rowbtn(row) {
|
||||
this.delData = row;
|
||||
this.btnsShow = true;
|
||||
@@ -468,6 +446,7 @@
|
||||
});
|
||||
this.studyList.forEach((item, index) => {
|
||||
if (item.id === this.delData.id) {
|
||||
// item.delcour = false;
|
||||
this.studyList.splice(index, 1);
|
||||
}
|
||||
})
|
||||
@@ -555,16 +534,22 @@
|
||||
})
|
||||
},
|
||||
autonomyStatus(num) {
|
||||
// this.isSelect = num;
|
||||
this.Applistatus = num;
|
||||
this.autonomy.status = num;
|
||||
this.statusSelectShow = false;
|
||||
// console.log(this.Applistatus)
|
||||
// this.getLearning();
|
||||
this.searchData();
|
||||
},
|
||||
taskStatus(num) {
|
||||
this.boeStatus = num;
|
||||
this.statusSelectShow = false;
|
||||
this.loadBoeData(true);
|
||||
},
|
||||
closeBtns() {
|
||||
this.btnsShow = false;
|
||||
},
|
||||
searchData() {
|
||||
// this.page.pageIndex = 1;
|
||||
// this.isListOne = true;
|
||||
let list = this.studyData;
|
||||
let type;
|
||||
let wei;
|
||||
@@ -605,10 +590,11 @@
|
||||
});
|
||||
// window.open(`/loaddetail?id=${task.cmtask_id}`)
|
||||
},
|
||||
|
||||
|
||||
loadBoeData(flag) {
|
||||
if (flag) {
|
||||
this.taskPageIndex = 1; //回到首页
|
||||
this.couresList = [];
|
||||
}
|
||||
let params = {
|
||||
page: this.taskPageIndex,
|
||||
@@ -620,14 +606,12 @@
|
||||
params.cmtask_name = this.keyWord;
|
||||
}
|
||||
apiBoeCourse.cmtaskList(params).then(res => {
|
||||
|
||||
this.taskCount = res.result.count;
|
||||
res.result.list.forEach(item => {
|
||||
let time = this.formatDate(item.created_at * 1000);
|
||||
item.created_at = time.split(' ')[0];
|
||||
// item.created_at = this.formatDate(item.created_at*1000);
|
||||
});
|
||||
this.couresList = res.result.list;
|
||||
this.taskCount = res.result.count;
|
||||
this.couresList.push(...res.result.list);
|
||||
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
||||
this.taskHasMore = true;
|
||||
} else {
|
||||
@@ -645,7 +629,37 @@
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
loadUserInfos(list, userIds) {
|
||||
const noReapetIds = [...new Set(userIds)];
|
||||
apiUser.getByIds(noReapetIds).then(res => {
|
||||
if (res.status == 200) {
|
||||
list.forEach(item => {
|
||||
res.result.some(author => {
|
||||
if (author.aid == item.sysCreateAid) {
|
||||
let { aid, avatar, name, orgInfo, code ,sex} = author;
|
||||
item.name = name;
|
||||
item.aid = aid;
|
||||
item.orgInfo = orgInfo;
|
||||
item.code = code;
|
||||
item.avatar = avatar;
|
||||
item.sex =sex;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '获取数据失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
uni.hideLoading();
|
||||
}, 100);
|
||||
});
|
||||
},
|
||||
message() {
|
||||
uni.navigateTo({
|
||||
url: './message'
|
||||
@@ -653,12 +667,12 @@
|
||||
},
|
||||
clicktab(idx) {
|
||||
this.tabIndex = idx;
|
||||
if (this.tabIndex == 1) {
|
||||
if (this.tabIndex == 1 && this.studyList.length == 0) {
|
||||
this.getLearning()
|
||||
// this.searchData();
|
||||
} else if (this.tabIndex == 2) {
|
||||
this.history()
|
||||
} else if (this.tabIndex == 0) {
|
||||
} else if (this.tabIndex == 0 && this.couresList.length == 0) {
|
||||
this.loadBoeData()
|
||||
}
|
||||
},
|
||||
@@ -710,23 +724,20 @@
|
||||
title: '加载中...'
|
||||
});
|
||||
this.loadStatus = 'loading';
|
||||
// let classType = null;
|
||||
|
||||
let data = [];
|
||||
let lear = {
|
||||
pageIndex: 1, //第几页
|
||||
pageSize: 200,
|
||||
courseName: this.learkeyword,
|
||||
// courseType: classType,
|
||||
status: this.status,
|
||||
status: this.Applistatus,
|
||||
}
|
||||
// if(this.classType == 'online-course' || this.classType == '') {
|
||||
await apicourseStudy.myStudyList(lear).then(res => {
|
||||
if (res.status == 200) {
|
||||
// 我报名的接口
|
||||
//console.log(res)
|
||||
let courseIds = [];
|
||||
res.result.list.forEach(item => {
|
||||
item.delcour = false;
|
||||
item.teachersName = '';
|
||||
item.addTime = item.addTime.split(' ')[0];
|
||||
courseIds.push(item.courseId);
|
||||
@@ -736,17 +747,20 @@
|
||||
data.push(...res.result.list);
|
||||
}
|
||||
})
|
||||
// }
|
||||
let learData = {
|
||||
page: 1,
|
||||
size: 200,
|
||||
type: this.classType
|
||||
}
|
||||
await apiBoeCourse.myLearning(learData).then(res => {
|
||||
|
||||
|
||||
if (res.status == 200) {
|
||||
res.result.dataList.forEach(item => {
|
||||
item.delcour = false;
|
||||
})
|
||||
let list = this.filterConversion(res.result.dataList);
|
||||
data.push(...list);
|
||||
|
||||
}
|
||||
})
|
||||
this.loadStatus = 'noMore';
|
||||
@@ -794,15 +808,9 @@
|
||||
url: '/pages/study/studydetail?id=' + citem.id + '&type=' + citem.courseType
|
||||
});
|
||||
} else {
|
||||
if (citem.courseType == 10) {
|
||||
uni.navigateTo({
|
||||
url: '../resource/microDetail?studyId=' + citem.id + '&id=' + citem.courseId
|
||||
url: '/pages/study/courseStudy?studyId=' + citem.id + '&id=' + citem.courseId
|
||||
})
|
||||
} else if (citem.courseType == 20) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/study/onlineCourse?studyId=' + citem.id + '&id=' + citem.courseId
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
choose(citem) {
|
||||
@@ -817,12 +825,12 @@
|
||||
}
|
||||
},
|
||||
// 自主学习选择状态事件
|
||||
chooseStatus(e) {
|
||||
this.statusSelectShow = false;
|
||||
this.statusBtnName = e.value[0].name;
|
||||
this.autonomy.status = e.value[0].value;
|
||||
this.searchData();
|
||||
},
|
||||
// chooseStatus(e) {
|
||||
// this.statusSelectShow = false;
|
||||
// this.statusBtnName = e.value[0].name;
|
||||
// this.autonomy.status = e.value[0].value;
|
||||
// this.searchData();
|
||||
// },
|
||||
// 自主学习选择类型事件
|
||||
// chooseStatust(e) {
|
||||
// this.statusSelecShow = false;
|
||||
@@ -833,38 +841,35 @@
|
||||
|
||||
// },
|
||||
// 历史记录选择类型事件
|
||||
hischooseStatus(e) {
|
||||
this.hisstatusSelectShow = false;
|
||||
this.hisstatusBtnName = e.value[0].name;
|
||||
this.hisswitch = e.value[0].value;
|
||||
if (this.hisswitch == 10) {
|
||||
this.hisclassType = 10
|
||||
this.history()
|
||||
} else {
|
||||
this.hisclassType = 20
|
||||
this.history()
|
||||
}
|
||||
},
|
||||
loadchooseStatust(e) {
|
||||
// this.loadstatusSelecShow = false;
|
||||
// this.loadstatusBtnName = e.value[0].name;
|
||||
this.boeStatus = e;
|
||||
this.loadBoeData()
|
||||
},
|
||||
Application(e) {
|
||||
this.classType = e;
|
||||
this.autonomy.type = e;
|
||||
this.searchData();
|
||||
// this.getLearning();
|
||||
},
|
||||
|
||||
// hischooseStatus(e) {
|
||||
// this.hisstatusSelectShow = false;
|
||||
// this.hisstatusBtnName = e.value[0].name;
|
||||
// this.hisswitch = e.value[0].value;
|
||||
// if (this.hisswitch == 10) {
|
||||
// this.hisclassType = 10
|
||||
// this.history()
|
||||
// } else {
|
||||
// this.hisclassType = 20
|
||||
// this.history()
|
||||
// }
|
||||
// },
|
||||
// loadchooseStatust(e) {
|
||||
// this.boeStatus = e;
|
||||
// this.loadBoeData()
|
||||
// },
|
||||
// Application(e) {
|
||||
// this.classType = e;
|
||||
// this.autonomy.type = e;
|
||||
// this.searchData();
|
||||
// this.getLearning();
|
||||
// },
|
||||
displayWord(data) {
|
||||
if (data.progress == 0) {
|
||||
return '未开始'
|
||||
} else if (data.progress == 100) {
|
||||
return '已完成'
|
||||
} else {
|
||||
return `已学<text style="color:#FF8E00">${data.progress}%</text>`
|
||||
return '进行中'
|
||||
}
|
||||
},
|
||||
jumpToDetail(data) {
|
||||
@@ -875,25 +880,99 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/deep/ .u-modal{
|
||||
width: 288px !important;
|
||||
border-radius: 28upx;
|
||||
}
|
||||
/deep/ .u-modal__content{
|
||||
text-align: center;
|
||||
font-size: 36upx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
padding: 33px 25px 33px 25px;
|
||||
}
|
||||
.delcoures{
|
||||
position: absolute;
|
||||
width: 180upx;
|
||||
top: 40upx;
|
||||
right: 0;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 1px 4px 1px rgba(0,0,0,0.08);
|
||||
border-radius: 8upx;
|
||||
z-index: 77;
|
||||
padding: 30upx 30upx;
|
||||
color: #333333;
|
||||
}
|
||||
.addition {
|
||||
position: absolute;
|
||||
right: 10upx;
|
||||
top: 136upx;
|
||||
.textbtn {
|
||||
display: flex;
|
||||
width: 108upx;
|
||||
color: #4f4f4f;
|
||||
font-size: 28upx;
|
||||
}
|
||||
.sea-show {
|
||||
width: 130upx;
|
||||
position: absolute;
|
||||
top: 80upx;
|
||||
right: 0;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0px 2upx 8upx 4upx rgba(0,0,0,0.07);
|
||||
border-radius: 12upx;
|
||||
padding: 20upx 60upx;
|
||||
z-index: 99;
|
||||
.sea-active{
|
||||
color: #387DF7 !important;
|
||||
}
|
||||
.sea-index{
|
||||
font-size: 28upx;
|
||||
color: #666666;
|
||||
line-height: 60upx;
|
||||
text-align: center;
|
||||
}
|
||||
.sea-index:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.listbox-top {
|
||||
height: 92upx;
|
||||
padding-top: 28upx;
|
||||
background: #fff;
|
||||
.top-ten {
|
||||
// margin-top: 20upx;
|
||||
margin-left: 24upx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.searchView {
|
||||
margin-left: 32upx;
|
||||
line-height: 62upx;
|
||||
height: 72upx;
|
||||
margin-right: 110upx;
|
||||
border-radius: 76upx;
|
||||
display: flex;
|
||||
background-color: #F2F5F7;
|
||||
::v-deep .u-search {
|
||||
width: 195px;
|
||||
border-radius: 76upx !important;
|
||||
}
|
||||
}
|
||||
.course-aut{
|
||||
font-size: 24upx;
|
||||
color: #333333;
|
||||
}
|
||||
.task-bottom{
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.coures-staus {
|
||||
flex: 1;
|
||||
font-size: 24upx;
|
||||
font-size: 28upx;
|
||||
color: #777980;
|
||||
// position: relative;
|
||||
|
||||
|
||||
// /deep/ .toStudyText{
|
||||
// font-size: 8px;
|
||||
// background: #EEEEEE;
|
||||
// padding: 4px 10px;
|
||||
// border-radius: 40px;
|
||||
// color: #FF8E00;
|
||||
// >span{
|
||||
// display:flex;
|
||||
// justify-content:center;
|
||||
// align-items:center;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
.big-button {
|
||||
@@ -907,9 +986,8 @@
|
||||
display: flex;
|
||||
|
||||
.course-author {
|
||||
// color: #777980;
|
||||
margin-right: 30upx;
|
||||
font-size: 28upx;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.coures-button {
|
||||
@@ -982,16 +1060,11 @@
|
||||
padding: 20upx 30upx 10upx 30upx;
|
||||
|
||||
.sea-active {
|
||||
border: 1rpx solid #679cfc !important;
|
||||
color: #679cfc;
|
||||
}
|
||||
|
||||
.sea-index {
|
||||
font-size: 26rpx;
|
||||
padding: 6rpx 16rpx;
|
||||
border: 1rpx solid #ccc;
|
||||
border-radius: 20rpx;
|
||||
margin-right: 16rpx;
|
||||
// margin-right: 16rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
@@ -1182,33 +1255,50 @@
|
||||
.tabbar {
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background: linear-gradient(to bottom, #6ba0fc, #6297fd);
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
color: #ffffff;
|
||||
|
||||
color: #666;
|
||||
font-size: 32upx;
|
||||
.tabbar-item {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
.border-bottom-one{
|
||||
width: 120upx;
|
||||
position: absolute;
|
||||
right: 28upx;
|
||||
height: 8upx;
|
||||
background: #387DF7;
|
||||
border-radius: 8upx;
|
||||
display: none;
|
||||
}
|
||||
.border-bottom-two{
|
||||
width: 120upx;
|
||||
position: absolute;
|
||||
left: 22upx;
|
||||
height: 8upx;
|
||||
background: #387DF7;
|
||||
border-radius: 8upx;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.tabbar-item :nth-child(1) {
|
||||
text-align: center;
|
||||
line-height: 20upx;
|
||||
height: 20upx;
|
||||
}
|
||||
|
||||
.tabber-co {
|
||||
position: absolute;
|
||||
right: -30upx;
|
||||
margin-top: 20upx;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 2px solid #ffffff;
|
||||
color: #387DF7;
|
||||
font-size: 44upx;
|
||||
font-weight: 500;
|
||||
.border-bottom-two{
|
||||
display: block;
|
||||
}
|
||||
.border-bottom-one{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.listbox {
|
||||
background-color: #F9f9f9;
|
||||
.course-info-text {
|
||||
padding: 15upx;
|
||||
margin-bottom: 15upx;
|
||||
@@ -1231,76 +1321,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
.listbox-top {
|
||||
height: 90upx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
.top-ten {
|
||||
// width: 120upx;
|
||||
// height: 62upx;
|
||||
margin-top: 20upx;
|
||||
margin-left: 24upx;
|
||||
// background-color: #fff;
|
||||
text-align: center;
|
||||
// line-height: 62upx;
|
||||
}
|
||||
|
||||
.searchView {
|
||||
background-color: #fff;
|
||||
flex: 1;
|
||||
height: 62upx;
|
||||
line-height: 62upx;
|
||||
margin-left: 20upx;
|
||||
margin-top: 30upx;
|
||||
border-radius: 8px;
|
||||
margin-right: 20upx;
|
||||
display: flex;
|
||||
|
||||
.u-search {
|
||||
width: 195px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// .listboxtwo-top {
|
||||
// height: 120upx;
|
||||
// display: flex;
|
||||
// justify-content: space-around;
|
||||
|
||||
// .top-ten {
|
||||
// width: 120upx;
|
||||
// height: 62upx;
|
||||
// margin-top: 30upx;
|
||||
// margin-left: 53upx;
|
||||
// background-color: #fff;
|
||||
// text-align: center;
|
||||
// line-height: 62upx;
|
||||
// border-radius: 8px;
|
||||
// }
|
||||
|
||||
// .searchView {
|
||||
// background-color: #fff;
|
||||
// flex: 1;
|
||||
// height: 62upx;
|
||||
// line-height: 62upx;
|
||||
// margin-left: 20upx;
|
||||
// margin-top: 30upx;
|
||||
// border-radius: 8px;
|
||||
// margin-right: 8upx;
|
||||
|
||||
// .u-search {
|
||||
// width: 195px;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
.content {
|
||||
|
||||
padding: 20upx 30upx;
|
||||
margin-bottom: 10px;
|
||||
margin-top: 10px;
|
||||
border-radius: 7upx;
|
||||
}
|
||||
|
||||
@@ -1372,12 +1398,11 @@
|
||||
|
||||
.course-text {
|
||||
display: flex;
|
||||
height: 80px;
|
||||
height: 140upx;
|
||||
margin-top: -6px;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
// font-size: 28upx;
|
||||
// color: #777980;
|
||||
|
||||
margin-left: 10px;
|
||||
margin-right: 1px;
|
||||
width: 100%;
|
||||
|
||||
@@ -746,52 +746,51 @@
|
||||
},
|
||||
onPlayerPlaying(e){
|
||||
//console.log("当前播放11",itme);
|
||||
this.isAppendTime=false;//禁止追加学习时间
|
||||
//console.log("当前播放11"+itme);
|
||||
let intTime=parseInt(e.detail.currentTime);
|
||||
if(intTime>this.videoPlayingTime){
|
||||
this.videoPlayingTime=intTime;
|
||||
this.isAppendTime=false;//禁止追加学习时间
|
||||
//console.log("当前播放11"+itme);
|
||||
let intTime=parseInt(e.detail.currentTime);
|
||||
if(intTime>this.videoPlayingTime){
|
||||
this.videoPlayingTime=intTime;
|
||||
|
||||
//判断是否完成
|
||||
let completeType=this.curriculumData.completeSetup;
|
||||
let completeSecond=this.curriculumData.second;
|
||||
if(!completeSecond){
|
||||
completeSecond=5;//如果没有就采用默认的时间了
|
||||
}
|
||||
if(completeType>0 && this.curContent.status<9){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
|
||||
if(completeType==1){
|
||||
let finishPercent=this.curriculumData.setupTage;
|
||||
let videDuration=this.curContent.duration;
|
||||
let percent =intTime*100/videDuration;
|
||||
if(percent>=finishPercent){
|
||||
this.finishStudyItem();
|
||||
let completeType=this.curriculumData.completeSetup;
|
||||
let completeSecond=this.curriculumData.second;
|
||||
if(!completeSecond){
|
||||
completeSecond=5;//如果没有就采用默认的时间了
|
||||
}
|
||||
if(completeType>0 && this.curContent.status<9){ //因为1按进度,2按时长都是计算时间,所以这里直接大于0处理
|
||||
if(completeType==1){
|
||||
let finishPercent=this.curriculumData.setupTage;
|
||||
let videDuration=this.curContent.duration;
|
||||
let percent =intTime*100/videDuration;
|
||||
if(percent>=finishPercent){
|
||||
this.finishStudyItem();
|
||||
}
|
||||
}else if(completeType==2){
|
||||
if(intTime>=completeSecond){
|
||||
this.finishStudyItem();
|
||||
}
|
||||
}
|
||||
}else if(completeType==2){
|
||||
if(intTime>=completeSecond){
|
||||
this.finishStudyItem();
|
||||
}
|
||||
}
|
||||
//以下是每隔10秒存储一下进度
|
||||
let saveTime=Math.floor(intTime%10);
|
||||
//console.log(intTime,saveTime,'aa',this.curContent.studyItemId)
|
||||
if(this.preTime!=intTime && saveTime==0 && this.curContent.studyItemId!=''){
|
||||
this.preTime=intTime;
|
||||
this.curContent.lastStudyTime=intTime;
|
||||
//记录播放时间
|
||||
//console.log('记录播放时间:'+intTime);
|
||||
let postData={
|
||||
itemId:this.curContent.studyItemId,
|
||||
videoTime:intTime
|
||||
}
|
||||
apiCourseStudy.studyVideoTime(postData).then(rs=>{
|
||||
if(rs.status!=200){
|
||||
console.log('记录播放时间错误');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//以下是每隔10秒存储一下进度
|
||||
let saveTime=Math.floor(intTime%10);
|
||||
//console.log(intTime,saveTime,'aa',this.curContent.studyItemId)
|
||||
if(this.preTime!=intTime && saveTime==0 && this.curContent.studyItemId!=''){
|
||||
this.preTime=intTime;
|
||||
this.curContent.lastStudyTime=intTime;
|
||||
//记录播放时间
|
||||
//console.log('记录播放时间:'+intTime);
|
||||
let postData={
|
||||
itemId:this.curContent.studyItemId,
|
||||
videoTime:intTime
|
||||
}
|
||||
apiCourseStudy.studyVideoTime(postData).then(rs=>{
|
||||
if(rs.status!=200){
|
||||
console.log('记录播放时间错误');
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
audioPlay(){
|
||||
this.isAppendTime=false;
|
||||
@@ -1026,7 +1025,7 @@
|
||||
},
|
||||
playContent(cata,con,conIndex,catIndex){
|
||||
|
||||
if(conIndex!=undefined && catIndex!=undefined) {
|
||||
if(conIndex && catIndex) {
|
||||
if(this.courseInfo.orderStudy) {
|
||||
let hasIndex=-1;
|
||||
this.scrollList.some((one,idx)=>{
|
||||
|
||||
80
pages/study/videoTest.vue
Normal file
80
pages/study/videoTest.vue
Normal file
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="show">
|
||||
<video-player
|
||||
:url="fileUrl"
|
||||
:name="title"
|
||||
:inittime="initTime"
|
||||
:drag="true"
|
||||
@play="videoPlay"
|
||||
@pause="videoPause"
|
||||
@timeupdate="videoPlaying"
|
||||
@ended="videoEnd"
|
||||
@fullscreenchange="videoScreen">
|
||||
</video-player>
|
||||
</view>
|
||||
<view style="padding-top: 30px;display: flex;justify-content: center;">
|
||||
<button type="default" @click="loadVideo()">加载</button>
|
||||
<button type="primary" @click="changeSrc()">切换测试</button>
|
||||
</view>
|
||||
<view>
|
||||
<video style="width: 100%;"
|
||||
:src="fileUrl"
|
||||
:controls="true"
|
||||
@fullscreenchange="videoScreen"
|
||||
></video>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
show:false,
|
||||
fileUrl:'',
|
||||
initTime:0,
|
||||
title:'',
|
||||
author:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadVideo();
|
||||
},
|
||||
methods:{
|
||||
loadVideo(){
|
||||
//this.fileUrl='http://localhost:9090/cdn/upload/course/2022/5/979321410778959872.mp3';
|
||||
this.fileUrl='/static/temp/test.mp4';
|
||||
this.title='标题内容111';
|
||||
this.initTime=40;
|
||||
this.show=true;
|
||||
},
|
||||
changeSrc(){
|
||||
this.fileUrl='/static/temp/video.mp4';
|
||||
this.title='标题内容221';
|
||||
this.initTime=20
|
||||
},
|
||||
videoPlay(){
|
||||
console.log('videoPlay');
|
||||
},
|
||||
videoEnd(){
|
||||
console.log('videoEnd');
|
||||
},
|
||||
videoPause(){
|
||||
console.log('videoPause');
|
||||
},
|
||||
videoPlaying(){
|
||||
console.log('videoPlaying');
|
||||
},
|
||||
videoScreen(e){
|
||||
console.log('全屏',e);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.xaudio{
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user