Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-annual-summary
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.education.frontend
pica-annual-summary
提交
e0231b60
提交
e0231b60
编写于
10月 09, 2020
作者:
guangjun.yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
防止重复提交
上级
94590e31
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
41 行增加
和
6 行删除
+41
-6
question-footer.vue
src/components/question/question-footer.vue
+4
-0
getters.js
src/store/getters.js
+1
-0
coop.js
src/store/modules/coop.js
+1
-1
question.js
src/store/modules/question.js
+5
-1
mixins.js
src/utils/mixins.js
+24
-3
question-detail.vue
src/views/question-detail.vue
+6
-1
未找到文件。
src/components/question/question-footer.vue
浏览文件 @
e0231b60
...
...
@@ -48,6 +48,7 @@ export default {
methods
:
{
// 上一页 // 有可能要触发上分页(前端的个数只有一条)
previous
()
{
if
(
!
this
.
canRun
())
return
;
if
(
this
.
currentQuestion
.
titleNo
==
1
)
{
Toast
(
"已是第一题"
);
}
else
{
...
...
@@ -66,6 +67,7 @@ export default {
// 下一页 // 有可能要触发下分页(后面的个数只有一条)
// TODO
next
()
{
if
(
!
this
.
canRun
())
return
;
if
(
this
.
currentQuestion
.
titleNo
==
this
.
totalCount
// if (this.currentQuestion.titleNo == this.questionList.length
||
this
.
currentQuestion
.
titleNo
==
this
.
questionList
[
this
.
questionList
.
length
-
1
].
titleNo
)
{
...
...
@@ -96,11 +98,13 @@ export default {
// 收藏/不收藏
toggleCollect
()
{
this
.
favor
(
this
.
currentQuestion
);
this
.
$emit
(
"scrollTop"
);
// this.$store.commit('SET_CURRENT_QUESTION', this.currentQuestion);
},
// 收藏/取消收藏
favor
()
{
if
(
!
this
.
canRun
())
return
;
let
favorFlag
=
this
.
currentQuestion
.
favorFlag
;
let
param
=
{
dataType
:
2
,
...
...
src/store/getters.js
浏览文件 @
e0231b60
...
...
@@ -15,5 +15,6 @@ const getters = {
commitKind
:
state
=>
state
.
question
.
titleConfig
.
commitKind
,
freeFlag
:
state
=>
state
.
question
.
titleConfig
.
freeFlag
,
totalCount
:
state
=>
state
.
question
.
titleConfig
.
totalCount
,
canRunNext
:
state
=>
state
.
question
.
canRunNext
,
}
export
default
getters
src/store/modules/coop.js
浏览文件 @
e0231b60
const
coop
=
{
state
:
{
userInfo
:
{
appVersion
:
"343"
,
userToken
:
"
EFC0A4A5EC4B49FBBBBCD1AD0E46515F
"
},
userInfo
:
{
appVersion
:
"343"
,
userToken
:
"
8E28243680E44C2A9275BF3F18F90494
"
},
statusBarHeight
:
{},
projectTabIndex
:
1
,
jumpURLForI
:
""
,
//中华医学会一类跳转地址
...
...
src/store/modules/question.js
浏览文件 @
e0231b60
...
...
@@ -67,7 +67,8 @@ const question = {
currentTitleNo
:
0
,
// 定位答题题目id
resultId
:
0
,
// 刷题库轮次ID
totalCount
:
0
,
// 题目总数
}
},
canRunNext
:
true
,
},
mutations
:
{
SET_COMMON_CONIFG
:
(
state
,
payload
)
=>
{
...
...
@@ -91,6 +92,9 @@ const question = {
SET_CURRENT_QUESTION
:
(
state
,
payload
)
=>
{
state
.
currentQuestion
=
payload
;
},
SET_CAN_RUN_NEXT
:
(
state
,
payload
)
=>
{
state
.
canRunNext
=
payload
;
},
},
actions
:
{
...
...
src/utils/mixins.js
浏览文件 @
e0231b60
import
fetch
from
'@/utils/fetch'
import
{
getBaseUrl
,
getApiUrl
}
from
'@/utils/index'
import
store
from
'../store'
;
import
{
getBaseUrl
,
getApiUrl
}
from
'@/utils/index'
;
import
{
mapGetters
}
from
'vuex'
;
// import store from '../store';
module
.
exports
=
{
data
:
function
()
{
...
...
@@ -16,9 +18,13 @@ module.exports = {
// alert('this.token' + this.token)
this
.
token
=
this
.
getUrlKey
(
'token'
)
||
(
query
&&
query
.
token
)
},
mounted
()
{
computed
:
{
...
mapGetters
([
'canRunNext'
])
},
mounted
()
{
},
methods
:
{
getUrlPara
(
obj
)
{
let
dataStr
=
''
...
...
@@ -250,5 +256,20 @@ module.exports = {
}
});
},
// 防止重复点击的最简单实现
canRun
(
delayTime
=
500
){
if
(
this
.
canRunNext
)
{
this
.
$store
.
commit
(
'SET_CAN_RUN_NEXT'
,
false
);
setTimeout
(
()
=>
{
this
.
$store
.
commit
(
'SET_CAN_RUN_NEXT'
,
true
)
},
delayTime
);
console
.
log
(
'in canRan '
,
this
.
canRunNext
);
return
true
;
}
else
{
console
.
log
(
'in canRan'
,
this
.
canRunNext
);
return
false
;
}
}
}
}
src/views/question-detail.vue
浏览文件 @
e0231b60
...
...
@@ -10,7 +10,7 @@
<no-content
v-show=
"!questionList.length"
:listType=
"commitKind"
></no-content>
</article>
<!--
<free-tips
></free-tips>
-->
<question-footer
v-show=
"questionList.length"
@
statistics=
"statistics"
@
pageQuestion=
"pageQuestion"
></question-footer>
<question-footer
v-show=
"questionList.length"
@
statistics=
"statistics"
@
scrollTop=
"scrollTop"
@
pageQuestion=
"pageQuestion"
></question-footer>
<ExperienceDialog
:showDialog=
"experienceDialog"
:statisConfig=
"statisConfig"
...
...
@@ -474,6 +474,11 @@ export default {
rocNative
.
getPositionData
({
__funcName
:
"__getPositionData"
});
},
// 滚动到最上面
scrollTop
()
{
}
}
};
...
...
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录