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

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

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