Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
account-book
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
刘文虎
account-book
Commits
f21b694a
Commit
f21b694a
authored
Jul 09, 2022
by
刘文虎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
自动多选组件
parent
38d31e0d
Pipeline
#2746
canceled with stages
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
139 additions
and
28 deletions
+139
-28
billing-details.vue
components/billing-details/billing-details.vue
+5
-2
checkbox-group.vue
pages/schedule/create-schedule/components/checkbox-group.vue
+56
-0
create-schedule.vue
pages/schedule/create-schedule/create-schedule.vue
+69
-26
index.js
utils/options/schedule/index.js
+9
-0
No files found.
components/billing-details/billing-details.vue
View file @
f21b694a
...
...
@@ -7,12 +7,15 @@
</
template
>
<
script
>
import
XlCalculator
from
'@/components/xl-calculator/xl-calculator.nvue'
;
export
default
{
name
:
'billing-details'
,
components
:{
XlCalculator
},
data
()
{
return
{
show
:
tru
e
,
show
:
fals
e
,
};
},
methods
:
{
...
...
pages/schedule/create-schedule/components/checkbox-group.vue
0 → 100644
View file @
f21b694a
<
template
>
<view
class=
"checkbox-group"
>
<view
class=
"checkbox-group-item"
:class=
"
{ active: item.value === checked }" v-for="(item, index) in options" :key="index" @click="handleCheck(item)">
{{
item
.
label
}}
</view>
</view>
</
template
>
<
script
>
export
default
{
name
:
"checkbox-group"
,
props
:
{
checked
:
{
type
:
Number
|
String
,
default
:
''
},
options
:
{
type
:
Array
,
default
:
()
=>
[]
}
},
data
()
{
return
{};
},
methods
:
{
handleCheck
(
item
)
{
console
.
log
(
item
);
this
.
$emit
(
'click'
,
item
);
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
>
.checkbox-group
{
display
:
flex
;
flex-wrap
:
wrap
;
&
-item
{
padding
:
12upx
24upx
;
font-size
:
24upx
;
line-height
:
28upx
;
color
:
#333333
;
// background-color: #ffffff;
background-color
:
#f2f2f2
;
border-radius
:
8upx
;
margin-right
:
24upx
;
&
:last-child
{
margin-right
:
0
;
}
}
.active
{
background-color
:
#87c287
;
color
:
#ffffff
;
}
}
</
style
>
pages/schedule/create-schedule/create-schedule.vue
View file @
f21b694a
<
template
>
<view
class=
"create-schedule"
>
<view
class=
""
>
添加行程
</view>
<view
class=
"schedule-card"
>
<u-form
:model=
"form"
ref=
"uForm"
label-position=
"top"
:error-type=
"errorType"
label-width=
"180"
>
<u-form-item
label=
"计划类型:"
prop=
"type"
>
<view
class=
"input-view"
>
<CheckboxGroup
:checked=
"form.type"
:options=
"scheduleTypeOptions"
@
click=
"scheduleTypeChange"
></CheckboxGroup>
</view>
</u-form-item>
<u-form-item
label=
"计划时间:"
prop=
"createdTime"
>
<view
class=
"input-view"
>
<input
type=
"text"
v-model=
"form.createdTime"
placeholder=
"请选择"
class=
"field-input"
/>
<u-icon
name=
"scan"
color=
"#272727"
size=
"28"
class=
"field-icon"
@
click=
"toScan('createdTime')"
></u-icon>
</view>
</u-form-item>
<u-form-item
label=
"提醒设置:"
prop=
"setting"
></u-form-item>
</u-form>
</view>
<view
class=
""
><button
@
click=
"startRecording"
>
录音
</button></view>
<!--
<u-prop></u-prop>
-->
<u-popup
v-model=
"soundShow"
mode=
"bottom"
border-radius=
"14"
safe-area-inset-bottom
>
<sound-recording
ref=
"sound-recording"
@
cancel=
"soundCancel"
@
confirm=
"soundConfirm"
></sound-recording>
</u-popup>
...
...
@@ -11,44 +25,73 @@
<
script
>
import
SoundRecording
from
'@/components/sound-recording/sound-recording.vue'
;
import
{
authorize
,
openSetting
,
showModal
}
from
"@/utils/auth.js"
import
CheckboxGroup
from
'./components/checkbox-group.vue'
;
import
{
authorize
,
openSetting
,
showModal
}
from
'@/utils/auth.js'
;
import
{
scheduleTypeOptions
}
from
'@/utils/options/schedule'
;
export
default
{
components
:
{
SoundRecording
},
components
:
{
SoundRecording
,
CheckboxGroup
},
data
()
{
return
{
soundShow
:
false
// 录音弹框
scheduleTypeOptions
,
soundShow
:
false
,
// 录音弹框
form
:
{
type
:
''
,
createdTime
:
''
,
setting
:
''
},
errorType
:
[
'toast'
,
'border-bottom'
],
rules
:
{
type
:
[{
required
:
true
,
message
:
'请选择计划类型'
,
trigger
:
[
'change'
,
'blur'
]
}],
createdTime
:
[{
required
:
true
,
message
:
'请选择计划时间'
,
trigger
:
[
'change'
,
'blur'
]
}],
setting
:
[{
required
:
true
,
message
:
'请选择提醒设置'
,
trigger
:
[
'change'
,
'blur'
]
}]
}
};
},
methods
:{
startRecording
(){
authorize
(
"scope.record"
).
then
(()
=>
{
this
.
soundShow
=
true
}).
catch
(()
=>
{
this
.
showModal
()
})
methods
:
{
startRecording
()
{
authorize
(
'scope.record'
)
.
then
(()
=>
{
this
.
soundShow
=
true
;
})
.
catch
(()
=>
{
this
.
showModal
();
});
},
showModal
(){
showModal
()
{
showModal
({
content
:
"检测到您没打开录音功能权限,是否去设置打开?"
,
callback
:
()
=>
{
content
:
'检测到您没打开录音功能权限,是否去设置打开?'
,
callback
:
()
=>
{
openSetting
({
scope
:
"scope.record"
,
callback
:
()
=>
{
this
.
soundShow
=
true
scope
:
'scope.record'
,
callback
:
()
=>
{
this
.
soundShow
=
true
;
}
})
})
;
}
})
})
;
},
soundCancel
(){
this
.
soundShow
=
false
soundCancel
()
{
this
.
soundShow
=
false
;
},
soundConfirm
(
e
){
console
.
log
(
e
)
this
.
soundShow
=
false
soundConfirm
(
e
)
{
console
.
log
(
e
)
;
this
.
soundShow
=
false
;
},
scheduleTypeChange
(
item
)
{
console
.
log
(
item
);
this
.
form
.
type
=
item
.
value
;
}
}
};
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
scoped
>
.create-schedule
{
padding
:
0
32upx
;
.schedule-card
{
padding
:
0
32upx
;
background-color
:
#ffffff
;
border-radius
:
20upx
;
}
}
</
style
>
utils/options/schedule/index.js
0 → 100644
View file @
f21b694a
export
const
scheduleTypeOptions
=
[{
value
:
"1"
,
label
:
"工作"
},
{
value
:
"2"
,
label
:
"生活"
},
]
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