$(function () var sliderHeight = 240; var newcomInfoHeight = $(".newcomInfo").height(); var curHeight = $("#des cription").height(); if (curHeight > sliderHeight) $(".newcomInfo").css('height', sliderHeight + 'px'); $('#seeDowns').addClass("seeDown"); $("#seeDowns").click(function () var curHeights = $(".newcomInfo").height(); if (curHeights sliderHeight) $('.newcomInfo').animate( height: curHeight + 52 , "normal"); $('#seeDowns').html('关闭'); $('#seeDowns').removeClass("seeDown"); $('#seeDowns').addClass("seeUp"); else $('.newcomInfo').animate( height: 240 , "normal"); $('#seeDowns').html('查看完整信息'); $('#seeDowns').removeClass("seeUp"); $('#seeDowns').addClass("seeDown"); ) else $("#des criptionMore").remove(); ) $(function () $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=GetFavorite&UserId=0&CompanyId=35151484", contentType: "application/json; charset=utf-8", success: function (data) var result = $.parseJSON(data); if (result true) $("#addFavoriteBtn").addClass("added"); $("#addFavoriteBtn").text("已收藏展厅"); else $("#addFavoriteBtn").addClass("newadd"); $("#addFavoriteBtn").text("收藏展厅"); ); $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=ShowQuestionAndAnswer&CompanyId=35151484&PageIndex=1&PageSize=4", success: function (data) var res = $.parseJSON(data); var list = res.list; var count = res.count; $(".answerContent").empty(); if (list.length > 0) var html = ""; f(var i = 0; i < list.length; i++) html = html + "
" + "" + list[i].QuestionContent + "" + "
" + list[i].CreateTime + "
" + list[i].ReplyCount + "个回答
"; if (list[i].IssueContent.length > 0) html = html + "
" + list[i].IssueContent + "
"; ; html = html + "
"; ; $("#questionAndAnswerDiv").show(); $(".answerContent").append(html); $(".newslistpage").hide(); if (count > 4) $(".newseemoreask").show(); else $("#questionAndAnswerDiv").hide(); , error: function (XMLHttpRequest, textStatus, errorThrown) $scope.Control = 0; ); $(".newseemoreask").click(function () $(".newseemoreask").hide(); $(".newslistpage").show(); $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=ShowQuestionAndAnswer&CompanyId=35151484&PageIndex=1&PageSize=8", success: function (data) var res = $.parseJSON(data); var list = res.list; var count = res.count; if (list.length > 0) var html = ""; f(var i = 0; i < list.length; i++) html = html + "
" + "" + list[i].QuestionContent + "" + "
" + list[i].CreateTime + "
" + list[i].ReplyCount + "个回答
"; if (list[i].IssueContent.length > 0) html = html + "
" + list[i].IssueContent + "
"; ; html = html + "
"; ; $("#QuestionPageCount").val(count); if (count <= 8) $(".newslistpage").hide(); $("#questionAndAnswerDiv").show(); $(".answerContent").empty(); $(".answerContent").append(html); else $("#questionAndAnswerDiv").hide(); , error: function (XMLHttpRequest, textStatus, errorThrown) $scope.Control = 0; ); ); $("#questionPagePreBtn").click(function () var index = $("#QuestionPageIndex").val(); if (index > 1) //上一页 $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=ShowQuestionAndAnswer&CompanyId=35151484&PageIndex=" + (parseInt(index) - 1) + "&PageSize=8", data: "'companyId': '35151484' ", success: function (data) var res = $.parseJSON(data); var list = res.list; var count = res.count; if (list.length > 0) var html = ""; f(var i = 0; i < list.length; i++) html = html + "
" + "" + list[i].QuestionContent + "" + "
" + list[i].CreateTime + "
" + list[i].ReplyCount + "个回答
"; if (list[i].IssueContent.length > 0) html = html + "
" + list[i].IssueContent + "
"; ; html = html + "
"; ; if (count <= 8 || list.length < 8) $(".newslistpage").hide(); $("#questionAndAnswerDiv").show(); $(".answerContent").empty(); $(".answerContent").append(html); $("#QuestionPageIndex").val(parseInt(index) - 1) else $("#questionAndAnswerDiv").hide(); ); ); $("#questionPageNextBtn").click(function () var index = $("#QuestionPageIndex").val(); var pageCount = $("#QuestionPageCount").val(); if (index * 8 < pageCount) //下一页 $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=ShowQuestionAndAnswer&CompanyId=35151484&PageIndex=" + (parseInt(index) + 1) + "&PageSize=8", data: "'companyId': '35151484' ", success: function (data) var res = $.parseJSON(data); var list = res.list; var count = res.count; if (list.length > 0) var html = ""; f(var i = 0; i < list.length; i++) html = html + "
" + "" + list[i].QuestionContent + "" + "
" + list[i].CreateTime + "
" + list[i].ReplyCount + "个回答
"; if (list[i].IssueContent.length > 0) html = html + "
" + list[i].IssueContent + "
"; ; html = html + "
"; ; //if (count <= 8||list.length<8) // $(".newslistpage").hide(); $("#questionAndAnswerDiv").show(); $(".answerContent").empty(); $(".answerContent").append(html); $("#QuestionPageIndex").val(parseInt(index) + 1) if (index * 8 < pageCount) else $("#questionAndAnswerDiv").hide(); ); ); ) function addFavoriteCompany() if (0<= 0) userLogin(); return false; if ($(".newadd").html() "收藏展厅") $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=AddFavorite&UserId=0&CompanyId=35151484", contentType: "application/json; charset=utf-8", success: function (data) if ($.parseJSON(data) > 0) $("#addFavoriteBtn").removeClass("newadd"); $("#addFavoriteBtn").addClass("added"); $("#addFavoriteBtn").html("已收藏展厅"); , error: function (XMLHttpRequest, textStatus, errorThrown) $scope.Control = 0; ); else $.ajax( type: "GET", url: "/GetCompanyNewsListHandel.ashx?Action=DeleteFavorite&UserId=0&CompanyId=35151484", contentType: "application/json; charset=utf-8", success: function (data) if ($.parseJSON(data) > 0) $("#addFavoriteBtn").removeClass("added"); $("#addFavoriteBtn").addClass("newadd"); $("#addFavoriteBtn").html("收藏展厅"); , error: function (XMLHttpRequest, textStatus, errorThrown) $scope.Control = 0; ); //提问 function addQuestion() if (0<= 0) userLogin(); return false; var str = $("#questionText").val(); if (str.length <= 0) return false; var strs = "[@/'\"#$%&^*]+"; var reg = new RegExp(strs); if(reg.test(str)) alert("输入的内容包含非法字符"); return false; var param = ; param["CompanyId"] = 35151484; param["UserId"] = 0; param["QuestionContent"] = str; $.ajax( type: "POST", data: param, url: "/gasgoo/cn/sns20/webmodel/handler/AddQuestionAndAnswerHandler.ajax?Action=AddQuestion", success: function (data) var count = $.parseJSON(data); if (count > 0) $("#questionText").val(""); $("#masterFullask").show(); $('#masterFullask').delay(3000).hide(0); , error: function (XMLHttpRequest, textStatus, errorThrown) $scope.Control = 0; ); function herfOnclick(url) return window.location.replace(url); function wordStatic() var values = $("#questionText").val(); // 更新计数 $("#masterLastwordnum").html( values.length+"/100字"); function setquestion() if (0<= 0) userLogin(); return false; function formatDate(jsondate) if (jsondate null) return ""; else jsondate = jsondate.replace("/Date(", "").replace(")/", ""); if (jsondate.indexOf("+") > 0) jsondate = jsondate.substring(0, jsondate.indexOf("+")); else if (jsondate.indexOf("-") > 0) jsondate = jsondate.substring(0, jsondate.indexOf("-")); var date = new Date(parseInt(jsondate, 10)); var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); return date.getFullYear() + "-" + month + "-" + currentDate;