| | |
| | | Feng.info("请选择课包名称") |
| | | return; |
| | | } |
| | | |
| | | var selectElement = document.getElementById('coursePackageName'); |
| | | var selectedOption = selectElement.options[selectElement.selectedIndex]; |
| | | console.log("插入") |
| | | var type = selectedOption.getAttribute('data-type'); |
| | | console.log('type----------'+type) |
| | | |
| | | |
| | | |
| | | if (type==1) { |
| | | if (role == 1) { |
| | | if ($("#courseTime").val() == '') { |
| | | Feng.info("请选择课时规格") |
| | | return; |
| | | } |
| | | } |
| | | }else { |
| | | data.classHours = 0 |
| | | } |
| | | if($("#cashPayment").val()==''){ |
| | | Feng.info("请输入支付金额") |
| | | return; |
| | |
| | | courseTimeId=0; |
| | | } |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment/"+ courseTimeId, |
| | | url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data), // 将数据转换为 JSON 字符串 |
| | |
| | | if(data!=null){ |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | // content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | content += "<option value='"+v.id+"' data-type='"+v.type+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#coursePackageName").empty().append(content); |
| | | } |
| | |
| | | } |
| | | ajax.set("id",oneId); |
| | | ajax.start(); |
| | | |
| | | |
| | | |
| | | var ajax1 = new $ax(Feng.ctxPath + "/cpPayment/getCoursePackageType", function(data){ |
| | | if(data!=null){ |
| | | console.log("data ===="+data) |
| | | if (data != 1){ |
| | | document.getElementById("toHidden").style.display = "none"; |
| | | |
| | | var selectElement = document.getElementById('courseTime'); |
| | | var selectedOption = selectElement.options[1]; |
| | | console.log("插入") |
| | | var cashPayment = selectedOption.getAttribute('data-cashpayment'); |
| | | var playPaiCoin = selectedOption.getAttribute('data-playpaicoin'); |
| | | console.log(cashPayment) |
| | | console.log(playPaiCoin) |
| | | $("#cashPayment").val(cashPayment); |
| | | $("#playPaiCoin").val(playPaiCoin); |
| | | |
| | | |
| | | }else { |
| | | document.getElementById("toHidden").style.display = "block"; |
| | | |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | ajax1.set("id",oneId); |
| | | ajax1.start(); |
| | | |
| | | }; |
| | | TQuestion.getCoursePackagePrice = function (e) { |
| | | var c1 = document.getElementById("c1"); |
| | |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/appUser/add' |
| | | }); |
| | | layer.closeAll('page'); |
| | | // layer.closeAll('page'); |
| | | }, |
| | | btn2:function () { |
| | | } |
| | |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/appUser/addStudent/'+appUserId |
| | | }); |
| | | layer.closeAll('page'); |
| | | // layer.closeAll('page'); |
| | | }, |
| | | }); |
| | | } |