$.ajaxSetup({ cache: false }); function search_ask() { var search = $("#search").val(); if (search == "") { easyDialog.open({ container : { content : '还未输入搜索内容' }, follow : "search", followX : 0, followY : 42, autoClose : 1500, overlay : false }); return false; } } function search_sory() { var search = $("#search_advisory").val(); if (search == "") { easyDialog.open({ container : { content : '还未输入搜索内容' }, follow : "search", followX : -123, followY : 100, autoClose : 1500, overlay : false }); return false; } } function login() { var username = $("#username").val(); var password = $("#password").val(); if (username == "" || password == ""){ easyDialog.open({ container : { content : '请输入用户名或者密码' }, follow : "username", followX : 320, followY : 22, autoClose : 1500, overlay : false }); return false; } } function login_index() { var username = $("#username").val(); var password = $("#password").val(); if (username == "" || password == ""){ $("#erroTips").html("请输入用户名或者密码"); $("#erroTips").show(1000); return false; } var form1 = $("#index_login_form"); form1.submit(); // var url="/ajax/login_index"; // // $.ajax({ // url:url, // type: "post", // cache: false, // dataType: "json", // data: { // username:username, // password:password // }, // global: true, // success: function(data){ // // if(!data.is_login){ // $("#erroTips").html("帐号/邮箱或者密码错误!"); // // $("#erroTips").show(1000); // // }else{ // var form1 = $("#index_login_form"); // // form1.submit(); // } // // }, // error:function(err){ // // is=false; // } // }); } $(function() { $('#search').focus(function(){ var url="ajax/get_search_works"; $('#search').autocomplete({ source: url, 'select':function(ev,ui) { $('#search').val(ui.item.label); $('#searchform').submit();} }); }).blur(function (){ var url="ajax/get_search_works"; $('#search').autocomplete({ source: url, 'select':function(ev,ui) { $('#search').val(ui.item.label); $('#searchform').submit();} }); }); //系统信息 $("a[id^='get_msg_']").click(function() { var msg = $(this).attr("data"); var a = msg.split("_"); document.getElementById("fromuid").value = a[0]; document.getElementById("on_page").value = a[1]; var form = document.getElementById("msgform"); form.submit(); }); //我的订单 $("a[id^='get_oder_']").click(function() { var msg = $(this).attr("data"); document.getElementById("on_page").value = msg; $("#oderform").submit(); }); $("#pu").click(function() { $("#pu").addClass('now'); $("#vip").removeClass('now'); $("#question_e").show(); $("#vip_question_e").hide(); }); $("#vip").click(function() { $("#pu").removeClass('now'); $("#vip").addClass('now'); $("#question_e").hide(); $("#vip_question_e").show(); }); $("#user_action").click(function() { $("#user_action").addClass('now'); $("#sys_action").removeClass('now'); $("#user").show(); $("#sys").hide(); }); $("#sys_action").click(function() { $("#user_action").removeClass('now'); $("#sys_action").addClass('now'); $("#user").hide(); $("#sys").show(); }); }) /** * 设置系统信息的读取时间 * * @param val */ function set_msg_time(val) { document.getElementById("time").value = val; } function set_oder_time(val) { document.getElementById("time").value = val; document.getElementById("on_page").value = 1; $("#oderform").submit(); }