jack 7 年之前
父节点
当前提交
b053e3f653
共有 3 个文件被更改,包括 183 次插入69 次删除
  1. 1 1
      js/patentList.js
  2. 152 68
      js/patentShow.js
  3. 30 0
      patentShow.html

+ 1 - 1
js/patentList.js

88
	 }
88
	 }
89
	/*点击修改跳转修改页面*/
89
	/*点击修改跳转修改页面*/
90
	$("#patentList").on("click",".editThis",function(){
90
	$("#patentList").on("click",".editThis",function(){
91
		location.href="resourceIssue.html?resourceId="+$(this).attr("data-id")
91
		location.href="patentShow.html?patentId="+$(this).attr("data-id")+"&flag=1"
92
	})
92
	})
93
	/*点击删除跳转修改页面*/
93
	/*点击删除跳转修改页面*/
94
	$("#patentList").on("click",".deteleThis2",function(){
94
	$("#patentList").on("click",".deteleThis2",function(){

+ 152 - 68
js/patentShow.js

1
$(document).ready(function() {
1
$(document).ready(function() {
2
	function Patent() {
2
	function Patent() {
3
		this.init();
3
		this.init();
4
		this.flag = GetQueryString("flag");
4
	}
5
	}
5
	Patent.prototype.init = function() {
6
	Patent.prototype.init = function() {
6
		loginStatus();
7
		loginStatus();
31
		});
32
		});
32
	}
33
	}
33
	Patent.prototype.ajax = function(obj) {
34
	Patent.prototype.ajax = function(obj) {
34
		var $this=this;
35
		var $this = this;
35
		$.ajax({
36
		$.ajax({
36
			url: obj.url,
37
			url: obj.url,
37
			data: obj.data,
38
			data: obj.data,
41
			traditional: true,
42
			traditional: true,
42
			success: function(data) {
43
			success: function(data) {
43
				if(data.success) {
44
				if(data.success) {
44
					obj.Fun(data.data,$this);
45
					obj.Fun(data.data, $this);
45
				}
46
				}
46
			},
47
			},
47
			error: function() {
48
			error: function() {
53
		$.MsgBox.Alert('提示', "服务器链接超时");
54
		$.MsgBox.Alert('提示', "服务器链接超时");
54
	}
55
	}
55
	Patent.prototype.keyword = function($key) {
56
	Patent.prototype.keyword = function($key) {
57
		console.log($key)
56
		for(var i in $key.split(",")) {
58
		for(var i in $key.split(",")) {
57
			$("#tagList").append("<li>" + $key.split(",")[i] + "<li>");
59
			if(this.flag == 1) {
60
				$("#paperSList").append("<li>" + $key.split(",")[i] + "<div class='closeThis'></div></li>");
61
			} else {
62
				$(".tagList").append("<li>" + $key.split(",")[i] + "</li>");
63
			}
64

58
		}
65
		}
59
	}
66
	}
60
	Patent.prototype.patentMess = function($data,$obj) {
67
	Patent.prototype.patentMess = function($data, $obj) {
61
		console.log($data);
68
		console.log($data);
69
		if($obj.flag == 1) {
70
			$(".advertItem,.tagList").hide();
71
			hotKey(".oinput", 10);
72
			if($data.keywords) {
73
				$obj.keyword($data.keywords);
74
			}
75
		} else {
76
			$(".oinput").parents(".form-item").hide();
77
			$(".conItem").hide();
78
			if($data.keywords) {
79
				$obj.keyword($data.keywords);
80
			} else {
81
				$(".tagList").hide();
82
			}
83
		}
62
		if($data.name) {
84
		if($data.name) {
63
			$("#paperName").text($data.name);
85
			$("#paperName").text($data.name);
64
		}
86
		}
79
		if($data.summary) {
101
		if($data.summary) {
80
			$(".showCon").eq(5).text($data.summary);
102
			$(".showCon").eq(5).text($data.summary);
81
		}
103
		}
82
		if($data.keywords) {
83
			$obj.keyword($data.keywords);
84
		}else{
85
			$(".tagList").hide();
86
		}
87
		var weibotitle = $data.name;
104
		var weibotitle = $data.name;
88
		var weibourl = window.location.href;
105
		var weibourl = window.location.href;
89
		var weibopic = "http://" + window.location.host + "/images/default-resource.jpg";
106
		var weibopic = "http://" + window.location.host + "/images/default-resource.jpg";
90
		$("#weibo").attr("href","http://service.weibo.com/share/share.php?appkey=3677230589&title="+encodeURIComponent(weibotitle)+"&url="+encodeURIComponent(weibourl)+"&pic="+encodeURIComponent(weibopic)+"&content=utf-8"+"&ralateUid=6242830109&searchPic=false&style=simple");
107
		$("#weibo").attr("href", "http://service.weibo.com/share/share.php?appkey=3677230589&title=" + encodeURIComponent(weibotitle) + "&url=" + encodeURIComponent(weibourl) + "&pic=" + encodeURIComponent(weibopic) + "&content=utf-8" + "&ralateUid=6242830109&searchPic=false&style=simple");
91
	}
108
	}
92
	Patent.prototype.patentAuth = function($data,$obj) {
109
	Patent.prototype.patentAuth = function($data, $obj) {
93
		console.log($data);
110
		console.log($data);
94
		if($data.length<4) {
111
		if($data.length < 4) {
95
			$(".lastBtn").hide();
112
			$(".lastBtn").hide();
96
		}else{
113
		} else {
97
			$(".lastBtn").find("span").text($data.length);
114
			$(".lastBtn").find("span").text($data.length);
98
		}
115
		}
99
		for(var i in $data) {
116
		for(var i in $data) {
115
					Fun: $obj.profess
132
					Fun: $obj.profess
116
				});
133
				});
117
			}
134
			}
118
			$obj.bindEvent();
135
			$obj.bindEvent($obj);
119
		}
136
		}
120
	}
137
	}
121
	Patent.prototype.profess = function($data) {
122
			console.log($data);
123
			var img;
124
			var oClass = autho($data.authType, $data.orgAuth, $data.authStatus);
125
			var arr=[];
126
			arr[0] = $data.title||$data.office;
127
			arr[1]=$data.orgName||"";
128
			if(arr[0]) {
129
				if(arr[1]) {
130
					arr[2]=arr[0]+","+arr[1]
131
				}else{
132
					arr[2]=arr[0];
133
				}
134
			}else{
135
				arr[2]="";
136
			}
137
			if($data.hasHeadImage) {
138
				img = "/images/head/" + $data.id + "_l.jpg";
138
	Patent.prototype.profess = function($data, $obj) {
139
		console.log($data);
140
		var img;
141
		var oClass = autho($data.authType, $data.orgAuth, $data.authStatus);
142
		var csAuto, oId;
143
		var arr = [];
144
		arr[0] = $data.title || $data.office;
145
		arr[1] = $data.orgName || "";
146
		if(arr[0]) {
147
			if(arr[1]) {
148
				arr[2] = arr[0] + "," + arr[1]
139
			} else {
149
			} else {
140
				img = "../images/default-photo.jpg"
150
				arr[2] = arr[0];
141
			}
151
			}
142
			var otr = '<li class="flexCenter" style="cursor:pointer;" data-id="'+$data.id+'">' +
143
					'<div class="madiaHead useHead" id="userimg" style="background-image:url('+img+')"></div>' +
144
					'<div class="madiaInfo">' +
145
					'<p class="ellipsisSty">' +
146
					'<span class="h1Font" id="name">' + $data.name + '</span><em class="authiconNew '+oClass.sty+'" title="'+oClass.title+'"></em>' +
147
					'</p>' +
148
					'<p class="h2Font ellipsisSty">'+arr[2]+'<p>'+
149
					'</div>' +
150
					'</li>'
151
				$("#faM").prepend(otr);
152
		} else {
153
			arr[2] = "";
154
		}
155
		if($data.hasHeadImage) {
156
			img = "/images/head/" + $data.id + "_l.jpg";
157
		} else {
158
			img = "../images/default-photo.jpg"
159
		}
160
		if($obj.flag == 1) {
161
			csAuto = "auto";
162
			oId = "#"
163
		} else {
164
			csAuto = "pointer";
165
			oId = $data.id;
166
		}
167
		var otr = '<li class="flexCenter" style="cursor:' + csAuto + ';" data-id="' + oId + '">' +
168
			'<div class="madiaHead useHead" id="userimg" style="background-image:url(' + img + ')"></div>' +
169
			'<div class="madiaInfo">' +
170
			'<p class="ellipsisSty">' +
171
			'<span class="h1Font" id="name">' + $data.name + '</span><em class="authiconNew ' + oClass.sty + '" title="' + oClass.title + '"></em>' +
172
			'</p>' +
173
			'<p class="h2Font ellipsisSty">' + arr[2] + '<p>' +
174
			'</div>' +
175
			'</li>'
176
		$("#faM").prepend(otr);
152
	}
177
	}
153
	Patent.prototype.bindEvent = function($data) {
154
		$("#faM").on("click","li",function(){
155
			var oDataId=$(this).attr("data-id");
156
			if(oDataId.substring(0,1)!="#")
157
			location.href="userInforShow.html?professorId="+oDataId
178
	Patent.prototype.bindEvent = function($obj) {
179
		$("#faM").on("click", "li", function() {
180
			var oDataId = $(this).attr("data-id");
181
			if(oDataId.substring(0, 1) != "#")
182
				location.href = "userInforShow.html?professorId=" + oDataId
158
		})
183
		})
159
		$('#attention em').click(function() {
184
		$('#attention em').click(function() {
160
		if(userid && userid != "null" && userid != null) {
161
			if($(this).is('.icon-collected')) {
162
				cancelCollectionAbout(GetQueryString("patentId"), 4)
185
			if(userid && userid != "null" && userid != null) {
186
				if($(this).is('.icon-collected')) {
187
					cancelCollectionAbout(GetQueryString("patentId"), 4)
188
				} else {
189
					collectionAbout(GetQueryString("patentId"), 4);
190
				}
163
			} else {
191
			} else {
164
				collectionAbout(GetQueryString("patentId"), 4);
192
				$.MsgBox.Alert('提示', "请先登录再进行收藏");
193
				$("#mb_btn_ok").val("去登录");
194
				var aele = document.createElement('a');
195
				$("#mb_btnbox").append(aele);
196
				$("#mb_btnbox a").css({
197
					'display': "block",
198
					'width': '100%',
199
					'height': '40px',
200
					'position': 'absolute',
201
					'bottom': '-6px',
202
					'left': '0'
203
				});
204
				aele.setAttribute('href', '../login.html');
165
			}
205
			}
166
		} else {
167
			$.MsgBox.Alert('提示', "请先登录再进行收藏");
168
			$("#mb_btn_ok").val("去登录");
169
			var aele = document.createElement('a');
170
			$("#mb_btnbox").append(aele);
171
			$("#mb_btnbox a").css({
172
				'display': "block",
173
				'width': '100%',
174
				'height': '40px',
175
				'position': 'absolute',
176
				'bottom': '-6px',
177
				'left': '0'
178
			});
179
			aele.setAttribute('href', '../login.html');
180
		}
181
	})
206
		})
207
		$("body").on("click", ".closeThis", function() {
208
			if($(this).parent().length < 5) {
209
				$(this).parents(".keyResult").siblings("div").show();
210
			}
211
			$(this).parent().remove();
212

213
		});
214
		$("#release").on("click", function() {
215
			$.MsgBox.Confirm("提示", "确认发布该专利?", $obj.pubPatent);
216
		});
217
		$("#delete").on("click", function() {
218
			$.MsgBox.Confirm("提示", "确认删除该专利?", $obj.delePatent);
219
		});
182
	}
220
	}
183
	Patent.prototype.pageview = function() {};
221
	Patent.prototype.pageview = function() {};
222
	Patent.prototype.captiureSubInd = function(subIndu) {
223
		var industrys = $("#" + subIndu + "").find("li");
224
		var industryAll = "";
225
		if(industrys.size() > 0) {
226
			for(var i = 0; i < industrys.size(); i++) {
227
				industryAll += industrys[i].innerText;
228

229
				industryAll += ',';
230
			};
231
			industryAll = industryAll.substring(0, industryAll.length - 1);
232
		}
233
		console.log(industryAll)
234
		return industryAll;
235
	}
236
	Patent.prototype.pubPatent = function() {
237
		var $key = oPent.captiureSubInd("paperSList");
238
		console.log($key)
239
		oPent.ajax({
240
			url: "/ajax/ppatent/kw",
241
			data: {
242
				id: GetQueryString("patentId"),
243
				keywords: $key
244
			},
245
			type: "post",
246
			Fun: oPent.pubsucess
247
		});
248
	}
249
	Patent.prototype.pubsucess = function() {
250
		$.MsgBox.Alert('提示', '资源发布成功!');
251
		$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
252
		location.href = "patentList.html"
253
	}
254
	Patent.prototype.delePatent = function() {
255
		oPent.ajax({
256
			url: "/ajax/ppatent/cAss",
257
			data: {
258
				id: GetQueryString("patentId"),
259
				uid:$.cookie("userid")
260
			},
261
			type: "post",
262
			Fun: oPent.delsucess
263
		});
264
	}
265
	Patent.prototype.delsucess = function() {
266
		location.href = "patentList.html"
267
	}
184
	var oPent = new Patent();
268
	var oPent = new Patent();
185
})
269
})

