Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
self-support
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
李俊赕
self-support
Commits
ab59ece0
Commit
ab59ece0
authored
Apr 17, 2021
by
李俊赕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
select-组件
parent
67336a61
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
15 deletions
+90
-15
classify.data.js
src/common/classify.data.js
+4
-1
XhRadio - 副本.vue
src/components/createCom/XhRadio - 副本.vue
+45
-0
XhSelect.vue
src/components/createCom/XhSelect.vue
+35
-13
complete.vue
src/pages/order/complete.vue
+6
-1
No files found.
src/common/classify.data.js
View file @
ab59ece0
...
...
@@ -29,7 +29,10 @@ export default [{
"cat"
:
10
},
{
"fieldsTitle"
:
"衬衫"
,
"fieldsTitle"
:
"选择框"
,
"fieldsName"
:
"select"
,
"fieldsType"
:
"select"
,
"settings"
:
[
'车主电'
,
'物业电'
,
'国电'
],
"key"
:
"衬衫"
,
"icon"
:
"https://cdn.uviewui.com/uview/common/classify/1/4.jpg"
,
"cat"
:
10
...
...
src/components/createCom/XhRadio - 副本.vue
0 → 100644
View file @
ab59ece0
<
template
>
<view
class=
"list"
>
<view
v-for=
"(item,index) in settings"
:key=
"index"
:class=
"
{'txt':true,'active':item===dataValue}"
@click="setValue(item)">
{{
item
}}
</view>
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'XhRadio'
,
components
:
{},
mixins
:
[
stringMixin
],
props
:
{},
data
()
{
return
{}
},
computed
:
{
settings
(){
return
this
.
item
.
settings
||
[]
}
},
watch
:
{},
mounted
()
{},
methods
:
{
setValue
(
txt
){
this
.
dataValue
=
txt
this
.
valueChange
(
txt
)
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.list
{
display
:
flex
;
.txt
{
color
:
#666
;
padding
:
10rpx
;
&
.active
{
background-color
:
red
;
color
:
#fff
;
}
}
}
</
style
>
src/components/createCom/XhSelect.vue
View file @
ab59ece0
<
template
>
<view>
<u-input
v-model=
"item.fieldsValue"
/>
<u-input
v-model=
"dataValue"
readOnly
@
click=
"show=true"
type=
"select"
/>
<u-action-sheet
:list=
"settings"
v-model=
"show"
@
click=
"actionSheetCallback"
></u-action-sheet>
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'xhInput'
,
props
:
{
item
:
{
type
:
Object
,
default
()
{
return
[{}]
name
:
'XhSelect'
,
components
:
{},
mixins
:
[
stringMixin
],
props
:
{},
data
()
{
return
{
show
:
false
}
},
computed
:
{
type
()
{
if
(
this
.
item
&&
this
.
item
.
fieldsType
==
'password'
)
{
return
this
.
item
.
fieldsType
}
else
{
return
'text'
}
},
settings
()
{
let
result
=
[]
let
settings
=
this
.
item
.
settings
||
[]
result
=
settings
.
map
(
item
=>
{
return
{
text
:
item
}
})
return
result
}
},
data
()
{
return
{
value
:
''
,
type
:
'text'
,
border
:
true
,
watch
:
{},
mounted
()
{},
methods
:
{
actionSheetCallback
(
index
)
{
let
txt
=
this
.
settings
[
index
].
text
;
this
.
dataValue
=
txt
this
.
valueChange
(
txt
)
}
}
}
...
...
src/pages/order/complete.vue
View file @
ab59ece0
...
...
@@ -38,6 +38,9 @@
<xh-checkbox
v-if=
"item.fieldsType==='checkbox'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-checkbox>
<xh-select
v-if=
"item.fieldsType==='select'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
@
value-change=
"fieldValueChange"
>
</xh-select>
</
template
>
</u-form-item>
</view>
...
...
@@ -54,6 +57,7 @@
import
XhInput
from
'@/components/createCom/XhInput.vue'
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
// import XhRadio from '@/components/createCom/XhRadio.vue'
export
default
{
data
()
{
...
...
@@ -104,7 +108,8 @@
components
:
{
XhInput
,
XhRadio
,
XhCheckbox
XhCheckbox
,
XhSelect
// formCom
},
created
()
{
...
...
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