mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-08 10:26:45 +08:00
我的任务对接
This commit is contained in:
47
pages/forward.vue
Normal file
47
pages/forward.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<!-- 学习任务详情 -->
|
||||
<view class="loaddetail-box">
|
||||
<!-- <page-title :showBack="true">详细信息</page-title> -->
|
||||
<web-view v-if="innerUrl!=''" :src="innerUrl" style="width: 100%;height: 100%;"></web-view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data (){
|
||||
return{
|
||||
innerUrl:'',
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options,'options')
|
||||
let params=options.params;
|
||||
let to=options.to;
|
||||
let urlPre=window.location.protocol+'//'+window.location.host;
|
||||
this.innerUrl=urlPre+to
|
||||
if(params){
|
||||
this.innerUrl=this.innerUrl+'?'+params;
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
body{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
uni-page-body{
|
||||
height: 100%;
|
||||
}
|
||||
.loaddetail-box{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -260,6 +260,7 @@
|
||||
import apicourseStudy from "../../api/modules/courseStudy.js"
|
||||
import apiCoursePortal from '@/api/modules/coursePortal.js'
|
||||
import apiBoeCourse from '@/api/boe/course.js';
|
||||
import apiManage from '@/api/manage/manage.js';
|
||||
import { formatDate } from '@/utils/tools.js';
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import { mapGetters } from 'vuex'
|
||||
@@ -413,7 +414,7 @@
|
||||
let $this = this;
|
||||
if (this.tabIndex == 0) {
|
||||
if (this.taskHasMore) {
|
||||
this.taskPageSize++;
|
||||
this.taskPageIndex++;
|
||||
this.loadBoeData(false);
|
||||
}
|
||||
|
||||
@@ -585,10 +586,20 @@
|
||||
},
|
||||
// 学习任务跳转详情
|
||||
loaddetail(task) {
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/study/loaddetail?id=' + task.cmtask_id
|
||||
// });
|
||||
let taskUrl='';
|
||||
if(task.cmtask_type==1){ //学习路径图
|
||||
let params=encodeURIComponent('routerId='+task.cmtask_id);
|
||||
taskUrl='/pages/forward?to=/student-h5/pathdetails¶ms='+params;
|
||||
}else if(task.cmtask_type==2){ //学习项目
|
||||
let params=encodeURIComponent('projectId='+task.cmtask_id);
|
||||
taskUrl='/pages/forward?to=/student-h5/projectdetails¶ms='+params;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: '/pages/study/loaddetail?id=' + task.cmtask_id
|
||||
url: taskUrl
|
||||
});
|
||||
// window.open(`/loaddetail?id=${task.cmtask_id}`)
|
||||
},
|
||||
|
||||
loadBoeData(flag) {
|
||||
@@ -605,29 +616,58 @@
|
||||
if (this.cmtask_name) {
|
||||
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];
|
||||
});
|
||||
this.couresList.push(...res.result.list);
|
||||
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
||||
this.taskHasMore = true;
|
||||
} else {
|
||||
this.taskHasMore = false;
|
||||
|
||||
apiManage.userTaskList(params).then(res => {
|
||||
if(res.code==200){
|
||||
this.taskCount = parseInt(res.data.total);
|
||||
this.couresList.push(...res.data.records);
|
||||
if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
||||
this.taskHasMore = true;
|
||||
} else {
|
||||
this.taskHasMore = false;
|
||||
}
|
||||
if (this.isOne) {
|
||||
this.value = this.taskCount;
|
||||
}
|
||||
if (this.isOne && res.result.records.length == 0) {
|
||||
this.tabIndex = 1;
|
||||
}
|
||||
this.isOne = false;
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: '获取任务失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
if (this.isOne) {
|
||||
this.value = res.result.count;
|
||||
}
|
||||
if (this.isOne && res.result.list.length == 0) {
|
||||
this.tabIndex = 1;
|
||||
}
|
||||
this.isOne = false;
|
||||
|
||||
|
||||
|
||||
}).catch(err => {
|
||||
|
||||
|
||||
})
|
||||
|
||||
// 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];
|
||||
// });
|
||||
// this.couresList.push(...res.result.list);
|
||||
// if (this.taskCount > this.taskPageIndex * this.taskPageSize) {
|
||||
// this.taskHasMore = true;
|
||||
// } else {
|
||||
// this.taskHasMore = false;
|
||||
// }
|
||||
// if (this.isOne) {
|
||||
// this.value = res.result.count;
|
||||
// }
|
||||
// if (this.isOne && res.result.list.length == 0) {
|
||||
// this.tabIndex = 1;
|
||||
// }
|
||||
// this.isOne = false;
|
||||
|
||||
// }).catch(err => {
|
||||
|
||||
// })
|
||||
},
|
||||
loadUserInfos(list, userIds) {
|
||||
const noReapetIds = [...new Set(userIds)];
|
||||
|
||||
Reference in New Issue
Block a user