From 783b9ee7a8caa508d123d34bfbbf294716211dd7 Mon Sep 17 00:00:00 2001 From: nickchange <126672920+nickchange@users.noreply.github.com> Date: 星期三, 18 十月 2023 16:50:16 +0800 Subject: [PATCH] 10.18.2 --- cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js | 111 +++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 83 insertions(+), 28 deletions(-) diff --git a/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js b/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js index 618aa38..9a624ee 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js @@ -48,6 +48,7 @@ * 提交添加用户 */ CoursePackageInfo.addSubmit = function () { + let province = $('#provinceCode option:checked').text(); let provinceCode = $('#provinceCode').val(); let city = $('#cityCode option:checked').text(); @@ -62,12 +63,13 @@ let type = $('#type').val(); let holitime = $('#holitime').val(); + console.log("=======这是type======"+type) var goodImgs = CoursePackageInfo.goodsPicArray1; - // if(goodImgs.length==0){ - // Feng.info("请上传赛事活动图片") - // return; - // } + if(goodImgs.length==0){ + Feng.info("请上传详情图片") + return; + } var imgOne =""; for (let i = 0; i <goodImgs.length; i++) { if(i==goodImgs.length-1){ @@ -105,6 +107,9 @@ $('#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({ @@ -142,40 +147,88 @@ 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 (type == 1 ) { + + 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){ Feng.error("课包封面不能为空"); return } - // if(null == detailDrawing || '' == detailDrawing){ - // Feng.error("详情页不能为空"); - // return - // } + if(null == introduceDrawing || '' == introduceDrawing){ Feng.error("课包介绍不能为空"); return } - // if(null == validDays || '' == validDays){ - // Feng.error("课时有效期不能为空"); - // return - // } + let obj = { province: province, @@ -281,6 +334,8 @@ 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, -- Gitblit v1.7.1