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
f339cbf1
Commit
f339cbf1
authored
Feb 04, 2021
by
王波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.增加奖品列表上移下移事件
parent
f2afe434
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
probability-prize-table.axml
...rize/probability-prize-table/probability-prize-table.axml
+1
-1
probability-prize-table.js
.../prize/probability-prize-table/probability-prize-table.js
+19
-0
No files found.
client/components/prize/probability-prize-table/probability-prize-table.axml
View file @
f339cbf1
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
</view>
</view>
</table-column>
</table-column>
<table-column title="奖品数量(件)" dataIndex="stock">
<table-column title="奖品数量(件)" dataIndex="stock">
<view slot-scope="x">{{x.value || '-'}}</view>
<view slot-scope="x">{{x.value ||
x.value === 0 ? x.value :
'-'}}</view>
</table-column>
</table-column>
<table-column a:if="{{type==='probability'}}" title="中奖概率(%)" dataIndex="probability">
<table-column a:if="{{type==='probability'}}" title="中奖概率(%)" dataIndex="probability">
<view slot-scope="x">{{x.value}}</view>
<view slot-scope="x">{{x.value}}</view>
...
...
client/components/prize/probability-prize-table/probability-prize-table.js
View file @
f339cbf1
...
@@ -26,6 +26,25 @@ Component({
...
@@ -26,6 +26,25 @@ Component({
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
onChange
&&
onChange
(
list
.
filter
(((
i
,
k
)
=>
k
!==
index
)),
dataName
)
onChange
&&
onChange
(
list
.
filter
(((
i
,
k
)
=>
k
!==
index
)),
dataName
)
},
},
up
(
e
)
{
const
index
=
e
.
target
.
dataset
.
idx
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
upPrize
=
JSON
.
parse
(
JSON
.
stringify
(
list
[
index
-
1
]))
const
nowPrize
=
JSON
.
parse
(
JSON
.
stringify
(
list
[
index
]))
list
[
index
-
1
]
=
nowPrize
list
[
index
]
=
upPrize
onChange
&&
onChange
(
list
,
dataName
);
},
down
(
e
)
{
const
index
=
e
.
target
.
dataset
.
idx
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
downPrize
=
JSON
.
parse
(
JSON
.
stringify
(
list
[
index
+
1
]))
const
nowPrize
=
JSON
.
parse
(
JSON
.
stringify
(
list
[
index
]))
list
[
index
+
1
]
=
nowPrize
list
[
index
]
=
downPrize
onChange
&&
onChange
(
list
,
dataName
);
},
addPrize
()
{
addPrize
()
{
const
{
limit
,
list
}
=
this
.
props
;
const
{
limit
,
list
}
=
this
.
props
;
...
...
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