Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
study
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Damon
study
Commits
472bd14c
Commit
472bd14c
authored
Jul 21, 2021
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 分页数据完善
parent
12eaffc5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
.env.dev.js
.env.dev.js
+1
-1
http.interceptor.js
src/common/http.interceptor.js
+1
-1
answer.vue
src/pages/learn/answer.vue
+8
-6
No files found.
.env.dev.js
View file @
472bd14c
const
UNI_APP
=
{
apiUrl
:
'http://192.168.0.20
4
:8760'
,
apiUrl
:
'http://192.168.0.20
8
:8760'
,
qn_base_url
:
'https://qn-static.banshouhui.com/study/'
,
qn_asset_url
:
'http://deudn.c.pp.cc/'
,
uUrl
:
'http://rest-u.yunya.com/'
,
...
...
src/common/http.interceptor.js
View file @
472bd14c
...
...
@@ -10,7 +10,7 @@ const install = (Vue, vm) => {
'tenant'
:
'weixiuhui'
,
'content-type'
:
'application/json; charset=utf-8'
,
},
loadingTime
:
0
,
loadingTime
:
80
0
,
originalData
:
true
,
});
...
...
src/pages/learn/answer.vue
View file @
472bd14c
...
...
@@ -8,7 +8,7 @@
title=
"答题"
title-bold
></u-navbar>
<view
class=
"u-flex contents"
v-if=
"
list.length
> 0"
>
<view
class=
"u-flex contents"
v-if=
"
total
> 0"
>
<view
class=
"head"
v-if=
"!daily"
>
<view
class=
"u-flex tab"
v-if=
"type !== 2"
>
<view
...
...
@@ -41,6 +41,7 @@
:current=
"current"
:type=
"type"
:model=
"model"
:total=
"total"
@
answerChange=
"answerChange"
@
change=
"swiperChange"
>
...
...
@@ -76,7 +77,7 @@
<view
class=
"u-flex default"
v-if=
"
list.length
=== 0 && [3, 4].includes(type)"
v-if=
"
total
=== 0 && [3, 4].includes(type)"
>
<view>
<image
:src=
"defaultImg"
/>
...
...
@@ -169,17 +170,17 @@ export default {
this
.
$u
.
api
.
getQuestionTotal
(
params
).
then
(
res
=>
{
// 列表总长度,一定要在第一次请求列表数据前明确该值
// 否则无法知道下一页是否还有数据
let
total
=
parseInt
(
res
)
let
total
=
parseInt
(
res
)
||
0
this
.
total
=
total
// 初始化答题卡列表
Utils
.
initAnswerCardList
(
total
,
this
)
this
.
cachePageDataMap
=
new
Map
()
// 上次答到了第几题
let
index
=
this
.
lastIndex
let
index
=
18
this
.
refresh
(
index
)
})
// 第一次进入,显示提示
if
(
this
.
questionList
.
length
===
0
)
{
this
.
show
=
true
}
...
...
@@ -203,7 +204,7 @@ export default {
icon
:
'none'
,
})
}
if
(
current
==
NO_NEXT_PAGE
)
{
if
(
this
.
type
===
2
)
{
this
.
$u
.
route
({
...
...
@@ -238,6 +239,7 @@ export default {
this
.
judgeLoadWay
(
list
[
0
].
currentPage
-
1
,
current
)
}
// 加载下一页
if
(
current
==
list
[
list
.
length
-
1
].
index
)
{
this
.
judgeLoadWay
(
list
[
list
.
length
-
1
].
currentPage
+
1
,
current
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment