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