From 30d8e227e8d823b6c38c3b9c90ac2df03b63befe Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 二月 2025 16:41:22 +0800 Subject: [PATCH] 淘宝转链接口更新 --- fanli/src/main/webapp/admin/new/js/nav.js | 324 +++++++++++++++++++++++++++--------------------------- 1 files changed, 162 insertions(+), 162 deletions(-) diff --git a/fanli/src/main/webapp/admin/new/js/nav.js b/fanli/src/main/webapp/admin/new/js/nav.js index d027d7b..7b81828 100644 --- a/fanli/src/main/webapp/admin/new/js/nav.js +++ b/fanli/src/main/webapp/admin/new/js/nav.js @@ -1,162 +1,162 @@ -$(function() { - setLogin(); -}); -function setLogin() { - $.ajax({ - url : "api/login/getLoginName", - async : true, - dataType : "json", - success : function(data) { - if (data.code == 0) { - var username = data.info.name; - setNav(username); - } else { - window.location.href = "login.html"; - } - }, - error : function() { - window.location.href = "login.html"; - } - }); -} - -function setNav(username) { - - $(".navbar").eq(0).empty(); - var html = ""; - html += "<div class='container-fluid'>"; - html += " <div class='navbar-header'>"; - html += " <button type='button' class='navbar-toggle collapsed' data-toggle='collapse' data-target='#bs-example-navbar-collapse-1'> <span class='sr-only'>Toggle navigation</span> <span class='icon-bar'></span> <span class='icon-bar'></span> <span class='icon-bar'></span> </button>"; - html += " <a class='navbar-brand' style='color:#FF3083' href='#'> 甯� 蹇� 琛� 鍚� 鍙� 绠� 鐞� 绯� 缁� </a> </div>"; - html += " <div class='collapse navbar-collapse' id='bs-example-navbar-collapse-1'> "; - html += " <ul class='nav navbar-nav navbar-left' id='menu-top'>"; - - $ - .ajax({ - url : 'js/navsetting.xml', - type : 'GET', - dataType : 'xml', - // timeout : 3000, // 璁惧畾瓒呮椂 - cache : false, // 绂佺敤缂撳瓨 - error : function(request, textStatus, errorThrown) { - // alert(textStatus+"鍔犺浇XML鏂囨。鍑洪敊!"+errorThrown); - // alert(request.status+":"+request.readyState); - }, - success : function(data) { - var firstIndex = -1; - var secondIndex = -1; - $(data) - .find("topNav") - .each( - function(index, ele) { - html += " <li><a href='" - + $(ele).attr("url") + "'>" - + $(ele).attr("name") - + "</a></li>"; - - $(ele) - .find("secondNav") - .each( - function(index1, ele1) { - var choosed = 0; - var secondUrl = $( - ele1).attr( - "url"); - $(ele1) - .find("url") - .each( - function( - index2, - ele2) { - if (document.location.href - .indexOf($( - ele2) - .text()) > 0) - choosed = 1; - }); - if (document.location.href - .indexOf(secondUrl) > 0) - choosed = 1; - - if (choosed == 1 - && secondIndex == -1) { - firstIndex = index; - secondIndex = index1; - console - .log("鎵惧埌:" - + $( - ele) - .attr( - "name") - + "-" - + secondIndex); - } - }); - if (secondIndex > -1 - && firstIndex == index) { - console.log(index + "-" - + secondIndex); - var htmlChild = "<dl>"; - $(ele) - .find("secondNav") - .each( - function(index1, - ele1) { - htmlChild += "<dd><a href=" - + $( - ele1) - .attr( - "url") - + ">"; - htmlChild += "<div class='cebiandh'>" - + $( - ele1) - .attr( - "name") - + "</div>"; - htmlChild += "</a></dd>"; - - }); - htmlChild += "</dl>"; - $("#sidebar").empty(); - $("#sidebar").html(htmlChild); - } - - }); - - html += " </ul>"; - html += " <ul class='nav navbar-nav navbar-right'>"; - html += " <li class='hover'><a href='#'>" + (username) - + "</a></li>"; - html += " <li><a href='api/login/loginExit'>閫�鍑虹櫥褰�</a></li>"; - html += " </ul>"; - html += " </div>"; - - html += " </div>"; - $(".navbar").eq(0).html(html); - - // 璁剧疆閫変腑 - $("#menu-top li").removeClass("active"); - $("#menu-top li").eq(firstIndex).addClass("active"); - $("#sidebar div").eq(secondIndex).addClass("cebiandh1"); - $("#sidebar div").eq(secondIndex).removeClass("cebiandh"); - - $.ajax({ - url : '../../client/html/api/v1/config/getSystemName', - type : 'GET', - dataType : 'json', - // timeout : 3000, // 璁惧畾瓒呮椂 - cache : false, // 绂佺敤缂撳瓨 - error : function(request, textStatus, errorThrown) { - }, - success : function(data) { - $(".navbar-brand").eq(0).html(data.data); - $("title").html(data.data); - } - }); - } // 璁剧疆鎴愬姛鍚庡洖璋冨嚱鏁� - }); - - - -} +$(function() { + setLogin(); +}); +function setLogin() { + $.ajax({ + url : "api/login/getLoginName", + async : true, + dataType : "json", + success : function(data) { + if (data.code == 0) { + var username = data.info.name; + setNav(username); + } else { + window.location.href = "login.html"; + } + }, + error : function() { + window.location.href = "login.html"; + } + }); +} + +function setNav(username) { + + $(".navbar").eq(0).empty(); + var html = ""; + html += "<div class='container-fluid'>"; + html += " <div class='navbar-header'>"; + html += " <button type='button' class='navbar-toggle collapsed' data-toggle='collapse' data-target='#bs-example-navbar-collapse-1'> <span class='sr-only'>Toggle navigation</span> <span class='icon-bar'></span> <span class='icon-bar'></span> <span class='icon-bar'></span> </button>"; + html += " <a class='navbar-brand' style='color:#FF3083' href='#'> 甯� 蹇� 琛� 鍚� 鍙� 绠� 鐞� 绯� 缁� </a> </div>"; + html += " <div class='collapse navbar-collapse' id='bs-example-navbar-collapse-1'> "; + html += " <ul class='nav navbar-nav navbar-left' id='menu-top'>"; + + $ + .ajax({ + url : 'js/navsetting.xml', + type : 'GET', + dataType : 'xml', + // timeout : 3000, // 璁惧畾瓒呮椂 + cache : false, // 绂佺敤缂撳瓨 + error : function(request, textStatus, errorThrown) { + // alert(textStatus+"鍔犺浇XML鏂囨。鍑洪敊!"+errorThrown); + // alert(request.status+":"+request.readyState); + }, + success : function(data) { + var firstIndex = -1; + var secondIndex = -1; + $(data) + .find("topNav") + .each( + function(index, ele) { + html += " <li><a href='" + + $(ele).attr("url") + "'>" + + $(ele).attr("name") + + "</a></li>"; + + $(ele) + .find("secondNav") + .each( + function(index1, ele1) { + var choosed = 0; + var secondUrl = $( + ele1).attr( + "url"); + $(ele1) + .find("url") + .each( + function( + index2, + ele2) { + if (document.location.href + .indexOf($( + ele2) + .text()) > 0) + choosed = 1; + }); + if (document.location.href + .indexOf(secondUrl) > 0) + choosed = 1; + + if (choosed == 1 + && secondIndex == -1) { + firstIndex = index; + secondIndex = index1; + console + .log("鎵惧埌:" + + $( + ele) + .attr( + "name") + + "-" + + secondIndex); + } + }); + if (secondIndex > -1 + && firstIndex == index) { + console.log(index + "-" + + secondIndex); + var htmlChild = "<dl>"; + $(ele) + .find("secondNav") + .each( + function(index1, + ele1) { + htmlChild += "<dd><a href=" + + $( + ele1) + .attr( + "url") + + ">"; + htmlChild += "<div class='cebiandh'>" + + $( + ele1) + .attr( + "name") + + "</div>"; + htmlChild += "</a></dd>"; + + }); + htmlChild += "</dl>"; + $("#sidebar").empty(); + $("#sidebar").html(htmlChild); + } + + }); + + html += " </ul>"; + html += " <ul class='nav navbar-nav navbar-right'>"; + html += " <li class='hover'><a href='#'>" + (username) + + "</a></li>"; + html += " <li><a href='api/login/loginExit'>閫�鍑虹櫥褰�</a></li>"; + html += " </ul>"; + html += " </div>"; + + html += " </div>"; + $(".navbar").eq(0).html(html); + + // 璁剧疆閫変腑 + $("#menu-top li").removeClass("active"); + $("#menu-top li").eq(firstIndex).addClass("active"); + $("#sidebar div").eq(secondIndex).addClass("cebiandh1"); + $("#sidebar div").eq(secondIndex).removeClass("cebiandh"); + + $.ajax({ + url : '../../client/html/api/v1/config/getSystemName', + type : 'GET', + dataType : 'json', + // timeout : 3000, // 璁惧畾瓒呮椂 + cache : false, // 绂佺敤缂撳瓨 + error : function(request, textStatus, errorThrown) { + }, + success : function(data) { + $(".navbar-brand").eq(0).html(data.data); + $("title").html(data.data); + } + }); + } // 璁剧疆鎴愬姛鍚庡洖璋冨嚱鏁� + }); + + + +} -- Gitblit v1.8.0