| | |
| | | var couponInfoDlg = { |
| | | couponInfoData: {}, |
| | | goodsPicArray: [], //商品图片数组 |
| | | goodsCover: '' //商品封面图 |
| | | goodsCover: '', //商品封面图 |
| | | storeIds: [], |
| | | }; |
| | | |
| | | /** |
| | |
| | | |
| | | var num = 0; |
| | | couponInfoDlg.addBranch = function () { |
| | | num=num+1; |
| | | var a= ""; |
| | | a = "<div style=\'margin-left: 25%\' class=\"col-sm-9 control-label\">\n" + |
| | | " <select class=\"col-sm-1\" id=\'provinceData"+num+"\' style=\"margin-top: 1%;width: 25%\" onchange=\'changeCity("+num+")\'>\n" + |
| | |
| | | " </div>"; |
| | | $("#cityDemo").append($(a)); |
| | | getProvince(num); |
| | | num=num+1 |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | couponInfoDlg.addSubmit = function () { |
| | | |
| | | var resultData = {}; |
| | | var cityIds = []; |
| | | // 优惠券名称 |
| | | var couponName = $('#name').val(); |
| | | // 优惠券类型 |
| | |
| | | let exchangeMethod = $(':radio[name="exchangeMethod"]:checked').val(); |
| | | |
| | | var requiredCash = $('#requiredCash').val(); |
| | | |
| | | var company = $('#company').val(); |
| | | if (company === '2'){ |
| | | var myselect=document.getElementById('cityData'); |
| | | var seCity = myselect.options[myselect.selectedIndex].value; |
| | | if (seCity === null || seCity === undefined || seCity === ''){ |
| | | return Feng.error('请选中一个省市'); |
| | | } |
| | | cityIds.push(seCity); |
| | | if (this.num > 0){ |
| | | for (let i = 1; i <= num; i++) { |
| | | var insSelect=document.getElementById('cityData'+i); |
| | | var inData = insSelect.options[insSelect.selectedIndex].value; |
| | | if (inData !== undefined || inData !== null || inData !== ''){ |
| | | cityIds.push(inData); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (company === '3'){ |
| | | |
| | | } |
| | | |
| | | console.log('11111111') |
| | | |
| | |
| | | ajax.set("goodImg",this.goodsCover); |
| | | ajax.set("goodImgs",this.goodsPicArray); |
| | | ajax.set("company",$('#company').val()); |
| | | ajax.set("cityIds",[]); |
| | | ajax.set("storeIds",[]); |
| | | ajax.set("cityIds",cityIds); |
| | | ajax.set("storeIds",this.storeIds); |
| | | ajax.start(); |
| | | |
| | | } |