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
18538b5b
Commit
18538b5b
authored
Jul 22, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improvement: 省份选择;首页notic
parent
6b2adf0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
39 deletions
+58
-39
index.vue
src/components/notice-bar/index.vue
+12
-10
examSetting.vue
src/pages/learn/examSetting.vue
+46
-29
No files found.
src/components/notice-bar/index.vue
View file @
18538b5b
...
...
@@ -131,17 +131,19 @@ export default {
var
a1
=
this
.
$u
.
random
(
0
,
49
)
var
a2
=
this
.
$u
.
random
(
0
,
49
)
var
a3
=
this
.
$u
.
random
(
0
,
49
)
console
.
log
(
a0
,
a1
,
a2
,
a3
,
this
.
defaultUrl
)
this
.
avatars
=
[
this
.
defaultUrl
+
a0
>
9
?
'a'
:
'a0'
+
a0
+
'.pn
g'
,
this
.
defaultUrl
+
a1
>
9
?
'a'
:
'a0'
+
a1
+
'.pn
g'
,
this
.
defaultUrl
+
a2
>
9
?
'a'
:
'a0'
+
a2
+
'.pn
g'
,
this
.
defaultUrl
+
a3
>
9
?
'a'
:
'a0'
+
a3
+
'.pn
g'
,
this
.
defaultUrl
+
(
a0
>
9
?
'a'
:
'a0'
)
+
String
(
a0
)
+
'.jpe
g'
,
this
.
defaultUrl
+
(
a1
>
9
?
'a'
:
'a0'
)
+
String
(
a1
)
+
'.jpe
g'
,
this
.
defaultUrl
+
(
a2
>
9
?
'a'
:
'a0'
)
+
String
(
a2
)
+
'.jpe
g'
,
this
.
defaultUrl
+
(
a3
>
9
?
'a'
:
'a0'
)
+
String
(
a3
)
+
'.jpe
g'
,
]
console
.
log
(
'----avatars------'
,
this
.
avatars
)
// this.avatars = [
// this.defaultUrl + 'xunzhang.
pn
g',
// this.defaultUrl + 'xunzhang.
pn
g',
// this.defaultUrl + 'xunzhang.
pn
g',
// this.defaultUrl + 'xunzhang.
pn
g',
// this.defaultUrl + 'xunzhang.
jpe
g',
// this.defaultUrl + 'xunzhang.
jpe
g',
// this.defaultUrl + 'xunzhang.
jpe
g',
// this.defaultUrl + 'xunzhang.
jpe
g',
// ]
this
.
list
=
[
this
.
noticeText
]
setInterval
(()
=>
{
...
...
@@ -164,9 +166,9 @@ export default {
var
a0
=
this
.
$u
.
random
(
0
,
49
)
this
.
avatars
=
[
...
array
,
this
.
defaultUrl
+
a0
>
9
?
'a'
:
'a0'
+
a0
+
'.
pn
g'
,
this
.
defaultUrl
+
a0
>
9
?
'a'
:
'a0'
+
a0
+
'.
jpe
g'
,
]
// this.avatars = [...array, this.defaultUrl + 'xunzhang.
pn
g']
// this.avatars = [...array, this.defaultUrl + 'xunzhang.
jpe
g']
console
.
log
(
this
.
avatars
.
length
)
this
.
list
=
[
this
.
noticeText
]
...
...
src/pages/learn/examSetting.vue
View file @
18538b5b
...
...
@@ -36,16 +36,33 @@
<text
class=
"rea-title-view"
>
包括区域
</text>
<text>
请确认与所在考试省份一致
</text>
</view>
<view
class=
"select-area"
>
<picker
@
change=
"handleConform"
range-key=
"label"
:value=
"index"
:range=
"range"
>
<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>
</view>
</picker>
<!--
<view
class=
"select-area"
>
<view
@
click=
"handleClickArea"
class=
"area-text-view"
>
<text>
{{
selected
Province
.
label
}}
</text>
<text>
{{
current
Province
.
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=
"region"
mode=
"selector"
:range=
"range"
v-model=
"show"
:params=
"params"
safe-area-inset-bottom
...
...
@@ -54,7 +71,7 @@
:default-region=
"defaultRegion"
@
confirm=
"handleConform"
></u-picker>
</view>
</view>
-->
</view>
<view
class=
"bottom-view"
>
<u-button
...
...
@@ -106,9 +123,11 @@ export default {
{
id
:
'1'
,
name
:
'初训(初次考试)'
,
selected
:
false
},
{
id
:
'2'
,
name
:
'复训(年审或换证)'
,
selected
:
false
},
],
selectedProvince
:
{
label
:
'北京市'
,
value
:
11
},
currentProvince
:
{
label
:
'北京市'
},
loading
:
true
,
showPop
:
false
,
range
:
[],
index
:
0
,
}
},
computed
:
{
...
...
@@ -120,9 +139,6 @@ export default {
province
:
true
,
}
},
defaultRegion
()
{
return
[
this
.
selectedProvince
.
label
]
},
buttonStyle
()
{
return
this
.
buttonDisabled
?
{
...
...
@@ -141,7 +157,7 @@ export default {
}
},
buttonDisabled
()
{
return
!
(
this
.
selected
Province
.
label
&&
this
.
selectedTypeId
)
return
!
(
this
.
current
Province
.
label
&&
this
.
selectedTypeId
)
},
selectedType
()
{
for
(
var
item
of
this
.
types
)
{
...
...
@@ -181,8 +197,8 @@ export default {
}
},
handleConform
(
e
)
{
console
.
log
(
e
)
this
.
selectedProvince
=
e
.
province
this
.
index
=
e
.
detail
.
value
this
.
currentProvince
=
this
.
range
[
this
.
index
]
},
getLocation
()
{
this
.
loading
=
true
...
...
@@ -202,35 +218,35 @@ export default {
async
getProvinceList
()
{
let
res
=
await
this
.
$u
.
api
.
getProvinceList
()
console
.
log
(
res
)
this
.
range
=
res
},
async
handleClickSubmit
()
{
if
(
this
.
buttonDisabled
)
return
if
(
this
.
index
==
0
)
{
this
.
changeIndex
()
}
let
param
=
{
provinceId
:
this
.
selectedProvince
.
value
,
provinceId
:
this
.
range
[
this
.
index
].
id
,
type
:
this
.
selectedTypeId
,
}
let
res
=
await
this
.
$u
.
api
.
getQuestionWarehouse
(
this
.
category
.
id
,
param
)
this
.
setPageInfo
(
res
)
this
.
setPageInfo
(
res
[
0
]
)
this
.
showPop
=
false
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
console
.
log
(
res
)
return
var
selected
=
{
key
:
0
,
name
:
'abc'
,
location
:
'aaa题'
,
count
:
'899'
,
pass
:
'96%'
,
},
changeIndex
()
{
for
(
var
i
=
0
;
i
<
this
.
range
.
length
;
i
++
)
{
if
(
this
.
currentProvince
.
label
==
this
.
range
[
i
].
fullName
||
this
.
currentProvince
.
label
==
this
.
range
[
i
].
label
)
{
this
.
index
=
i
break
}
}
selected
.
free
=
true
this
.
setPageInfo
(
selected
)
this
.
showPop
=
false
uni
.
switchTab
({
url
:
'/pages/index/index'
,
})
},
baiduLocation
(
long
,
lat
)
{
let
a
=
this
,
...
...
@@ -238,8 +254,9 @@ export default {
let
t
=
{
success
:
function
(
res
)
{
let
e
=
res
.
originalData
.
result
a
.
selected
Province
.
label
=
e
.
addressComponent
.
province
a
.
current
Province
.
label
=
e
.
addressComponent
.
province
a
.
loading
=
false
a
.
changeIndex
()
},
fail
:
function
(
a
)
{
a
.
loading
=
false
...
...
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