From 7e7f901b2172281dc294dfbc67e6ad00625f09f4 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期一, 04 三月 2024 10:11:21 +0800
Subject: [PATCH] 合并代码

---
 cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html |   43 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html
index 0674a16..ebdf427 100644
--- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html
+++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit_three.html
@@ -12,7 +12,7 @@
                         跳转模块
                     </button>
                 </div>
-                <select class="form-control" id="name" style="width: 400px;" onclick="updateType(this)">
+                <select class="form-control" id="name" style="width: 400px;" onchange="updateType(this)">
                     <option value="" selected disabled>选择跳转模块</option>
                     <option value="不跳转">不跳转</option>
                     <option value="加入玩湃">加入玩湃</option>
@@ -39,7 +39,7 @@
                         跳转类型
                     </button>
                 </div>
-                <select class="form-control" id="type" style="width: 400px;" >
+                <select class="form-control" id="type" style="width: 400px;" onchange="updateT(this)">
 
                 </select>
             </div>
@@ -64,7 +64,7 @@
         <div class="row btn-group-m-t">
             <div class="col-sm-10 col-sm-offset-5">
                 <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/>
-                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TCompetition.addSubmit3()"/>
+                <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="TCompetition.addSubmit9()"/>
             </div>
         </div>
 
@@ -77,6 +77,29 @@
             range:true
         });
 
+
+        document.addEventListener('DOMContentLoaded', function() {
+            var selectElement = document.getElementById('page');
+            selectElement.onchange();
+        });
+
+        function updateT(e) {
+            var oneId = $('#type option:selected').text();
+            console.log(oneId);
+            if (oneId!="详情"&&oneId!="指定商品"&&oneId!="指定折扣"){
+                $("#t3").hide()
+                $("#t3").val("")
+            }else{
+                $("#t3").show()
+            }
+            var page = $('#page option:selected').text();
+            if (page=="线上课得积分" || page=="看视频得奖励"){
+                if (oneId == "列表"){
+                    $("#t3").show()
+                }
+            }
+        }
+
         function updateType(e) {
             let name  =  $("#name").val()
             console.log(name
@@ -85,6 +108,9 @@
                 $("#t1").hide()
                 $("#t2").hide()
                 $("#t3").hide()
+                $("#t1").val("")
+                $("#t2").val("")
+                $("#t3").val("")
             }else {
                 $("#t1").show()
                 $("#t2").show()
@@ -103,22 +129,31 @@
                 ajax.set("name",oneId);
                 ajax.start();
             }
+
+
         }
 
 
         function updateOne(e) {
             var oneId=$(e).val();
             var ajax = new $ax(Feng.ctxPath + "/tShop/typeChangeOne", function(data){
-                if(data!=null){
+                if(data!=null&&data.length>0){
+                    $("#t2").show()
                     var content1;
                     $.each(data, function(k,v) {
                         content1 += "<option value='"+v.id+"'>"+v.name+"</option>";
                     });
                     $("#type").empty().append(content1);
+                }else {
+                    console.log("=-======0000")
+                    $("#t2").hide()
+                    $("#t2").val("")
                 }
             });
             ajax.set("id",oneId);
             ajax.start();
+            updateT(document.getElementById("type"));
+
         }
     </script>
     @}

--
Gitblit v1.7.1