Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
transport-show-h5
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
EzijingWeb
transport-show-h5
Commits
6eb67cfc
提交
6eb67cfc
authored
7月 30, 2020
作者:
lihuihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updata
上级
8e1d38da
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
76 行增加
和
5 行删除
+76
-5
ExamAction.js
src/modules/exam-module/action/ExamAction.js
+12
-0
exam_api.js
src/modules/exam-module/api/exam_api.js
+2
-0
ExamTopic.vue
src/modules/exam-module/src/ExamTopic.vue
+62
-5
没有找到文件。
src/modules/exam-module/action/ExamAction.js
浏览文件 @
6eb67cfc
...
...
@@ -77,4 +77,16 @@ export default class ExamAction extends BaseACTION {
return
res
})
}
deleteCollect
(
obj
)
{
return
Exam
.
deleteCollect
(
obj
).
then
(
res
=>
{
return
res
})
}
collectQuestion
(
obj
)
{
return
Exam
.
collectQuestion
(
obj
).
then
(
res
=>
{
return
res
})
}
}
src/modules/exam-module/api/exam_api.js
浏览文件 @
6eb67cfc
...
...
@@ -3,4 +3,6 @@ export default class Exam extends BaseAPI {
getExam
=
(
obj
,
url
)
=>
this
.
get
(
url
,
obj
)
getPower
=
(
obj
,
url
)
=>
this
.
post
(
url
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
examSubmit
=
(
obj
,
url
)
=>
this
.
post
(
url
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
deleteCollect
=
(
obj
)
=>
this
.
post
(
'/zy/v2/examination/delete-my-question'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
collectQuestion
=
(
obj
)
=>
this
.
post
(
'/zy/v2/examination/question/add'
,
obj
,
{
headers
:
{
'Content-Type'
:
'multipart/form-data'
}
})
}
src/modules/exam-module/src/ExamTopic.vue
浏览文件 @
6eb67cfc
...
...
@@ -73,12 +73,11 @@
</swiper>
</div>
<!-- v-if="$route.query.id != undefined || questionCount == 1" -->
<!-- <div v-if="swiper"></div> -->
<
template
v-if=
"$route.query.id == undefined"
>
<div
class=
"btn-box"
>
<div
class=
"padd"
v-if=
"!topicCard.isShow"
>
<!--
{{
swiper
.
slides
[
swiper
.
activeIndex
].
attributes
[
'data-dId'
].
nodeValue
}}
-->
<
!--
<div
class=
"icon1 active"
@
click=
"collectQuestion()"
></div>
--
>
<
div
:class=
"collect.currentPages ? 'icon1 active' : 'icon1'"
@
click=
"collectQuestion()"
></div
>
<div
class=
"analysis"
@
click=
"analyShow"
v-if=
"$route.query.id == undefined && ($route.query.course_id || $route.query.tag_id)"
>
查看解析
</div>
<div
class=
"btn left"
@
click=
"switchQuestions('left')"
v-show=
"currentNum !== 1"
>
上一题
</div>
<div
class=
"btn right"
@
click=
"switchQuestions('right')"
v-show=
"nextBtnShow"
>
下一题
</div>
...
...
@@ -94,7 +93,7 @@
<div
class=
"btn-box"
v-if=
"questionCount != 1"
>
<div
class=
"padd"
v-if=
"!topicCard.isShow"
>
<!--
{{
swiper
.
slides
[
swiper
.
activeIndex
].
attributes
[
'data-dId'
].
nodeValue
}}
-->
<
!--
<div
class=
"icon1 active"
@
click=
"collectQuestion()"
></div>
--
>
<
div
:class=
"collect.currentPages ? 'icon1 active' : 'icon1'"
@
click=
"collectQuestion()"
></div
>
<div
class=
"analysis"
@
click=
"analyShow"
v-if=
"$route.query.id == undefined && ($route.query.course_id || $route.query.tag_id)"
>
查看解析
</div>
<div
class=
"btn left"
@
click=
"switchQuestions('left')"
v-show=
"currentNum !== 1"
>
上一题
</div>
<div
class=
"btn right"
@
click=
"switchQuestions('right')"
v-show=
"nextBtnShow"
>
下一题
</div>
...
...
@@ -160,7 +159,12 @@ export default {
data
()
{
const
_this
=
this
return
{
currentId
:
{},
collect
:
{
currentPages
:
false
,
currentId
:
''
,
currentIdParent
:
''
},
currentCollect
:
false
,
clickStatus
:
0
,
questionCount
:
Number
,
classHide
:
true
,
...
...
@@ -176,6 +180,7 @@ export default {
autoHeight
:
true
,
on
:
{
slideChangeTransitionStart
:
function
()
{
_this
.
setCurrentCollect
()
_this
.
getIsSign
()
if
(
this
.
activeIndex
===
_this
.
questionsData
.
sheet
.
question_count
)
{
_this
.
topicCard
.
isShow
=
true
...
...
@@ -255,7 +260,41 @@ export default {
this
.
answerInit
()
},
methods
:
{
collectQuestion
()
{},
collectQuestion
()
{
const
queIds
=
this
.
collect
.
currentId
this
.
collect
.
currentPages
?
this
.
removeColl
(
queIds
,
()
=>
{
Toast
(
'取消收藏成功'
)
this
.
collect
.
currentPages
=
false
this
.
setCollect
(
false
)
})
:
this
.
addColl
(
queIds
,
()
=>
{
Toast
(
'收藏成功'
)
this
.
collect
.
currentPages
=
true
this
.
setCollect
(
true
)
})
// console.log(this.questionsData.questions)
},
setCollect
(
state
)
{
this
.
questionsData
.
questions
.
map
(
item
=>
{
if
(
item
.
id
===
this
.
collect
.
currentIdParent
)
{
const
data
=
item
.
question_list
.
find
(
i
=>
{
return
i
.
id
===
this
.
collect
.
currentId
})
data
.
is_collection
=
state
}
})
},
addColl
(
id
,
callback
)
{
Exam
.
collectQuestion
({
question_id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
callback
()
}
})
},
removeColl
(
id
,
callback
)
{
Exam
.
deleteCollect
({
type
:
2
,
question_id
:
id
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
callback
()
}
})
},
// 页面初始化
answerInit
()
{
Toast
.
loading
({
...
...
@@ -363,6 +402,7 @@ export default {
this
.
currentNum
===
this
.
questionsData
.
sheet
.
question_count
?
this
.
nextBtnShow
=
false
:
this
.
nextBtnShow
=
true
this
.
setCurrentCollect
()
},
100
)
this
.
getIsSign
()
},
200
)
...
...
@@ -616,6 +656,7 @@ export default {
setTimeout
(()
=>
{
this
.
currentNum
=
res
.
answers
.
answerPage
+
1
this
.
swiper
.
slideTo
(
res
.
answers
.
answerPage
,
0
,
false
)
this
.
setCurrentCollect
()
this
.
currentNum
===
this
.
questionsData
.
sheet
.
question_count
?
this
.
nextBtnShow
=
false
:
this
.
nextBtnShow
=
true
},
100
)
}
...
...
@@ -628,11 +669,27 @@ export default {
this
.
requestData
=
datas
this
.
requestData2
=
Object
.
keys
(
datas
).
length
}
else
{
setTimeout
(()
=>
{
this
.
setCurrentCollect
()
},
300
)
this
.
requestData
=
{}
this
.
requestData2
=
0
}
})
},
setCurrentCollect
()
{
const
itemDid
=
this
.
swiper
.
slides
[
this
.
swiper
.
activeIndex
].
attributes
[
'data-dId'
].
nodeValue
const
itemCid
=
this
.
swiper
.
slides
[
this
.
swiper
.
activeIndex
].
attributes
[
'data-cId'
].
nodeValue
this
.
questionsData
.
questions
.
find
(
item
=>
{
if
(
item
.
id
===
itemCid
)
{
const
currentItem
=
item
.
question_list
.
find
(
i
=>
{
return
i
.
id
===
itemDid
})
// this.currentCollect = currentItem.is_collection
this
.
collect
.
currentPages
=
currentItem
.
is_collection
this
.
collect
.
currentId
=
itemDid
this
.
collect
.
currentIdParent
=
itemCid
}
})
},
errorQuestion
(
data
)
{
let
count
=
0
const
result
=
data
.
questions
.
map
(
item
=>
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论