| | |
| | | }; |
| | | |
| | | |
| | | 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 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("所在省不能为空"); |
| | |
| | | return |
| | | } |
| | | if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | | if(null == codeTime || '' == codeTime){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } |
| | |
| | | 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, |
| | |
| | | let siteId = $('#siteId').val(); |
| | | let coachId = $('#coachId').val(); |
| | | let maxSubscribeNumber = $('#maxSubscribeNumber').val(); |
| | | let codeTime = $('#codeTime').val(); |
| | | |
| | | let classStartTime = $('#classStartTime').val(); |
| | | let classWeeks = ''; |
| | | $('input[name="classWeeks"]:checked').each(function (index, e) { |
| | |
| | | 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){ |
| | |
| | | } |
| | | if(null == maxSubscribeNumber || '' == maxSubscribeNumber){ |
| | | Feng.error("最多预约人数不能为空"); |
| | | return |
| | | } if(null == codeTime || '' == codeTime){ |
| | | Feng.error("扣除课时不能为空"); |
| | | return |
| | | } |
| | | if(null == classStartTime || '' == classStartTime){ |
| | |
| | | siteId: siteId, |
| | | coachId: coachId, |
| | | maxSubscribeNumber: maxSubscribeNumber, |
| | | codeTime: codeTime, |
| | | |
| | | classStartTime: classStartTime.split(" - ")[0], |
| | | classEndTime: classStartTime.split(" - ")[1], |
| | | classWeeks: classWeeks, |
| | |
| | | paiCoin = true; |
| | | } |
| | | }) |
| | | |
| | | var i = $('#price > div').length+1 |
| | | let htmlStr = '' + |
| | | '<div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">*课时数:</label>\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" class = "counpons" id = "counpons'+i+'" >'+i+ |
| | | '</div>'; |
| | | $('#price').append(htmlStr); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | function removePrice(e){ |
| | | $(e).parent('div').parent('div').remove(); |
| | | } |