From d42f32d6c6ff2cbaab2fbdabbeefb2367e72d446 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 25 三月 2024 17:08:31 +0800
Subject: [PATCH] 新增加功能
---
cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js | 143 +++++++++++++++++++++++++----------------------
1 files changed, 76 insertions(+), 67 deletions(-)
diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js
index 34ad6ba..dedc89f 100644
--- a/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js
+++ b/cloud-server-management/src/main/webapp/static/modular/system/tSite/tSite_info.js
@@ -205,6 +205,7 @@
introduce:"",
imgs:"",
reservation:"",
+ isCanBeBooked:"",
};
data.province = $("#pCode").val()
data.id = $("#id").val()
@@ -225,64 +226,51 @@
var sm =data.appointmentStartTime.split(':')[1];
var eh =data.appointmentEndTime.split(':')[0];
var em =data.appointmentEndTime.split(':')[1];
-
- if (data.typeName === "智慧场地"){
- console.log("===========这是智慧球场")
-
- console.log("====="+data.appointmentStartTime)
-
- var value = data.appointmentStartTime;
- var lastTwoDigits = value.slice(-2);
-
- if (lastTwoDigits === "00" || lastTwoDigits === "15" || lastTwoDigits === "30" || lastTwoDigits === "45") {
- console.log("Last two digits are 00, 15, 30, or 45");
+ var reservation= $("input[name='reservation']:checked").val();
+ data.reservation= reservation;
+ data.isCanBeBooked= reservation;
+ if (reservation==1) {
+ if (data.typeName === "智慧场地") {
+ console.log("===========这是智慧球场")
+ console.log("=====" + data.appointmentStartTime)
+ var value = data.appointmentStartTime;
+ var lastTwoDigits = value.slice(-2);
+ if (lastTwoDigits === "00" || lastTwoDigits === "15" || lastTwoDigits === "30" || lastTwoDigits === "45") {
+ console.log("Last two digits are 00, 15, 30, or 45");
+ } else {
+ Feng.error("智慧场地的可预约时间段是15分钟的倍数")
+ return;
+ }
+ var value1 = data.appointmentEndTime;
+ var lastTwoDigits1 = value1.slice(-2);
+ if (lastTwoDigits1 === "00" || lastTwoDigits1 === "15" || lastTwoDigits1 === "30" || lastTwoDigits1 === "45") {
+ console.log("Last two digits are 00, 15, 30, or 45");
+ } else {
+ Feng.error("智慧场地的可预约时间段是15分钟的倍数")
+ return;
+ }
} else {
- Feng.error("智慧场地的可预约时间段是15分钟的倍数")
- return;
+ console.log("===========这是普通球场")
+ console.log("=====" + data.appointmentStartTime)
+ var value = data.appointmentStartTime;
+ var lastTwoDigits = value.slice(-2);
+ if (lastTwoDigits === "00" || lastTwoDigits === "30") {
+ console.log("Last two digits are 00, 15, 30, or 45");
+ } else {
+ Feng.info("普通场地可预约时间段需是30分钟的倍数")
+ return;
+ }
+ var value1 = data.appointmentEndTime;
+ var lastTwoDigits1 = value1.slice(-2);
+ if (lastTwoDigits1 === "00" || lastTwoDigits1 === "30") {
+ console.log("Last two digits are 00, 15, 30, or 45");
+ } else {
+ Feng.info("普通场地可预约时间段需是30分钟的倍数")
+ return;
+
+ }
}
-
-
- var value1 = data.appointmentEndTime;
- var lastTwoDigits1 = value1.slice(-2);
-
- if (lastTwoDigits1 === "00" || lastTwoDigits1 === "15" || lastTwoDigits1 === "30" || lastTwoDigits1 === "45") {
- console.log("Last two digits are 00, 15, 30, or 45");
- } else {
- Feng.error("智慧场地的可预约时间段是15分钟的倍数")
- return;
-
- }
-
-
- }else {
- console.log("===========这是普通球场")
-
- console.log("====="+data.appointmentStartTime)
- var value = data.appointmentStartTime;
- var lastTwoDigits = value.slice(-2);
-
- if (lastTwoDigits === "00" || lastTwoDigits === "30" ) {
- console.log("Last two digits are 00, 15, 30, or 45");
- } else {
- Feng.info("普通场地可预约时间段需是30分钟的倍数")
- return;
- }
-
-
- var value1 = data.appointmentEndTime;
- var lastTwoDigits1 = value1.slice(-2);
-
- if (lastTwoDigits1 === "00"|| lastTwoDigits1 === "30" ) {
- console.log("Last two digits are 00, 15, 30, or 45");
- } else {
- Feng.info("普通场地可预约时间段需是30分钟的倍数")
- return;
-
- }
-
-
-
}
@@ -322,12 +310,9 @@
var ishalf= $("input[name='ishalf']:checked").val();
data.ishalf= ishalf;
- var reservation= $("input[name='reservation']:checked").val();
- data.reservation= reservation;
+
var halfName="";
if (reservation==1){
-
-
if(ishalf==1){
let cashPriceOne = $("#cashPriceOne").val()
if(cashPriceOne=='' ){
@@ -528,18 +513,39 @@
};
TSiteInfo.oneChangeYys = function(e){
- var oneId=$(e).val();
- var SelectValue="";
- var getSelectValueMenbers = $("input[name='pt']:checked").each(function(j) {
- if (j >= 0) {
- SelectValue += $(this).val()
+ var oneId = $(e).val();
+ var checkbox = document.querySelector('input[name="pt"]');
+ if (checkbox.checked) {
+ oneId=0;
+ console.log("选中是平台");
+ }else{
+ oneId = 1;
+ console.log("运营商");
+ console.log(oneId)
+ }
+ if (oneId == "1"){
+ oneId = $("#yys").val()
+ if (oneId==""){
+ oneId = 1
}
- });
- if(SelectValue=='0' ){
- oneId=0
+ console.log("看看选择之后")
+ console.log(oneId)
+ var button = document.getElementById("yys");
+ button.removeAttribute("disabled");
}
var ajax = new $ax(Feng.ctxPath + "/tSite/getChangeOne", function(data){
if(data!=null){
+ // var content1 = '<option value="0">平台</option>';
+ console.log("看看oneId")
+ console.log(oneId)
+ if (oneId == 0) {
+ console.log("锁住")
+ $("#yys").prop('disabled', true);
+ }else{
+ console.log("放开")
+ $("#yys").prop('disabled', false);
+ }
+
var content='<option value="">选择门店</option>';
$.each(data, function(k,v) {
content += "<option value='"+v.id+"'>"+v.name+"</option>";
@@ -547,6 +553,9 @@
$("#store").empty().append(content);
}
});
+
+
+
ajax.set("oneId",oneId);
ajax.start();
};
--
Gitblit v1.7.1