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
d8430cda
Commit
d8430cda
authored
Jul 07, 2021
by
Facius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
备注及优化
parent
4c359099
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
18 deletions
+22
-18
XhSpecifications.vue
src/components/createCom/XhSpecifications.vue
+6
-6
complete.vue
src/pages/order/complete.vue
+2
-2
specification.vue
src/pages/order/specification.vue
+14
-10
No files found.
src/components/createCom/XhSpecifications.vue
View file @
d8430cda
<!-- ******************* 单个下拉选择 ******************* -->
<
template
>
<view
class=
"xh-specifications"
:style=
"
{'width': fieldsWidth}">
<view
class=
"u-flex u-row-between picker-common"
@
click=
"
handleClick(
)"
>
<view
class=
"u-flex u-row-between picker-common"
@
click=
"
$u.throttle(handleClick, 500
)"
>
<view>
{{
text
||
'请选择'
}}
</view>
<u-icon
class=
"input-icon"
color=
"#2272FF"
name=
"arrow-down"
></u-icon>
</view>
...
...
@@ -33,10 +33,10 @@
}
},
computed
:
{
fieldsWidth
()
{
fieldsWidth
()
{
// 后台返回宽度就用后台的
return
this
.
item
.
fieldsWidth
?
(
this
.
item
.
fieldsWidth
+
'rpx'
)
:
'100%'
},
text
(){
text
(){
// 根据选中的key显示
let
option
=
this
.
item
.
fieldsOptions
.
find
(
a
=>
{
return
a
.
key
===
this
.
dataValue
})
return
option
?
option
.
label
:
''
}
...
...
@@ -48,10 +48,10 @@
var
pages
=
getCurrentPages
();
if
(
pages
.
length
>=
1
)
{
var
page
=
pages
[
pages
.
length
-
1
];
page
.
info
=
this
.
item
page
.
info
=
this
.
item
// 给下个页面传递数据
}
uni
.
navigateTo
({
url
:
'pages/order/specification?s
pecification
Id='
+
this
.
dataValue
uni
.
navigateTo
({
// 把选中的key传给下个页面
url
:
'pages/order/specification?s
elected
Id='
+
this
.
dataValue
})
}
}
...
...
src/pages/order/complete.vue
View file @
d8430cda
...
...
@@ -36,7 +36,7 @@
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-select>
<xh-specifications
v-else-if=
"item.formType==='s
pecifications
'"
<xh-specifications
v-else-if=
"item.formType==='s
elect-new-page
'"
:groupIndex=
"groupIndex"
:itemIndex=
"itemIndex"
:item=
"item"
:value=
'form[item.fieldsName] || ""'
@
value-change=
"fieldValueChange"
>
</xh-specifications>
...
...
@@ -132,7 +132,7 @@
[
'jscode'
,
[
'input'
,
'text'
]],
[
'multiinput'
,
[
'multiinput'
,
'text'
]],
[
'select'
,
[
'select'
,
'text'
]],
[
'specifications'
,
[
's
pecifications
'
,
'text'
]],
[
'specifications'
,
[
's
elect-new-page
'
,
'text'
]],
[
'radio'
,
[
'radio'
,
'text'
]],
[
'checkbox'
,
[
'checkbox'
,
'text'
]],
[
'file'
,
[
'file'
,
'text'
]],
...
...
src/pages/order/specification.vue
View file @
d8430cda
<
template
>
<
template
>
<!-- 选择产品规格 -->
<view
class=
"specification-view"
>
<u-navbar
back-icon-color=
"#333333"
background=
"#FFFFFF"
title=
"选择产品规格"
titleColor=
"#333333"
:border-bottom=
"false"
title-bold
></u-navbar>
...
...
@@ -9,7 +10,8 @@
<text>
{{
item
.
label
}}
</text>
</view>
<view
class=
"icon-view"
>
<u-icon
name=
"checkbox-mark"
v-if=
"item.key == specificationId"
></u-icon>
<!-- 选中显示打勾 -->
<u-icon
name=
"checkbox-mark"
v-if=
"item.key == selectedId"
></u-icon>
</view>
</view>
<view
class=
"line-view"
></view>
...
...
@@ -23,28 +25,30 @@
data
()
{
return
{
info
:
{
fieldsName
:
'specificationId'
,
fieldsOptions
:
[]},
s
pecificationId
:
''
s
electedId
:
''
// 选中id
};
},
onLoad
(
e
)
{
getApp
().
trackPage
(
'完工-规格选择页面'
)
if
(
e
&&
e
.
s
pecificationId
)
{
this
.
s
pecificationId
=
e
.
specification
Id
if
(
e
&&
e
.
s
electedId
)
{
// 选中id
this
.
s
electedId
=
e
.
selected
Id
}
var
pages
=
getCurrentPages
();
if
(
pages
.
length
>=
2
)
{
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
];
//上一个页面
this
.
selectedId
=
selectedId
let
pages
=
getCurrentPages
()
let
prevPage
=
pages
[
pages
.
length
-
2
]
let
data
=
{}
data
[
this
.
info
.
fieldsName
]
=
selectedId
prevPage
.
$vm
.
setData
(
data
)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
prevPage
.
$vm
.
setData
(
data
)
//直接调用上一个页面的setData()方法,把数据存到上一个页面中去
uni
.
navigateBack
();
}
}
...
...
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