Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
1c176d77
Commit
1c176d77
authored
Feb 07, 2021
by
王波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
容器支持表单顺序展示
parent
c4121f4b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
17 deletions
+34
-17
probability-prize-table.js
.../prize/probability-prize-table/probability-prize-table.js
+20
-7
add.axml
client/pages/activity/add/add.axml
+14
-10
No files found.
client/components/prize/probability-prize-table/probability-prize-table.js
View file @
1c176d77
...
@@ -14,7 +14,7 @@ Component({
...
@@ -14,7 +14,7 @@ Component({
imageLimit
:
[
250
,
250
],
imageLimit
:
[
250
,
250
],
prizeDataType
:
null
,
prizeDataType
:
null
,
typeChecked
:
[],
typeChecked
:
[],
type
:
''
type
:
''
},
},
didMount
()
{
},
didMount
()
{
},
didUpdate
()
{
},
didUpdate
()
{
},
...
@@ -29,20 +29,33 @@ Component({
...
@@ -29,20 +29,33 @@ Component({
up
(
e
)
{
up
(
e
)
{
const
index
=
e
.
target
.
dataset
.
idx
;
const
index
=
e
.
target
.
dataset
.
idx
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
upPrize
=
list
[
index
-
1
]
const
nowPrize
=
list
[
index
]
const
nowPrize
=
list
[
index
]
list
[
index
-
1
]
=
nowPrize
if
(
index
===
0
){
//最顶级往上,则移动到最后
list
.
splice
(
index
,
1
)
list
.
push
(
nowPrize
)
}
else
{
const
upPrize
=
list
[
index
-
1
]
list
[
index
-
1
]
=
nowPrize
list
[
index
]
=
upPrize
list
[
index
]
=
upPrize
}
onChange
&&
onChange
(
list
,
dataName
);
onChange
&&
onChange
(
list
,
dataName
);
},
},
down
(
e
)
{
down
(
e
)
{
const
index
=
e
.
target
.
dataset
.
idx
;
const
index
=
e
.
target
.
dataset
.
idx
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
downPrize
=
list
[
index
+
1
]
const
nowPrize
=
list
[
index
]
const
nowPrize
=
list
[
index
]
list
[
index
+
1
]
=
nowPrize
if
(
index
===
list
.
length
-
1
){
//最底部往下,则移动到最上面
list
.
splice
(
index
,
1
)
list
.
unshift
(
nowPrize
)
}
else
{
const
downPrize
=
list
[
index
+
1
]
list
[
index
+
1
]
=
nowPrize
list
[
index
]
=
downPrize
list
[
index
]
=
downPrize
}
onChange
&&
onChange
(
list
,
dataName
);
onChange
&&
onChange
(
list
,
dataName
);
},
},
addPrize
()
{
addPrize
()
{
...
...
client/pages/activity/add/add.axml
View file @
1c176d77
...
@@ -8,16 +8,20 @@
...
@@ -8,16 +8,20 @@
<view class="edit-content">
<view class="edit-content">
<form class="edit-content-form" inline="true" labelTextAlign="right" labelCol="{{labelCol}}">
<form class="edit-content-form" inline="true" labelTextAlign="right" labelCol="{{labelCol}}">
<% for(var i = 0; i < configList.length; ++i) {%>
<%-configList[i].template%><% } %>
<% for(var i = 0; i < configHtmlList.length; ++i) {%>
<!-- 容器组件 -->
<% if(boxhtmlDatas[i].type == 'Box')% {>
<% for(var i = 0; i < boxhtmlDatas.length; ++i) {%>
<%- `
<%- `
<form-item label='${boxhtmlDatas[i].name}'>
<form-item label='${boxhtmlDatas[i].name}'>
${boxhtmlDatas[i].value}
${boxhtmlDatas[i].value}
</form-item>
</form-item>
`
`
%><% } %>
%>
<%} else {%>
<%-configList[i].template%><% } %>
<% } %>
<% } %>
<view class="submit-btn">
<view class="submit-btn">
<button a:if="{{!isEnd}}" onTap="onSubmit" type="primary">确定</button>
<button a:if="{{!isEnd}}" onTap="onSubmit" type="primary">确定</button>
...
...
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