提交 812c5042 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

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