Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
85291c3f
Commit
85291c3f
authored
Jun 07, 2025
by
tao.huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 多选
parent
5b57105a
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
164 additions
and
114 deletions
+164
-114
MultiSelectLayer.vue
components/MultiSelectLayer.vue
+47
-19
PickerCustom.vue
components/PickerCustom.vue
+5
-3
person.vue
pages/person/person.vue
+111
-91
My.vue
views/My.vue
+1
-1
No files found.
components/MultiSelectLayer.vue
View file @
85291c3f
<
template
>
<
template
>
<Layer
<Layer
:modelValue=
"modelValue"
:modelValue=
"modelValue"
:
title=
"titl
e"
:
customHeader=
"tru
e"
:showCancel=
"
tru
e"
:showCancel=
"
fals
e"
:showConfirm=
"
tru
e"
:showConfirm=
"
fals
e"
@
update:modelValue=
"$emit('update:modelValue', $event)"
@
update:modelValue=
"$emit('update:modelValue', $event)"
@
confirm=
"onConfirm"
@
confirm=
"onConfirm"
@
cancel=
"onCancel"
@
cancel=
"onCancel"
>
>
<template>
<template>
<view
class=
"multi-select-title"
>
{{
title
}}
</view>
<view
class=
"multi-select-list"
>
<view
class=
"multi-select-list"
>
<view
<view
v-for=
"opt in options"
v-for=
"opt in options"
...
@@ -21,18 +22,22 @@
...
@@ -21,18 +22,22 @@
<image
<image
v-if=
"selectedSet.has(opt)"
v-if=
"selectedSet.has(opt)"
class=
"check-icon"
class=
"check-icon"
src=
"/static/check.png
"
:src=
"$baseUrl + 'person/icon_gou.png'
"
/>
/>
</view>
</view>
</view>
</view>
<view
class=
"multi-select-btn"
@
click=
"onConfirm"
>
保存
</view>
</
template
>
</
template
>
</Layer>
</Layer>
</template>
</template>
<
script
setup
>
<
script
setup
>
import
{
ref
,
watch
,
computed
}
from
"vue"
;
import
{
ref
,
watch
,
computed
,
getCurrentInstance
}
from
"vue"
;
import
Layer
from
"./Layer.vue"
;
import
Layer
from
"./Layer.vue"
;
const
{
proxy
}
=
getCurrentInstance
();
const
$baseUrl
=
proxy
.
$baseUrl
;
const
props
=
defineProps
({
const
props
=
defineProps
({
modelValue
:
Boolean
,
modelValue
:
Boolean
,
title
:
String
,
title
:
String
,
...
@@ -40,7 +45,12 @@ const props = defineProps({
...
@@ -40,7 +45,12 @@ const props = defineProps({
modelSelected
:
{
type
:
Array
,
default
:
()
=>
[]
},
modelSelected
:
{
type
:
Array
,
default
:
()
=>
[]
},
max
:
Number
,
max
:
Number
,
});
});
const
emit
=
defineEmits
([
"update:modelValue"
,
"update:selected"
,
"confirm"
,
"cancel"
]);
const
emit
=
defineEmits
([
"update:modelValue"
,
"update:selected"
,
"confirm"
,
"cancel"
,
]);
const
selected
=
ref
([...
props
.
modelSelected
]);
const
selected
=
ref
([...
props
.
modelSelected
]);
watch
(
watch
(
...
@@ -72,32 +82,50 @@ function onCancel() {
...
@@ -72,32 +82,50 @@ function onCancel() {
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
.multi-select-btn {
width: 686rpx;
height: 94rpx;
background: #d3a358;
color: #fff;
border-radius: 46rpx;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
margin-top: 24rpx;
font-size: 32rpx;
}
.multi-select-title {
font-size: 32rpx;
color: #222;
font-weight: bold;
margin-bottom: 24rpx;
}
.multi-select-list {
.multi-select-list {
display: flex;
display: flex;
flex-wrap: wrap;
flex-wrap: wrap;
gap:
24
rpx 20rpx;
gap:
15
rpx 20rpx;
}
}
.multi-select-tag {
.multi-select-tag {
display: flex;
display: flex;
align-items: center;
align-items: center;
padding: 0
32
rpx;
padding: 0
24
rpx;
height: 56rpx;
height: 56rpx;
background: #fff;
background: #fff
fff
;
border-radius: 28rpx;
border-radius: 28rpx;
color: #222;
color: #1d1e25;
font-size: 28rpx;
font-size: 24rpx;
margin-bottom: 24rpx;
position: relative;
position: relative;
border: 1rpx solid #eee;
.check-icon {
.check-icon {
width: 28rpx;
width: 19rpx;
height: 28rpx;
height: 19rpx;
margin-left: 8rpx;
position: absolute;
right: 2rpx;
top: 3rpx;
display: block;
}
}
&.selected {
&.selected {
background: #e9d3b1;
background: #efe7da;
color: #b88a3a;
border: 1rpx solid #b88a3a;
}
}
}
}
</
style
>
</
style
>
\ No newline at end of file
components/PickerCustom.vue
View file @
85291c3f
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
<picker-view
<picker-view
class=
"picker-layer-view"
class=
"picker-layer-view"
mask-style=
"background: rgb(246, 248, 250); z-index: 0;"
mask-style=
"background: rgb(246, 248, 250); z-index: 0;"
indicator-style=
"border-radius: 10px; height: 50px;background:#ffffff; z-index:0"
indicator-style=
"border-radius: 10px; height: 50px;
background:#ffffff; z-index:0"
:value=
"pickerValue"
:value=
"pickerValue"
@
change=
"onChange"
@
change=
"onChange"
>
>
...
@@ -55,9 +55,9 @@
...
@@ -55,9 +55,9 @@
<
/picker-view-column
>
<
/picker-view-column
>
<
/template
>
<
/template
>
<
template
v
-
else
>
<
template
v
-
else
>
<
picker
-
view
-
column
v
-
for
=
"(col, colIdx) in columns"
:
key
=
"colIdx"
>
<
picker
-
view
-
column
>
<
view
<
view
v
-
for
=
"(item, idx) in col"
v
-
for
=
"(item, idx) in col
umns[0]
"
:
key
=
"idx"
:
key
=
"idx"
class
=
"picker-layer-item"
class
=
"picker-layer-item"
>
>
...
@@ -309,6 +309,7 @@ function onChange(e) {
...
@@ -309,6 +309,7 @@ function onChange(e) {
overflow
:
hidden
;
overflow
:
hidden
;
display
:
flex
;
display
:
flex
;
flex
-
direction
:
column
;
flex
-
direction
:
column
;
position
:
relative
;
}
}
.
picker
-
layer
-
header
{
.
picker
-
layer
-
header
{
display
:
flex
;
display
:
flex
;
...
@@ -350,6 +351,7 @@ function onChange(e) {
...
@@ -350,6 +351,7 @@ function onChange(e) {
.
picker
-
layer
-
view
{
.
picker
-
layer
-
view
{
flex
:
1
;
flex
:
1
;
width
:
100
%
;
width
:
100
%
;
height
:
100
%
;
}
}
.
picker
-
layer
-
item
{
.
picker
-
layer
-
item
{
height
:
100
rpx
;
height
:
100
rpx
;
...
...
pages/person/person.vue
View file @
85291c3f
This diff is collapsed.
Click to expand it.
views/My.vue
View file @
85291c3f
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
<BabySwitcher
<BabySwitcher
v-if=
"showBabySwitcher"
v-if=
"showBabySwitcher"
:show=
"showBabySwitcher"
:show=
"showBabySwitcher"
:babyList=
"babyInfo.allBabyBaseInfo"
:babyList=
"babyInfo.allBabyBaseInfo
|| []
"
:addIcon=
"$baseUrl + 'my/baby_add_btn.png'"
:addIcon=
"$baseUrl + 'my/baby_add_btn.png'"
@
close=
"showBabySwitcher = false"
@
close=
"showBabySwitcher = false"
@
select=
"onSelectBaby"
@
select=
"onSelectBaby"
...
...
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