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
0323b236
Commit
0323b236
authored
Jul 27, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 获取省份接口优化
parent
e6afd79e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
53 deletions
+63
-53
learn.js
src/api/learn.js
+1
-1
index.vue
src/pages/index/index.vue
+28
-27
examSetting.vue
src/pages/learn/examSetting.vue
+34
-25
No files found.
src/api/learn.js
View file @
0323b236
...
@@ -22,7 +22,7 @@ let learnApiFun = function(vm) {
...
@@ -22,7 +22,7 @@ let learnApiFun = function(vm) {
// 查询省份列表
// 查询省份列表
let
getProvinceList
=
async
(
subjectId
)
=>
let
getProvinceList
=
async
(
subjectId
)
=>
await
vm
.
$u
.
get
(
'/rest/question/getProvinceList'
+
subjectId
)
await
vm
.
$u
.
get
(
'/rest/question/getProvinceList
/
'
+
subjectId
)
// 学生查询题库首页
// 学生查询题库首页
let
queryMyQuestionWarehouseDetail
=
async
(
questionWarehouseId
)
=>
let
queryMyQuestionWarehouseDetail
=
async
(
questionWarehouseId
)
=>
...
...
src/pages/index/index.vue
View file @
0323b236
...
@@ -47,9 +47,7 @@
...
@@ -47,9 +47,7 @@
:src=
"item.image"
:src=
"item.image"
></image
></image
><text
v-if=
"item.title"
class=
"detail-title"
>
{{
item
.
title
}}
</text
><text
v-if=
"item.title"
class=
"detail-title"
>
{{
item
.
title
}}
</text
><text
class=
"detail-text"
>
{{
><text
class=
"detail-text"
>
{{
info
[
item
.
key
]
}}
</text></view
item
.
key
==
'location'
?
provinceName
:
info
[
item
.
key
]
}}
</text></view
>
>
</view>
</view>
<SubjectStatistics
<SubjectStatistics
...
@@ -117,10 +115,10 @@ export default {
...
@@ -117,10 +115,10 @@ export default {
visible
:
false
,
// 免费体验弹窗
visible
:
false
,
// 免费体验弹窗
show
:
false
,
show
:
false
,
type
:
'select'
,
type
:
'select'
,
provinceList
:
[],
//
provinceList: [],
detail
:
{
questionWarehouse
:
{}
},
detail
:
{
questionWarehouse
:
{}
},
selected
:
{},
selected
:
{},
data
:
{},
data
:
{
questionWarehouse
:
{}
},
// relationId: 0, // 绑卡用
// relationId: 0, // 绑卡用
loading
:
false
,
loading
:
false
,
canExperience
:
false
,
// 体验资格
canExperience
:
false
,
// 体验资格
...
@@ -166,7 +164,10 @@ export default {
...
@@ -166,7 +164,10 @@ export default {
id
:
this
.
selected
.
id
,
id
:
this
.
selected
.
id
,
cardId
:
cardId
:
this
.
detail
.
questionWarehouse
&&
this
.
detail
.
questionWarehouse
.
cardId
,
this
.
detail
.
questionWarehouse
&&
this
.
detail
.
questionWarehouse
.
cardId
,
provinceName
:
this
.
provinceName
,
provinceName
:
this
.
data
.
questionWarehouse
.
echoMap
&&
this
.
data
.
questionWarehouse
.
echoMap
.
provinceId
&&
this
.
data
.
questionWarehouse
.
echoMap
.
provinceId
.
fullName
,
experience
:
this
.
canExperience
,
experience
:
this
.
canExperience
,
pass
:
this
.
$u
.
random
(
95
,
99
)
+
'%'
,
pass
:
this
.
$u
.
random
(
95
,
99
)
+
'%'
,
days
:
this
.
detail
.
totalDayCount
||
0
,
days
:
this
.
detail
.
totalDayCount
||
0
,
...
@@ -208,19 +209,19 @@ export default {
...
@@ -208,19 +209,19 @@ export default {
},
},
]
]
},
},
provinceName
()
{
//
provinceName() {
for
(
var
item
of
this
.
provinceList
)
{
//
for (var item of this.provinceList) {
if
(
item
.
id
==
this
.
selected
.
provinceId
)
{
//
if (item.id == this.selected.provinceId) {
return
item
.
fullName
+
'题'
//
return item.fullName + '题'
}
//
}
}
//
}
return
''
//
return ''
},
//
},
detailItems
()
{
detailItems
()
{
return
[
return
[
{
{
title
:
''
,
title
:
''
,
key
:
'
location
'
,
key
:
'
provinceName
'
,
image
:
process
.
uniEnv
.
qn_base_url
+
'quyu.png'
,
image
:
process
.
uniEnv
.
qn_base_url
+
'quyu.png'
,
imageStyle
:
'width:24rpx;height:28rpx'
,
imageStyle
:
'width:24rpx;height:28rpx'
,
},
},
...
@@ -248,7 +249,7 @@ export default {
...
@@ -248,7 +249,7 @@ export default {
onLoad
()
{
onLoad
()
{
if
(
this
.
vuex_token
)
{
if
(
this
.
vuex_token
)
{
this
.
loading
=
true
this
.
loading
=
true
this
.
getProvinceList
()
//
this.getProvinceList()
}
}
},
},
onShow
()
{
onShow
()
{
...
@@ -269,7 +270,7 @@ export default {
...
@@ -269,7 +270,7 @@ export default {
},
},
methods
:
{
methods
:
{
initData
()
{
initData
()
{
this
.
getProvinceList
()
//
this.getProvinceList()
this
.
queryMyQuestionWarehouseDetail
(
'0'
)
this
.
queryMyQuestionWarehouseDetail
(
'0'
)
},
},
// 检查是否具有体验资格
// 检查是否具有体验资格
...
@@ -497,16 +498,16 @@ export default {
...
@@ -497,16 +498,16 @@ export default {
})
})
}
}
},
},
getProvinceList
()
{
//
getProvinceList() {
this
.
$u
.
api
//
this.$u.api
.
getProvinceList
()
//
.getProvinceList()
.
then
((
res
)
=>
{
//
.then((res) => {
this
.
provinceList
=
res
||
[]
//
this.provinceList = res || []
})
//
})
.
catch
((
err
)
=>
{
//
.catch((err) => {
console
.
log
(
err
)
//
console.log(err)
})
//
})
},
//
},
setPageInfo
(
info
)
{
setPageInfo
(
info
)
{
var
pages
=
getCurrentPages
()
var
pages
=
getCurrentPages
()
if
(
pages
.
length
>=
1
)
{
if
(
pages
.
length
>=
1
)
{
...
...
src/pages/learn/examSetting.vue
View file @
0323b236
...
@@ -194,7 +194,7 @@ export default {
...
@@ -194,7 +194,7 @@ export default {
onLoad
(
e
)
{
onLoad
(
e
)
{
this
.
getPageInfo
()
this
.
getPageInfo
()
this
.
getLocation
()
this
.
getLocation
()
this
.
getProvinceList
(
this
.
questionWarehouseI
d
)
this
.
getProvinceList
(
this
.
category
.
i
d
)
},
},
methods
:
{
methods
:
{
handleClickArea
()
{
handleClickArea
()
{
...
@@ -228,8 +228,8 @@ export default {
...
@@ -228,8 +228,8 @@ export default {
this
.
showPop
=
true
this
.
showPop
=
true
},
},
// 获取省份列表
// 获取省份列表
async
getProvinceList
(
questionWarehouseI
d
)
{
async
getProvinceList
(
i
d
)
{
let
res
=
await
this
.
$u
.
api
.
getProvinceList
(
questionWarehouseI
d
)
let
res
=
await
this
.
$u
.
api
.
getProvinceList
(
i
d
)
console
.
log
(
res
)
console
.
log
(
res
)
this
.
range
=
res
this
.
range
=
res
},
},
...
@@ -250,6 +250,7 @@ export default {
...
@@ -250,6 +250,7 @@ export default {
}
}
// 获取科目对应的题库
// 获取科目对应的题库
let
res
=
await
this
.
$u
.
api
.
getQuestionWarehouse
(
this
.
category
.
id
,
param
)
let
res
=
await
this
.
$u
.
api
.
getQuestionWarehouse
(
this
.
category
.
id
,
param
)
if
(
res
&&
res
.
length
>
0
)
{
let
data
=
res
[
0
]
let
data
=
res
[
0
]
this
.
setPageInfo
(
data
)
this
.
setPageInfo
(
data
)
// 学员增加自己的题库
// 学员增加自己的题库
...
@@ -277,6 +278,14 @@ export default {
...
@@ -277,6 +278,14 @@ export default {
}
else
{
}
else
{
this
.
showPop
=
false
this
.
showPop
=
false
}
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
'所选科目没有对应的题库'
,
type
:
'warning'
,
duration
:
1500
,
callback
:
()
=>
{},
})
}
},
},
changeIndex
()
{
changeIndex
()
{
for
(
var
i
=
0
;
i
<
this
.
range
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
range
.
length
;
i
++
)
{
...
...
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