Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
L
learn-online-pc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
learn-online-pc
Commits
d9b41e57
提交
d9b41e57
authored
4月 27, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
课程讨论模块提取
上级
b9174c64
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
69 行增加
和
50 行删除
+69
-50
index.js
client/src/modules/discuss/api/index.js
+11
-7
discuss.vue
client/src/modules/discuss/src/discuss.vue
+2
-2
discussDetail.vue
client/src/modules/discuss/src/discussDetail.vue
+13
-0
courseDetail.vue
client/src/pages/learn/courseDetail.vue
+38
-36
discussion.vue
client/src/pages/learn/discussion.vue
+5
-5
没有找到文件。
client/src/modules/discuss/api/index.js
浏览文件 @
d9b41e57
...
...
@@ -37,16 +37,20 @@ export function getChapterVideoAliyun(vid) {
/**
* 获取课程讨论列表
*/
export
const
getDiscussList
=
(
path
,
dataJson
)
=>
{
export
const
getDiscussList
=
(
param
)
=>
{
const
paramPath
=
param
.
path
||
''
return
httpRequest
.
get
(
`/v2/qa/questions
${
path
}
`
,
dataJson
`/v2/qa/questions
${
pa
ramPa
th
}
`
,
param
.
dataJson
)
}
export
const
request
=
(
obj
)
=>
{
/**
* 获取我的课程讨论列表
*/
export
const
getCourseDiscussList
=
(
param
)
=>
{
const
paramPath
=
param
.
path
||
''
return
httpRequest
.
get
(
obj
.
path
,
obj
.
dataJson
`/v2/qa/questions/course
${
paramPath
}
`
,
param
.
dataJson
)
}
client/src/modules/discuss/src/discuss.vue
浏览文件 @
d9b41e57
...
...
@@ -28,7 +28,7 @@
</template>
<
script
>
import
{
request
}
from
'../api/index'
import
*
as
api
from
'../api/index'
export
default
{
name
:
'Discuss'
,
...
...
@@ -54,7 +54,7 @@ export default {
methods
:
{
loadAjax
()
{
const
loading
=
this
.
$loading
({
lock
:
true
,
text
:
''
,
spinner
:
''
,
background
:
'rgba(255, 255, 255, 0.9)'
})
request
(
this
.
params
)
api
[
this
.
params
.
request
]
(
this
.
params
)
.
then
(
json
=>
{
this
.
discussList
=
json
})
...
...
client/src/modules/discuss/src/discussDetail.vue
0 → 100644
浏览文件 @
d9b41e57
<
template
>
<div>
</div>
</
template
>
<
script
>
export
default
{
}
</
script
>
<
style
lang=
"scss"
scoped
>
</
style
>
client/src/pages/learn/courseDetail.vue
浏览文件 @
d9b41e57
...
...
@@ -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-bind:key=
"index"
class=
'item-list'
@
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'
>
<div
class=
'no-data'
>
暂无相关讨论
</div>
</
template
>
<
!-- <discuss :params="params"></discuss> --
>
</
template
>
-->
<
discuss
:params=
"params"
></discuss
>
</div>
</template>
<
template
v-else
>
...
...
@@ -232,13 +232,14 @@ export default {
},
data
()
{
return
{
// params: {
// path: `/v2/qa/questions/course/${this.sid}/${this.cid}`,
// page: {
// limit: 10,
// offset: 0
// }
// },
params
:
{
path
:
`/
${
this
.
sid
}
/
${
this
.
cid
}
`
,
request
:
'getCourseDiscussList'
,
page
:
{
limit
:
10
,
offset
:
0
}
},
ckeditor
:
null
,
activeName
:
'1'
,
activeName1
:
'1'
,
...
...
@@ -394,9 +395,9 @@ export default {
this
.
tabs
[
3
].
assess
=
json1
loading
.
close
()
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
cAction
.
Discuss
.
getCourseDiscussList
(
this
.
cid
,
this
.
sid
,
this
.
param
).
then
(
json2
=>
{
this
.
discussList
=
json2
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
//
cAction.Discuss.getCourseDiscussList(this.cid, this.sid, this.param).then(json2 => {
//
this.discussList = json2
//
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
);
loading
.
close
()
}).
finally
(()
=>
{
})
window
.
addEventListener
(
'resize'
,
this
.
resizeRoot
.
bind
(
this
),
false
)
/* 实时刷新数据 */
...
...
@@ -737,17 +738,17 @@ export default {
message
:
'问题发布成功'
})
this
.
isPublicShow
=
false
//
this.params = {
// path: `/v2/qa/questions/course
/${this.sid}/${this.cid}`,
// page: {
// limit: 10,
// offset: 0
// },
// v: (new Date()).valueOf()
//
}
cAction
.
Discuss
.
getCourseDiscussList
(
this
.
cid
,
this
.
sid
,
this
.
param
).
then
(
json2
=>
{
this
.
discussList
=
json2
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
})
this
.
params
=
{
path
:
`
/
${
this
.
sid
}
/
${
this
.
cid
}
`
,
request
:
'getCourseDiscussList'
,
page
:
{
limit
:
10
,
offset
:
0
}
}
//
cAction.Discuss.getCourseDiscussList(this.cid, this.sid, this.param).then(json2 => {
//
this.discussList = json2
//
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}).
catch
(
e
=>
{
this
.
$message
.
error
(
e
.
message
)
}).
finally
(()
=>
{
loading
.
close
()
})
}
}
else
{
...
...
@@ -774,18 +775,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
.
sid
}
/
${
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() })
}
}
}
...
...
client/src/pages/learn/discussion.vue
浏览文件 @
d9b41e57
...
...
@@ -56,11 +56,11 @@ export default {
tabs
:
[{
title
:
this
.
$t
(
'pages.learn.discussion.tap1'
),
isShow
:
true
,
path
:
'/
v2/qa/questions/
my'
path
:
'/my'
},
{
title
:
this
.
$t
(
'pages.learn.discussion.tap2'
),
isShow
:
false
,
path
:
'/
v2/qa/questions/
involved'
path
:
'/involved'
}],
discussList
:
[
// {
...
...
@@ -82,7 +82,8 @@ export default {
offset: 0 // 偏移量(未考虑传输时,产生新问题情况)
},
params: {
path: '
/
v2
/
qa
/
questions
/
my
',
path: '
/
my
',
request: '
getDiscussList
',
dataJson: {
limit: 10,
offset: 0
...
...
@@ -148,9 +149,8 @@ export default {
*/
goDiscussDetail (e) {
const qid = e.currentTarget.dataset.id
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/${cid}/${qid}` })
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论