+ 30 - 0
patentShow.html

77
					<ul class="tagList">
77
					<ul class="tagList">
78
						
78
						
79
					</ul>
79
					</ul>
80
					<!--标签模块-->
81
					<div class="form-item">
82
						<div class="aboutTit">关键词</div>
83
						<div class="col-w-12" style="position: relative;">
84
							<input type="text" class="frmcontype oinput" placeholder="请填写相关的关键词,如:腐蚀防护、石墨烯、纳米材料" data-pro="关键词不得超过10个字"  data-num="5" data-fontSizeN="10" />
85
							<button type="button" class="frmcontype btnModel frmaddG addButton">添加</button>
86
							<div class="form-drop keydrop">
87
								<ul>
88
									
89
								</ul>
90
							</div>
91
						</div>
92
						<div class="form-result keyResult">
93
							<ul class="ulspace editUlist clearfix" id="paperSList">
94
								<!--<li>XXX<div class="closeThis"></div></li>-->
95
							</ul>
96
						</div>
97
					</div>
80
					<!--作者-->
98
					<!--作者-->
81
					<div class="form-item aboutPa">
99
					<div class="form-item aboutPa">
82
						<div class="aboutTit">发明人</div>
100
						<div class="aboutTit">发明人</div>
95
				<ul class="advertItem">
113
				<ul class="advertItem">
96
					<li><a href="download.html" target="_blank"><img src="images/find_img_xiazai_nor.png" /></a></li>
114
					<li><a href="download.html" target="_blank"><img src="images/find_img_xiazai_nor.png" /></a></li>
97
				</ul>
115
				</ul>
116
				<div class="conItem">
117
					<ul class="operateBlock">
118
						<li class="goFabu" id="release">
119
							<em class="operateicon icon-issue"></em>
120
							<p>发布</p>
121
						</li>
122
						<li class="disableLi" id="delete" style="cursor:pointer;opacity: 1">
123
							<em class="operateicon icon-delete"></em>
124
							<p>删除</p>
125
						</li>
126
					</ul>
127
				</div>
98
			</div>
128
			</div>
99
		</div>
129
		</div>
100
	</div>
130
	</div>