Commit 50a9e51c authored by 李硕's avatar 李硕

限制库存和不限库存切换校验限制

parent 59107fa8
......@@ -69,7 +69,7 @@ Component({
status: "success",
content: "",
},
goodIdTips: {
goodsIdTips: {
status: "success",
content: "",
},
......@@ -397,11 +397,11 @@ Component({
}
//实物奖品的配置商品id
// if (type == OBJECT_TYPE) {
// if (!goodId) {
// this.showItemTips('goodIdTips', 'error', '请选择商品链接');
// if (!goodsId) {
// this.showItemTips('goodsIdTips', 'error', '请选择商品链接');
// }
// else {
// this.showItemTips('goodIdTips', 'success', '');
// this.showItemTips('goodsIdTips', 'success', '');
// }
// }
if (type == EQUITY_TYPE || type == OBJECT_TYPE) {
......@@ -421,10 +421,7 @@ Component({
}
// 库存奖品的库存值判断
let usePass = switchStock == 1 ? +stock > (useStock || 0) : true;
// console.log("stock==", stock, "useStock==", useStock, 'type===', type);
let intNum = /^[1-9]+[0-9]*$/;
let stockPass = switchStock == 1 ? (intNum.test(+stock) && +stock > 0 && +stock <= 99999) : true;
console.log(intNum.test(+stock), +stock <= 0, +stock > 99999, usePass);
let stockPass = switchStock == 1 ? !validateRangeNumber(credits, [0, 99999]) : true;
if (!stockPass || !usePass) {
this.showItemTips(
"prizeNumberTips",
......@@ -480,7 +477,7 @@ Component({
creditsValueTips,
useUrlTips,
prizeDescTips,
goodIdTips,
goodsIdTips,
} = this.data;
const isImagePass = image && imageTips.status !== "error";
......@@ -500,7 +497,7 @@ Component({
isImagePass &&
probabilityTips.status !== "error" &&
prizeNumberTips.status !== "error" &&
goodIdTips.status !== "error" &&
goodsIdTips.status !== "error" &&
prizeDescTips.status !== "error";
const isCreditsPass =
type == CREDITS_TYPE &&
......
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