Memory_LG 5 ماه پیش
والد
کامیت
fe38a65b88

+ 23 - 0
src/main/resources/static/js/register/jyxx.js

@@ -0,0 +1,23 @@
+function showStateFunc(categoryName, state, id, aId, href){
+    //state == true  为已经登录
+    var html = $("#"+id);
+    if(state){
+        console.log("用户已经登陆")
+        var link = $("<a>", {
+            href: href, // 设置链接的href属性
+            text: categoryName, // 设置链接的文本
+            id: aId // 可选:添加一个ID
+        });
+        html.append(link);
+    }else{
+        console.log("用户未登录")
+        if("招聘信息" !== categoryName && "优质岗位" !== categoryName){
+            var link = $("<a>", {
+                href: href, // 设置链接的href属性
+                text: categoryName, // 设置链接的文本
+                id: aId // 可选:添加一个ID
+            });
+            html.append(link);
+        }
+    }
+}

+ 2 - 25
src/main/resources/templates/www/tuiyijunren/list-dpsg.html

@@ -7,38 +7,15 @@
 		let arr = post_str.replace(/ /g,"").replace(/,/g," | ");
 		$("#"+id).html(arr);
 	}
-
-	function showState(categoryName, state, id, aId, href){
-		//state == true  为已经登录
-		var html = $("#"+id);
-		if(state){
-			console.log("用户已经登陆")
-			var link = $("<a>", {
-				href: href, // 设置链接的href属性
-				text: categoryName, // 设置链接的文本
-				id: aId // 可选:添加一个ID
-			});
-			html.append(link);
-		}else{
-			console.log("用户未登录")
-			if("招聘信息" !== categoryName && "优质岗位" !== categoryName){
-				var link = $("<a>", {
-					href: href, // 设置链接的href属性
-					text: categoryName, // 设置链接的文本
-					id: aId // 可选:添加一个ID
-				});
-				html.append(link);
-			}
-		}
-	}
 </script>
+<script src="${ctxPath}/static/js/register/jyxx.js"></script>
 <div class="er_content clearfix">
 	<div class="er_left fl">
 		<div class="er_nav">
 			<h4>就业信息</h4>
 			<span id="${site.siteId}"></span>
 			<#cms_category_list  siteId="${site.siteId}" categoryId="1218" isNav="0" var="bean">
-			<script>showState("${bean.categoryName}", ${showState}, "${site.siteId}", "${bean.categoryId}", "${frontPath}/${site.siteId}/${bean.categoryId}.html")</script>
+			<script>showStateFunc("${bean.categoryName}", showState, "${site.siteId}", "${bean.categoryId}", "${frontPath}/${site.siteId}/${bean.categoryId}.html")</script>
 			</#cms_category_list>
 		</div>
 	</div>

+ 2 - 26
src/main/resources/templates/www/tuiyijunren/list-jyxx.html

@@ -6,31 +6,7 @@
         display: none;
     }
 </style>
-<script>
-	function showState(categoryName, state, id, aId, href){
-		//state == true  为已经登录
-		var html = $("#"+id);
-        if(state){
-            console.log("用户已经登陆")
-            var link = $("<a>", {
-                href: href, // 设置链接的href属性
-                text: categoryName, // 设置链接的文本
-                id: aId // 可选:添加一个ID
-            });
-            html.append(link);
-        }else{
-            console.log("用户未登录")
-            if("招聘信息" !== categoryName && "优质岗位" !== categoryName){
-                var link = $("<a>", {
-                    href: href, // 设置链接的href属性
-                    text: categoryName, // 设置链接的文本
-                    id: aId // 可选:添加一个ID
-                });
-                html.append(link);
-            }
-        }
-	}
-</script>
+<script src="${ctxPath}/static/js/register/jyxx.js"></script>
 <!--中间内容开始-->
 <div class="er_content clearfix">
 	<div class="er_left fl">
@@ -38,7 +14,7 @@
 			<h4>就业信息</h4>
 			<span id="${site.siteId}"></span>
 			<#cms_category_list  siteId="${site.siteId}" categoryId="1218" isNav="0" var="bean">
-				<script>showState("${bean.categoryName}", ${showState}, "${site.siteId}", "${bean.categoryId}", "${frontPath}/${site.siteId}/${bean.categoryId}.html")</script>
+				<script>showStateFunc("${bean.categoryName}", showState, "${site.siteId}", "${bean.categoryId}", "${frontPath}/${site.siteId}/${bean.categoryId}.html")</script>
 			</#cms_category_list>
 		</div>
 	</div>

+ 3 - 24
src/main/resources/templates/www/tuiyijunren/list-yzgw.html

@@ -28,37 +28,16 @@
     function renderExperienceAndEducation(experienceAndEducation) {
         return "&nbsp;&nbsp"+experienceAndEducation.replaceAll("/","&nbsp;&nbsp;");
     }
-    function showState(categoryName, state, id, aId, href){
-        //state == true  为已经登录
-        var html = $("#"+id);
-        if(state){
-            console.log("用户已经登陆")
-            var link = $("<a>", {
-                href: href, // 设置链接的href属性
-                text: categoryName, // 设置链接的文本
-                id: aId // 可选:添加一个ID
-            });
-            html.append(link);
-        }else{
-            console.log("用户未登录")
-            if("招聘信息" !== categoryName && "优质岗位" !== categoryName){
-                var link = $("<a>", {
-                    href: href, // 设置链接的href属性
-                    text: categoryName, // 设置链接的文本
-                    id: aId // 可选:添加一个ID
-                });
-                html.append(link);
-            }
-        }
-    }
+
 </script>
+<script src="${ctxPath}/static/js/register/jyxx.js"></script>
 <div class="er_content clearfix">
     <div class="er_left fl">
         <div class="er_nav">
             <h4>就业信息</h4>
             <span id="${site.siteId}"></span>
             <#cms_category_list  siteId="${site.siteId}" categoryId="1223" isNav="0" var="bean">
-                <script>showState("${bean.categoryName}", ${showState}, "${site.siteId}", "${bean.categoryId}", "${frontPath}/${site.siteId}/${bean.categoryId}.html")</script>
+                <script>showStateFunc("${bean.categoryName}", showState, "${site.siteId}", "${bean.categoryId}", "${frontPath}/${site.siteId}/${bean.categoryId}.html")</script>
             </#cms_category_list>
         </div>
     </div>