Browse Source

根据身份跳不同扥页面

jack 8 years ago
parent
commit
cb49eeb61b
3 changed files with 28 additions and 15 deletions
  1. 1 1
      app/js/needSure.js
  2. 1 1
      app/js/researchArea.js
  3. 26 13
      app/js/resinforbrow.js

+ 1 - 1
app/js/needSure.js

165
				plus.webview.create("../html/researcherProw.html", 'researcherProw.html', {}, {
165
				plus.webview.create("../html/researcherProw.html", 'researcherProw.html', {}, {
166
					proid: professId
166
					proid: professId
167
				});
167
				});
168
			} else if(authentication == 2) {
168
			} else if(authentication == 2|| authentication == 0) {
169
				plus.webview.create("../html/companybrowse.html", 'companybrowse.html', {}, {
169
				plus.webview.create("../html/companybrowse.html", 'companybrowse.html', {}, {
170
					proid: conId
170
					proid: conId
171
				});
171
				});

+ 1 - 1
app/js/researchArea.js

36
				plus.webview.create("../html/researcherProw.html", 'researcherProw.html', {}, {
36
				plus.webview.create("../html/researcherProw.html", 'researcherProw.html', {}, {
37
					proid: professId
37
					proid: professId
38
				});
38
				});
39
			} else if(authentication == 2) {
39
			} else if(authentication == 2||authentication == 0) {
40
				plus.webview.create("../html/companybrowse.html", 'companybrowse.html', {}, {
40
				plus.webview.create("../html/companybrowse.html", 'companybrowse.html', {}, {
41
					proid: professId
41
					proid: professId
42
				});
42
				});

+ 26 - 13
app/js/resinforbrow.js

181
					var $info = data.data || {}
181
					var $info = data.data || {}
182
182
183
					if(data.success && data.data) {
183
					if(data.success && data.data) {
184
						if($info.authType||$info.authentication == 1) {
184
						if($info.authType==1){
185
							mui.openWindow({
185
							mui.openWindow({
186
								url: '../html/proinforbrow.html',
186
								url: '../html/proinforbrow.html',
187
								id: 'html/proinforbrow.html',
187
								id: 'html/proinforbrow.html',
193
									proid: professorId
193
									proid: professorId
194
								},
194
								},
195
							});
195
							});
196
						} else if(!$info.authType&&$info.authentication == 2) {
196
						}else{
197
						if($info.authentication == 1) {
198
							mui.openWindow({
199
								url: '../html/researcherProw.html',
200
								id: 'researcherProw.html',
201
								show: {
202
									autoShow: false,
203
									aniShow: "slide-in-left"
204
								},
205
								extras: {
206
									proid: professorId
207
								},
208
							});
209
						} else if($info.authentication == 2 ||$info.authentication == 0) {
197
							mui.openWindow({
210
							mui.openWindow({
198
								url: '../html/companybrowse.html',
211
								url: '../html/companybrowse.html',
199
								id: 'html/companybrowse.html',
212
								id: 'html/companybrowse.html',
205
									proid: professorId
218
									proid: professorId
206
								},
219
								},
207
							});
220
							});
208
						} else if(!$info.authType&&$info.authentication == 3) {
221
						} else if($info.authentication == 3) {
209
							mui.openWindow({
222
							mui.openWindow({
210
								url: '../html/studentbrowse.html',
223
								url: '../html/studentbrowse.html',
211
								id: 'html/studentbrowse.html',
224
								id: 'html/studentbrowse.html',
218
								},
231
								},
219
							});
232
							});
220
						}
233
						}
234
						}
221
235
222
					}
236
					}
223
				},
237
				},
251
			}, false);
265
			}, false);
252
266
253
		} else {
267
		} else {
254
			goLoginFun();
268
			mui.openWindow({
269
				url: '../html/login.html',
270
				id: 'login.html'
271
			})
272
255
		}
273
		}
256
	};
274
	};
257
	oconsult.addEventListener('tap', function() {
275
	oconsult.addEventListener('tap', function() {
266
	ifCollection();
284
	ifCollection();
267
285
268
	yesExpert.addEventListener('tap', function() {
286
	yesExpert.addEventListener('tap', function() {
269
		var userid = plus.storage.getItem('userid');
270
		var $this = this;
287
		var $this = this;
271
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
288
		if(userid && userid != null && userid != "null") {
272
			collectionExpert($this);
289
			collectionExpert($this);
273
		} else {
290
		} else {
274
			goLoginFun();
291
			//			plus.nativeUI.toast("请先登录");
292
			isLogin();
275
		}
293
		}
276
	});
294
	});
277
295
278
	noExpert.addEventListener('tap', function() {
296
	noExpert.addEventListener('tap', function() {
279
		var userid = plus.storage.getItem('userid');
280
		var $this = this;
297
		var $this = this;
281
		if(userid && userid != null && userid != 'null' && userid != undefined && userid != 'undefined') {
282
			cancelCollectionExpert($this);
283
		} else {
284
			goLoginFun();
285
		}
298
		cancelCollectionExpert($this);
286
	});
299
	});
287
300
288
	/*判断是否收藏资源*/
301
	/*判断是否收藏资源*/