浏览代码

收藏资源图片、专家浏览信息图片、资源详情关键字搜索

luyanan 8 年之前
父节点
当前提交
7bd9100738
共有 5 个文件被更改,包括 53 次插入32 次删除
  1. 1 1
      app/html/searchListNew.html
  2. 35 25
      app/js/attentions2.js
  3. 3 3
      app/js/index.js
  4. 1 2
      app/js/proinfobrow.js
  5. 13 1
      app/js/resourceShow.js

+ 1 - 1
app/html/searchListNew.html

14
		<!-- 主页面标题 -->
14
		<!-- 主页面标题 -->
15
		<header class="mui-bar mui-bar-nav toptitbox">
15
		<header class="mui-bar mui-bar-nav toptitbox">
16
			<a class="mui-action-back mui-icon mui-icon-left-nav topback leftnav"></a>
16
			<a class="mui-action-back mui-icon mui-icon-left-nav topback leftnav"></a>
17
			<div class="searchboxNew searchboxNewT">
17
			<div class="searchboxNew searchboxNewT" id="searB">
18
				<form onsubmit="return false;">
18
				<form onsubmit="return false;">
19
					<input type="search" class="mui-input-clear searchtxtNew" placeholder="请输入专家姓名、机构、研究方向" id="searchval" />
19
					<input type="search" class="mui-input-clear searchtxtNew" placeholder="请输入专家姓名、机构、研究方向" id="searchval" />
20
				</form>
20
				</form>

+ 35 - 25
app/js/attentions2.js

138
       
138
       
139
		/*获取头像*/
139
		/*获取头像*/
140
		if(item.resource.images.length) {
140
		if(item.resource.images.length) {
141
			var img = baseUrl + "/images/resource/" + item.resource.resourceId + "_s.jpg";
141
			var img = baseUrl + '/data/resource/' + item.resource.images[0].imageSrc.replace(/.jpg/,"_s.jpg"); 
142
		} else {
142
		} else {
143
			var img = "../images/default-resource.jpg";
143
			var img = "../images/default-resource.jpg";
144
		}
144
		}
145
		
146
		/*判断用户是否认证*/
145
		/*判断用户是否认证*/
147
		var icont = '';
148
		var oSty = autho(item.resource.editProfessor.authType, item.resource.editProfessor.orgAuth, item.resource.editProfessor.authStatus);
149
		icont='<em class="authicon ' + oSty.sty + '"></em>'
150

151
		var title = item.resource.editProfessor.title || "";
152
		var office = item.resource.editProfessor.office || "";
153
		var orgName = item.resource.editProfessor.orgName || "";
154
		var address = item.resource.editProfessor.address || "";
155

156
		if(title != "") {
157
			title = title + " , ";
158
		}
159
		if(office != "") {
160
			office = office + " , ";
161
		}
162
		if(orgName != "") {
163
			orgName = orgName;
164
		}
165
		if(address != "") {
166
			address = " | " + address;
167
		}
146
		if(item.resource.editProfessor) {
147
			var oSty = autho(item.resource.editProfessor.authType,item.resource.editProfessor.orgAuth, item.resource.editProfessor.authStatus);
148
			oName=item.resource.editProfessor.name;
149
		}else {
150
			var oSty={};
151
			oSty.sty="";
152
			oSty.title="";
153
			if(item.resource.organization.authStatus==3) {	
154
				oSty.sty="authicon-com-ok";
155
				oSty.title="科袖认证企业";	
156
			}
157
			oName=item.resource.organization.name;
158
		 }
159

160
//		var title = item.resource.editProfessor.title || "";
161
//		var office = item.resource.editProfessor.office || "";
162
//		var orgName = item.resource.editProfessor.orgName || "";
163
//		var address = item.resource.editProfessor.address || "";
164
//
165
//		if(title != "") {
166
//			title = title + " , ";
167
//		}
168
//		if(office != "") {
169
//			office = office + " , ";
170
//		}
171
//		if(orgName != "") {
172
//			orgName = orgName;
173
//		}
174
//		if(address != "") {
175
//			address = " | " + address;
176
//		}
168

177

169
		var li = document.createElement('li');
178
		var li = document.createElement('li');
170
		li.className = 'mui-table-view-cell mui-media';
179
		li.className = 'mui-table-view-cell mui-media';
174
			'<div class="mui-media-body">' +
183
			'<div class="mui-media-body">' +
175
			'<span class="listtit">' + item.resource.resourceName + '</span>' +
184
			'<span class="listtit">' + item.resource.resourceName + '</span>' +
176
			'<p class="mui-ellipsis listtit2">' + item.resource.supportedServices + '</p>' +
185
			'<p class="mui-ellipsis listtit2">' + item.resource.supportedServices + '</p>' +
177
			'<span class="listtit">' + item.resource.editProfessor.name + icont + '</span>' +
178
			'<p class="listtit3"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
186
			'<span class="listtit">' +oName+ '<em class="authicon '+oSty.sty+'" title="'+oSty.title+'"></em>'+
