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
3d294a13
Commit
3d294a13
authored
Jul 24, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 首页刷新
parent
56908c89
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
15 deletions
+36
-15
learn.js
src/api/learn.js
+4
-1
index.vue
src/pages/index/index.vue
+26
-14
boundQuestions.vue
src/pages/learn/boundQuestions.vue
+3
-0
detail.vue
src/pages/learn/detail.vue
+3
-0
No files found.
src/api/learn.js
View file @
3d294a13
...
@@ -86,7 +86,9 @@ let learnApiFun = function(vm) {
...
@@ -86,7 +86,9 @@ let learnApiFun = function(vm) {
`/rest/question/searchQuestion/
${
params
.
questionWarehouseId
}
`
,
`/rest/question/searchQuestion/
${
params
.
questionWarehouseId
}
`
,
params
params
)
)
// 检查是否具有体验资格
let
checkGetQuestion
=
async
(
questionWarehouseId
)
=>
await
vm
.
$u
.
get
(
'/rest/question/checkGetQuestion/'
+
questionWarehouseId
)
const
learnApi
=
{
const
learnApi
=
{
getQuestion
,
getQuestion
,
getQuestionTotal
,
getQuestionTotal
,
...
@@ -108,6 +110,7 @@ let learnApiFun = function(vm) {
...
@@ -108,6 +110,7 @@ let learnApiFun = function(vm) {
getMyQuestionWarehouseList
,
getMyQuestionWarehouseList
,
bindCard
,
bindCard
,
searchQuestion
,
searchQuestion
,
checkGetQuestion
,
}
}
return
learnApi
return
learnApi
}
}
...
...
src/pages/index/index.vue
View file @
3d294a13
...
@@ -113,6 +113,7 @@ export default {
...
@@ -113,6 +113,7 @@ export default {
data
:
{},
data
:
{},
relationId
:
0
,
// 绑卡用
relationId
:
0
,
// 绑卡用
loading
:
false
,
loading
:
false
,
canExperience
:
false
,
// 体验资格
}
}
},
},
computed
:
{
computed
:
{
...
@@ -166,12 +167,7 @@ export default {
...
@@ -166,12 +167,7 @@ export default {
cardId
:
cardId
:
this
.
detail
.
questionWarehouse
&&
this
.
detail
.
questionWarehouse
.
cardId
,
this
.
detail
.
questionWarehouse
&&
this
.
detail
.
questionWarehouse
.
cardId
,
provinceName
:
this
.
provinceName
,
provinceName
:
this
.
provinceName
,
experience
:
experience
:
this
.
canExperience
,
this
.
selected
.
state
&&
(
!
this
.
detail
.
questionWarehouse
||
!
this
.
detail
.
questionWarehouse
.
cardId
)
?
true
:
false
,
pass
:
this
.
$u
.
random
(
95
,
99
)
+
'%'
,
pass
:
this
.
$u
.
random
(
95
,
99
)
+
'%'
,
days
:
this
.
detail
.
totalDayCount
||
0
,
days
:
this
.
detail
.
totalDayCount
||
0
,
today
:
this
.
detail
.
todayCount
||
0
,
today
:
this
.
detail
.
todayCount
||
0
,
...
@@ -250,7 +246,7 @@ export default {
...
@@ -250,7 +246,7 @@ export default {
},
},
},
},
onLoad
()
{
onLoad
()
{
this
.
initData
()
this
.
getProvinceList
()
},
},
onShow
()
{
onShow
()
{
let
pages
=
getCurrentPages
()
let
pages
=
getCurrentPages
()
...
@@ -261,11 +257,8 @@ export default {
...
@@ -261,11 +257,8 @@ export default {
page
.
info
=
null
page
.
info
=
null
this
.
visible
=
info
.
state
this
.
visible
=
info
.
state
this
.
queryMyQuestionWarehouseDetail
(
this
.
selected
.
id
)
this
.
queryMyQuestionWarehouseDetail
(
this
.
selected
.
id
)
}
}
else
{
let
refresh
=
page
.
refresh
this
.
queryMyQuestionWarehouseDetail
(
this
.
info
.
id
||
0
)
if
(
refresh
)
{
page
.
refresh
=
null
this
.
queryMyQuestionWarehouseDetail
(
this
.
info
.
id
)
}
}
},
},
methods
:
{
methods
:
{
...
@@ -273,6 +266,21 @@ export default {
...
@@ -273,6 +266,21 @@ export default {
this
.
getProvinceList
()
this
.
getProvinceList
()
this
.
queryMyQuestionWarehouseDetail
(
'0'
)
this
.
queryMyQuestionWarehouseDetail
(
'0'
)
},
},
// 检查是否具有体验资格
checkGetQuestion
(
id
)
{
this
.
$u
.
api
.
checkGetQuestion
(
id
)
.
then
((
res
)
=>
{
console
.
log
(
'-------checkGet---------------Question----------'
,
res
)
this
.
canExperience
=
res
<=
0
console
.
log
(
this
.
canExperience
)
})
.
catch
((
err
)
=>
{
console
.
log
(
'----------------'
,
err
)
console
.
log
(
err
)
})
},
// 题库详情
// 题库详情
queryQuestionWarehouseById
(
id
)
{
queryQuestionWarehouseById
(
id
)
{
this
.
$u
.
api
this
.
$u
.
api
...
@@ -305,6 +313,10 @@ export default {
...
@@ -305,6 +313,10 @@ export default {
this
.
queryQuestionWarehouseById
(
this
.
queryQuestionWarehouseById
(
res
.
questionWarehouse
.
questionWarehouseId
res
.
questionWarehouse
.
questionWarehouseId
)
)
if
(
res
.
questionWarehouse
.
questionWarehouseId
)
{
this
.
checkGetQuestion
(
res
.
questionWarehouse
.
questionWarehouseId
)
}
})
})
.
catch
((
err
)
=>
{
.
catch
((
err
)
=>
{
this
.
loading
=
false
this
.
loading
=
false
...
@@ -325,7 +337,7 @@ export default {
...
@@ -325,7 +337,7 @@ export default {
// ...
// ...
}
else
if
(
this
.
info
.
id
)
{
}
else
if
(
this
.
info
.
id
)
{
if
(
this
.
info
.
experience
)
{
if
(
this
.
info
.
experience
)
{
this
.
selected
.
state
=
false
//
this.selected.state = false
// this.$u.vuex('experience', false)
// this.$u.vuex('experience', false)
// 体验
// 体验
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
...
@@ -387,7 +399,7 @@ export default {
...
@@ -387,7 +399,7 @@ export default {
}
}
},
},
handleClickExperience
()
{
handleClickExperience
()
{
this
.
selected
.
state
=
false
//
this.selected.state = false
// this.$u.vuex('experience', false)
// this.$u.vuex('experience', false)
// 体验
// 体验
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
// 1.顺序答题 2.随机练习 3.模拟考试 4.收藏答题 5.错题答题 6.专项练习-单选 7.专项练习-多选 8.专项练习-判断 9.专项练习-答案是
...
...
src/pages/learn/boundQuestions.vue
View file @
3d294a13
...
@@ -166,6 +166,9 @@ export default {
...
@@ -166,6 +166,9 @@ export default {
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
.
trade_state
===
'SUCCESS'
)
{
if
(
res
.
trade_state
===
'SUCCESS'
)
{
this
.
$u
.
toast
(
'支付成功'
)
this
.
$u
.
toast
(
'支付成功'
)
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
this
.
$u
.
toast
(
'请稍后核实订单状态,不要重复发起支付'
)
this
.
$u
.
toast
(
'请稍后核实订单状态,不要重复发起支付'
)
}
else
if
(
res
.
trade_state
===
'PAYERROR'
)
{
}
else
if
(
res
.
trade_state
===
'PAYERROR'
)
{
...
...
src/pages/learn/detail.vue
View file @
3d294a13
...
@@ -253,6 +253,9 @@ export default {
...
@@ -253,6 +253,9 @@ export default {
uni
.
hideLoading
()
uni
.
hideLoading
()
if
(
res
.
trade_state
===
'SUCCESS'
)
{
if
(
res
.
trade_state
===
'SUCCESS'
)
{
this
.
$u
.
toast
(
'支付成功'
)
this
.
$u
.
toast
(
'支付成功'
)
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
}
else
if
(
res
.
trade_state
===
'NOTPAY'
)
{
this
.
$u
.
toast
(
'请稍后核实订单状态,不要重复发起支付'
)
this
.
$u
.
toast
(
'请稍后核实订单状态,不要重复发起支付'
)
}
else
if
(
res
.
trade_state
===
'PAYERROR'
)
{
}
else
if
(
res
.
trade_state
===
'PAYERROR'
)
{
...
...
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