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
abcfa346
Commit
abcfa346
authored
Jul 30, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 【ID1001400】 【小程序-首页-选择题库设置页面】:添加题库时,点2次确定按钮才提示:添加成功
parent
a4219333
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
65 deletions
+51
-65
index.vue
src/components/pop-view/index.vue
+1
-6
examSetting.vue
src/pages/learn/examSetting.vue
+50
-59
No files found.
src/components/pop-view/index.vue
View file @
abcfa346
...
...
@@ -39,7 +39,7 @@
:loading=
"loading"
@
click=
"handleClickSure"
>
{{
buttonText
}}
确定
</u-button>
</view>
</view>
...
...
@@ -61,11 +61,6 @@ export default {
type
:
String
,
default
:
''
,
},
buttonText
:
{
// 确定按钮
type
:
String
,
default
:
'确定'
,
},
},
data
()
{
return
{
...
...
src/pages/learn/examSetting.vue
View file @
abcfa346
...
...
@@ -52,26 +52,6 @@
</view>
</view>
</picker>
<!--
<view
class=
"select-area"
>
<view
@
click=
"handleClickArea"
class=
"area-text-view"
>
<text>
{{
currentProvince
.
label
}}
</text>
<u-icon
name=
"arrow-down"
></u-icon>
</view>
<view
class=
"loading-view"
v-if=
"loading"
>
<u-loading
mode=
"flower"
></u-loading>
</view>
<u-picker
mode=
"selector"
:range=
"range"
v-model=
"show"
:params=
"params"
safe-area-inset-bottom
cancel-color=
"#9EA5BB"
confirm-color=
"#2953FF"
:default-region=
"defaultRegion"
@
confirm=
"handleConform"
></u-picker>
</view>
-->
</view>
<view
class=
"bottom-view"
>
<u-button
...
...
@@ -80,6 +60,7 @@
shape=
"circle"
:disabled=
"buttonDisabled"
:type=
"buttonDisabled ? '' : 'primary'"
throttle-time=
"250"
>
确定
</u-button>
...
...
@@ -233,8 +214,8 @@ export default {
console
.
log
(
res
)
this
.
range
=
res
||
[]
},
async
handleClickSubmit
()
{
if
(
this
.
buttonDisabled
)
return
handleClickSubmit
()
{
//
if (this.buttonDisabled) return
if
(
this
.
range
.
length
<=
0
||
this
.
range
.
length
==
null
)
{
this
.
$refs
.
uToast
.
show
({
title
:
'该类型和区域没有的题库'
,
...
...
@@ -246,6 +227,7 @@ export default {
})
return
}
if
(
this
.
index
==
0
)
{
this
.
changeIndex
()
}
...
...
@@ -254,46 +236,55 @@ export default {
type
:
this
.
selectedTypeId
,
}
// 获取科目对应的题库
let
res
=
await
this
.
$u
.
api
.
getQuestionWarehouse
(
this
.
category
.
id
,
param
)
if
(
res
&&
res
.
length
>
0
)
{
let
data
=
res
[
0
]
// 学员增加自己的题库
let
result
=
await
this
.
$u
.
api
.
addQuestionWarehouse
({
questionWarehouseId
:
data
.
id
,
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
})
this
.
$u
.
api
.
getQuestionWarehouse
(
this
.
category
.
id
,
param
)
.
then
((
res
)
=>
{
if
(
res
&&
res
.
length
>
0
)
{
let
data
=
res
[
0
]
if
(
result
)
{
data
.
isAdd
=
true
this
.
setPageInfo
(
data
)
// 成功
this
.
$refs
.
uToast
.
show
({
title
:
'添加题库成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
showPop
=
false
uni
.
switchTab
({
url
:
'/pages/index/index'
,
// 学员增加自己的题库
this
.
$u
.
api
.
addQuestionWarehouse
({
questionWarehouseId
:
data
.
id
,
})
},
})
}
else
{
this
.
showPop
=
false
}
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
'该类型和区域没有的题库'
,
type
:
'warning'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
showPop
=
false
},
.
then
((
result
)
=>
{
if
(
result
)
{
data
.
isAdd
=
true
this
.
setPageInfo
(
data
)
// 成功
this
.
$refs
.
uToast
.
show
({
title
:
'添加题库成功'
,
type
:
'success'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
showPop
=
false
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
},
})
}
else
{
this
.
showPop
=
false
}
})
.
catch
((
err
)
=>
{
this
.
showPop
=
false
console
.
log
(
err
)
})
}
else
{
this
.
$refs
.
uToast
.
show
({
title
:
'该类型和区域没有的题库'
,
type
:
'warning'
,
duration
:
1500
,
callback
:
()
=>
{
this
.
showPop
=
false
},
})
}
})
.
catch
((
err
)
=>
{
console
.
log
(
err
)
})
}
},
changeIndex
()
{
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