Browse Source

我的需求

jack 8 years ago
parent
commit
63e6671160
2 changed files with 55 additions and 13 deletions
  1. 4 0
      app/js/index.js
  2. 51 13
      app/js/needList.js

+ 4 - 0
app/js/index.js

98
							aniShow: "slide-in-right",
98
							aniShow: "slide-in-right",
99
						}
99
						}
100
					});
100
					});
101
					}else if($data.authStatus == 2){
102
						plus.nativeUI.toast("我们正在对您的信息进行认证,请稍等片刻", {'verticalAlign':'center'});
103
					}else if($data.authStatus == 1){
104
						plus.nativeUI.toast("我们将尽快对您的信息进行认证", {'verticalAlign':'center'});
101
					}else{
105
					}else{
102
						mui.openWindow({
106
						mui.openWindow({
103
						url: '../html/realname-authentication2.html',
107
						url: '../html/realname-authentication2.html',

+ 51 - 13
app/js/needList.js

4
		var ws = plus.webview.currentWebview();
4
		var ws = plus.webview.currentWebview();
5
		var oUlist = document.getElementsByClassName("tableList")[0];
5
		var oUlist = document.getElementsByClassName("tableList")[0];
6
		window.addEventListener("newId", function(event) {
6
		window.addEventListener("newId", function(event) {
7
				demandList();
8
			})
7
			demandList();
8
		})
9

9
		function demandHtml(data) {
10
		function demandHtml(data) {
10
			for(var i = 0; i < data.length; i++) {
11
			for(var i = 0; i < data.length; i++) {
11
				var oDemandStatus, oDemandType, oDemandAim, oCreateTime,stColor;
12
				(data[i].demandStatus == 1) ? (oDemandStatus = "发布中",stColor="status-1"): (oDemandStatus = "已关闭",stColor="status-5");
12
				var oDemandStatus, oDemandType, oDemandAim, oCreateTime, stColor;
13
				(data[i].demandStatus == 1) ? (oDemandStatus = "发布中", stColor = "status-1") : (oDemandStatus = "已关闭", stColor = "status-5");
13
				(data[i].demandType == 1) ? oDemandType = "个人": oDemandType = "企业";
14
				(data[i].demandType == 1) ? oDemandType = "个人": oDemandType = "企业";
14
				(data[i].demandAim == 1) ? oDemandAim = "技术": (data[i].demandAim == 2) ? oDemandAim = "资源" : oDemandAim = "其他";
15
				(data[i].demandAim == 1) ? oDemandAim = "技术": (data[i].demandAim == 2) ? oDemandAim = "资源" : oDemandAim = "其他";
15
				oCreateTime = data[i].createTime.substr(0, 4) + "-" + data[i].createTime.substr(4, 2) + "-" + data[i].createTime.substr(6, 2) + " " + data[i].createTime.substr(8, 2) + ":" + data[i].createTime.substr(10, 2);
16
				oCreateTime = data[i].createTime.substr(0, 4) + "-" + data[i].createTime.substr(4, 2) + "-" + data[i].createTime.substr(6, 2) + " " + data[i].createTime.substr(8, 2) + ":" + data[i].createTime.substr(10, 2);
21
				oString += '<div class="coustatus mui-pull-right">'
22
				oString += '<div class="coustatus mui-pull-right">'
22
				oString += '<span class="aimlabel">' + oDemandType + '</span>'
23
				oString += '<span class="aimlabel">' + oDemandType + '</span>'
23
				oString += '<span class="aimlabel">' + oDemandAim + '</span>'
24
				oString += '<span class="aimlabel">' + oDemandAim + '</span>'
24
				oString += '<span class="'+stColor+'">' + oDemandStatus + '</span>'
25
				oString += '<span class="' + stColor + '">' + oDemandStatus + '</span>'
25
				oString += '</div></div>'
26
				oString += '</div></div>'
26
				oString += '<a class="proinfor itemBtn">'
27
				oString += '<a class="proinfor itemBtn">'
27
				oString += '<div class="mui-media-body">'
28
				oString += '<div class="mui-media-body">'
45
				success: function(data) {
46
				success: function(data) {
46
					if(data.success) {
47
					if(data.success) {
47
						console.log(JSON.stringify(data));
48
						console.log(JSON.stringify(data));
48
						oUlist.innerHTML="";
49
						oUlist.innerHTML = "";
49
						demandHtml(data.data);
50
						demandHtml(data.data);
50
						plus.nativeUI.closeWaiting();; //新webview的载入完毕后关闭等待框
51
						plus.nativeUI.closeWaiting();; //新webview的载入完毕后关闭等待框
51
						ws.show("slide-in-right", 150);
52
						ws.show("slide-in-right", 150);
67
					aniShow: "slide-in-right"
68
					aniShow: "slide-in-right"
68
				},
69
				},
69
				extras: {
70
				extras: {
70
					demanid:oDemandId,
71
					demandStatus1:demandStatus
71
					demanid: oDemandId,
72
					demandStatus1: demandStatus
72
				}
73
				}
73

74

74
			});
75
			});
75
		});
76
		});
76
		/*发布新需求*/
77
		/*发布新需求*/
77
		document.getElementById("btnLinkBox").addEventListener("tap", function() {
78
		document.getElementById("btnLinkBox").addEventListener("tap", function() {
78
			mui.openWindow({
79
				url: '../html/needIssue.html',
80
				id: '../html/needIssue.html',
81
				show: {
82
					aniShow: "slide-in-right",
79
			mui.ajax(baseUrl + "/ajax/professor/auth", {
80
				dataType: 'json', //数据格式类型
81
				type: 'GET', //http请求类型
82
				timeout: 10000, //超时设置
83
				data: {
84
					"id": userid
85
				},
86
				success: function(data) {
87
					if(data.success) {
88
						var $data = data.data;
89
						if($data.authStatus == 3) {
90
							mui.openWindow({
91
								url: '../html/needIssue.html',
92
								id: '../html/needIssue.html',
93
								show: {
94
									autoShow: false,
95
									aniShow: "slide-in-right",
96
								}
97
							});
98
						} else if($data.authStatus == 2) {
99
							plus.nativeUI.toast("我们正在对您的信息进行认证,请稍等片刻", {
100
								'verticalAlign': 'center'
101
							});
102
						} else if($data.authStatus == 1) {
103
							plus.nativeUI.toast("我们将尽快对您的信息进行认证", {
104
								'verticalAlign': 'center'
105
							});
106
						} else if($data.authStatus <= 0) {
107
							mui.openWindow({
108
								url: '../html/realname-authentication.html',
109
								id: 'realname-authentication.html',
110
								show: {
111
									aniShow: "slide-in-right",
112
								}
113
							});
114
						}
115
					}
116
				},
117
				error: function() {
118
					plus.nativeUI.toast("服务器链接超时", toastStyle);
119
					return;
83
				}
120
				}
84
			});
121
			});
85
		})
122
		})
123

86
	});
124
	});
87
})
125
})