jack 8 years ago
parent
commit
f6f348cf29
1 changed files with 26 additions and 1 deletions
  1. 26 1
      app/js/needIssue.js

+ 26 - 1
app/js/needIssue.js

@ -8,6 +8,7 @@ mui.ready(function() {
8 8
		var oNavsub = document.getElementById("navsub");
9 9
		var consun;
10 10
		var demandType;
11
		var orgId;
11 12
		if(ws.flag==0){
12 13
			demanTy(); 
13 14
		}else if(ws.flag==1){
@ -155,13 +156,36 @@ function demanTy() {
155 156
		}
156 157
		industry("INDUSTRY");
157 158
		industry("SUBJECT");
159
		getOrgId();
160
		function getOrgId(){
161
			mui.ajax(baseUrl + "/ajax/professor/baseInfo/"+userid, {
162
				dataType: 'json', //数据格式类型
163
				type: 'GET', //http请求类型
164
				timeout: 10000, //超时设置
165
				success: function(data) {
166
					if(data.success) {
167
					var $rta = data.data;
168
					orgId = $rta.orgId
169
					}
170
				},
171
				error: function() {
172
					plus.nativeUI.toast("服务器链接超时", toastStyle);
173
					return;
174
				}
175
			});
176
		}
158 177
		/*发布新需求*/
159 178
		document.getElementsByClassName("topsave")[0].addEventListener("tap", function() {
160 179
				var dd = oNavsub.getElementsByClassName("set");
180
				var cc=document.getElementById("navsubTo").getElementsByClassName("checkNow")
161 181
				if(dd.length == 0) {
162 182
					plus.nativeUI.toast("请选择您发布需求的目的", toastStyle);
163 183
					return;
164 184
				}
185
				if(cc.length == 0) {
186
					plus.nativeUI.toast("请选择您的需求类型", toastStyle);
187
					return;
188
				}
165 189
				if(!trim(demandContent.value)) {
166 190
					plus.nativeUI.toast("请填写需求主题", toastStyle);
167 191
					return;
@ -195,7 +219,8 @@ function demanTy() {
195 219
					"demandType": demandType,
196 220
					"demandTitle": demandContent.value,
197 221
					"demandContent": oconsultcon.innerText,
198
					"args": arr
222
					"args": arr,
223
					"orgId": (demandType == 2) ? orgId : "",
199 224
				},
200 225
				success: function(data) {
201 226
					console.log(JSON.stringify(data))