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
4bc2bfc3
Commit
4bc2bfc3
authored
Jul 16, 2020
by
秦海涛
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opt
parent
2912f34c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
+20
-19
probability-prize-table.js
.../prize/probability-prize-table/probability-prize-table.js
+6
-5
rank-table.js
client/components/rank/rank-table/rank-table.js
+6
-5
add.js
client/pages/activity/add/add.js
+8
-9
No files found.
client/components/prize/probability-prize-table/probability-prize-table.js
View file @
4bc2bfc3
...
...
@@ -8,7 +8,8 @@ Component({
props
:
{
limit
:
20
,
list
:
[],
onChange
:
()
=>
{}
onChange
:
()
=>
{},
dataName
:
''
},
didMount
()
{},
didUpdate
()
{},
...
...
@@ -46,19 +47,19 @@ Component({
this
.
setData
({
dialogVisible
:
false
})
},
onPrizeUpdate
(
data
,
index
)
{
const
{
onChange
,
list
}
=
this
.
props
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
updatedData
=
list
.
map
((
v
,
i
)
=>
{
if
(
index
===
i
)
return
{...
v
,
...
data
}
return
v
;
})
onChange
&&
onChange
(
updatedData
)
onChange
&&
onChange
(
updatedData
,
dataName
)
},
onPrizeAdd
(
data
)
{
const
{
list
,
onChange
}
=
this
.
props
;
const
{
list
,
onChange
,
dataName
}
=
this
.
props
;
onChange
&&
onChange
([...
list
,
data
])
onChange
&&
onChange
([...
list
,
data
]
,
dataName
)
}
},
});
client/components/rank/rank-table/rank-table.js
View file @
4bc2bfc3
...
...
@@ -11,7 +11,8 @@ Component({
fixedRank
:
[],
maxRankLimit
:
''
,
list
:
[],
onChange
:
()
=>
{}
onChange
:
()
=>
{},
dataName
:
''
},
didMount
()
{},
didUpdate
()
{},
...
...
@@ -54,17 +55,17 @@ Component({
this
.
setData
({
dialogVisible
:
false
})
},
onPrizeUpdate
(
data
,
index
)
{
const
{
onChange
,
list
}
=
this
.
props
;
const
{
onChange
,
list
,
dataName
}
=
this
.
props
;
const
updatedData
=
list
.
map
((
v
,
i
)
=>
{
if
(
index
===
i
)
return
{...
v
,
...
data
}
return
v
;
})
onChange
&&
onChange
(
updatedData
)
onChange
&&
onChange
(
updatedData
,
dataName
)
},
onPrizeAdd
(
data
)
{
const
{
list
,
onChange
}
=
this
.
props
;
const
{
list
,
onChange
,
dataName
}
=
this
.
props
;
let
newList
=
[...
list
,
data
].
sort
((
a
,
b
)
=>
{
let
prevRank
=
a
.
rank
.
split
(
'-'
)[
0
]
...
...
@@ -72,7 +73,7 @@ Component({
return
prevRank
-
nextRank
;
})
onChange
&&
onChange
(
newList
)
onChange
&&
onChange
(
newList
,
dataName
)
}
},
});
client/pages/activity/add/add.js
View file @
4bc2bfc3
...
...
@@ -200,7 +200,7 @@ Component({
rule
})
},
setDataByKey
(
name
,
val
)
{
setDataByKey
(
val
,
name
)
{
const
keys
=
name
.
split
(
'.'
);
if
(
keys
.
length
===
1
)
{
this
.
setData
({
...
...
@@ -224,14 +224,14 @@ Component({
})
}
},
on
Task
InputChange
(
e
)
{
on
Config
InputChange
(
e
)
{
const
{
name
}
=
e
.
target
.
dataset
;
const
{
value
}
=
e
.
detail
;
this
.
setDataByKey
(
name
,
valu
e
);
this
.
setDataByKey
(
value
,
nam
e
);
},
onCheckChange
(
e
)
{
const
{
...
...
@@ -240,11 +240,11 @@ Component({
const
{
value
}
=
e
.
detail
;
this
.
setDataByKey
(
name
,
valu
e
);
this
.
setDataByKey
(
value
,
nam
e
);
},
onTaskChange
(
data
,
key
)
{
console
.
log
(
data
,
key
)
this
.
setDataByKey
(
key
,
data
);
this
.
setDataByKey
(
data
,
key
);
},
onImageChange
(
image
)
{
console
.
log
(
'image'
,
image
)
...
...
@@ -271,10 +271,9 @@ Component({
})
},
onPrizeListChange
(
prizeInfoList
)
{
console
.
log
(
'prizeInfoList'
,
prizeInfoList
);
onPrizeListChange
(
list
,
target
)
{
this
.
setData
({
prizeInfoL
ist
[
target
]:
l
ist
})
},
validateForm
(
data
,
target
)
{
...
...
@@ -440,7 +439,7 @@ Component({
})
},
onChangeByDataName
(
val
,
dataName
)
{
this
.
setDataByKey
(
dataName
,
val
)
this
.
setDataByKey
(
val
,
dataName
)
},
onCloseDialog
(
data
)
{
...
...
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