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
a9a5da2a
Commit
a9a5da2a
authored
Dec 18, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:
🐛
bug
parent
458f3136
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
prize-dialog.axml
client/components/dialog/prize-dialog/prize-dialog.axml
+3
-2
prize-dialog.js
client/components/dialog/prize-dialog/prize-dialog.js
+10
-10
probability-prize-table.axml
...rize/probability-prize-table/probability-prize-table.axml
+1
-1
No files found.
client/components/dialog/prize-dialog/prize-dialog.axml
View file @
a9a5da2a
...
@@ -111,13 +111,14 @@
...
@@ -111,13 +111,14 @@
class="probability-prize-content-formItem"
class="probability-prize-content-formItem"
label="奖品描述"
label="奖品描述"
validateState="{{prizeDescTips.status}}"
validateState="{{prizeDescTips.status}}"
help="{{prizeDescTips.content}}"
help="{{prizeDescTips.content}}">
required>
<input
<input
class="probability-prize-content-input edit-probability-input"
class="probability-prize-content-input edit-probability-input"
type="desc"
type="desc"
onChange="onChangePrizeValue"
onChange="onChangePrizeValue"
data-name="desc"
data-name="desc"
maxLength="{{30}}"
hasLimitHint="{{true}}"
value="{{prizeInitData.desc}}"
value="{{prizeInitData.desc}}"
name="奖品描述"
name="奖品描述"
defaultValue="{{prizeInitData.desc}}"
defaultValue="{{prizeInitData.desc}}"
...
...
client/components/dialog/prize-dialog/prize-dialog.js
View file @
a9a5da2a
...
@@ -16,7 +16,7 @@ const STOCK_NO_LIMIT = 2;
...
@@ -16,7 +16,7 @@ const STOCK_NO_LIMIT = 2;
const
INIT_DATA
=
{
const
INIT_DATA
=
{
ename
:
""
,
ename
:
""
,
stock
:
""
,
stock
:
""
,
type
:
1
,
type
:
EQUITY_TYPE
,
image
:
""
,
image
:
""
,
desc
:
""
,
desc
:
""
,
useUrl
:
""
,
useUrl
:
""
,
...
@@ -221,7 +221,7 @@ Component({
...
@@ -221,7 +221,7 @@ Component({
onPrizeTypeChange
(
e
)
{
onPrizeTypeChange
(
e
)
{
let
value
=
e
.
detail
.
value
;
let
value
=
e
.
detail
.
value
;
const
{
type
,
rank
}
=
this
.
data
.
prizeInitData
;
const
{
type
,
rank
,
isBackUp
}
=
this
.
data
.
prizeInitData
;
let
initData
=
{
let
initData
=
{
ename
:
""
,
ename
:
""
,
stock
:
""
,
stock
:
""
,
...
@@ -265,7 +265,7 @@ Component({
...
@@ -265,7 +265,7 @@ Component({
});
});
}
else
{
}
else
{
this
.
setData
({
this
.
setData
({
prizeInitData
:
INIT_DATA
,
prizeInitData
:
{
...
INIT_DATA
,
type
:
typeChecked
.
length
?
+
typeChecked
[
0
]:
EQUITY_TYPE
}
,
});
});
}
}
},
},
...
@@ -436,11 +436,11 @@ Component({
...
@@ -436,11 +436,11 @@ Component({
// }
// }
// }
// }
if
(
type
==
EQUITY_TYPE
||
type
==
OBJECT_TYPE
)
{
if
(
type
==
EQUITY_TYPE
||
type
==
OBJECT_TYPE
)
{
if
(
!
desc
)
{
//
if (!desc) {
this
.
showItemTips
(
"prizeDescTips"
,
"error"
,
"请填写奖品描述"
);
//
this.showItemTips("prizeDescTips", "error", "请填写奖品描述");
}
else
{
//
} else {
this
.
showItemTips
(
"prizeDescTips"
,
"success"
,
""
);
//
this.showItemTips("prizeDescTips", "success", "");
}
//
}
if
(
!
name
)
{
if
(
!
name
)
{
this
.
showItemTips
(
"nameTips"
,
"error"
,
"请输入奖品名称"
);
this
.
showItemTips
(
"nameTips"
,
"error"
,
"请输入奖品名称"
);
}
else
{
}
else
{
...
@@ -451,7 +451,7 @@ Component({
...
@@ -451,7 +451,7 @@ Component({
}
}
}
}
// 库存奖品的库存值判断
// 库存奖品的库存值判断
let
usePass
=
switchStock
==
1
?
+
stock
>
(
useStock
||
0
)
:
true
;
let
usePass
=
switchStock
==
1
?
+
stock
>
=
(
useStock
||
0
)
:
true
;
let
stockPass
=
switchStock
==
1
?
validateRangeNumber
(
stock
,
[
0
,
99999
])
:
true
;
let
stockPass
=
switchStock
==
1
?
validateRangeNumber
(
stock
,
[
0
,
99999
])
:
true
;
if
(
!
stockPass
||
!
usePass
)
{
if
(
!
stockPass
||
!
usePass
)
{
this
.
showItemTips
(
this
.
showItemTips
(
...
@@ -468,7 +468,7 @@ Component({
...
@@ -468,7 +468,7 @@ Component({
);
);
}
}
if
(
type
==
CREDITS_TYPE
&&
!
validateRangeNumber
(
credits
,
[
0
,
999
]
))
{
if
(
type
==
CREDITS_TYPE
&&
(
!
validateRangeNumber
(
credits
,
[
0
,
999
])
||
!
credits
))
{
this
.
showItemTips
(
this
.
showItemTips
(
"creditsValueTips"
,
"creditsValueTips"
,
"error"
,
"error"
,
...
...
client/components/prize/probability-prize-table/probability-prize-table.axml
View file @
a9a5da2a
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<table-column title="奖品数量(件)" dataIndex="stock">
<table-column title="奖品数量(件)" dataIndex="stock">
<view slot-scope="x">{{x.value || '-'}}</view>
<view slot-scope="x">{{x.value || '-'}}</view>
</table-column>
</table-column>
<table-column 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>
</table-column>
</table-column>
<table-column title="操作">
<table-column title="操作">
...
...
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