From 4bf8791d622dc54e6fc57a84c21718805fb39c66 Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期二, 10 十月 2023 15:33:50 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js | 200 ++++++++++++++++++++++++++++++++++++++------------
1 files changed, 152 insertions(+), 48 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 23da9f0..abd40bf 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
@@ -15,6 +15,33 @@
};
+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;
+};
/**
* 提交添加用户
*/
@@ -29,7 +56,19 @@
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() + ";";
@@ -40,15 +79,17 @@
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("所在省不能为空");
@@ -78,18 +119,22 @@
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){
@@ -104,10 +149,10 @@
Feng.error("课包介绍不能为空");
return
}
- if(null == validDays || '' == validDays){
- Feng.error("课时有效期不能为空");
- return
- }
+ // if(null == validDays || '' == validDays){
+ // Feng.error("课时有效期不能为空");
+ // return
+ // }
let obj = {
province: province,
@@ -120,15 +165,19 @@
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
}
//提交信息
@@ -162,7 +211,17 @@
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() + ";";
@@ -172,15 +231,21 @@
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){
@@ -211,18 +276,22 @@
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){
@@ -237,10 +306,10 @@
Feng.error("课包介绍不能为空");
return
}
- if(null == validDays || '' == validDays){
- Feng.error("课时有效期不能为空");
- return
- }
+ // if(null == validDays || '' == validDays){
+ // Feng.error("课时有效期不能为空");
+ // return
+ // }
let obj = {
id: id,
@@ -254,16 +323,21 @@
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) {
@@ -332,7 +406,8 @@
}
-function addPrice(){
+function addPrice(y){
+ console.log("===="+y)
let cash = false;
let paiCoin = false;
$('input[name="payType"]:checked').each(function (index, e) {
@@ -344,8 +419,26 @@
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' +
@@ -357,17 +450,28 @@
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 () {
--
Gitblit v1.7.1