187
//			'<span class="listtit">' + item.resource.editProfessor.name + icont + '</span>' +
188
//			'<p class="listtit3"><span>' + title + '</span><span>' + office + '</span><span>' + orgName + '</span><span>' + address + '</span></p>' +
179
			'</div></a></li>';
189
			'</div></a></li>';
180
		table.appendChild(li, table.firstChild);
190
		table.appendChild(li, table.firstChild);
181
		
191
		

+ 3 - 3
app/js/index.js

181
	//plus.nativeUI.showWaiting();//显示原生等待框
181
	//plus.nativeUI.showWaiting();//显示原生等待框
182
	//webviewShow = plus.webview.create("../html/search.html",'search.html',{},{subject:subject,bigClass:1});//后台创建webview并打开show.html
182
	//webviewShow = plus.webview.create("../html/search.html",'search.html',{},{subject:subject,bigClass:1});//后台创建webview并打开show.html
183
	mui.openWindow({
183
	mui.openWindow({
184
		url: '../html/search.html',
185
		id: '../html/search.html',
184
		url: '../html/searchListNew.html',
185
		id: '../html/searchListNew.html',
186
		show: {
186
		show: {
187
			//autoShow:false,
187
			//autoShow:false,
188
			aniShow: "slide-in-right",
188
			aniShow: "slide-in-right",
189
		},
189
		},
190
		extras: {
190
		extras: {
191
			subject: subject,
191
			key: subject,
192
			bigClass: 1
192
			bigClass: 1
193
		}
193
		}
194
	});
194
	});

+ 1 - 2
app/js/proinfobrow.js

149
				var string = '<li class="mui-table-view-cell mui-media listitem" resouseId=' + $data[i].resourceId + '>'
149
				var string = '<li class="mui-table-view-cell mui-media listitem" resouseId=' + $data[i].resourceId + '>'
150
				string += '<a class="proinfor"><div class="mui-media-object mui-pull-left ResImgBox ResImgBox2">'
150
				string += '<a class="proinfor"><div class="mui-media-object mui-pull-left ResImgBox ResImgBox2">'
151
				if($data[i].images.length) {
151
				if($data[i].images.length) {
152
					string += '<img class="resImg headRadius" src="' + baseUrl + '/images/resource/' + $data[i].resourceId + '.jpg">'
153
152
					string += '<img class="resImg headRadius" src="'+ baseUrl+'/data/resource/' + $data[i].images[0].imageSrc + '" />'
154
				} else {
153
				} else {
155
154
156
					string += '<img class="resImg headRadius" src="../images/default-resource.jpg">'
155
					string += '<img class="resImg headRadius" src="../images/default-resource.jpg">'

+ 13 - 1
app/js/resourceShow.js

173
			});
173
			});
174
		})
174
		})
175
	}
175
	}
176
	//关键词标签点击进去搜索
177
	mui(".tagList").on("tap","li",function(){
178
		var tagText = this.getElementsByTagName("span")[0].innerText;
179
		console.log(tagText)
180
		plus.nativeUI.showWaiting();
181
		plus.webview.create("../html/searchListNew.html", 'searchListNew.html', {}, {
182
			key: tagText,
183
			/*qiFlag: 2*/
184
		});
185
	})
176
	/*资源里面相关文章*/
186
	/*资源里面相关文章*/
177
	function relatedArticles() {
187
	function relatedArticles() {
178
		mui.ajax(baseUrl + '/ajax/resource/articles', {
188
		mui.ajax(baseUrl + '/ajax/resource/articles', {
366
	//相关文章详情
376
	//相关文章详情
367
	mui('#likeArtical').on('tap', 'li', function() {
377
	mui('#likeArtical').on('tap', 'li', function() {
368
		var artId = this.getAttribute("data-id");
378
		var artId = this.getAttribute("data-id");
379
		var professorId = othisInfo.getAttribute("data-id");
369
		plus.nativeUI.showWaiting();
380
		plus.nativeUI.showWaiting();
370
		plus.webview.create("../html/professorArticle.html", 'professorArticle.html', {}, {
381
		plus.webview.create("../html/professorArticle.html", 'professorArticle.html', {}, {
371
			articleId: artId,
382
			articleId: artId,
372
			ownerid:professorId
383
			ownerid: professorId
373
		});
384
		});
374
	});
385
	});
375
	//感兴趣的资源详情
386
	//感兴趣的资源详情
625
					title: oresourceName.innerHTML,
636
					title: oresourceName.innerHTML,
626
					href: baseUrl + "/ekexiu/shareResinfor.html?resourceId=" + resourceId,
637
					href: baseUrl + "/ekexiu/shareResinfor.html?resourceId=" + resourceId,
627
					thumbs: [firstImg.querySelectorAll("img")[0].getAttribute("src").replace(/.jpg/,"_s.jpg") ]
638
					thumbs: [firstImg.querySelectorAll("img")[0].getAttribute("src").replace(/.jpg/,"_s.jpg") ]
639
					
628
				});
640
				});
629
			}
641
			}
630
		}
642
		}