| | |
| | | }; |
| | | |
| | | |
| | | CoursePackageInfo.openDia = function (i) { |
| | | |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['80%', '80%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/conpun/'+i |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | CoursePackageInfo.openDia1 = function (i) { |
| | | var ids = $("#counpons"+i).val() |
| | | |
| | | console.log($("#counpons"+i).val()) |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['80%', '80%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/coursePackage/conpun1'+'/'+i+'?conpunids='+ids |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | /** |
| | | * 提交添加用户 |
| | | */ |
| | |
| | | let siteId = $('#siteId').val(); |
| | | let coachId = $('#coachId').val(); |
| | | let maxSubscribeNumber = $('#maxSubscribeNumber').val(); |
| | | let classStartTime = $('#classStartTime').val(); |
| | | let codeTime = $('#codeTime').val(); |
| | | let type = $('#type').val(); |
| | | let holitime = $('#holitime').val(); |
| | | |
| | | |
| | | // let classStartTime = JSON.stringify($('#classStartTime').val()); |
| | | |
| | | |
| | | var inputElements = document.querySelectorAll('input[name="classStartTime"]'); |
| | | let classStartTime = JSON.stringify(Array.from(inputElements).map(function(element) { |
| | | return element.value; |
| | | })) |
| | | |
| | | let classWeeks = ''; |
| | | $('input[name="classWeeks"]:checked').each(function (index, e) { |
| | | classWeeks += $(e).val() + ";"; |
| | |
| | | let sort = $('#sort').val(); |
| | | let validDays = $('#validDays').val(); |
| | | let price = []; |
| | | $('#price>.form-group').each(function (i, e) { |
| | | $('#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(); |
| | | 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, |
| | | playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin |
| | | }) |
| | | playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin, |
| | | couponIds: typeof counpons == "undefined" ? 0 : counpons |
| | | }); |
| | | }); |
| | | if(null == provinceCode || '' == provinceCode){ |
| | | Feng.error("所在省不能为空"); |
| | |
| | | Feng.error("授课教师不能为空"); |
| | | return |
| | | } |
| | | if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | | if(null == classStartTime || '' == classStartTime){ |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | if(null == classWeeks || '' == classWeeks){ |
| | | 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 |
| | | // } |
| | | classWeeks = classWeeks.substring(0, classWeeks.length - 1); |
| | | |
| | | if(null == coverDrawing || '' == coverDrawing){ |
| | |
| | | Feng.error("课包介绍不能为空"); |
| | | return |
| | | } |
| | | if(null == validDays || '' == validDays){ |
| | | Feng.error("课时有效期不能为空"); |
| | | return |
| | | } |
| | | // if(null == validDays || '' == validDays){ |
| | | // Feng.error("课时有效期不能为空"); |
| | | // return |
| | | // } |
| | | |
| | | let obj = { |
| | | province: province, |
| | |
| | | siteId: siteId, |
| | | coachId: coachId, |
| | | maxSubscribeNumber: maxSubscribeNumber, |
| | | classStartTime: classStartTime.split(" - ")[0], |
| | | classEndTime: classStartTime.split(" - ")[1], |
| | | classStartTime: classStartTime, |
| | | codeTime:codeTime, |
| | | // classStartTime: classStartTime.split(" - ")[0], |
| | | // classEndTime: classStartTime.split(" - ")[1], |
| | | classWeeks: classWeeks, |
| | | coverDrawing: coverDrawing, |
| | | detailDrawing: detailDrawing, |
| | | introduceDrawing: introduceDrawing, |
| | | sort: sort, |
| | | validDays: validDays, |
| | | coursePackagePaymentConfig: JSON.stringify(price) |
| | | coursePackagePaymentConfig: JSON.stringify(price), |
| | | type:type, |
| | | holitime:holitime |
| | | } |
| | | |
| | | //提交信息 |
| | |
| | | let siteId = $('#siteId').val(); |
| | | let coachId = $('#coachId').val(); |
| | | let maxSubscribeNumber = $('#maxSubscribeNumber').val(); |
| | | let classStartTime = $('#classStartTime').val(); |
| | | let codeTime = $('#codeTime').val(); |
| | | let type = $('#type').val(); |
| | | |
| | | let holitime = $('#holitime').val(); |
| | | |
| | | var inputElements = document.querySelectorAll('input[name="classStartTime"]'); |
| | | let classStartTime = JSON.stringify(Array.from(inputElements).map(function(element) { |
| | | return element.value; |
| | | })) |
| | | |
| | | // let classStartTime = $('#classStartTime').val(); |
| | | let classWeeks = ''; |
| | | $('input[name="classWeeks"]:checked').each(function (index, e) { |
| | | classWeeks += $(e).val() + ";"; |
| | |
| | | let introduceDrawing = $('#introduceDrawing').val(); |
| | | let sort = $('#sort').val(); |
| | | let validDays = $('#validDays').val(); |
| | | // let counpons = $($(e).find(".counpons")).val(); |
| | | |
| | | let price = []; |
| | | $('#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(); |
| | | 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, |
| | | playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin |
| | | playPaiCoin: typeof paiCoin == "undefined" ? 0 : paiCoin, |
| | | couponIds: typeof counpons == "undefined" ? 0 : counpons |
| | | |
| | | }) |
| | | }); |
| | | if(null == provinceCode || '' == provinceCode){ |
| | |
| | | Feng.error("授课教师不能为空"); |
| | | return |
| | | } |
| | | if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | | if(null == classStartTime || '' == classStartTime){ |
| | | Feng.error("上课时间不能为空"); |
| | | return |
| | | } |
| | | if(null == classWeeks || '' == classWeeks){ |
| | | 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 |
| | | // } |
| | | classWeeks = classWeeks.substring(0, classWeeks.length - 1); |
| | | |
| | | if(null == coverDrawing || '' == coverDrawing){ |
| | |
| | | Feng.error("课包介绍不能为空"); |
| | | return |
| | | } |
| | | if(null == validDays || '' == validDays){ |
| | | Feng.error("课时有效期不能为空"); |
| | | return |
| | | } |
| | | // if(null == validDays || '' == validDays){ |
| | | // Feng.error("课时有效期不能为空"); |
| | | // return |
| | | // } |
| | | |
| | | let obj = { |
| | | id: id, |
| | |
| | | siteId: siteId, |
| | | coachId: coachId, |
| | | maxSubscribeNumber: maxSubscribeNumber, |
| | | classStartTime: classStartTime.split(" - ")[0], |
| | | classEndTime: classStartTime.split(" - ")[1], |
| | | codeTime: codeTime, |
| | | type:type, |
| | | classStartTime: classStartTime, |
| | | // classEndTime: classStartTime.split(" - ")[1], |
| | | classWeeks: classWeeks, |
| | | coverDrawing: coverDrawing, |
| | | detailDrawing: detailDrawing, |
| | | introduceDrawing: introduceDrawing, |
| | | sort: sort, |
| | | validDays: validDays, |
| | | coursePackagePaymentConfig: JSON.stringify(price) |
| | | coursePackagePaymentConfig: JSON.stringify(price), |
| | | holitime:holitime |
| | | } |
| | | |
| | | console.log("======="+obj) |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/updateCoursePackage", function (data) { |
| | |
| | | } |
| | | |
| | | |
| | | function addPrice(){ |
| | | function addPrice(y){ |
| | | console.log("===="+y) |
| | | let cash = false; |
| | | let paiCoin = false; |
| | | $('input[name="payType"]:checked').each(function (index, e) { |
| | |
| | | paiCoin = true; |
| | | } |
| | | }) |
| | | var i = $('#price > div').length+1 |
| | | let htmlStr = '' |
| | | |
| | | let htmlStr = '' + |
| | | |
| | | if (y===1){ |
| | | |
| | | htmlStr += '<div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">*课时数:</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <span class="classNumber_span"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> <span class="cash_span">\n'; |
| | | |
| | | } |
| | | if (y===2){ |
| | | |
| | | htmlStr += '<div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label"></label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | | ' <span class="classNumber_span" hidden="hidden"><input class="classNumber" type="number" min="0" placeholder="请输入" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> </span> <span class="cash_span">\n'; |
| | | |
| | | } |
| | | '<div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">*课时数:</label>\n' + |
| | | ' <div class="col-sm-8">\n' + |
| | |
| | | if(paiCoin){ |
| | | htmlStr += '玩湃币支付:<input class="paiCoin" type="number" min="0" placeholder="请输入金额" style="width: 110px;background-color: #FFFFFF;background-image: none;border: 1px solid #e5e6e7;border-radius: 1px;color: inherit;padding: 6px 12px;"> 币 \n'; |
| | | } |
| | | htmlStr += '</span> <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice(this)"></i>\n' + |
| | | '</div>\n' + |
| | | htmlStr += '<button type="button" class="btn btn-info " onclick="CoursePackageInfo.openDia('+i+')" id="ensure">\n' + |
| | | ' <i class="fa fa-check"></i> 优惠券\n' + |
| | | '</button>'; |
| | | |
| | | htmlStr += '</span> <i class="fa fa-trash-o" style="font-size:24px" onclick="removePrice(this)"></i>\n' + |
| | | '</div>\n' +'<input type="text" hidden="hidden" class = "counpons" id = "counpons'+i+'" >'+i+ |
| | | '</div>'; |
| | | $('#price').append(htmlStr); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | function removePrice(e){ |
| | | $(e).parent('div').parent('div').remove(); |
| | | } |
| | | |
| | | function removePrice1(e){ |
| | | $(e).parent('div').remove(); |
| | | } |
| | | |
| | | |
| | | |
| | | $(function () { |
| | | $('#provinceCode').change(function () { |