﻿function focusSearch(d, e) { var b = $(d); var c = "", a = e; b.focus(function () { c = $(this).val(); if (c == a) { $(this).val("") } }).blur(function () { if (a == $(this).val() || $(this).val() == "") { $(this).val(a) } }) } function colorList() { if ($(".colorList").length) { var a = $(".colorList li"); a.each(function () { $(this).click(function () { if ($(this).attr("class") == "now") { $(this).removeClass("now") } else { a.removeClass("now"); $(this).addClass("now") } }) }) } } function heightBar() { } function serviceSearch() { var c = $("#btnServiceSxSearch"); var a = $("#btnServiceKeySearch"); var g = $("#a_siteCountSort"); var f = $("#a_ratingSort"); if (c[0] == undefined) { return } var b = location.href.split("/")[0]; var e = location.href.split("?")[1]; var d = function (h, i) { h.bind("click", i) }; d(c, function () { var m = ""; $(".csvList input[name=service]").each(function () { if ($(this).attr("checked") == true) { m += "1," } else { m += "0," } }); var k = $("#txtServiceSearch").val(); var i = (k == "\u5168\u90e8\u57ce\u5e02" || k == "") ? "0" : $("#txtServiceSearch").val(); var l = $("#ddlServiceTrade option").eq($("#ddlServiceTrade")[0].selectedIndex).val(); l = (l == "\u5168\u90e8\u884c\u4e1a" || l == "") ? "0" : $("#ddlServiceTrade option").eq($("#ddlServiceTrade")[0].selectedIndex).val(); var j = ""; $("input[name=type]").each(function () { if ($(this).attr("checked") == true) { j += $(this).val() + "," } else { j += "0," } }); j = j.substring(0, j.length - 1); m = m.substring(0, m.length - 1); if (i == "" && l == "" && m.indexOf("1") < 0) { alert("\u63d0\u793a\uff1a\u8bf7\u9009\u62e9\u7b5b\u9009\u6761\u4ef6\uff01"); $("#txtServiceSearch").focus(); return } var h = location.href.indexOf("_") < 0 ? "TotalOrderFinishNum.html" : location.href.split("_")[location.href.split("_").length - 1]; location.href = "ShopSearch_" + encodeURI(i) + "_" + l + "_" + escape(j) + "_" + escape(m) + "_" + h }); $("#txtServiceName").focus(function () { $(document.body).keydown(function (h) { if (h.keyCode == 13) { a.click() } }) }); d(a, function () { var i = $("#txtServiceName").val(); if (i == "\u8bf7\u8f93\u5165\u670d\u52a1\u5546\u540d\u79f0") { alert("\u63d0\u793a\uff1a\u8bf7\u8f93\u5165\u670d\u52a1\u5546\u540d\u79f0!"); $("#txtServiceName").focus(); return } var h = location.search.indexOf("order") > -1 ? "&" + location.search.substring(location.search.indexOf("order"), location.search.length) : ""; location.href = "ShopSearch.html?keyword=" + escape(i) + h }); d(g, function () { location.href = location.href.substring(0, location.href.indexOf(location.href.split("_")[location.href.split("_").length - 1])) + ($(this).attr("class") != "on" ? "TotalOrderFinishNum.html" : "0.html") }); d(f, function () { location.href = location.href.substring(0, location.href.indexOf(location.href.split("_")[location.href.split("_").length - 1])) + ($(this).attr("class") != "on" ? "RatingAvg.html" : "0.html") }) } function tempSearch() { if ($("#btnTempSearch")[0] != undefined) { var d = $("#sellNum"); var b = $("#pubDate"); var c = location.href.split("?")[1]; d.click(function () { location.href = location.href.substring(0, location.href.indexOf(location.href.split("_")[location.href.split("_").length - 1])) + ($(this).attr("class") != "on" ? "SellNum.html" : "0.html") }); b.click(function () { location.href = location.href.substring(0, location.href.indexOf(location.href.split("_")[location.href.split("_").length - 1])) + ($(this).attr("class") != "on" ? "PubDate.html" : "0.html") }); var a = 0; $(".colorList li").each(function () { a++; $(this).attr("colorval", a) }); $(".colorList li").last().attr("colorval", "0"); $("#btnTempSearch").click(function () { var g = $("#ddlServiceTrade").val(); if (g == "") { g = 0 } var f = $(".colorList li[class=now]").attr("colorval"); f = f == undefined ? "0" : f; var e = location.href.indexOf("_") < 0 ? "SellNum.html" : location.href.split("_")[location.href.split("_").length - 1]; location.href = "/TemplateSearch_" + g + "_" + f + "_1_" + e }) } } function caseSearch() { var b = $("#btnCaseSxSearch"); var a = $("#btnCaseSearch"); if (b[0] == undefined) { return } var d = function (e, f) { e.bind("click", f) }; var c = 0; $(".colorList li").each(function () { c++; $(this).attr("colorval", c) }); $(".colorList li").last().attr("colorval", "0"); d(b, function () { var g = $("#ddlCaseTrade option").eq($("#ddlCaseTrade")[0].selectedIndex).val(); g = (g == "\u5168\u90e8\u884c\u4e1a" || g == "") ? "0" : g; var f = ""; $("input[name=type]").each(function () { if ($(this).attr("checked") == true) { f += $(this).val() + "," } else { f += "0," } }); f = f.substring(0, f.length - 1); var e = $(".colorList li[class=now]").attr("colorval"); location.href = "CaseSearch_" + g + "_" + escape(f) + "_" + (e == undefined ? "0" : e) + "_1.html" }); d(a, function () { var e = $("#txtCaseSiteName").val(); if (e == "\u8bf7\u8f93\u5165\u7f51\u7ad9\u540d\u79f0") { alert("\u63d0\u793a\uff1a\u8bf7\u8f93\u5165\u7f51\u7ad9\u540d\u79f0!"); $("#txtCaseSiteName").focus(); return } location.href = "CaseSearch.html?keyword=" + escape(e) }) } function serviceWorkShow() { var b = $("#serviceCaseTagCon"); if (b[0] == undefined) { return } var d = $("#serviceVersionBoxShow"); var c = $("#serviceCaseList"); d.find(".arrowBtn").click(function () { d.slideUp("slow", function () { $(this).after('<div id="serviceVersionBoxClose" class="versionBox2"><a style="cursor:pointer;" title="\u5c55\u5f00" class="arrowBtn"></a></div>'); $("#serviceVersionBoxClose").find(".arrowBtn").click(function () { d.slideDown("slow"); $(this).parent().remove() }) }) }); (function () { c.find("li").remove(); for (var e = 0; e < data.work.length; e++) { c.append('<li idx="' + data.work[e].id + '"><a><img src="' + data.work[e].minImg + '" alt="' + alts + '" /></a></li>') } })(); var a = function (e) { for (var f = 0; f < data.work.length; f++) { if (e == data.work[f].id) { c.find("li").removeClass("on").eq(f).addClass("on"); b.find(".caseImgBox").html('<a href="' + $("#a_zpUrl").attr("href") + '" target="_blank"><img src="' + data.work[f].maxImg + '" alt="' + alts + '" /></a>'); b.find(".caseInfor").html("<p><span>\u8bbe\u8ba1\u5206\u7c7b\uff1a" + ConvertFileType(data.work[f].designSort) + "</span></p><p><span>\u6b64\u7f51\u7ad9\u8bbe\u8ba1\u8bf4\u660e\uff1a</span><br />" + descrption + "</p>"); break } } }; c.find("li").click(function () { a($(this).attr("idx")) }).eq(0).click() } function ConvertFileType(a) { switch (a) { case "1": return "\u9996\u9875"; case "2": return "\u4e8c\u7ea7\u9875"; case "3": return "\u8be6\u60c5\u9875"; case "4": return "\u5176\u4ed6"; default: return "\u5176\u4ed6" } } function valueAd() { if ($(".valueAdd").length) { var b = $(".valueAdd li div"); var c = $(".showA01"); b.each(function () { $(this).hover(function () { $(this).css({ "background-color": "#e8f2ff", border: "1px solid #aed2ff" }) }, function () { $(this).css({ "background-color": "#ffffff", border: "1px solid #dadade" }) }) }); var a = $(".txtA05"); c.each(function (d) { $(this).click(function () { a.css("display", "none"); a.eq(d).css("display", "block") }) }) } } function siteLanguage() { if (typeof $(".languageItem")[0] == undefined) { return } var a = 1; $(".languageItem li input[type=checkbox]").click(function () { var b = 0; $(".languageItem li input").each(function () { if ($(this).attr("checked") == true) { b++ } }); if (b > maxSelected) { $(this).attr("checked", ""); alert("\u63d0\u793a:\u60a8\u5f53\u524d\u53ea\u80fd\u9009\u62e9" + maxSelected + "\u79cd\u8bed\u8a00\u7248\u672c!"); return } if ($(this).attr("checked") == true) { $(this).parent().removeClass("selected").addClass("selected").append('<span>\u540e\u53f0\u7ba1\u7406\u8d26\u53f7\uff1a<input id="txtAdmin_' + a + '"  ver="email" message="\u8bf7\u8f93\u5165\u6709\u6548\u90ae\u7bb1\u5730\u5740\uff0c\u5e76\u59a5\u5584\u4fdd\u7ba1\uff0c\u4f5c\u4e3a\u767b\u5f55\u540e\u53f0\u7ba1\u7406\u7684\u8d26\u53f7" error="\u90ae\u7bb1\u683c\u5f0f\u9519\u8bef" checkInput="true" maxVal="50" minVal="6" type="text" class="input_text1 field1" checkUrl="' + manageEmailUrl + '" /></span>') } else { $(this).parent().removeClass("selected").find("span").remove() } a++ }); $("#btnSubmit").click(function () { var b = ""; $(".languageItem li").each(function (c) { if ($(this).attr("class") == "selected") { b += $(this).find("input[type=checkbox]").val() + ";" + $(this).find("input[type=text]").val() + "|" } }); $("#hidLanguage").val(b.substring(0, b.length - 1)); $("#form_Requirement").submit() }) } function servicePackageEdit() { if (typeof $(".sBox1")[0] == undefined) { return } var a = 0; $(".sBox1 .edit1").click(function () { var b = ""; if ($(this).attr("show") != undefined) { b = $(this).next().text(); $(this).nextAll().remove(); $(this).after("<p>" + b + "</p>"); $(this).removeAttr("show") } else { b = $(this).next().html(); $(this).next().remove(); $(this).after('<p style="margin-bottom:5px; ">\u4ef7\u683c\uff1a<input name="txtPrice" style="line-height:20px; height:20px; width:60px; border:1px solid #ccc;" type="text" id="txtPrice_' + a + '" value="' + $(this).prev().find("span").text() + '" maxLength="5" checked="true" errorMsg="\u8bf7\u586b\u5199\u4ef7\u683c\uff01"/></p><textarea style=" width:652px;" name="txtContent" class="txta1" id="txta1_' + a + '"  maxLength="1000" checked="true" errorMsg="\u8bf7\u586b\u5199\u5185\u5bb9\uff01">' + b + '</textarea><input name="botton_submit" class="botton_submit1" type="submit" value="\u63d0\u4ea4\u4fdd\u5b58" />'); var c = $(this); new Content({ url: "/OrderDetail/Ajax_UpdateOrderExtension.html?oxid=" + $(this).attr("serviceId") + "&orderId=" + $(this).attr("orderId"), ids: "#txta1_" + a + ",#txtPrice_" + a, submit: $(this).next().next().next(), success: function (d) { if (d == "alreadypay") { alert("\u5df2\u7ecf\u4ed8\u6b3e\u4e0d\u80fd\u4fee\u6539\uff01"); return } if (d.split("|").length <= 1) { alert("\u6570\u636e\u683c\u5f0f\u4e0d\u6b63\u786e\uff01"); return } c.nextAll().remove(); c.after("<p>" + d.split("|")[1] + "</p>"); c.prev().find("span").text(d.split("|")[0]); c.removeAttr("show") } }); $(this).attr("show", "show") } a++ }) } function sjgUploadFile() { if (typeof $("#sjg_uploadList")[0] == undefined) { return } $("#sjg_uploadList li a").click(function () { if (!confirm("\u60a8\u786e\u5b9a\u8981\u5220\u9664\u5417\uff1f")) { return } var a = "/Requirement/DeleteProjectRequirementFile?fileId=" + $(this).attr("idx"); var b = $(this); $.ajax({ type: "GET", url: a, cache: false, async: false, error: function () { alert("\u8fde\u63a5\u5730\u5740\u9519\u8bef!") }, success: function (c) { if (c == "success") { b.parent().remove() } else { alert("\u5220\u9664\u5931\u8d25\uff01") } } }) }) } function setStarCent() { if ($(".rateit-range")[0] == undefined) { return } var b = null; var a = function () { if (b == null) { return } var c = b.rateit("value"); b.next().next().html(c + "\u5206"); switch (c) { case 1: b.next().html("\u975e\u5e38\u5dee"); break; case 2: b.next().html("\u8f83\u5dee"); break; case 3: b.next().html("\u4e00\u822c"); break; case 4: b.next().html("\u8f83\u597d"); break; case 5: b.next().html("\u975e\u5e38\u597d"); break } b.parent().find("input[type=hidden]").remove(); b.next().next().after('<input type="hidden" name="' + b.attr("id") + '" value="' + c + '"/>') }; $(".rateit-range").find("*").click(function () { b = $(this).parent().parent(); setTimeout(a, 1) }); $(".rateit").each(function () { b = $(this); b.rateit("value", 3); a() }) } function messageReply() { if ($(".bbsList")[0] == undefined) { return } var a = 0; $(".bbsList li .bbsReply").click(function () { if ($(this).attr("mtype") == $(this).attr("replay")) { alert("\u4e0d\u80fd\u56de\u590d\u81ea\u5df1\u63d0\u4ea4\u7684\u7559\u8a00"); return false } if ($(this).attr("show") != undefined) { $(this).parent().next().remove(); $(this).parent().next().remove(); $(this).removeAttr("show"); return } $(this).parent().after('<textarea style=" width:660px;" name="askContent" class="txta1" id="txta1_' + a + '"  maxLength="1000" minLength="10" checked="true" errorMsg="\u8bf7\u586b\u5199\u56de\u590d\u5185\u5bb9\uff01"></textarea><input name="botton_submit" id="btnSubmit_' + a + '" class="botton_submit1" type="submit" value="\u63d0\u4ea4\u4fdd\u5b58" />'); var b = $(this); new Content({ url: "/Project/" + $("#projectOId").val() + "/GuestBook/Submit.html?parentidid=" + $(this).attr("val") + "&stepsNum=" + $("#commentStepsNum").val(), ids: "#txta1_" + a, submit: $("#btnSubmit_" + a), success: function (c) { b.parent().nextAll().remove(); b.parent().after('<div class="replyBox"><p><span>\u56de\u590d\uff1a</span>' + c + "</p></div>"); b.remove() } }); $(this).attr("show", "show"); a++ }) } function otherContact() { if ($(".ctBox").length) { var c = $(".ctBox"); var a = $(".aP05 a"); var b = c.html(); var d = 1; a.click(function () { if (d > 5) { alert("\u60a8\u6700\u591a\u53ea\u80fd5\u4e2a\u8054\u7cfb\u65b9\u5f0f!"); return } if (d == 1) { c.removeClass("hide") } else { c.append(b) } d++ }) } } function workEdit() { if ($(".workListA01").length) { var b = $(".workA01"); var d = null; var c = $(".imgUpload"); var a = $(".uploadWork"); var f = $(".close"); var e = null; b.hover(function () { if (e != null) { clearTimeout(e) } $(".workA01").next().css("display", "none"); d = $(this).next(".editA01"); d.css("display", "block"); $(this).next(".editA01").mouseout(function () { var g = $(this); e = setTimeout(function () { g.css("display", "none") }, 200) }); d.click(function () { a.find("input[type=text]").val($(this).next().text()); $("#saveType").val($(this).attr("val")); a.show() }) }, function () { if (e != null) { clearTimeout(e) } }); c.click(function () { if (($(".workBox10 .workListA01").size() - 1) >= 5) { return } $("#saveType").val(""); a.show() }); f.click(function () { a.hide(); a.find("input[type=text]").val("") }) } } function miscTab() { if ($(".tab-holder2").length) { var a = $(".tab-holder2 li"); var b = $(".tab-panel2"); b.hide(); b.eq(0).show(); a.each(function (c) { $(this).click(function () { a.removeClass("selected"); $(this).addClass("selected"); b.hide(); b.eq(c).show() }) }) } } function upLoad() { if ($(".addUpload").length) { var b = $(".addUpload"); var d = $(".upload_p span"); var a = d.html(); var c = 1; b.click(function () { if (c < 5) { d.append(a); c++ } }); $(".txtA06").keydown(function () { if ($(this).val().length > 500) { alert("\u60a8\u7684\u63cf\u8ff0\u5df2\u8d85\u51fa500\u5b57\uff01") } }) } } var curAnswerId = 0; function showAnswer(c, e, a, f, b) { if (f != "" && f == b) { alert("\u4e0d\u80fd\u56de\u590d\u81ea\u5df1\u63d0\u4ea4\u7684\u7559\u8a00"); return false } if (c.attr("show") != undefined) { c.parent().next().remove(); c.parent().next().remove(); c.removeAttr("show"); return } c.parent().after('<textarea class="txtAnswer" name="askContent" id="txta1_' + curAnswerId + '"  maxLength="1000" minLength="10" checked="true" errorMsg="\u8bf7\u586b\u5199\u56de\u590d\u5185\u5bb9\uff01"></textarea><input name="botton_submit" id="btnSubmit_' + curAnswerId + '" class="btnAnswerSubmit" type="submit" value="\u63d0 \u4ea4" />'); var d = c; var a = a; new Content({ url: e, ids: "#txta1_" + curAnswerId, submit: "#btnSubmit_" + curAnswerId, success: function (i) { switch (a) { case 1: d.parent().nextAll().remove(); d.parent().after('<p class="grayBox"><strong>\u56de\u590d\uff1a</strong>' + i + "</p>"); d.remove(); break; case 2: var g = i.split("|").length > 1 ? i.split("|")[0] : ""; var h = i.split("|").length > 1 ? i.split("|")[1] : ""; d.parent().nextAll().remove(); d.parent().after('<div class="answer">     <div class="arrow"></div>     <dl class="messageList">         <dt><span class="right">' + g + '</span><font class="f1"></font>\u56de\u590d\uff1a</dt>         <dd>' + h + "         </dd>     </dl></div>"); d.remove(); break } } }); c.attr("show", "show"); curAnswerId++ } function vote() { if ($(".voteRadio2").length) { var d = $(".voteRadio2"); var c = $(".voteRadio3"); var b = $(".voteLi1"); var a = $(".voteLi2"); d.click(function () { b.slideDown(); a.slideUp(); a.find(".txtaH02").text("") }); c.click(function () { a.slideDown(); b.slideUp(); b.find(".txtaH02").text("") }) } } function rating() { if ($(".ratingBox").length) { var c = $(".ratingBox p"); var b = $(".ratingList"); var a; var d = null; c.hover(function () { a = setTimeout(function () { b.slideDown(200); b.hover(function () { clearTimeout(d) }, function () { clearTimeout(a); b.slideUp(500) }) }, 500) }, function () { d = setTimeout(function () { clearTimeout(a); b.slideUp(500) }, 500) }) } } function scInfor() { var a = $(".scInfor"); a.hover(function () { a.find("div").slideUp(); $(this).find("div").slideDown() }, function () { a.find("div").slideUp() }) } function searchTab() { $(".tab-holder li").each(function (b) { var a = b; $(this).click(function () { $(".tab-holder li").removeClass("selected"); $(this).addClass("selected"); $(".bd").css({ display: "none" }); $(".bd").eq(a).css({ display: "block" }) }) }) } jQuery(function () { messageReply(); servicePackageEdit(); sjgUploadFile(); setStarCent(); focusSearch(".txtInput1", "\u8bf7\u8f93\u5165\u7f51\u7ad9\u540d\u79f0"); focusSearch(".txtInput2", "\u5317\u4eac"); focusSearch(".txtInput3", "\u8bf7\u8f93\u5165\u670d\u52a1\u5546\u540d\u79f0"); colorList(); heightBar(); serviceSearch(); caseSearch(); tempSearch(); serviceWorkShow(); valueAd(); if (typeof SearchSelect != "undefined") { new SearchSelect({ mark: "#txtSearch", text: "\u5317\u4eac", defaultVals: { text: "\u5168\u90e8\u57ce\u5e02", css: 'fontSize:"12px",color:"#999"'} }); new SearchSelect({ mark: "#txtServiceSearch", text: "\u5317\u4eac", defaultVals: { text: "\u5168\u90e8\u57ce\u5e02", css: 'fontSize:"12px",color:"#999"'} }); new SearchSelect({ mark: "#txtMainAreaSearch", text: "\u5317\u4eac", defaultVals: { text: "\u5168\u90e8\u57ce\u5e02", css: 'fontSize:"12px",color:"#999"'} }).GotoUrl(mainServiceFilter) } if (typeof ProductService != "undefined") { } if (typeof formVerify != "undefined") { new formVerify() } siteLanguage(); otherContact(); workEdit(); miscTab(); upLoad(); vote(); rating(); scInfor(); searchTab() });
