$(document).ready(function() {
loginStatus(); //判断个人是否登录
valUser();
var userid = $.cookie("userid");
$(".jqzoom").imagezoom();
$("#thumblist").on("click", "li a", function() {
$(this).parents("li").addClass("tb-selected").siblings().removeClass("tb-selected");
$(".jqzoom").attr('src', $(this).find("img").attr("src"));
$(".jqzoom").attr('rel', $(this).find("img").attr("src"));
});
$('.shareWeixin').hover(function() {
$('.shareCode').stop(true, false).fadeToggle();
});
var resourceId = GetQueryString("productId");
var professorId = "";
getRecourceMe();
/*获取资源信息*/
function getRecourceMe() {
$.ajax({
"url": "/ajax/product/qo",
"type": "GET",
"success": function(data) {
console.log(data);
if(data.success) {
resourceHtml(data.data);
var resourceName = data.data.name + "-科袖网";
document.title = resourceName;
}
},
"data": {
"id": resourceId
},
dataType: "json",
'error': function() {
$.MsgBox.Alert('提示', '服务器连接超时!');
}
});
}
/*合作备注及性能参数存储换行格式*/
function outHTML(selecter) {
var getValue = selecter;
var aa = "";
if(getValue) {
var endValue = ((getValue.replace(/<(.+?)>/gi, "<$1>")).replace(/ /gi, " ")).replace(/\n/gi, "|");
var cc = endValue.split("|");
for(var i = 0; i < cc.length; i++) {
aa += cc[i] + '
'
}
}
return aa;
}
/*处理资源html代码*/
function resourceHtml($da) {
comMess($da.owner);
$("#resourceName").text($da.name ); //名字
$("#application").text($da.cnt); //应用用途
if($da.producingArea) {
$("#productArea").text($da.producingArea).parents("li").show();
}
if($da.price) {
$("#officialPrice").text($da.price).parents("li").show();
}
if($da.spec) { //厂商型号
$("#modelNumber").text($da.spec).parents("li").show();
}
if($da.parameter) { //性能参数
$("#performancePa").html(outHTML($da.parameter)).parents("li").show();
}
if($da.keywords) {
var oSub = $da.keywords.split(",");
var oSt = "";
for(var i = 0; i < oSub.length; i++) {
oSt += '
' + oSub[i] + '
' oSt += ''+$res[i].name+'' oSt += '
' oSt += ''+oTitle+'
' oSt += '