|
@@ -4,7 +4,9 @@ var edit = require('../../../../common/edit'); |
|
@@ -4,7 +4,9 @@ var edit = require('../../../../common/edit'); |
4
|
var jsonUtils=require('./jsonUtils');
|
4
|
var jsonUtils=require('./jsonUtils');
|
5
|
var promotionInfoRefresh=require('./promotionInfoRefresh');
|
5
|
var promotionInfoRefresh=require('./promotionInfoRefresh');
|
6
|
console.log("operationEdit in");
|
6
|
console.log("operationEdit in");
|
7
|
-
|
7
|
+var regrex_special_prds = new RegExp(/^\d{1,9}(,\d{1,9})*$/);
|
|
|
8
|
+var regrex_double =new RegExp(/\d+(\.\d+)?/);
|
|
|
9
|
+var regrex_small_digit =new RegExp(/[0]\.\d{1,2}/);
|
8
|
var operationEdit={
|
10
|
var operationEdit={
|
9
|
tabLoader:null,
|
11
|
tabLoader:null,
|
10
|
columnName:null,
|
12
|
columnName:null,
|
|
@@ -342,13 +344,60 @@ var operationEdit={ |
|
@@ -342,13 +344,60 @@ var operationEdit={ |
342
|
var _g=this;
|
344
|
var _g=this;
|
343
|
var result=true;
|
345
|
var result=true;
|
344
|
switch(_reqData["promotionType"]){
|
346
|
switch(_reqData["promotionType"]){
|
|
|
347
|
+ //打折 请使用小数,例如:0.85,表示85折
|
|
|
348
|
+ case _g.config.Discount.enName:
|
|
|
349
|
+ var discount = _reqData["data"]["discount"];
|
|
|
350
|
+ result = regrex_small_digit.test(discount);
|
|
|
351
|
+ break;
|
|
|
352
|
+ //满减 double
|
|
|
353
|
+ case _g.config.Cashreduce.enName:
|
|
|
354
|
+ var reduce = _reqData["data"]["reduce"];
|
|
|
355
|
+ result = regrex_double.test(reduce);
|
|
|
356
|
+ break;
|
|
|
357
|
+ //赠品 多个使用英文逗号(,)分割,例如:"50017804,50019370"
|
|
|
358
|
+ case _g.config.Gift.enName:
|
|
|
359
|
+ var gift_list = _reqData["data"]["gift_list"];
|
|
|
360
|
+ result = regrex_special_prds.test(gift_list);
|
|
|
361
|
+ break;
|
|
|
362
|
+ /*
|
|
|
363
|
+ case _g.config.Changeshippingfee.enName:
|
|
|
364
|
+
|
|
|
365
|
+ break; //调整运费
|
|
|
366
|
+
|
|
|
367
|
+ //VIP固定折扣
|
|
|
368
|
+ case _g.config.Vipfixeddiscount.enName:
|
|
|
369
|
+
|
|
|
370
|
+ break;
|
|
|
371
|
+
|
|
|
372
|
+ //送优惠券
|
|
|
373
|
+ case _g.config.Givecoupon.enName:
|
|
|
374
|
+
|
|
|
375
|
+ break;
|
|
|
376
|
+ */
|
|
|
377
|
+ //加价购
|
|
|
378
|
+ // goods_list 商品列表 多个使用英文逗号(,)分割,例如:"50017804,50019370"
|
|
|
379
|
+ //add_cost 支付金额 double
|
|
|
380
|
+ case _g.config.Needpaygift.enName:
|
|
|
381
|
+ var goods_list = _reqData["data"]["goods_list"];
|
|
|
382
|
+ var add_cost = _reqData["data"]["add_cost"];
|
|
|
383
|
+ result = regrex_double.test(add_cost) && regrex_special_prds.test(goods_list);
|
|
|
384
|
+ break;
|
|
|
385
|
+ //满X免1
|
|
|
386
|
+ case _g.config.Cheapestfree.enName:
|
|
|
387
|
+
|
|
|
388
|
+ break;
|
|
|
389
|
+ //分件折扣
|
345
|
case _g.config.Degressdiscount.enName:
|
390
|
case _g.config.Degressdiscount.enName:
|
346
|
- var regrex=new RegExp(/(\d+:\d+(\.\d+)?)(;\d+:\d+(\.\d+)?)*/,'g');
|
391
|
+ //new RegExp(/^(\d+:\d+(\.\d+);)*(\d+:\d+(\.\d+)?)/)
|
|
|
392
|
+ //var regrex=new RegExp(/(\d+:\d+(\.\d+)?)(;\d+:\d+(\.\d+)?)*/);
|
|
|
393
|
+ //^\s*(\d+:\d+\.?\d*;)*(\d+:\d+\.?\d*)\s*$
|
|
|
394
|
+ var _regexp = new RegExp(/^(\d+:\d+(\.\d+)?;)*(\d+:\d+(\.\d+)?)$/);
|
347
|
var degress_discount_list=_reqData["data"]["degress_discount_list"];
|
395
|
var degress_discount_list=_reqData["data"]["degress_discount_list"];
|
348
|
- result = regrex.test(degress_discount_list);
|
396
|
+ result = _regexp.test(degress_discount_list);
|
349
|
break;
|
397
|
break;
|
|
|
398
|
+ //X件X元
|
350
|
case _g.config.SpecifiedAmount.enName:
|
399
|
case _g.config.SpecifiedAmount.enName:
|
351
|
- var regrex=new RegExp(/^\d+:\d+(\.\d+)?$/,'g');
|
400
|
+ var regrex=new RegExp(/^\d+:\d+(\.\d+)?$/);
|
352
|
var specified_amount_list=_reqData["data"]["specified_amount_list"];
|
401
|
var specified_amount_list=_reqData["data"]["specified_amount_list"];
|
353
|
result = regrex.test(specified_amount_list);
|
402
|
result = regrex.test(specified_amount_list);
|
354
|
break;
|
403
|
break;
|