提交 1c36672d authored 作者: 王鹏飞's avatar 王鹏飞

merge...

......@@ -61,6 +61,7 @@
:page-size="page.size"
layout="total, prev, pager, next, jumper"
:total="page.total"
:hide-on-single-page="true"
@current-change="handleCurrentChange"
></el-pagination>
</div>
......@@ -154,8 +155,8 @@ export default {
// 分页
if (this.hasPage) {
this.dataList = response.list
this.page.total = parseInt(response.count)
this.dataList = response.list || []
this.page.total = parseInt(response.count) || 0
}
})
},
......
......@@ -2,55 +2,57 @@ import BaseAPI from '@/api/base_api'
const httpRequest = new BaseAPI(webConf)
/**
* 获取课程详情
* @param {string} courseId 课程ID
* @param {string} semesterId 学期ID
* 获取课程讨论列表
*/
export function getCourse(courseId, semesterId) {
return httpRequest.get(`/v2/education/courses/${courseId}/${semesterId}`)
export const getDiscussList = (param) => {
const paramPath = param.path || ''
return httpRequest.get(
`/v2/qa/questions${paramPath}`,
param.dataJson
)
}
/**
* 获取章节资源详情
* @param {string} vid 资源ID
* 获取我的课程讨论列表
*/
export function getChapterVideo(vid) {
return httpRequest.post(
'/v2/education/video-streaming',
{ vid },
{ headers: { 'Content-Type': 'application/json' } }
export const getCourseDiscussList = (param) => {
const paramPath = param.path || ''
return httpRequest.get(
`/v2/qa/questions/course${paramPath}`,
param.dataJson
)
}
/**
* 获取章节资源详情
* @param {string} vid 章节的资源ID
* 删除提问
*/
export function getChapterVideoAliyun(vid) {
return httpRequest.post(
'/v2/education/aliyun-video-streaming',
{ vid },
{ headers: { 'Content-Type': 'application/json' } }
export const deleteDiscuss = (qid) => {
return httpRequest.delete(
`/v2/qa/questions/${qid}`
)
}
/**
* 获取课程讨论列表
* 获取问题详情
*/
export const getDiscussList = (param) => {
const paramPath = param.path || ''
export const getDiscussDetail = (qid) => {
return httpRequest.get(
`/v2/qa/questions${paramPath}`,
param.dataJson
`/v2/qa/questions/${qid}`
)
}
/**
* 获取我的课程讨论列表
* 删除评论
*/
export const getCourseDiscussList = (param) => {
const paramPath = param.path || ''
return httpRequest.get(
`/v2/qa/questions/course${paramPath}`,
param.dataJson
export const deleteComment = (cid) => {
return httpRequest.delete(
`/v2/qa/comments/${cid}`
)
}
/**
* 回复评论
*/
export const callbackComment = (param) => {
return httpRequest.post(
'/v2/qa/comments',
param,
{ headers: { 'Content-Type': 'application/json' } }
)
}
<template>
<div>
<div class='ask'>
<template v-for='(item, index) in abswerData.comments'>
<div v-bind:key="index" class='item-list' :data-id='item.id'>
<div class='user'>
<div class='name'>{{item.user.name}}</div>
<div class='time'>{{item.user.time}}</div>
<template v-if='item.mine'><div class='right-txt' @click='deleteComment' :data-cid='item.cid'>{{ $t('pages.learn.discussDetail.delete') }}</div></template>
<div class='right-txt' @click='callbackComment' :data-sid='abswerData.sid' :data-qid='abswerData.qid' :data-quesid='abswerData.qid' :data-to='item.user.name'>{{ $t('pages.learn.discussDetail.reply') }}</div>
</div>
<div class='text'>{{item.text}}</div>
</div>
</template>
</div>
</div>
</template>
<script>
import * as api from '../api/index'
export default {
data () {
return {
abswerData: {}
}
},
props: {
dataJson: {
type: Object,
require: false
}
},
mounted() {
},
methods: {
deleteComment (e) {
const cid = e.currentTarget.dataset.cid
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
api.deleteComment(cid).then(json => {
this.$emit('updateList')
this.$message({ type: 'success', message: this.$t('pages.learn.discussDetail.deleteSuccess') })
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() })
},
callbackComment () {
}
},
watch: {
dataJson: function(newVal, oldVal) {
this.abswerData = newVal
console.log(this.abswerData, '==============')
}
}
}
</script>
<style lang="scss" scoped>
</style>
import './index.scss'
import Discuss from './src/discuss.vue'
import DiscussDetail from './src/discussDetail.vue'
const components = [
Discuss
Discuss,
DiscussDetail
]
const install = function (Vue, opts = {}) {
......@@ -26,5 +28,6 @@ if (typeof window !== 'undefined' && window.Vue) {
export default {
install,
Discuss
Discuss,
DiscussDetail
}
......@@ -28,6 +28,19 @@
</template>
<script>
/**
* 调用:通过组件传值监听watch来请求渲染
*
params: {
path: '/my', 地址参数
request: 'getDiscussList', 请求方法
dataJson: { 参数
limit: 10,
offset: 0
}
}
*/
import * as api from '../api/index'
export default {
......
......@@ -2,6 +2,7 @@
<div>
<div class="con-title">{{ $t('pages.learn.discussDetail.title') }}</div>
<div class="con-box">
<!-- <discuss-detail :paramId='paramId'></discuss-detail> -->
<div class='discuss-detail-scroll'>
<div class='ques'>
<div class='title'>{{discussQues.title}}</div>
......@@ -13,7 +14,6 @@
<div class='right-txt' @click='callbackComment' :data-sid='discussQues.sid' :data-qid='discussQues.qid' :data-quesid='discussQues.qid'>{{ $t('pages.learn.discussDetail.reply') }}</div>
<div class='right-txt' @click='openOrcloseDis' data-key='disQus'>{{ $t('pages.learn.discussDetail.discuss') }}({{discussQues.comCnt}})</div>
<div class='right-txt' @click='btnlike' :data-quesid='discussQues.qid' :data-sid='discussQues.sid' :data-tagid='discussQues.tag_id'>
<!-- <image class='img' src='{{discussQues.has_tag ? "./icons/like-on.png" : "./icons/like.png"}}'></image> -->
{{ $t('pages.learn.discussDetail.like') }}({{discussQues.likeCnt}})</div>
</div>
<template v-if='disQus.isShowComment'>
......@@ -53,7 +53,6 @@
<div class='right-txt' @click='callbackComment' :data-sid='discussQues.sid' :data-qid='discussQues.qid' :data-ansid='item.aid'>{{ $t('pages.learn.discussDetail.reply') }}</div>
<div class='right-txt' @click='openOrcloseDis' :data-key='answers' :data-index='index'>{{ $t('pages.learn.discussDetail.discuss') }}({{item.comCnt}})</div>
<div class='right-txt' @click='btnlike' :data-sid='discussQues.sid' :data-quesid='discussQues.qid' :data-ansid='item.aid' :data-tagid='item.tag_id'>
<!-- <image class='img' src='{{item.has_tag ? "./icons/like-on.png" : "./icons/like.png"}}'></image> -->
点赞({{item.likeCnt}})</div>
</div>
<template v-if='answers[index].isShowComment'>
......@@ -103,6 +102,7 @@ export default {
},
data () {
return {
paramId: {},
ckeditor: null,
courseTitle: '课程问题',
discussQues: {
......@@ -142,6 +142,13 @@ export default {
call: {}
}
},
created() {
this.paramId = {
sid: this.$route.params.sid,
cid: this.$route.params.cid,
id: this.$route.params.id
}
},
mounted () {
this.call = { questionId: this.id, semester_id: '', contents: '', question_id: this.id, answer: true }
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
......
......@@ -33,7 +33,7 @@
<div class="live-item-content__time">{{subitem.start_time}}</div>
<div
class="live-item-content__status"
v-if="subitem.enable_record"
v-if="!(subitem.live_status === 103 && !subitem.enable_record)"
>{{calcTimeText(subitem.start_time, subitem.live_status)}}</div>
</div>
</div>
......@@ -65,7 +65,7 @@ export default {
methods: {
/* 退出登录 - 跳转方法 */
logout() {
cAction.Others.outLogin()
cAction.Other.outLogin()
.then(str => {
window.G.UserInfo = {}
this.$router.push({ path: '/login/index' })
......@@ -96,9 +96,10 @@ export default {
this.dataList = response.data
}
})
.catch(e => {
this.$message.error(e.message)
})
// 取消报错提醒
// .catch(e => {
// this.$message.error(e.message)
// })
.finally(() => {
if (this.loading) {
this.loading.close()
......@@ -182,6 +183,7 @@ export default {
openCloudLive(data, message) {
// https://doc.bokecc.com/live/Appendix_1.html
const liveStatus = data.live_status
data.viewer_name = data.viewer_name || this.nickName
if (liveStatus === 1) {
// 进行中
const url = `https://view.csslcloud.net/api/view/index?roomid=${data.room_id}&userid=${data.user_id}&autoLogin=true&viewername=${data.viewer_name}&viewertoken=${data.viewer_token}`
......@@ -258,7 +260,7 @@ export default {
this.timer = setInterval(() => {
this.getNewLiveMsg()
this.getLiveList()
}, 3000)
}, 10000)
},
beforeDestroy() {
this.timer && clearInterval(this.timer)
......@@ -292,7 +294,11 @@ body {
padding: 0.2rem 0.2rem 0.16rem;
}
.head .logo {
height: 0.3rem;
width: 0.9rem;
/* height: 0.3rem; */
}
.head .logo:nth-child(2) {
margin-left: 0.1rem;
}
.head .user {
display: flex;
......@@ -379,7 +385,7 @@ body {
font-size: 0.12rem;
color: #333;
}
.live-item-content__time {
.live-item-content__status {
color: #b01c3d;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论