123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494 |
- $(document).ready(function() {
- $(".unlogin").show();
- $(".onlogin").hide();
- var footerHeight = $("footer").outerHeight(true);
- $('#container').css("padding-bottom", footerHeight + "px");
- $(".footer_tools").css("bottom", (footerHeight+10) + "px");
- $(window).resize(function() {
- footerHeight = $("footer").outerHeight(true);
- $('#container').css("padding-bottom", footerHeight + "px");
- });
-
- var orgid = $.cookie('orgId');
- $("#cmpSet2").on("click", function() {
- if(orgid && orgid != "null" && orgid != null) {
- location.href = "cmp-portal/cmp-needList.html"
- } else {
- location.href = "cmp-portal/cmp-settled-reg.html"
- }
- })
- $("#cmpSet3").on("click", function() {
- if(orgid && orgid != "null" && orgid != null) {
- location.href = "/cmp-portal/cmp-needList.html"
- } else {
- location.href = "/cmp-portal/cmp-settled-reg.html"
- }
- })
-
-
- $("#search").on("click", function() {
- var searchContent = $.trim($("#searchContent").val());
- if(searchContent) {
- wlog("kw", searchContent)
- setTimeout(function(){location.href = "searchNew.html?searchContent=" + encodeURI(searchContent)},300);
- }
- });
-
- $("#searchContent").keydown(function(e) {
- if(e.which == 13) {
- var searchContent = $.trim($("#searchContent").val());
- if(searchContent)
- location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
- }
-
- })
- $("#hsearchContent").keydown(function(e) {
- if(e.which == 13) {
- var searchContent = $.trim($("#hsearchContent").val());
- if(!searchContent) {
- return;
- }
- if($(this).siblings()[0].id=="searchh") {
- location.href = "/searchNew.html?searchContent=" + encodeURI(searchContent);
- return;
- }
- location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
- }
- })
-
- $("#hsearch").on("click", function() {
- var searchContent = $.trim($("#hsearchContent").val());
- if(searchContent) {
- wlog("kw", searchContent)
- setTimeout(function(){
- location.href = "searchNew.html?searchContent=" + encodeURI(searchContent);
- },300)
- }
- });
- $("#searchh").on("click", function() {
- var searchContent = $.trim($("#hsearchContent").val());
- if(searchContent)
- setTimeout(function(){
- location.href = "/searchNew.html?searchContent=" + encodeURI(searchContent);
- },300)
-
- });
-
-
- $(document).scroll(function() {
- var top = $(document).scrollTop();
-
- if(top == 0) {
- $(".navheader").removeClass("navhdown");
- } else {
- $(".navheader").addClass("navhdown");
- }
-
- if(top >= 300) {
- $(".content-left").css({
- "position": "fixed",
- "top": "80px"
- })
- } else {
- $(".content-left").css({
- "position": "static"
- })
- }
-
- });
-
- $(document).on("click", "#Province li a", function() {
- var aVal = $(this).text();
- $(this).parent().parent().parent().find('.mr_show').text(aVal);
- $(this).parent().parent().parent().find('input[name=cho_Province]').val(aVal);
-
- if($("#oprovince").text() == "请选择省/直辖市") {
- $("#oprovince").removeClass("mr_select");
- $("#ocity").removeClass("mr_select");
- } else {
- $("#oprovince").addClass("mr_select");
- $("#ocity").removeClass("mr_select");
- }
- });
-
- $(document).on("click", "#City li a", function() {
- var aVal = $(this).text();
- $(this).parent().parent().parent().find('.mr_show').text(aVal);
- $(this).parent().parent().parent().find('input[name=cho_City]').val(aVal);
- if($("#ocity").text() == "请选择城市") {
- $("#ocity").removeClass("mr_select");
- } else {
- $("#ocity").addClass("mr_select");
- }
- });
-
- $(".msgContbox textarea").focus(function() {
- $(this).parent().css("border-color", "#ff9900");
- }).blur(function() {
- $(this).parent().css("border-color", "#E5E5E5");
- })
- });
- var userid;
- function exit() {
- $.cookie('userid', null);
- $.cookie('userAuth', null);
- $.cookie('userEmail', null);
- $.cookie('userMobilePhone', null);
- $.cookie('userName', null);
- $.cookie('userType', null);
- location.href = "index.html"
- }
- function exitStaticize() {
- $.cookie('userid', null,{ path: '/' });
- $.cookie('userAuth', null,{ path: '/' });
- $.cookie('userEmail', null,{ path: '/' });
- $.cookie('userMobilePhone', null,{ path: '/' });
- $.cookie('userName', null,{ path: '/' });
- $.cookie('userType', null,{ path: '/' });
- location.href = "/index.html"
- }
- function valUser() {
- var userid = $.cookie('userid');
- var userAuth = $.cookie('userAuth');
- if(userid == undefined || userid.length == 0 || userid == "null" || userAuth == false) {
- location.href = "login.html";
- }
- }
- function loginStatus() {
- userid = $.cookie('userid');
- userAuth = $.cookie('userAuth');
- authentication = $.cookie('authentication');
- if(userid && userid != "null" && userid != null) {
- if(userAuth == "false" && authentication == "null") {
- location.href = "loginInviteFirst.html";
- }
- if(userAuth == "true" && authentication == "null") {
- location.href = "fillinfo-select.html";
- }
- if(userAuth == "true" && authentication != "null") {
- $(".onlogin").show();
- $(".unlogin").hide();
- $(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
- $(".portrait-p").load(function() {
- })
- .error(function() {
- $(".portrait-p").attr("src", "/images/default-photo.jpg");
- });
- unReadedCount(userid);
- unInformCount(userid)
- }
- $(".portrait-p").on("click",function(){
- location.href="userInforShow.html?professorId="+userid;
- })
- $(".onlogin").on("click",".goMyInf",function(){
- $(this).attr("href","userInforShow.html?professorId="+userid)
- })
- } else {
- $(".unlogin").show();
- $(".onlogin").hide();
- }
- }
- function loginYesOrNo() {
- userid = $.cookie('userid');
- userAuth = $.cookie('userAuth');
- authentication = $.cookie('authentication');
- if(userid && userid != "null" && userid != null) {
- if(userAuth == "false" && authentication == "null") {
- location.href = "/loginInviteFirst.html";
- }
- if(userAuth == "true" && authentication == "null") {
- location.href = "/fillinfo-select.html";
- }
- if(userAuth == "true" && authentication != "null") {
- $(".onlogin").show();
- $(".unlogin").hide();
- $(".portrait-p").attr("src", "/images/head/" + userid + "_m.jpg");
- $(".portrait-p").load(function() {
- })
- .error(function() {
- $(".portrait-p").attr("src", "/images/default-photo.jpg");
- });
- unReadedCount(userid);
- }
- $(".portrait-p").on("click",function(){
- location.href="/userInforShow.html?professorId="+userid;
- })
- $(".onlogin").on("click",".goMyInf",function(){
- $(this).attr("href","/userInforShow.html?professorId="+userid)
- })
- } else {
- $(".unlogin").show();
- $(".onlogin").hide();
- }
- }
- function unReadedCount(id){
- $.ajax({
- type:"get",
- url:"/ajax/webMsg/unReadedCount",
- async:true,
- data:{"id":id},
- success:function(data){
- console.log(data)
- if(data.success){
- platMessageTotal(id,data.data)
- }
-
- }
- });
- }
- function unInformCount(id){
- $.ajax({
- type:"get",
- url:"/ajax/notify/idx",
- async:true,
- data:{"id":id},
- success:function(data){
- console.log(data)
- if(data.success && data.data){
- if(data.data.unRead!=0){
- $(".myinform").find(".badge").text(data.data.unRead);
- }else{
- $(".myinform").find(".badge").text("");
- }
- }
-
- }
- });
- }
- function platMessageTotal(id,num) {
- $.ajax({
- url: "/ajax/platform/msg/unread",
- type: "GET",
- timeout: 10000,
- dataType: "json",
- traditional:true,
- data:{
- provider: id
- },
- success: function(data) {
- console.log(data)
- if(data.success) {
- if(data.data) {
- console.log(data.data +num)
- if(data.data + num !=0){
- $(".mymessage").find(".badge").text(data.data + num);
- }else{
- $(".mymessage").find(".badge").text("");
- }
- }
- }
- },
- error: function() {
- $.MsgBox.Alert('提示', '链接服务器超时')
- }
- })
- }
- function Carousel(inde, num, show, childcount, obj, next, prev) {
- var tapnum = 0;
- if(childcount > num) {
- next.css("display", "block");
- prev.css("display", "none");
- } else {
- next.css("display", "none");
- prev.css("display", "none");
- }
- next.click(function() {
- if(!obj.is(":animated")) {
- if(num < childcount) {
- tapnum++;
- prev.css("display", "block");
- if(tapnum == childcount - show) {
- next.css("display", "none");
- }
- num++;
- obj.animate({
- left: "-=212px"
- }, 600);
- }
- }
- });
- prev.click(function() {
- if(!obj.is(":animated")) {
- if(num > inde) {
- tapnum--;
- next.css("display", "block");
- if(tapnum == 0) {
- prev.css("display", "none");
- }
- num--;
- obj.animate({
- left: "+=212px"
- }, 600);
- }
- }
- });
- }
- function ifcollectionAbout(watchObject, sel,num) {
- var that=sel;
- $.ajax('/ajax/watch/hasWatch', {
- data: {
- "professorId": userid,
- "watchObject": watchObject
- },
- dataType: 'json',
- type: 'get',
- timeout: 10000,
- async: false,
- success: function(data) {
- if(data.success && data.data != null) {
- if(num == "1" || num == "6" || num == "13") {
- $(that).addClass("attenedSpan");
- $(that).text("已关注");
- } else {
- $(that).removeClass("icon-collect");
- $(that).addClass("icon-collected");
- }
- } else {
- if(num == "1" || num == "6" || num == "13") {
- $(that).removeClass("attenedSpan");
- $(that).text("关注");
- } else {
- $(that).addClass("icon-collect");
- $(that).removeClass("icon-collected");
- }
- }
- },
- error: function(data) {
- $.MsgBox.Alert('提示', "服务器链接超时");
- }
- });
- }
- function collectionAbout(watchObject,sel, num) {
- var that=sel;
- $.ajax('/ajax/watch', {
- data: {
- "professorId": userid,
- "watchObject": watchObject,
- "watchType": num,
- "uname":$.cookie("userName")
- },
- dataType: 'json',
- type: 'POST',
- timeout: 10000,
- async: false,
- success: function(data) {
- if(data.success) {
- console.log(data)
- if(num == "1" || num == "6") {
- $(that).addClass("attenedSpan");
- $(that).text("已关注");
- } else {
- $(that).removeClass("icon-collect");
- $(that).addClass("icon-collected");
- }
- }
- },
- error: function(data) {
- $.MsgBox.Alert('提示', "服务器链接超时");
- }
- });
- }
- function cancelCollectionAbout(watchObject,sel,num) {
- var that=sel;
- $.ajax({
- url: '/ajax/watch/delete',
- data: {
- professorId: userid,
- watchObject: watchObject
- },
- dataType: 'json',
- type: 'post',
- timeout: 10000,
- async: true,
- success: function(data) {
- console.log(data.success)
- if(num == "1" || num == "6") {
- $(that).removeClass("attenedSpan");
- $(that).text("关注");
- } else {
- $(that).addClass("icon-collect");
- $(that).removeClass("icon-collected");
- }
- },
- error: function(data) {
- $.MsgBox.Alert('提示', "服务器链接超时");
- }
- });
- }
- function backSuccessed(){
- $(".correctCon").val("");
- $(".correctSubmit").attr("disabled",true);
- $(".correctSubmit").parents(".correctBlock").fadeOut();
- $.MsgBox.Alert('提示', '感谢您的反馈,我们马上处理。');
- $("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- }
- function suImg() {
- $("#mb_msgicon").css("background", 'url("/images/sign_icon_chenggong_nor.png") 0% 0% / contain');
- $("#mb_ico").css("background",'url(/images/sign_icon_guanbi_nor.png) center center no-repeat');
- }
- var bannerRotate = {
- _time: 3000,
- _i: 0,
- _interval: null,
- _navId: "#slide-tab",
- _navBox: "#slide-list",
- bannerShow: function() {
- $(this._navId).find("li").removeClass("slide-tab-item-active");
- $(this._navId).find("li:eq("+this._i+")").addClass("slide-tab-item-active");
-
- $(this._navBox).find("li").removeClass("slide-item-active");
- $(this._navBox).find("li:eq("+this._i+")").addClass("slide-item-active");
- },
- bannerStart:function() {
- var _this = this;
- _this._interval = setInterval(function() {
- if(_this._i >= 4) {
- _this._i = 0;
- }
- else {
- _this._i++;
- }
- _this.bannerShow();
- }, _this._time);
- },
- bannerInit: function() {
- var _this = this;
- _this.bannerStart();
-
- $(_this._navId).find("li").bind("mouseover", function() {
- clearInterval(_this._interval);
- _this._i = $(this).index();
- _this.bannerShow();
- _this.bannerStart();
- });
- }
- };
- $(document).ready(function(){
-
- $("body").on("click","a.advertsub",function(){
- var adId = this.getAttribute('data-id');
- console.log(adId)
- wlog("ad", adId ,"1");
- return true;
- })
- })
|