From b1069cdbce2086877055c32a19a0ab51b29331a8 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期四, 21 三月 2024 17:26:22 +0800
Subject: [PATCH] 修改bug
---
cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackageDiscount.js | 36 ++++++++++++++++++++++++++----------
1 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackageDiscount.js b/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackageDiscount.js
index 03693e1..77de3f2 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackageDiscount.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/coursePackage/coursePackageDiscount.js
@@ -191,7 +191,7 @@
lay('.startAndEndDay').each(function(i, e){
laydate.render({
trigger: 'click',
- elem: this
+ elem: e
,type: 'datetime'
,range: true
,done: function(value, date, endDate){
@@ -405,7 +405,7 @@
let index = $('#classHours').find('button[checked]').attr('index');
let obj = CoursePackageDiscount.coursePackagePaymentConfig[index];
$('#payment').text(obj.payment);
- $('#cashPayment').text(obj.cashPayment);
+ $('#cashPayment').text(obj.cashPayment+"元");
$('#memberDiscount').html('');
$('#renewalOffer').html('');
@@ -431,14 +431,21 @@
let htmlStr = '';
for (let i = 0; i < CoursePackageDiscount.coursePackagePaymentConfig.length; i++) {
let obj = CoursePackageDiscount.coursePackagePaymentConfig[i];
- if(i == 0){
- htmlStr += '<button checked onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;">' + obj.classHours + '课时</button> ';
- }else{
- htmlStr += '<button onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;border: none;border-radius: 5px;">' + obj.classHours + '课时</button> ';
- }
+ console.log("看看课程类型")
+ console.log($('#type').val());
+ if(i == 0){
+ htmlStr += '<button checked onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;background-color: #0086F6;border: none;border-radius: 5px;color: white;">' + obj.classHours + '课时</button> ';
+ }else{
+ htmlStr += '<button onclick="selectedPperiod(this)" index="' + i + '" style="width: 60px;height: 30px;border: none;border-radius: 5px;">' + obj.classHours + '课时</button> ';
+ }
+
}
$('#classHours').html(htmlStr);
-
+ if ($('#type').val()==2) {
+ var cla = document.getElementById("classHours");
+ console.log("隐藏")
+ cla.style.display="none";
+ }
$('input[name="type"]').click(function () {
let v = $(this).val();
let index = $('#classHours').find('button[checked]').attr('index');
@@ -825,7 +832,7 @@
lay('.startAndEndDay').each(function(i, e){
laydate.render({
trigger: 'click',
- elem: this
+ elem: e
,type: 'datetime'
,range: true
,done: function(value, date, endDate){
@@ -833,7 +840,16 @@
let obj = CoursePackageDiscount.coursePackagePaymentConfig[index];
let ii = $(e).parent('div').parent('div').parent('div').parent('div').attr('index');
for (let i = 0; i < obj.coursePackageDiscount.length; i++) {
- if(type == obj.coursePackageDiscount[i].type){
+ if(3 == obj.coursePackageDiscount[i].type){
+ let jsonArray = obj.coursePackageDiscount[i].content;
+ for (let j = 0; j < jsonArray.length; j++) {
+ if(j == ii){
+ let arr = value.split(" - ");
+ obj.coursePackageDiscount[i].content[j]['startDate'] = arr[0];
+ obj.coursePackageDiscount[i].content[j]['endDate'] = arr[1];
+ }
+ }
+ } if(4 == obj.coursePackageDiscount[i].type){
let jsonArray = obj.coursePackageDiscount[i].content;
for (let j = 0; j < jsonArray.length; j++) {
if(j == ii){
--
Gitblit v1.7.1