From 36b0739f8c02ff2460fb3806ab1dabe3fde41f0b Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期二, 24 十月 2023 18:49:18 +0800
Subject: [PATCH] 运营商添加bug修改
---
cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackage_info.js | 381 +++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 349 insertions(+), 32 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 abd40bf..01ab8b9 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
@@ -2,7 +2,9 @@
* 用户详情对话框(可用于添加和修改对话框)
*/
var CoursePackageInfo = {
+ goodsPicArray1:[],
userInfoData: {},
+ goodsPicArray: [],
};
@@ -46,6 +48,7 @@
* 提交添加用户
*/
CoursePackageInfo.addSubmit = function () {
+
let province = $('#provinceCode option:checked').text();
let provinceCode = $('#provinceCode').val();
let city = $('#cityCode option:checked').text();
@@ -59,6 +62,23 @@
let codeTime = $('#codeTime').val();
let type = $('#type').val();
let holitime = $('#holitime').val();
+
+ console.log("=======这是type======"+type)
+
+ var goodImgs = CoursePackageInfo.goodsPicArray1;
+ if(goodImgs.length==0){
+ Feng.info("请上传详情图片")
+ return;
+ }
+ var imgOne ="";
+ for (let i = 0; i <goodImgs.length; i++) {
+ if(i==goodImgs.length-1){
+ imgOne += (goodImgs[i].response)
+ }else {
+ imgOne+=(goodImgs[i].response+",")
+ }
+
+ }
// let classStartTime = JSON.stringify($('#classStartTime').val());
@@ -74,7 +94,12 @@
classWeeks += $(e).val() + ";";
})
let coverDrawing = $('#coverDrawing').val();
- let detailDrawing = $('#detailDrawing').val();
+ var detailDrawing="";
+ for (let i = 0; i <CoursePackageInfo.goodsPicArray.length ; i++) {
+ detailDrawing = detailDrawing+CoursePackageInfo.goodsPicArray[i]+",";
+ }
+
+
let introduceDrawing = $('#introduceDrawing').val();
let sort = $('#sort').val();
let validDays = $('#validDays').val();
@@ -82,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({
@@ -119,40 +147,163 @@
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;
+ var isChecked1 = false;
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '1') {
+ isChecked = true;
+ break;
+ }
+ }
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '2') {
+ isChecked1 = true;
+ break;
+ }
+ }
+
+ if (isChecked1) {
+ var elements3 = document.getElementsByClassName('paiCoin');
+
+ for (var i = 0; i < elements3.length; i++) {
+ var value = elements3[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入玩湃币价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+
+ if (isChecked) {
+ var elements2 = document.getElementsByClassName('cash');
+
+ for (var i = 0; i < elements2.length; i++) {
+ var value = elements2[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入现金价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+ var elements1 = document.getElementsByClassName('classNumber');
+
+ for (var i = 0; i < elements1.length; i++) {
+ var value = elements1[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入课时数")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+
+
+ var elements = document.querySelectorAll('[name="classStartTime"]');
+ var isEmpty = false;
+
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i].value.trim() === '') {
+ isEmpty = true;
+ break;
+ }
+ }
+
+ if (isEmpty) {
+ Feng.error("请输入上课时间")
+ return;
+ console.log("At least one element with the name 'yourName' is empty.");
+ } else {
+ console.log("All elements with the name 'yourName' are filled.");
+ }
+
+
+
+ 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,
@@ -171,7 +322,7 @@
// classEndTime: classStartTime.split(" - ")[1],
classWeeks: classWeeks,
coverDrawing: coverDrawing,
- detailDrawing: detailDrawing,
+ detailDrawing: imgOne,
introduceDrawing: introduceDrawing,
sort: sort,
validDays: validDays,
@@ -214,6 +365,24 @@
let codeTime = $('#codeTime').val();
let type = $('#type').val();
+
+
+
+ var goodImgs = CoursePackageInfo.goodsPicArray1;
+ // if(goodImgs.length==0){
+ // Feng.info("请上传赛事活动图片")
+ // return;
+ // }
+ var imgOne ="";
+ for (let i = 0; i <goodImgs.length; i++) {
+ if(i==goodImgs.length-1){
+ imgOne += (goodImgs[i].response)
+ }else {
+ imgOne+=(goodImgs[i].response+",")
+ }
+
+ }
+
let holitime = $('#holitime').val();
var inputElements = document.querySelectorAll('input[name="classStartTime"]');
@@ -239,6 +408,8 @@
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,
@@ -292,16 +463,162 @@
// 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;
+ var isChecked1 = false;
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '1') {
+ isChecked = true;
+ break;
+ }
+ }
+
+ for (var i = 0; i < checkboxes.length; i++) {
+ if (checkboxes[i].checked && checkboxes[i].value === '2') {
+ isChecked1 = true;
+ break;
+ }
+ }
+
+ if (isChecked1) {
+ var elements3 = document.getElementsByClassName('paiCoin');
+
+ for (var i = 0; i < elements3.length; i++) {
+ var value = elements3[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入玩湃币价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+
+ if (isChecked) {
+ var elements2 = document.getElementsByClassName('cash');
+
+ for (var i = 0; i < elements2.length; i++) {
+ var value = elements2[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入现金价格")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+ }
+
+
+ var elements1 = document.getElementsByClassName('classNumber');
+
+ for (var i = 0; i < elements1.length; i++) {
+ var value = elements1[i].value.trim();
+
+ if (value === '') {
+ Feng.error("请输入课时数")
+ return;
+ // Value is empty
+ // Perform your desired action
+ } else {
+ // Value is not empty
+ // Perform other actions
+ }
+ }
+
+
+
+
+ var elements = document.querySelectorAll('[name="classStartTime"]');
+ var isEmpty = false;
+
+ for (var i = 0; i < elements.length; i++) {
+ if (elements[i].value.trim() === '') {
+ isEmpty = true;
+ break;
+ }
+ }
+
+ if (isEmpty) {
+ Feng.error("请输入上课时间")
+ return;
+ console.log("At least one element with the name 'yourName' is empty.");
+ } else {
+ console.log("All elements with the name 'yourName' are filled.");
+ }
+
+
+
+ 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 == detailDrawing || '' == detailDrawing){
+ // Feng.error("详情页不能为空");
+ // return
+ // }
if(null == introduceDrawing || '' == introduceDrawing){
Feng.error("课包介绍不能为空");
return
@@ -329,7 +646,7 @@
// classEndTime: classStartTime.split(" - ")[1],
classWeeks: classWeeks,
coverDrawing: coverDrawing,
- detailDrawing: detailDrawing,
+ detailDrawing: imgOne,
introduceDrawing: introduceDrawing,
sort: sort,
validDays: validDays,
@@ -451,7 +768,7 @@
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 += '<button type="button" class="btn btn-info " onclick="CoursePackageInfo.openDia('+i+')" id="ensure">\n' +
- ' <i class="fa fa-check"></i> 优惠卷\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' +
--
Gitblit v1.7.1