Commit a9a5da2a authored by qinhaitao's avatar qinhaitao

fix: 🐛 bug

parent 458f3136
......@@ -111,13 +111,14 @@
class="probability-prize-content-formItem"
label="奖品描述"
validateState="{{prizeDescTips.status}}"
help="{{prizeDescTips.content}}"
required>
help="{{prizeDescTips.content}}">
<input
class="probability-prize-content-input edit-probability-input"
type="desc"
onChange="onChangePrizeValue"
data-name="desc"
maxLength="{{30}}"
hasLimitHint="{{true}}"
value="{{prizeInitData.desc}}"
name="奖品描述"
defaultValue="{{prizeInitData.desc}}"
......
......@@ -16,7 +16,7 @@ const STOCK_NO_LIMIT = 2;
const INIT_DATA = {
ename: "",
stock: "",
type: 1,
type: EQUITY_TYPE,
image: "",
desc: "",
useUrl: "",
......@@ -221,7 +221,7 @@ Component({
onPrizeTypeChange(e) {
let value = e.detail.value;
const { type, rank } = this.data.prizeInitData;
const { type, rank, isBackUp } = this.data.prizeInitData;
let initData = {
ename: "",
stock: "",
......@@ -265,7 +265,7 @@ Component({
});
} else {
this.setData({
prizeInitData: INIT_DATA,
prizeInitData: { ...INIT_DATA, type: typeChecked.length ? +typeChecked[0]: EQUITY_TYPE } ,
});
}
},
......@@ -436,11 +436,11 @@ Component({
// }
// }
if (type == EQUITY_TYPE || type == OBJECT_TYPE) {
if (!desc) {
this.showItemTips("prizeDescTips", "error", "请填写奖品描述");
} else {
this.showItemTips("prizeDescTips", "success", "");
}
// if (!desc) {
// this.showItemTips("prizeDescTips", "error", "请填写奖品描述");
// } else {
// this.showItemTips("prizeDescTips", "success", "");
// }
if (!name) {
this.showItemTips("nameTips", "error", "请输入奖品名称");
} else {
......@@ -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;
if (!stockPass || !usePass) {
this.showItemTips(
......@@ -468,7 +468,7 @@ Component({
);
}
if (type == CREDITS_TYPE && !validateRangeNumber(credits, [0, 999])) {
if (type == CREDITS_TYPE && (!validateRangeNumber(credits, [0, 999]) || !credits)) {
this.showItemTips(
"creditsValueTips",
"error",
......
......@@ -22,7 +22,7 @@
<table-column title="奖品数量(件)" dataIndex="stock">
<view slot-scope="x">{{x.value || '-'}}</view>
</table-column>
<table-column title="中奖概率(%)" dataIndex="probability">
<table-column a:if="{{type==='probability'}}" title="中奖概率(%)" dataIndex="probability">
<view slot-scope="x">{{x.value}}</view>
</table-column>
<table-column title="操作">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment