| | |
| | | $('#price > .form-group').each(function (i, e) { |
| | | let classHours = $($(e).find(".classNumber_span input[class='classNumber']")[0]).val(); |
| | | let cash = $($(e).find(".cash_span input[class='cash']")[0]).val(); |
| | | if (typeof cash == "undefined"){ |
| | | console.log("========进入===") |
| | | } |
| | | let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val(); |
| | | let counpons = $($(e).find(".counpons")).val(); |
| | | price.push({ |
| | |
| | | Feng.error("授课教师不能为空"); |
| | | return |
| | | } |
| | | // if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | // Feng.error("最多预约人数不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == codeTime || '' == codeTime){ |
| | | // Feng.error("扣除课时数不能为空不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == classStartTime || '' == classStartTime){ |
| | | // Feng.error("上课时间不能为空"); |
| | | // return |
| | | // } |
| | | // if(null == classWeeks || '' == classWeeks){ |
| | | // Feng.error("上课时间不能为空"); |
| | | // return |
| | | // } |
| | | |
| | | // if(null == detailDrawing || '' == detailDrawing){ |
| | | // Feng.error("详情页不能为空"); |
| | | // return |
| | | // } |
| | | if (type == 1 ) { |
| | | |
| | | // if(null == validDays || '' == validDays){ |
| | | // Feng.error("课时有效期不能为空"); |
| | | // return |
| | | // } |
| | | var checkboxes1 = document.getElementsByName('payType'); |
| | | var isChecked1 = false; |
| | | |
| | | for (var i = 0; i < checkboxes1.length; i++) { |
| | | if (checkboxes1[i].checked) { |
| | | isChecked1 = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (isChecked1) { |
| | | console.log("At least one checkbox is selected."); |
| | | } else { |
| | | Feng.error("请选择支付方式") |
| | | return; |
| | | } |
| | | |
| | | |
| | | var checkboxes = document.getElementsByName('payType'); |
| | | var isChecked = false; |
| | | |
| | | for (var i = 0; i < checkboxes.length; i++) { |
| | | if (checkboxes[i].checked && checkboxes[i].value === '1') { |
| | | isChecked = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (isChecked) { |
| | | console.log("选择了现金"); |
| | | var cashElement = document.querySelector('.cash'); |
| | | var cashValue = cashElement.value.trim(); |
| | | |
| | | if (cashValue === '' || cashValue === undefined) { |
| | | console.log('金额为空或未定义'); |
| | | Feng.error("请输入金额") |
| | | return; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | if (null == maxSubscribeNumber || '' == maxSubscribeNumber) { |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | | if (null == codeTime || '' == codeTime) { |
| | | Feng.error("扣除课时数不能为空不能为空"); |
| | | return |
| | | } |
| | | if (null == classStartTime || '' == classStartTime) { |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | if (null == classWeeks || '' == classWeeks) { |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | |
| | | |
| | | |
| | | if (null == validDays || '' == validDays) { |
| | | Feng.error("课时有效期不能为空"); |
| | | return |
| | | } |
| | | } |
| | | classWeeks = classWeeks.substring(0, classWeeks.length - 1); |
| | | |
| | | if(null == coverDrawing || '' == coverDrawing){ |
| | |
| | | let paiCoin = $($(e).find(".paiCoin_span input[class='paiCoin']")[0]).val(); |
| | | let counpons = $($(e).find(".counpons")).val(); |
| | | |
| | | |
| | | |
| | | price.push({ |
| | | classHours: classHours, |
| | | cashPayment: typeof cash == "undefined" ? 0 : cash, |