mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
对接接口
This commit is contained in:
@@ -3,13 +3,26 @@ import ajax from '../ajax';
|
|||||||
const baseURL = '/activityApi';
|
const baseURL = '/activityApi';
|
||||||
|
|
||||||
//notice新增
|
//notice新增
|
||||||
const saveOpinion=function (data){
|
const saveOpinion = (data = {}) => ajax.postJson(baseURL, '/xboe/m/boe/opinion/save', data);
|
||||||
return ajax.postJson(baseURL,'/xboe/m/boe/opinion/save',data);
|
//工具列表
|
||||||
}
|
const toolList = (data = {}) => ajax.postJson(baseURL, '/xboe/m/boe/files/list', data);
|
||||||
|
//通知列表
|
||||||
|
const noticeList = (data = {}) => ajax.postJson(baseURL, '/xboe/m/boe/notice/list', data);
|
||||||
|
//通知列表
|
||||||
|
const courselList = (data = {}) => ajax.postJson(baseURL, '/xboe/m/boe/course/list', data);
|
||||||
|
//通知根据id查询
|
||||||
|
const noticeDataById = (id) => ajax.get(baseURL, `/xboe/m/boe/notice/getDataById?id=${id}`);
|
||||||
|
const teachersList =(data = {}) => ajax.postJson(baseURL, '/xboe/m/boe/teachers/list', data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
saveOpinion
|
saveOpinion,
|
||||||
|
toolList,
|
||||||
|
noticeList,
|
||||||
|
noticeDataById,
|
||||||
|
courselList,
|
||||||
|
teachersList
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,15 +18,17 @@
|
|||||||
<router-link to="/grateful/gratefulNotice" style="font-size: 14px;">查看更多</router-link>
|
<router-link to="/grateful/gratefulNotice" style="font-size: 14px;">查看更多</router-link>
|
||||||
</div>
|
</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="(item, index) in 6" :key="index" style="cursor: pointer;line-height: 22px;" class="liList">
|
<li v-for="(item, index) in courseList.noticeList" :key="index"
|
||||||
<router-link :to="'/case/detail?id=' + item.id" style="display: flex;align-items: center;">
|
style="cursor: pointer;line-height: 22px;" class="liList">
|
||||||
|
<router-link :to="'/grateful/noticeDetail?id=' + item.id"
|
||||||
|
style="display: flex;align-items: center;">
|
||||||
<span class="portal-right-text blue-one">
|
<span class="portal-right-text blue-one">
|
||||||
<img :src="getPic(index)" alt="">
|
<img :src="getPic(index)" alt="">
|
||||||
</span>
|
</span>
|
||||||
<div class="portal-title-desc"
|
<div class="portal-title-desc"
|
||||||
style="flex: 1;font-size: 14px;display: flex;justify-content: space-between;">
|
style="flex: 1;font-size: 14px;display: flex;justify-content: space-between;">
|
||||||
<span class="title-line-ellipsis " style="width: 130px;">哈哈哈哈哈哈哈哈哈哈哈哈哈</span>
|
<span class="title-line-ellipsis " style="width: 130px;">{{ item.content }}</span>
|
||||||
<span>2023-09-09</span>
|
<span>{{ item.createTime.split(' ')[0] }}</span>
|
||||||
</div>
|
</div>
|
||||||
</router-link>
|
</router-link>
|
||||||
</li>
|
</li>
|
||||||
@@ -89,11 +91,6 @@
|
|||||||
<!--内容列表内容-->
|
<!--内容列表内容-->
|
||||||
<div v-for="(course, ccidx) in courseList.list" :key="'cc' + ccidx" class="xindex-course"
|
<div v-for="(course, ccidx) in courseList.list" :key="'cc' + ccidx" class="xindex-course"
|
||||||
style="position: relative;margin-right: 0;">
|
style="position: relative;margin-right: 0;">
|
||||||
<div style="position: absolute; right: 25px; bottom: 72px">
|
|
||||||
<interactBar nodeWidth="20px" :courseExclusive="true" :type="1" :data="course" :comments="false"
|
|
||||||
:praises="false" :shares="false" :views="false">
|
|
||||||
</interactBar>
|
|
||||||
</div>
|
|
||||||
<a @click="toCourseDetail(course)">
|
<a @click="toCourseDetail(course)">
|
||||||
<div class="xindex-course-image">
|
<div class="xindex-course-image">
|
||||||
<course-image :course="course"></course-image>
|
<course-image :course="course"></course-image>
|
||||||
@@ -104,13 +101,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="course-author">
|
<div class="course-author">
|
||||||
<div class="course-author-left">
|
<div class="course-author-left">
|
||||||
{{ course.authorInfo.name }}
|
{{ course.createName }}
|
||||||
|
<span class="study-num">{{ formatNum(course.studies) }}人学习</span>
|
||||||
<span class="study-num">{{ formatNum(course.studys) }}人学习</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<div v-if="course.score">
|
<div v-if="course.score != '0'">
|
||||||
<span class="course-score-value" style="margin-left: 10px">{{ toScore(course.score) }}分</span>
|
<span class="course-score-value" style="margin-left: 10px">{{ toScore(Number(course.score)) }}分</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="course-score-no">未评分</div>
|
<div v-else class="course-score-no">未评分</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -157,18 +153,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from "vuex";
|
|
||||||
import apiCourseStudy from "@/api/modules/courseStudy.js";
|
import apiCourseStudy from "@/api/modules/courseStudy.js";
|
||||||
import apiCourse from "@/api/modules/coursePortal.js";
|
|
||||||
import interactBar from "@/components/Portal/interactBar.vue";
|
|
||||||
import courseImage from "@/components/Course/courseImage.vue";
|
import courseImage from "@/components/Course/courseImage.vue";
|
||||||
import { toScore, formatUserNumber } from "@/utils/tools.js";
|
import { toScore, formatUserNumber } from "@/utils/tools.js";
|
||||||
import apiIndex from "@/api/phase2/index.js";
|
import { saveOpinion, noticeList, courselList } from '@/api/modules/grateful.js'
|
||||||
import { saveOpinion } from '@/api/modules/grateful.js'
|
|
||||||
export default {
|
export default {
|
||||||
name: "Grateful",
|
name: "Grateful",
|
||||||
components: {
|
components: {
|
||||||
interactBar,
|
|
||||||
courseImage,
|
courseImage,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -178,24 +169,20 @@ export default {
|
|||||||
},
|
},
|
||||||
gratefulVisible: false,
|
gratefulVisible: false,
|
||||||
formatNum: formatUserNumber,
|
formatNum: formatUserNumber,
|
||||||
isNext: true,
|
|
||||||
toScore,
|
toScore,
|
||||||
// 列表
|
// 列表
|
||||||
courseList: {
|
courseList: {
|
||||||
num: 12,
|
num: 12,
|
||||||
orderType: 2,
|
orderType: 2,
|
||||||
list: [],
|
list: [],
|
||||||
}
|
noticeList: []
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCourseData(1);
|
this.getCourseData(1);
|
||||||
},
|
this.getNoticeData()
|
||||||
computed: {
|
this.getToolData()
|
||||||
...mapGetters(["userInfo", "studyTaskCount"]),
|
|
||||||
swiper() {
|
|
||||||
return this.$refs.mySwiper.swiper;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
submitNotice() {
|
submitNotice() {
|
||||||
@@ -213,85 +200,44 @@ export default {
|
|||||||
this.gratefulVisible = false
|
this.gratefulVisible = false
|
||||||
},
|
},
|
||||||
toCourseDetail(item) {
|
toCourseDetail(item) {
|
||||||
//二期调整,直接改成一个地址
|
|
||||||
//return this.webBaseUrl + '/course/detail?id=' + item.id;
|
|
||||||
let $this = this;
|
|
||||||
if (item.type == 10) {
|
if (item.type == 10) {
|
||||||
//return this.webBaseUrl + "/course/studyindex?id=" + item.id;
|
|
||||||
//console.log("直接进入学习页面");
|
//console.log("直接进入学习页面");
|
||||||
this.$router.push("/course/studyindex?id=" + item.id);
|
this.$router.push("/course/studyindex?id=" + item.id);
|
||||||
} else if (item.type == 20) {
|
} else if (item.type == 20) {
|
||||||
apiCourseStudy.hasSignup(item.id).then((rs) => {
|
apiCourseStudy.hasSignup(item.id).then((rs) => {
|
||||||
if (rs.status == 200) {
|
if (rs.status == 200) {
|
||||||
//return $this.webBaseUrl + "/course/studyindex?id=" + item.id;
|
|
||||||
this.$router.push("/course/studyindex?id=" + item.id);
|
this.$router.push("/course/studyindex?id=" + item.id);
|
||||||
} else {
|
} else {
|
||||||
//return $this.webBaseUrl + "/course/detail?id=" + item.id;
|
|
||||||
this.$router.push("/course/detail?id=" + item.id);
|
this.$router.push("/course/detail?id=" + item.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//return $this.webBaseUrl + "/course/detail?id=" + item.id;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCourseData(pageIndex) {
|
getCourseData(pageIndex) {
|
||||||
this.isNext = false;
|
courselList({
|
||||||
let { orderType, num } = this.courseList;
|
pageNo: pageIndex,
|
||||||
let course = {
|
pageSize: 8
|
||||||
pageSize: 8,
|
}).then((res) => {
|
||||||
device: 1,
|
if (res.code == 200 && res.data.records.length > 0) {
|
||||||
orderField: orderType == 1 ? "" : "studys",
|
console.log(res.result, '之前的');
|
||||||
orderAsc: false,
|
this.courseList.list = res.data.records;
|
||||||
topOrder: true,
|
|
||||||
pageIndex: pageIndex,
|
|
||||||
};
|
|
||||||
|
|
||||||
apiIndex.courselist(course).then((res) => {
|
|
||||||
if (res.status == 200 && res.result.length > 0) {
|
|
||||||
let courseIds = [];
|
|
||||||
res.result.forEach((item) => {
|
|
||||||
item.authorInfo = {
|
|
||||||
aid: "",
|
|
||||||
name: "",
|
|
||||||
orgInfo: "",
|
|
||||||
avatar: "",
|
|
||||||
code: "",
|
|
||||||
sex: null,
|
|
||||||
};
|
|
||||||
courseIds.push(item.id);
|
|
||||||
});
|
|
||||||
this.loadCouserTeacher(res.result, courseIds);
|
|
||||||
this.courseList.list = res.result;
|
|
||||||
} else {
|
} else {
|
||||||
console.log("加载课程信息失败:" + res.error);
|
console.log("加载课程信息失败:" + res.error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadCouserTeacher(list, ids) {
|
getNoticeData() {
|
||||||
// 先查课程关联教师iD
|
noticeList({
|
||||||
apiCourse.getTeacherByCourseIDs(ids).then((cres) => {
|
pageNo: 1,
|
||||||
if (cres.status == 200) {
|
pageSize: 6,
|
||||||
let userIds = [];
|
isTop: '0'
|
||||||
list.forEach((item, index) => {
|
}).then((res) => {
|
||||||
cres.result.some((courseTeahcer) => {
|
this.courseList.noticeList = res.data.records || []
|
||||||
if (courseTeahcer.courseId == item.id) {
|
})
|
||||||
if (courseTeahcer.teacherIds) {
|
},
|
||||||
userIds.push(courseTeahcer.teacherIds[0]);
|
getToolData() {
|
||||||
item.authorInfo.aid = courseTeahcer.teacherIds[0];
|
|
||||||
item.authorInfo.name = courseTeahcer.names[0];
|
},
|
||||||
if (item.authorInfo.name == "BOE教师") {
|
|
||||||
item.authorInfo.name = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
//that.loadCourseAuthorInfo(list, userIds);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="modules xcontent2">
|
<div class="modules xcontent2">
|
||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="navTop">
|
<div class="navTop">
|
||||||
<router-link to="/">首页</router-link> > <span style="cursor: pointer;">通知</span>
|
<router-link to="/grateful">首页</router-link> > <span style="cursor: pointer;">通知</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -18,70 +18,66 @@
|
|||||||
<div class="modules-list" style="margin-top: 0;">
|
<div class="modules-list" style="margin-top: 0;">
|
||||||
<div style="padding:20px 70px;" class="bgc">
|
<div style="padding:20px 70px;" class="bgc">
|
||||||
<!--内容列表内容-->
|
<!--内容列表内容-->
|
||||||
<div v-for="(item, ccidx) in 10" :key="'cc' + ccidx" class="toolEvery" @click="noticeDetail(item)">
|
<div v-for="(item, ccidx) in list" :key="'cc' + ccidx" class="toolEvery" @click="noticeDetail(item)">
|
||||||
<div class="contnet">教师节活动通知</div>
|
<div class="contnet">{{ item.name }}</div>
|
||||||
<div class="case-info-date portal-time">
|
<div class="case-info-date portal-time">
|
||||||
<i class="el-icon-time" style="margin-right: 5px;"></i>
|
<i class="el-icon-time" style="margin-right: 5px;"></i>
|
||||||
<time-show time="2023-08-04"></time-show>
|
<time-show :time="item.createTime.split(' ')[0]"></time-show>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<pagination :size="courseList.pageSize" :total="courseList.count" :page="courseList.pageIndex"
|
<div v-if="total > 0">
|
||||||
@change-size="changePageSize" @change-page="loadData">
|
<pagination style="background-color: rgba(0, 0, 0, 0);" :size="params.pageSize" :total="total"
|
||||||
</pagination>
|
:page="params.pageNo" @change-size="changePageSize" @change-page="changPage" :autoScroll="false">
|
||||||
|
</pagination>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="xcontent2-minor" style="margin-left: 25px;">
|
|
||||||
<div class="portal-ranking ranking-bg">
|
|
||||||
<p class="ranking-title">教师赋能排行榜</p>
|
|
||||||
<ul class="xindex-ranking-course">
|
|
||||||
<li class="xindex-ranking-li" v-for="(item, cindex) in 10" :key="'cc' + cindex">
|
|
||||||
<a style="display: inherit">
|
|
||||||
<span class="portal-right-text blue-one">
|
|
||||||
<img :src="getPic(cindex)" alt="" />
|
|
||||||
</span>
|
|
||||||
<span class="portal-title-desc index-one-line-ellipsis title-line-ellipsis"
|
|
||||||
style="font-size: 14px; color: #04243c">哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import timeShow from "@/components/Portal/datetimeShow.vue";
|
import timeShow from "@/components/Portal/datetimeShow.vue";
|
||||||
|
import { noticeList } from '@/api/modules/grateful.js'
|
||||||
export default {
|
export default {
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
courseList: {
|
list: [],
|
||||||
list: [],
|
total: 0,
|
||||||
count: 0,
|
params: {
|
||||||
pageIndex: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: { timeShow },
|
components: { timeShow },
|
||||||
|
mounted() {
|
||||||
|
this.getNoticeList()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
noticeDetail(detailInfo) {
|
getNoticeList() {
|
||||||
console.log(detailInfo);
|
noticeList(this.params).then((result) => {
|
||||||
this.$router.push({
|
console.log(result);
|
||||||
path: '/grateful/noticeDetail',
|
const { total, records } = result.data
|
||||||
|
this.total = total
|
||||||
|
this.list = records
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
noticeDetail(item) {
|
||||||
|
console.log(item);
|
||||||
|
this.$router.push('/grateful/noticeDetail?id=' + item.id)
|
||||||
},
|
},
|
||||||
getPic(index) {
|
getPic(index) {
|
||||||
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
||||||
},
|
},
|
||||||
changePageSize(pageSize) {
|
changePageSize(pageSize) {
|
||||||
this.courseList.pageSize = pageSize;
|
this.params.pageSize = pageSize;
|
||||||
|
this.getNoticeList()
|
||||||
},
|
},
|
||||||
loadData(pindex) {
|
changPage(pageNo) {
|
||||||
console.log(pindex);
|
this.params.pageNo = pageNo
|
||||||
|
this.getNoticeList()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -116,12 +112,13 @@ export default {
|
|||||||
height: 240px;
|
height: 240px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navTop{
|
|
||||||
|
.navTop {
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modules-list {
|
.modules-list {
|
||||||
min-height: 555px;
|
// min-height: 555px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="navTop">
|
<div class="navTop">
|
||||||
<div>
|
<div>
|
||||||
<router-link to="/">首页</router-link> >
|
<router-link to="/grateful">首页</router-link> >
|
||||||
<span style="cursor: pointer;">通知详情</span>
|
<span style="cursor: pointer;">通知详情</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -22,14 +22,14 @@
|
|||||||
<div class="title">教师节活动通知</div>
|
<div class="title">教师节活动通知</div>
|
||||||
<!--内容列表内容-->
|
<!--内容列表内容-->
|
||||||
<div class="timeAndAuthor">
|
<div class="timeAndAuthor">
|
||||||
<div class="author">发布人:李玉冰</div>
|
<div class="author">发布人:{{ createName }}</div>
|
||||||
<div class="case-info-date portal-time">
|
<div class="case-info-date portal-time">
|
||||||
<i class="el-icon-time" style="margin-right: 5px;"></i>
|
<i class="el-icon-time" style="margin-right: 5px;"></i>
|
||||||
<time-show time="2023-08-04"></time-show>
|
<time-show :time="createTime.split(' ')[0]"></time-show>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="topTitle">通知内容</div>
|
<div class="topTitle">通知内容</div>
|
||||||
<div class="noticeContent">--内容列表内容--</div>
|
<div class="noticeContent">{{ content }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -39,18 +39,25 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import timeShow from "@/components/Portal/datetimeShow.vue";
|
import timeShow from "@/components/Portal/datetimeShow.vue";
|
||||||
|
import { noticeDataById } from '@/api/modules/grateful';
|
||||||
export default {
|
export default {
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
courseList: {
|
content: '',
|
||||||
list: [],
|
createName: '',
|
||||||
count: 0,
|
createTime: ''
|
||||||
pageIndex: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: { timeShow },
|
components: { timeShow },
|
||||||
|
mounted() {
|
||||||
|
noticeDataById(this.$route.query.id).then((result) => {
|
||||||
|
console.log(result);
|
||||||
|
const { content, createName, createTime } = result.data
|
||||||
|
this.content = content
|
||||||
|
this.createTime = createTime
|
||||||
|
this.createName = createName
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
noticeDetail(item) {
|
noticeDetail(item) {
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="navTop">
|
<div class="navTop">
|
||||||
<div>
|
<div>
|
||||||
<router-link to="/">首页</router-link> >
|
<router-link to="/grateful">首页</router-link> >
|
||||||
<span style="cursor: pointer;">教师赋能</span>
|
<span style="cursor: pointer;">教师赋能</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position: relative;">
|
<div style="position: relative;">
|
||||||
<el-input class="portal-input" placeholder="请输入课程名称" style="border-radius: 20px !important; "
|
<el-input class="portal-input" placeholder="请输入课程名称" style="border-radius: 20px !important; "
|
||||||
@keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword">
|
@keyup.enter.native="searchJump()" clearable maxlength="50" v-model="param.name">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
|
<el-button class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,13 +26,7 @@
|
|||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="modules-list list" style="margin-top: 0">
|
<div class="modules-list list" style="margin-top: 0">
|
||||||
<!--内容列表内容-->
|
<!--内容列表内容-->
|
||||||
<div v-for="(course, ccidx) in courseList.list" :key="'cc' + ccidx" class="xindex-course"
|
<div v-for="(course, ccidx) in list" :key="'cc' + ccidx" class="xindex-course" style="position: relative">
|
||||||
style="position: relative">
|
|
||||||
<div style="position: absolute; right: 25px; bottom: 72px">
|
|
||||||
<interactBar nodeWidth="20px" :courseExclusive="true" :type="1" :data="course" :comments="false"
|
|
||||||
:praises="false" :shares="false" :views="false">
|
|
||||||
</interactBar>
|
|
||||||
</div>
|
|
||||||
<a @click="toCourseDetail(course)">
|
<a @click="toCourseDetail(course)">
|
||||||
<div class="xindex-course-image">
|
<div class="xindex-course-image">
|
||||||
<course-image :course="course"></course-image>
|
<course-image :course="course"></course-image>
|
||||||
@@ -43,13 +37,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="course-author">
|
<div class="course-author">
|
||||||
<div class="course-author-left">
|
<div class="course-author-left">
|
||||||
{{ course.authorInfo.name }}
|
{{ course.createName }}
|
||||||
|
<span class="study-num">{{ formatNum(course.studies) }}人学习</span>
|
||||||
<span class="study-num">{{ formatNum(course.studys) }}人学习</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<div v-if="course.score">
|
<div v-if="course.score != '0'">
|
||||||
<span class="course-score-value" style="margin-left: 10px">{{ toScore(course.score) }}分</span>
|
<span class="course-score-value" style="margin-left: 10px">{{ toScore(Number(course.score))
|
||||||
|
}}分</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="course-score-no">未评分</div>
|
<div v-else class="course-score-no">未评分</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -60,72 +54,56 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div v-if="courseList.count > courseList.pageSize"> -->
|
|
||||||
<div>
|
<div>
|
||||||
<pagination :size="courseList.pageSize" :total="courseList.count" :page="courseList.pageIndex"
|
<pagination :size="param.pageSize" :total="total" :page="param.pageNo" @change-size="changePageSize"
|
||||||
@change-size="changePageSize" @change-page="loadData" style="background-color: rgba(0, 0, 0, 0);"></pagination>
|
@change-page="loadData" style="background-color: rgba(0, 0, 0, 0);" :autoScroll="false"
|
||||||
|
:pageSizes="[12, 24, 36, 48]"></pagination>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from "vuex";
|
|
||||||
import apiCourseStudy from "@/api/modules/courseStudy.js";
|
import apiCourseStudy from "@/api/modules/courseStudy.js";
|
||||||
import apiCourse from "@/api/modules/coursePortal.js";
|
|
||||||
import interactBar from "@/components/Portal/interactBar.vue";
|
|
||||||
import courseImage from "@/components/Course/courseImage.vue";
|
import courseImage from "@/components/Course/courseImage.vue";
|
||||||
import { toScore, formatUserNumber } from "@/utils/tools.js";
|
import { toScore, formatUserNumber } from "@/utils/tools.js";
|
||||||
import apiIndex from "@/api/phase2/index.js";
|
import { courselList } from '@/api/modules/grateful.js'
|
||||||
export default {
|
export default {
|
||||||
name: "TeacherEmpowerment",
|
name: "TeacherEmpowerment",
|
||||||
components: {
|
components: {
|
||||||
interactBar,
|
|
||||||
courseImage,
|
courseImage,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
keyword: '',
|
|
||||||
form: {
|
|
||||||
textarea: "",
|
|
||||||
},
|
|
||||||
gratefulVisible: false,
|
|
||||||
formatNum: formatUserNumber,
|
formatNum: formatUserNumber,
|
||||||
isNext: true,
|
|
||||||
toScore,
|
toScore,
|
||||||
// 列表
|
list: [],
|
||||||
courseList: {
|
total: 0,
|
||||||
pageSize: 10,
|
param: {
|
||||||
count: 0,
|
name: '',
|
||||||
pageIndex: 1,
|
pageNo: 1,
|
||||||
list: [],
|
pageSize: 12
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getCourseData(1);
|
this.getCourseData();
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapGetters(["userInfo", "studyTaskCount"]),
|
|
||||||
swiper() {
|
|
||||||
return this.$refs.mySwiper.swiper;
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
searchJump() {
|
searchJump() {
|
||||||
|
this.param.pageNo = 1
|
||||||
|
this.getCourseData();
|
||||||
},
|
},
|
||||||
changePageSize(pageSize) {
|
changePageSize(pageSize) {
|
||||||
this.courseList.pageSize = pageSize;
|
this.param.pageSize = pageSize;
|
||||||
|
this.getCourseData()
|
||||||
},
|
},
|
||||||
loadData(pindex) {
|
loadData(pageNo) {
|
||||||
console.log(pindex);
|
this.param.pageNo = pageNo
|
||||||
|
this.getCourseData()
|
||||||
}, getPic(index) {
|
},
|
||||||
|
getPic(index) {
|
||||||
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
||||||
},
|
},
|
||||||
closeDlg() {
|
|
||||||
this.gratefulVisible = false
|
|
||||||
},
|
|
||||||
toCourseDetail(item) {
|
toCourseDetail(item) {
|
||||||
//二期调整,直接改成一个地址
|
//二期调整,直接改成一个地址
|
||||||
//return this.webBaseUrl + '/course/detail?id=' + item.id;
|
//return this.webBaseUrl + '/course/detail?id=' + item.id;
|
||||||
@@ -147,63 +125,16 @@ export default {
|
|||||||
//return $this.webBaseUrl + "/course/detail?id=" + item.id;
|
//return $this.webBaseUrl + "/course/detail?id=" + item.id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getCourseData(pageIndex) {
|
getCourseData() {
|
||||||
this.isNext = false;
|
courselList(this.param).then((res) => {
|
||||||
let { orderType, num } = this.courseList;
|
if (res.code == 200 && res.data.records.length > 0) {
|
||||||
let course = {
|
console.log(res.data, '之前的');
|
||||||
pageSize: 12,
|
this.list = res.data.records;
|
||||||
device: 1,
|
this.total = res.data.total
|
||||||
orderField: orderType == 1 ? "" : "studys",
|
|
||||||
orderAsc: false,
|
|
||||||
topOrder: true,
|
|
||||||
pageIndex: pageIndex,
|
|
||||||
};
|
|
||||||
|
|
||||||
apiIndex.courselist(course).then((res) => {
|
|
||||||
if (res.status == 200 && res.result.length > 0) {
|
|
||||||
let courseIds = [];
|
|
||||||
res.result.forEach((item) => {
|
|
||||||
item.authorInfo = {
|
|
||||||
aid: "",
|
|
||||||
name: "",
|
|
||||||
orgInfo: "",
|
|
||||||
avatar: "",
|
|
||||||
code: "",
|
|
||||||
sex: null,
|
|
||||||
};
|
|
||||||
courseIds.push(item.id);
|
|
||||||
});
|
|
||||||
this.loadCouserTeacher(res.result, courseIds);
|
|
||||||
this.courseList.list = res.result;
|
|
||||||
} else {
|
} else {
|
||||||
console.log("加载课程信息失败:" + res.error);
|
console.log("加载课程信息失败:" + res.error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
|
||||||
loadCouserTeacher(list, ids) {
|
|
||||||
// 先查课程关联教师iD
|
|
||||||
apiCourse.getTeacherByCourseIDs(ids).then((cres) => {
|
|
||||||
if (cres.status == 200) {
|
|
||||||
let userIds = [];
|
|
||||||
list.forEach((item, index) => {
|
|
||||||
cres.result.some((courseTeahcer) => {
|
|
||||||
if (courseTeahcer.courseId == item.id) {
|
|
||||||
if (courseTeahcer.teacherIds) {
|
|
||||||
userIds.push(courseTeahcer.teacherIds[0]);
|
|
||||||
item.authorInfo.aid = courseTeahcer.teacherIds[0];
|
|
||||||
item.authorInfo.name = courseTeahcer.names[0];
|
|
||||||
if (item.authorInfo.name == "BOE教师") {
|
|
||||||
item.authorInfo.name = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,12 +7,12 @@
|
|||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="navTop">
|
<div class="navTop">
|
||||||
<div>
|
<div>
|
||||||
<router-link to="/">首页</router-link> >
|
<router-link to="/grateful">首页</router-link> >
|
||||||
<span style="cursor: pointer;">名师好课</span>
|
<span style="cursor: pointer;">名师好课</span>
|
||||||
</div>
|
</div>
|
||||||
<div style="position: relative;">
|
<div style="position: relative;">
|
||||||
<el-input class="portal-input" placeholder="请输入课程名称" style="border-radius: 20px !important; "
|
<el-input class="portal-input" placeholder="请输入课程名称" style="border-radius: 20px !important; "
|
||||||
@keyup.enter.native="searchJump()" clearable maxlength="50" v-model="keyword">
|
@keyup.enter.native="searchJump()" clearable maxlength="50" v-model="params.keyword">
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
|
<el-button class="sear-but" @click="searchJump()" type="primary" size="mini">搜索</el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -26,19 +26,17 @@
|
|||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="modules-list" style="margin-top: 0;">
|
<div class="modules-list" style="margin-top: 0;">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<el-table :data="pageData" stripe border>
|
<el-table :data="list" stripe border>
|
||||||
<el-table-column label="课程名称" prop="courseUser" align="center"></el-table-column>
|
<el-table-column label="课程名称" prop="courseName" align="center" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column label="课程价值" prop="auditTime" align="center" show-overflow-tooltip></el-table-column>
|
<el-table-column label="课程价值" prop="meaning" align="center" show-overflow-tooltip></el-table-column>
|
||||||
<el-table-column label="教师名称" prop="auditRemark" align="center" width="200px"
|
<el-table-column label="教师名称" prop="teacherName" align="center" width="150px"></el-table-column>
|
||||||
show-overflow-tooltip></el-table-column>
|
<el-table-column label="教师工号" prop="teacherNo" align="center" width="150px"></el-table-column>
|
||||||
<el-table-column label="教师工号" prop="auditRemark" align="center" width="200px"
|
|
||||||
show-overflow-tooltip></el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
<div v-if="pageData.length > 0" style="text-align: center;margin-top: 50px;">
|
<div v-if="pageData.length > 0" style="text-align: center;margin-top: 50px;">
|
||||||
<pagination :size="courseList.pageSize" :total="courseList.count" :page="courseList.pageIndex"
|
<pagination style="background-color: rgba(0, 0, 0, 0);" :size="params.pageSize" :total="total"
|
||||||
@change-size="changePageSize" @change-page="loadData" :autoScroll="false"></pagination>
|
:page="params.pageNo" @change-size="changePageSize" @change-page="loadData" :autoScroll="false">
|
||||||
|
</pagination>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,10 +46,10 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import timeShow from "@/components/Portal/datetimeShow.vue";
|
import timeShow from "@/components/Portal/datetimeShow.vue";
|
||||||
|
import { teachersList } from "../../api/modules/grateful";
|
||||||
export default {
|
export default {
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
keyword: '',
|
|
||||||
pageData: [
|
pageData: [
|
||||||
{
|
{
|
||||||
courseUser: '2016-05-02',
|
courseUser: '2016-05-02',
|
||||||
@@ -109,34 +107,42 @@ export default {
|
|||||||
auditRemark: '上海市普陀区金沙江路 1518 弄'
|
auditRemark: '上海市普陀区金沙江路 1518 弄'
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
courseList: {
|
total: 0,
|
||||||
list: [],
|
list: [],
|
||||||
count: 0,
|
params: {
|
||||||
pageIndex: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
keyword: '',
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: { timeShow },
|
components: { timeShow },
|
||||||
|
mounted() {
|
||||||
|
this.getTeachersList()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getTeachersList() {
|
||||||
|
teachersList(this.params).then((result) => {
|
||||||
|
console.log(result);
|
||||||
|
const { total, records } = result.data
|
||||||
|
this.total = total;
|
||||||
|
this.list = records;
|
||||||
|
})
|
||||||
|
},
|
||||||
searchJump() {
|
searchJump() {
|
||||||
|
this.params.pageNo = 1
|
||||||
|
this.getTeachersList()
|
||||||
},
|
},
|
||||||
changePageSize(pageSize) {
|
loadData(pageNo) {
|
||||||
this.courseList.pageSize = pageSize
|
this.params.pageNo = pageNo
|
||||||
|
this.getTeachersList()
|
||||||
},
|
},
|
||||||
loadData(pageIndex) {
|
|
||||||
this.pageIndex = pageIndex
|
|
||||||
},
|
|
||||||
noticeDetail(item) { },
|
|
||||||
getPic(index) {
|
getPic(index) {
|
||||||
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
||||||
},
|
},
|
||||||
changePageSize(pageSize) {
|
changePageSize(pageSize) {
|
||||||
this.courseList.pageSize = pageSize;
|
this.params.pageSize = pageSize;
|
||||||
},
|
this.getTeachersList()
|
||||||
loadData(pindex) {
|
|
||||||
console.log(pindex);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -185,7 +191,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.modules-list {
|
.modules-list {
|
||||||
min-height: 555px;
|
// min-height: 555px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="navTop">
|
<div class="navTop">
|
||||||
<div>
|
<div>
|
||||||
<router-link to="/">首页</router-link> >
|
<router-link to="/grateful">首页</router-link> >
|
||||||
<span style="cursor: pointer;">下载工具</span>
|
<span style="cursor: pointer;">下载工具</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -20,21 +20,29 @@
|
|||||||
<div class="modules xcontent2">
|
<div class="modules xcontent2">
|
||||||
<div class="xcontent2-main">
|
<div class="xcontent2-main">
|
||||||
<div class="modules-list" style="margin-top: 0;">
|
<div class="modules-list" style="margin-top: 0;">
|
||||||
<div style="padding: 20px 70px;border-radius: 8px 8px 0 0;" class="bgc">
|
<div v-if="toolList.total > toolList.pageSize" style="padding: 20px 70px;border-radius: 8px 8px 0 0;"
|
||||||
|
class="bgc">
|
||||||
<!--内容列表内容-->
|
<!--内容列表内容-->
|
||||||
<div v-for="(course, ccidx) in 10" :key="'cc' + ccidx" class="toolEvery">
|
<div v-for="(tool, index) in toolList.list" :key="'cc' + index" class="toolEvery">
|
||||||
<div class="contnet">
|
<div class="contnet">
|
||||||
MNT销量突破促经营哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
|
{{ tool.courseName }}
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<button>立即下载</button>
|
<button>立即下载</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="toolList.total > toolList.pageSize">
|
||||||
<pagination :size="courseList.pageSize" :total="courseList.count" :page="courseList.pageIndex"
|
<pagination :size="toolList.pageSize" :total="toolList.total" :page="toolList.pageIndex"
|
||||||
@change-size="changePageSize" @change-page="loadData">
|
@change-size="changePageSize" @change-page="loadData">
|
||||||
</pagination>
|
</pagination>
|
||||||
|
</div>
|
||||||
|
<div class="pagination-div">
|
||||||
|
<span class="notcoures" v-if="toolList.list.length == 0">
|
||||||
|
<img :src="`${webBaseUrl}/images/nocase.png`" alt="">
|
||||||
|
<h5>暂无工具~</h5>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -42,23 +50,36 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { toolList } from '../../api/modules/grateful';
|
||||||
export default {
|
export default {
|
||||||
data: () => {
|
data: () => {
|
||||||
return {
|
return {
|
||||||
courseList: {
|
toolList: {
|
||||||
list: [],
|
list: [],
|
||||||
count: 0,
|
total: 0,
|
||||||
pageIndex: 1,
|
pageIndex: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getToolList()
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getToolList() {
|
||||||
|
const result = await toolList()
|
||||||
|
if (result.code === 200) {
|
||||||
|
|
||||||
|
const { total, records } = result.data
|
||||||
|
this.toolList.list = records
|
||||||
|
this.toolList.total = total
|
||||||
|
}
|
||||||
|
},
|
||||||
getPic(index) {
|
getPic(index) {
|
||||||
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
|
||||||
},
|
},
|
||||||
changePageSize(pageSize) {
|
changePageSize(pageSize) {
|
||||||
this.courseList.pageSize = pageSize;
|
this.toolList.pageSize = pageSize;
|
||||||
},
|
},
|
||||||
loadData(pindex) {
|
loadData(pindex) {
|
||||||
console.log(pindex);
|
console.log(pindex);
|
||||||
@@ -104,19 +125,26 @@ export default {
|
|||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bgc {
|
||||||
|
background: linear-gradient(180deg,
|
||||||
|
rgba(56, 125, 247, 0.2) 0%,
|
||||||
|
rgba(166, 168, 255, 0) 100%) no-repeat;
|
||||||
|
background-size: 100% 166px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
.modules-list {
|
.modules-list {
|
||||||
min-height: 555px;
|
// min-height: 555px;
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|
||||||
.bgc {
|
.pagination-div {
|
||||||
background: linear-gradient(180deg,
|
text-align: center;
|
||||||
rgba(56, 125, 247, 0.2) 0%,
|
padding: 70px 0;
|
||||||
rgba(166, 168, 255, 0) 100%) no-repeat;
|
|
||||||
background-size: 100% 166px;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.toolEvery {
|
.toolEvery {
|
||||||
height: 80px;
|
height: 80px;
|
||||||
line-height: 80px;
|
line-height: 80px;
|
||||||
|
|||||||
Reference in New Issue
Block a user