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
61a42247
Commit
61a42247
authored
Jul 07, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完工页面-产品规格选择跳到新页面选择
parent
3602ff28
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
194 additions
and
1 deletion
+194
-1
XhSpecifications.vue
src/components/createCom/XhSpecifications.vue
+87
-0
pages.json
src/pages.json
+9
-0
complete.vue
src/pages/order/complete.vue
+7
-1
specification.vue
src/pages/order/specification.vue
+91
-0
No files found.
src/components/createCom/XhSpecifications.vue
0 → 100644
View file @
61a42247
<!-- ******************* 单个下拉选择 ******************* -->
<
template
>
<view
class=
"xh-specifications"
:style=
"
{'width': fieldsWidth}">
<view
class=
"u-flex u-row-between picker-common"
@
click=
"handleClick()"
>
<view>
{{
text
||
'请选择'
}}
</view>
<u-icon
class=
"input-icon"
color=
"#2272FF"
name=
"arrow-down"
></u-icon>
</view>
</view>
</
template
>
<
script
>
import
stringMixin
from
'./stringMixin'
export
default
{
name
:
'XhSpecifications'
,
components
:
{},
mixins
:
[
stringMixin
],
props
:
{
placeholder
:
{
type
:
String
,
default
:
'请选择'
},
width
:
{
// 例如:454rpx
type
:
String
,
default
:
'100%'
},
type
:
{
type
:
String
,
default
:
'text'
},
},
data
()
{
return
{
}
},
computed
:
{
fieldsWidth
()
{
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
},
text
(){
let
option
=
this
.
item
.
fieldsOptions
.
find
(
a
=>
{
return
a
.
key
===
this
.
dataValue
})
return
option
?
option
.
label
:
''
}
},
watch
:
{},
mounted
()
{},
methods
:
{
handleClick
()
{
var
pages
=
getCurrentPages
();
if
(
pages
.
length
>=
1
)
{
var
page
=
pages
[
pages
.
length
-
1
];
page
.
info
=
this
.
item
}
uni
.
navigateTo
({
url
:
'pages/order/specification?specificationId='
+
this
.
dataValue
})
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.xh-specifications
{
position
:
relative
;
.input-icon
{
position
:
absolute
;
right
:
20rpx
;
top
:
26rpx
;
color
:
#2272FF
;
}
}
.picker-common
{
min-height
:
35px
;
background-color
:
#F4F5F7
;
border-radius
:
6px
;
color
:
#333333
;
padding-left
:
10px
;
padding-right
:
12px
;
width
:
100%
;
height
:
38px
;
.txt
{
font-size
:
14px
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
}
}
</
style
>
src/pages.json
View file @
61a42247
...
@@ -340,6 +340,15 @@
...
@@ -340,6 +340,15 @@
"enablePullDownRefresh"
:
false
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
"disableScroll"
:
true
}
}
},
{
"path"
:
"specification"
,
"style"
:
{
"navigationBarTitleText"
:
""
,
//
完工-产品规格
"navigationStyle"
:
"custom"
,
"enablePullDownRefresh"
:
false
,
"disableScroll"
:
true
}
}
}
]
]
},
},
...
...
src/pages/order/complete.vue
View file @
61a42247
...
@@ -36,6 +36,10 @@
...
@@ -36,6 +36,10 @@
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
@
value-change=
"fieldValueChange"
>
</xh-select>
</xh-select>
<xh-specifications
v-else-if=
"item.formType==='specifications'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-specifications>
<view
v-else-if=
"item.formType==='file'"
>
<view
v-else-if=
"item.formType==='file'"
>
<xh-files
<xh-files
:ref=
"`fileChild$
{groupIndex}${itemIndex}`"
:ref=
"`fileChild$
{groupIndex}${itemIndex}`"
...
@@ -103,6 +107,7 @@
...
@@ -103,6 +107,7 @@
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhRadio
from
'@/components/createCom/XhRadio.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhCheckbox
from
'@/components/createCom/XhCheckbox.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
import
XhSelect
from
'@/components/createCom/XhSelect.vue'
import
XhSpecifications
from
'@/components/createCom/XhSpecifications.vue'
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
import
XhFiles
from
'@/components/createCom/XhFiles.vue'
import
XhLocation
from
'@/components/createCom/XhLocation.vue'
import
XhLocation
from
'@/components/createCom/XhLocation.vue'
import
XhScan
from
'@/components/createCom/XhScan.vue'
import
XhScan
from
'@/components/createCom/XhScan.vue'
...
@@ -127,7 +132,7 @@
...
@@ -127,7 +132,7 @@
[
'jscode'
,
[
'input'
,
'text'
]],
[
'jscode'
,
[
'input'
,
'text'
]],
[
'multiinput'
,
[
'multiinput'
,
'text'
]],
[
'multiinput'
,
[
'multiinput'
,
'text'
]],
[
'select'
,
[
'select'
,
'text'
]],
[
'select'
,
[
'select'
,
'text'
]],
[
'specifications'
,
[
's
elect
'
,
'text'
]],
[
'specifications'
,
[
's
pecifications
'
,
'text'
]],
[
'radio'
,
[
'radio'
,
'text'
]],
[
'radio'
,
[
'radio'
,
'text'
]],
[
'checkbox'
,
[
'checkbox'
,
'text'
]],
[
'checkbox'
,
[
'checkbox'
,
'text'
]],
[
'file'
,
[
'file'
,
'text'
]],
[
'file'
,
[
'file'
,
'text'
]],
...
@@ -267,6 +272,7 @@
...
@@ -267,6 +272,7 @@
XhRadio
,
XhRadio
,
XhCheckbox
,
XhCheckbox
,
XhSelect
,
XhSelect
,
XhSpecifications
,
XhFiles
,
XhFiles
,
XhLocation
,
XhLocation
,
XhScan
,
XhScan
,
...
...
src/pages/order/specification.vue
0 → 100644
View file @
61a42247
<
template
>
<view
class=
"specification-view"
>
<u-navbar
back-icon-color=
"#333333"
background=
"#FFFFFF"
title=
"选择产品规格"
titleColor=
"#333333"
:border-bottom=
"false"
title-bold
></u-navbar>
<view
class=
"specification-content"
>
<view
v-for=
"(item, index) in info.fieldsOptions"
:key=
"index"
>
<view
@
tap=
"handleClick(item.key)"
class=
"item-view"
hover-class=
'hover-class'
>
<view
class=
"item-title"
>
<text>
{{
item
.
label
}}
</text>
</view>
<view
class=
"icon-view"
>
<u-icon
name=
"checkbox-mark"
v-if=
"item.key == specificationId"
></u-icon>
</view>
</view>
<view
class=
"line-view"
></view>
</view>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
info
:
{
fieldsName
:
'specificationId'
,
fieldsOptions
:
[]},
specificationId
:
''
};
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'完工-规格选择页面'
)
if
(
e
&&
e
.
specificationId
)
{
this
.
specificationId
=
e
.
specificationId
}
var
pages
=
getCurrentPages
();
if
(
pages
.
length
>=
2
)
{
var
page
=
pages
[
pages
.
length
-
2
];
this
.
info
=
page
.
info
}
},
methods
:
{
handleClick
(
selectedId
)
{
this
.
specificationId
=
selectedId
let
pages
=
getCurrentPages
();
let
prevPage
=
pages
[
pages
.
length
-
2
];
//上一个页面
let
data
=
{}
data
[
this
.
info
.
fieldsName
]
=
selectedId
prevPage
.
$vm
.
setData
(
data
)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
uni
.
navigateBack
();
}
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
.specification-view
{
height
:
100vh
;
display
:
flex
;
flex-direction
:
column
;
.specification-content
{
height
:
100%
;
width
:
100%
;
overflow-y
:
auto
;
padding-bottom
:
44rpx
;
.item-view
{
height
:
104rpx
;
background-color
:
#FFFFFF
;
line-height
:
104rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
.item-title
{
text-align
:
center
;
min-width
:
400rpx
;
}
.icon-view
{
color
:
#2272FF
;
text-align
:
left
;
}
}
.hover-class
{
background-color
:
#f7f8f9
;
}
.line-view
{
height
:
2rpx
;
padding
:
0
30rpx
;
background-color
:
#F4F5F7
;
}
}
}
</
style
>
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