Quellcode durchsuchen

专家信息和资源信息中,判断是否登录,登录可咨询,未登录,跳转登录

wangaidan vor 8 Jahren
Ursprung
Commit
18e5f529af
2 geänderte Dateien mit 39 neuen und 34 gelöschten Zeilen
  1. 20 16
      app/js/proinfobrow.js
  2. 19 18
      app/js/resinforbrow.js

+ 20 - 16
app/js/proinfobrow.js

@ -10,8 +10,12 @@ mui.plusReady(function() {
10 10
	var proId = self.proid;
11 11
	console.log(userid);
12 12
	/*点击咨询*/
13
	if(userid) {
14
		ozixun.addEventListener('tap', function() {
13
	//判断是否登录,登录才可咨询,否则登录
14
	function isLogin(){
15
		var userid = plus.storage.getItem('userid');
16
	
17
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined'){
18
			
15 19
			var flag = 'professor';
16 20
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
17 21
			webviewShow = plus.webview.create("../html/consultapply.html", 'consultapply.html', {}, {
@ -22,21 +26,21 @@ mui.plusReady(function() {
22 26
			webviewShow.addEventListener("loaded", function() {
23 27
24 28
			}, false);
25
		});
26
	} else if(userid == '' || userid == undefined) {
27
		ozixun.addEventListener('tap', function() {
28
			/*mui.alert('请登录', '' ,function(){
29
				mui.openWindow({
30
					url: '../html/login.html',
31
					id: 'html/login.html',
32
					show: {
33
						aniShow: "slide-in-left"
34
					}
35
				});
36
			});*/
37
			plus.nativeUI.toast("请先登录");
38
		});
29
			
30
		}else {
31
			mui.openWindow({
32
			    url:'../html/login.html',
33
			    id:'login.html'
34
			})
35
				
36
		}
39 37
	}
38
	
39
	ozixun.addEventListener('tap', function() {
40
		isLogin();
41
	});
42
	
43
40 44
41 45
	//查询学术领域
42 46
	var subjectShow = function(data) {

+ 19 - 18
app/js/resinforbrow.js

@ -216,8 +216,12 @@ mui.plusReady(function() {
216 216
	//资源信息
217 217
	ziyuaninfo(resourceId);
218 218
	/*点击咨询*/
219
	if(userid) {
220
		oconsult.addEventListener('tap', function() {
219
	//判断是否登录,登录才可咨询,否则登录
220
	function isLogin(){
221
		var userid = plus.storage.getItem('userid');
222
	
223
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined'){
224
			
221 225
			var flag = 'ziyuan';
222 226
			var consulttitle = oresorcename.innerHTML;
223 227
			var nwaiting = plus.nativeUI.showWaiting(); //显示原生等待框
@ -230,22 +234,19 @@ mui.plusReady(function() {
230 234
			webviewShow.addEventListener("loaded", function() {
231 235
232 236
			}, false);
233
234
		});
235
	} else if(userid == '' || userid == undefined) {
236
		oconsult.addEventListener('tap', function() {
237
			/*mui.alert('请登录', '' ,function(){
238
				mui.openWindow({
239
					url: '../html/login.html',
240
					id: 'html/login.html',
241
					show: {
242
						aniShow: "slide-in-left"
243
					}
244
				});
245
			});*/
246
			plus.nativeUI.toast("请先登录");
247
		});
248
	}
237
			
238
		}else {
239
			mui.openWindow({
240
			    url:'../html/login.html',
241
			    id:'login.html'
242
			})
243
				
244
		}
245
	};
246
	oconsult.addEventListener('tap', function() {
247
		isLogin();
248
	});
249
	
249 250
250 251
	/*咨询成功,返回资源信息*/
251 252
	window.addEventListener('backziyuaninfo', function(event) {