Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
8ab83997
提交
8ab83997
authored
4月 28, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提取模块
上级
d9b41e57
全部展开
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
122 行增加
和
39 行删除
+122
-39
index.js
client/src/api/index.js
+1
-1
index.js
client/src/modules/discuss/api/index.js
+34
-32
childAnswer.vue
client/src/modules/discuss/components/childAnswer.vue
+58
-0
index.js
client/src/modules/discuss/index.js
+5
-2
discuss.vue
client/src/modules/discuss/src/discuss.vue
+13
-0
discussDetail.vue
client/src/modules/discuss/src/discussDetail.vue
+0
-0
discussDetail.vue
client/src/pages/learn/discussDetail.vue
+11
-4
没有找到文件。
client/src/api/index.js
浏览文件 @
8ab83997
...
...
@@ -5,7 +5,7 @@ import ReportAPI from './report_api'
import
PlayerAPI
from
'./player_api'
import
DiscussAPI
from
'./discuss_api'
import
FeedbackAPI
from
'./feedback_api'
import
AffairsAPI
from
'./
A
ffairs_api'
import
AffairsAPI
from
'./
a
ffairs_api'
const
Other
=
new
OtherAPI
(
webConf
)
const
Course
=
new
CourseAPI
(
webConf
)
...
...
client/src/modules/discuss/api/index.js
浏览文件 @
8ab83997
...
...
@@ -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'
}
}
)
}
client/src/modules/discuss/components/childAnswer.vue
0 → 100644
浏览文件 @
8ab83997
<
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
>
client/src/modules/discuss/index.js
浏览文件 @
8ab83997
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
}
client/src/modules/discuss/src/discuss.vue
浏览文件 @
8ab83997
...
...
@@ -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
{
...
...
client/src/modules/discuss/src/discussDetail.vue
浏览文件 @
8ab83997
差异被折叠。
点击展开。
client/src/pages/learn/discussDetail.vue
浏览文件 @
8ab83997
...
...
@@ -2,7 +2,8 @@
<div>
<div
class=
"con-title"
>
{{
$t
(
'pages.learn.discussDetail.title'
)
}}
</div>
<div
class=
"con-box"
>
<div
class=
'discuss-detail-scroll'
>
<discuss-detail
:paramId=
'paramId'
></discuss-detail>
<!--
<div
class=
'discuss-detail-scroll'
>
<div
class=
'ques'
>
<div
class=
'title'
>
{{
discussQues
.
title
}}
</div>
<div
class=
'text'
v-html=
"discussQues.text"
></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'
>
...
...
@@ -76,7 +75,7 @@
<div
class=
'no-data'
>
{{
$t
(
'pages.learn.discussDetail.noAnswer'
)
}}
</div>
</
template
>
<div
style=
'width: 750rpx; height: 200rpx;'
></div>
</div>
</div>
-->
</div>
<div
style=
"width: 100%; height: 1.7rem;"
></div>
<div
class=
'input-publish'
>
...
...
@@ -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
)
' })
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论