提交 7facf264 authored 作者: lihuihui's avatar lihuihui

Merge branch 'enterprise-wmp-copy' of…

Merge branch 'enterprise-wmp-copy' of https://gitlab.ezijing.com/zhangyanxin/learn-mbaOnline into enterprise-wmp-copy
...@@ -7,7 +7,7 @@ const httpRequest = new BaseAPI(webConf) ...@@ -7,7 +7,7 @@ const httpRequest = new BaseAPI(webConf)
export const getDiscussList = (param) => { export const getDiscussList = (param) => {
const paramPath = param.path || '' const paramPath = param.path || ''
return httpRequest.get( return httpRequest.get(
`/v2/qa/questions${paramPath}`, `/api/lms/v2/qa/questions${paramPath}`,
param.dataJson param.dataJson
) )
} }
...@@ -17,7 +17,7 @@ export const getDiscussList = (param) => { ...@@ -17,7 +17,7 @@ export const getDiscussList = (param) => {
export const getCourseDiscussList = (param) => { export const getCourseDiscussList = (param) => {
const paramPath = param.path || '' const paramPath = param.path || ''
return httpRequest.get( return httpRequest.get(
`/v2/qa/questions/course${paramPath}`, `/api/lms/v2/qa/questions/course${paramPath}`,
param.dataJson param.dataJson
) )
} }
...@@ -26,7 +26,7 @@ export const getCourseDiscussList = (param) => { ...@@ -26,7 +26,7 @@ export const getCourseDiscussList = (param) => {
*/ */
export const deleteDiscuss = (qid) => { export const deleteDiscuss = (qid) => {
return httpRequest.delete( return httpRequest.delete(
`/v2/qa/questions/${qid}` `/api/lms/v2/qa/questions/${qid}`
) )
} }
...@@ -35,7 +35,7 @@ export const deleteDiscuss = (qid) => { ...@@ -35,7 +35,7 @@ export const deleteDiscuss = (qid) => {
*/ */
export const getDiscussDetail = (qid) => { export const getDiscussDetail = (qid) => {
return httpRequest.get( return httpRequest.get(
`/v2/qa/questions/${qid}` `/api/lms/v2/qa/questions/${qid}`
) )
} }
/** /**
...@@ -43,7 +43,7 @@ export const getDiscussDetail = (qid) => { ...@@ -43,7 +43,7 @@ export const getDiscussDetail = (qid) => {
*/ */
export const deleteComment = (cid) => { export const deleteComment = (cid) => {
return httpRequest.delete( return httpRequest.delete(
`/v2/qa/comments/${cid}` `/api/lms/v2/qa/comments/${cid}`
) )
} }
/** /**
...@@ -51,7 +51,7 @@ export const deleteComment = (cid) => { ...@@ -51,7 +51,7 @@ export const deleteComment = (cid) => {
*/ */
export const callbackComment = (param) => { export const callbackComment = (param) => {
return httpRequest.post( return httpRequest.post(
'/v2/qa/comments', '/api/lms/v2/qa/comments',
param, param,
{ headers: { 'Content-Type': 'application/json' } } { headers: { 'Content-Type': 'application/json' } }
) )
...@@ -62,7 +62,7 @@ export const callbackComment = (param) => { ...@@ -62,7 +62,7 @@ export const callbackComment = (param) => {
*/ */
export const answerQues = (param) => { export const answerQues = (param) => {
return httpRequest.post( return httpRequest.post(
'/v2/qa/answers', '/api/lms/v2/qa/answers',
param, param,
{ headers: { 'Content-Type': 'application/json' } } { headers: { 'Content-Type': 'application/json' } }
) )
...@@ -72,7 +72,7 @@ export const answerQues = (param) => { ...@@ -72,7 +72,7 @@ export const answerQues = (param) => {
*/ */
export const deleteAnswer = (aid) => { export const deleteAnswer = (aid) => {
return httpRequest.delete( return httpRequest.delete(
`/v2/qa/answers/${aid}` `/api/lms/v2/qa/answers/${aid}`
) )
} }
/** /**
...@@ -80,7 +80,7 @@ export const deleteAnswer = (aid) => { ...@@ -80,7 +80,7 @@ export const deleteAnswer = (aid) => {
*/ */
export const unlike = (tagid) => { export const unlike = (tagid) => {
return httpRequest.delete( return httpRequest.delete(
`/v2/qa/tags/${tagid}` `/api/lms/v2/qa/tags/${tagid}`
) )
} }
/** /**
...@@ -88,7 +88,7 @@ export const unlike = (tagid) => { ...@@ -88,7 +88,7 @@ export const unlike = (tagid) => {
*/ */
export const like = (param) => { export const like = (param) => {
return httpRequest.post( return httpRequest.post(
'/v2/qa/tags', '/api/lms/v2/qa/tags',
param, param,
{ headers: { 'Content-Type': 'application/json' } } { headers: { 'Content-Type': 'application/json' } }
) )
......
...@@ -78,9 +78,10 @@ export default { ...@@ -78,9 +78,10 @@ export default {
*/ */
goDiscussDetail (e) { goDiscussDetail (e) {
const qid = e.currentTarget.dataset.id const qid = e.currentTarget.dataset.id
const sid = e.currentTarget.dataset.sid // const sid = e.currentTarget.dataset.sid
const cid = e.currentTarget.dataset.cid const cid = e.currentTarget.dataset.cid
this.$router.push({ path: `/app/learn/discuss-detail/${sid}/${cid}/${qid}` }) // this.$router.push({ path: `/app/learn/discuss-detail/${sid}/${cid}/${qid}` })
this.$router.push({ path: `/app/learn/discuss-detail/${cid}/${qid}` })
} }
}, },
watch: { watch: {
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
<!-- <div :class='["item-order", (sort[1].isShow ? "on" : "")]' @click='sortFn' :data-index='1' :data-str='sort[1].str'>按投票排序</div> --> <!-- <div :class='["item-order", (sort[1].isShow ? "on" : "")]' @click='sortFn' :data-index='1' :data-str='sort[1].str'>按投票排序</div> -->
</div> </div>
<div class='discuss-scroll' bindscrolltolower='loadmore' bindscrolltoupper='updatenew'> <div class='discuss-scroll' bindscrolltolower='loadmore' bindscrolltoupper='updatenew'>
<template v-for='(item, index) in discussList'> <!-- <template v-for='(item, index) in discussList'>
<div v-if="item.questioner.uid == $GLOBAL.UserInfo.id" v-bind:key="index" class='item-list lhhId' @click='goDiscussDetail' :data-id='item.id' :data-sid='item.sid' :data-index='index'> <div v-if="item.questioner.uid == $GLOBAL.UserInfo.id" v-bind:key="index" class='item-list lhhId' @click='goDiscussDetail' :data-id='item.id' :data-sid='item.sid' :data-index='index'>
<div class='user'> <div class='user'>
<template v-if="item.user.url"> <template v-if="item.user.url">
...@@ -95,8 +95,8 @@ ...@@ -95,8 +95,8 @@
</template> </template>
<template v-if='!discussList.length && !domLength'> <template v-if='!discussList.length && !domLength'>
<div class='no-data'>暂无相关讨论</div> <div class='no-data'>暂无相关讨论</div>
</template> </template> -->
<!-- <discuss :params="params"></discuss> --> <discuss :params="params"></discuss>
</div> </div>
</template> </template>
<template v-else> <template v-else>
...@@ -228,6 +228,15 @@ export default { ...@@ -228,6 +228,15 @@ export default {
}, },
data () { data () {
return { return {
params: {
path: `/${this.cid}`,
request: 'getCourseDiscussList',
dataJson: {
limit: 10,
offset: 0,
sort: ''
}
},
isCourseDis: this.getQueryString('v'), isCourseDis: this.getQueryString('v'),
domLength: 0, domLength: 0,
ckeditor: null, ckeditor: null,
...@@ -860,18 +869,19 @@ export default { ...@@ -860,18 +869,19 @@ export default {
this.param.sort = this.sort[index].isShow ? str : '' this.param.sort = this.sort[index].isShow ? str : ''
this.param.offset = 0 this.param.offset = 0
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) // const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
// this.params = { this.params = {
// path: `/v2/qa/questions/course/${this.sid}/${this.cid}`, path: `/${this.cid}`,
// dataJson: { request: 'getCourseDiscussList',
// limit: 10, dataJson: {
// offset: 0, limit: 10,
// sort: this.sort[index].isShow ? str : '' offset: 0,
// } sort: this.sort[index].isShow ? str : ''
// } }
cAction.Discuss.getCourseDiscussList(this.cid, this.sid, this.param).then(json => { }
this.discussList = json // cAction.Discuss.getCourseDiscussList(this.cid, this.sid, this.param).then(json => {
}).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() }) // this.discussList = json
// }).catch(e => { this.$message.error(e.message) }).finally(() => { loading.close() })
}, },
getQueryString (name) { getQueryString (name) {
const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i') const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论