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
75523d5f
Commit
75523d5f
authored
Aug 07, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 规范库存字段
parent
decf940d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
prize-dialog.axml
client/components/dialog/prize-dialog/prize-dialog.axml
+3
-3
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+12
-9
add.js
client/pages/activity/addBackup/add.js
+6
-4
No files found.
client/components/dialog/prize-dialog/prize-dialog.axml
View file @
75523d5f
...
...
@@ -53,14 +53,14 @@
class="probablity-prize-content-formItem"
label="库存类型"
required>
<radio-group value="{{+prizeInitData.
limitStock}}" onChange="onLimit
StockChange">
<radio value="{{
0
}}">不限库存</radio>
<radio-group value="{{+prizeInitData.
switchStock}}" onChange="onswitch
StockChange">
<radio value="{{
2
}}">不限库存</radio>
<radio value="{{1}}">限制库存</radio>
</radio-group>
</form-item>
<form-item
style="width:100%"
a:if="{{(prizeInitData.type == OBJECT_TYPE || prizeInitData.type == EQUITY_TYPE) && prizeInitData.
limit
Stock && type === 'probablity'}}"
a:if="{{(prizeInitData.type == OBJECT_TYPE || prizeInitData.type == EQUITY_TYPE) && prizeInitData.
switch
Stock && type === 'probablity'}}"
size="large"
class="probablity-prize-content-formItem"
label="奖品库存"
...
...
client/components/dialog/prize-dialog/prize-dialog.js
View file @
75523d5f
...
...
@@ -11,6 +11,9 @@ const CREDITS_TYPE = 2;
const
OBJECT_TYPE
=
3
;
const
THANKS_TYPE
=
4
;
const
STOCK_LIMIT
=
1
;
const
STOCK_NO_LIMIT
=
2
;
const
INIT_DATA
=
{
ename
:
""
,
stock
:
""
,
...
...
@@ -19,7 +22,7 @@ const INIT_DATA = {
credits
:
""
,
probablity
:
""
,
name
:
""
,
limitStock
:
0
,
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
""
};
...
...
@@ -71,7 +74,7 @@ Component({
credits
:
""
,
probablity
:
""
,
name
:
""
,
limitStock
:
0
,
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
""
},
...
...
@@ -172,7 +175,7 @@ Component({
credits
:
""
,
probablity
:
""
,
name
:
""
,
limitStock
:
0
switchStock
:
STOCK_NO_LIMIT
};
if
(
type
!==
value
)
{
this
.
resetPrizeData
(
+
value
,
rank
);
...
...
@@ -208,12 +211,12 @@ Component({
});
}
},
on
Limit
StockChange
(
e
)
{
on
switch
StockChange
(
e
)
{
const
value
=
e
.
detail
.
value
;
this
.
setData
({
prizeInitData
:
{
...
this
.
data
.
prizeInitData
,
limit
Stock
:
value
,
switch
Stock
:
value
,
stock
:
value
===
0
?
''
:
this
.
data
.
prizeInitData
.
stock
},
});
...
...
@@ -292,7 +295,7 @@ Component({
probablity
,
stock
,
credits
,
limit
Stock
,
switch
Stock
,
endTime
,
rank
,
...
rest
...
...
@@ -337,7 +340,7 @@ Component({
this
.
showItemTips
(
"prizeNameTips"
,
"success"
,
""
);
}
if
((
type
==
OBJECT_TYPE
||
type
==
EQUITY_TYPE
)
&&
limitStock
&&
!
validateRangeNumber
(
stock
,
[
0
,
9999
]))
{
if
((
type
==
OBJECT_TYPE
||
type
==
EQUITY_TYPE
)
&&
switchStock
===
STOCK_LIMIT
&&
!
validateRangeNumber
(
stock
,
[
0
,
9999
]))
{
this
.
showItemTips
(
"prizeNumberTips"
,
"error"
,
...
...
@@ -382,7 +385,7 @@ Component({
const
isImagePass
=
image
&&
imageTips
.
status
!==
"error"
;
let
stockPass
=
true
;
if
(
limitStock
&&
!
stock
)
{
if
(
switchStock
===
STOCK_LIMIT
&&
!
stock
)
{
stockPass
=
false
;
}
const
isEquietyPass
=
...
...
@@ -417,7 +420,7 @@ Component({
stock
,
credits
,
rank
,
limit
Stock
,
switch
Stock
,
...
rest
,
};
...
...
client/pages/activity/addBackup/add.js
View file @
75523d5f
...
...
@@ -10,7 +10,9 @@ import {
addFloat
}
from
'/utils/helper'
const
THANKS_TYPE
=
5
const
THANKS_TYPE
=
5
;
const
STOCK_LIMIT
=
1
;
const
STOCK_NO_LIMIT
=
2
;
var
validator
=
new
schema
(
descriptor
);
...
...
@@ -33,7 +35,7 @@ Component({
image
:
""
,
credits
:
""
,
name
:
""
,
limitStock
:
0
,
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
"1"
},
...
...
@@ -45,7 +47,7 @@ Component({
image
:
""
,
credits
:
""
,
name
:
""
,
limitStock
:
0
,
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
"2"
},
...
...
@@ -57,7 +59,7 @@ Component({
image
:
""
,
credits
:
""
,
name
:
""
,
limitStock
:
0
,
switchStock
:
STOCK_NO_LIMIT
,
useStock
:
0
,
rank
:
"3"
}
...
...
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