Browse Source

需求修正

LIPENGTAO1313 6 years ago
parent
commit
47ff6e5f5f

+ 8 - 2
app/html/demandModify.html

@ -48,8 +48,8 @@
48 48
		    </div>
49 49
		     <div class="mui-input-group mainbox">
50 50
				<div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix" id="ExpecteDuration">
51
    				<span class="mui-pull-left">预期时长</span>
52
				    <span class="rightword" id="ExpecteResult">请选择预期时长</span>
51
    				<span class="mui-pull-left">预计合作周期</span>
52
				    <span class="rightword" id="ExpecteResult">请选择预计合作周期</span>
53 53
    			</div>
54 54
		    </div>
55 55
		    <div class="mui-input-group mainbox">
@ -58,6 +58,12 @@
58 58
				    <span class="rightword" id="yearResult">请选择需求的截止日期</span>
59 59
    			</div>
60 60
		    </div>
61
		    <div class="mui-input-group mainbox">
62
		   		<div class="infocontit infocontitM">您所在的企业<span class="requiredThis"> *</span></div>
63
				<div class="infocon">
64
					<textarea class="textareabox simulation" id="org" oninput="autoGrow(this)" maxlength="50" placeholder="建议填写完整的企业名称"></textarea>
65
				</div>
66
		    </div>
61 67
		   <div class="mui-input-group mainbox">
62 68
		   		<div class="infocontit infocontitM">联系电话<span class="requiredThis"> *</span></div>
63 69
				<div class="infocon">

+ 9 - 9
app/html/demandPublish.html

@ -36,13 +36,7 @@
36 36
		<div class="mui-content" style="padding-top:34px;">
37 37
			<div class="mui-input-group mainbox">
38 38
				<div class="littip-top">只能发布您所在机构的需求<br />您可以使用【修改资料】功能,变更您的所在机构</div>
39
		    </div>
40
			<div class="mui-input-group mainbox">
41
				<div class="infocontit infocontitM OnetitM  mui-clearfix" id="publish">
42
    				<span class="mui-pull-left">发布者</span>
43
				    <span class="rightword" id="publisher" style="right:19px;color:#333;"></span>
44
    			</div>
45
		    </div>
39
		   </div>
46 40
			<div class="mui-input-group mainbox">
47 41
				<div class="infocontit infocontitM">需求主题<span class="requiredThis"> *</span></div>
48 42
				<div class="infocon">
@ -72,8 +66,8 @@
72 66
		    </div>
73 67
		     <div class="mui-input-group mainbox">
74 68
				<div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix" id="ExpecteDuration">
75
    				<span class="mui-pull-left">预期时长</span>
76
				    <span class="rightword" id="ExpecteResult" flag="">请选择预期时长</span>
69
    				<span class="mui-pull-left">预计合作周期</span>
70
				    <span class="rightword" id="ExpecteResult" flag="">请选择预计合作周期</span>
77 71
    			</div>
78 72
		    </div>
79 73
		    <div class="mui-input-group mainbox">
@ -82,6 +76,12 @@
82 76
				    <span class="rightword" id="yearResult">请选择需求的截止日期</span>
83 77
    			</div>
84 78
		    </div>
79
		    <div class="mui-input-group mainbox">
80
		   		<div class="infocontit infocontitM">您所在的企业<span class="requiredThis"> *</span></div>
81
				<div class="infocon">
82
					<textarea class="textareabox simulation" id="org" oninput="autoGrow(this)" maxlength="50" placeholder="建议填写完整的企业名称"></textarea>
83
				</div>
84
		    </div>
85 85
		   <div class="mui-input-group mainbox">
86 86
		   		<div class="infocontit infocontitM">联系电话<span class="requiredThis"> *</span></div>
87 87
				<div class="infocon">

+ 1 - 1
app/html/needShow.html

@ -67,7 +67,7 @@
67 67
									<p class="h3Font" id="oTime"></p>
68 68
								</div>
69 69
				            </div>
70
				            <span class="mui-icon attenSpan" id="attBtn" style="display:block;">关注</span>
70
				            <span class="mui-icon attenSpan" id="attBtn" style="display:none;">关注</span>
71 71
				        </li>
72 72
				    </ul>
73 73
	    		</div>

+ 12 - 2
app/js/demondModify.js

@ -169,7 +169,6 @@
169 169
 			timeout: 10000,
170 170
 			async: true,
171 171
 			success: function(data) {
172
 				console.log(JSON.stringify(data))
173 172
 				if(data.success) {
174 173
 					var $data=data.data;
175 174
 					document.querySelector("#cityResult").innerHTML=$data.province + "-" + $data.city ;
@ -186,6 +185,9 @@
186 185
						document.querySelector("#ExpecteResult").innerHTML=oSpend[ $data.duration ] ;
187 186
						document.querySelector("#ExpecteDuration").setAttribute('flag', $data.duration );
188 187
					}
188
					if($data.orgName) {
189
						document.getElementById("org").value = $data.orgName;
190
					}
189 191
 				}
190 192
 			},
191 193
 			error: function() {
@ -209,6 +211,12 @@
209 211
 				length : 2
210 212
 			},
211 213
 			arr[2] = {
214
 				demand : document.querySelector("#org"),
215
 				fontNum : 50,
216
 				alertTitle : "您所在的企业" ,
217
 				length : 3
218
 			};
219
 			arr[3] = {
212 220
 				demand : document.querySelector("#phone"),
213 221
 				fontNum : 50,
214 222
 				alertTitle : "联系电话" ,
@ -267,7 +275,9 @@
267 275
				"duration": document.querySelector("#ExpecteDuration").getAttribute('flag')==null?'':document.querySelector("#ExpecteDuration").getAttribute('flag'),
268 276
				"invalidDay": btns.getAttribute('flag'),
269 277
				"contactNum": document.querySelector("#phone").value,
270
				"modifier" : userid
278
				"modifier" : userid,
279
				'orgName': document.querySelector("#org").value,
280
				'source': 'ekexiuApp'
271 281
 			},
272 282
 			timeout: 10000,
273 283
 			async: true,

+ 15 - 26
app/js/demondPublish.js

@ -3,8 +3,6 @@
3 3
 	$.plusReady(function() {
4 4

5 5
 		var userid = plus.storage.getItem('userid');
6
 		var oRd="";
7
 		
8 6
 		/**
9 7
 		 * 获取对象属性的值
10 8
 		 * 主要用于过滤三级联动中,可能出现的最低级的数据不存在的情况,实际开发中需要注意这一点;
@ -153,33 +151,16 @@
153 151
 					if( data.data.province ) {
154 152
 						document.querySelector("#cityResult").innerHTML = data.data.province + "-" + data.data.address ;
155 153
 						cityResult.setAttribute('city', data.data.address );
156
 						cityResult.setAttribute('province', data.data.province )
154
 						cityResult.setAttribute('province', data.data.province );
155
 						
156
 					}
157
 					if(data.data.orgName) {
158
 						document.getElementById("org").value = data.data.orgName;
157 159
 					}
158 160
 					if( data.data.phone ) {
159 161
 						document.querySelector("#phone").value = data.data.phone ;
160 162
 					}
161
 					oRd = data.data.orgId ;
162
 					queryCompany( data.data.orgId );
163
 				}
164
 			},
165
 			error: function() {
166
 				plus.nativeUI.toast("服务器链接超时", toastStyle);
167
 			}
168
 		});
169
 	}
170
 	/*企业信息*/
171
 	function queryCompany(orgId) {
172
 		$.ajax(baseUrl + '/ajax/org/' + orgId, {
173
 			dataType: 'json', //数据格式类型
174
 			type: 'GET', //http请求类型
175
 			timeout: 10000,
176
 			async: true,
177
 			success: function(data) {
178
 				if(data.success) {
179
 					var osur = plus.webview.getWebviewById("sureOrg.html");
180
 					if(osur!=null)
181
 					osur.close();
182
 					document.querySelector("#publisher").innerHTML = data.data.forShort ? data.data.forShort : data.data.name;
163
 					
183 164
 				}
184 165
 			},
185 166
 			error: function() {
@ -187,6 +168,7 @@
187 168
 			}
188 169
 		});
189 170
 	}
171
 	
190 172
 	/*检查格式是否合格*/
191 173
 	function  checkout() {
192 174
 		var arr=[];
@ -215,6 +197,12 @@
215 197
 				length : 2
216 198
 			},
217 199
 			arr[4] = {
200
 				demand : document.querySelector("#org"),
201
 				fontNum : 50,
202
 				alertTitle : "您所在的企业" ,
203
 				length : 3
204
 			};
205
 			arr[5] = {
218 206
 				demand : document.querySelector("#phone"),
219 207
 				fontNum : 50,
220 208
 				alertTitle : "联系电话" ,
@ -259,7 +247,8 @@
259 247
				"invalidDay": btns.getAttribute('flag'),
260 248
				"contactNum": document.querySelector("#phone").value,
261 249
				"creator": userid,
262
				"orgId": oRd
250
				'orgName':document.querySelector("#org").value,
251
				'source' :'ekexiuApp'
263 252
 			},
264 253
 			timeout: 10000,
265 254
 			async: true,

+ 8 - 60
app/js/index.js

@ -18,65 +18,6 @@ mui.plusReady(function() {
18 18
		checkVersion();
19 19
	}, false)
20 20
})
21
function orName() {
22
	mui.ajax(baseUrl + "/ajax/professor/baseInfo/" + plus.storage.getItem('userid'), {
23
		dataType: 'json', //数据格式类型
24
		type: 'GET', //http请求类型
25
		timeout: 10000, //超时设置
26
		success: function(data) {
27
			if(data.success && data.data) {
28
				var $info = data.data || {};
29
				dem($info.id, $info.orgId)
30
			}
31
		},
32
		error: function() {
33
			plus.nativeUI.toast("服务器链接超时", toastStyle);
34
			return;
35
		}
36
	});
37
}
38

39
function dem(uid, oid) {
40
	mui.ajax(baseUrl + "/ajax/demand/qc", {
41
		dataType: 'json', //数据格式类型
42
		type: 'GET', //http请求类型
43
		timeout: 10000, //超时设置
44
		data: {
45
			"state": [0, 1],
46
			"uid": uid,
47
			"oid": oid
48
		},
49
		traditional: true,
50
		success: function(data) {
51
			if(data.success) {
52
				var $data = data.data;
53
				if($data) {
54
					mui.openWindow({
55
						url: '../html/demandPublish.html',
56
						id: 'demandPublish.html',
57
						show: {
58
							autoShow: true,
59
							aniShow: "slide-in-right"
60
						}
61
					});
62
				} else {
63
					mui.openWindow({
64
						url: '../html/sureOrg.html',
65
						id: 'sureOrg.html',
66
						show: {
67
							autoShow: true,
68
							aniShow: "slide-in-right",
69
						}
70
					});
71
				}
72
			}
73
		},
74
		error: function() {
75
			plus.nativeUI.toast("服务器链接超时", toastStyle);
76
			return;
77
		}
78
	});
79
}
80 21
document.getElementById("demandP").addEventListener("tap", function() {
81 22
	var userid = plus.storage.getItem('userid');
82 23
	if(userid == null) {
@ -86,7 +27,14 @@ document.getElementById("demandP").addEventListener("tap", function() {
86 27
		})
87 28
		return;
88 29
	}
89
	orName()
30
	mui.openWindow({
31
						url: '../html/demandPublish.html',
32
						id: 'demandPublish.html',
33
						show: {
34
							autoShow: true,
35
							aniShow: "slide-in-right"
36
						}
37
					});
90 38

91 39
})
92 40
document.getElementById("improfessor").addEventListener("tap", function() {

+ 32 - 17
app/js/needShow.js

@ -23,6 +23,8 @@ mui.ready(function() {
23 23
		moreMes();//更多
24 24
		
25 25
		document.getElementById("personAL").addEventListener("tap", function() {//企业详情
26
			if(tiaoFlag) {
27
			
26 28
			var cmpId=this.getAttribute("data-id");
27 29
			mui.openWindow({
28 30
				url: '../html/cmpInforShow.html',
@ -35,6 +37,8 @@ mui.ready(function() {
35 37
					cmpId: cmpId
36 38
				}
37 39
			});
40
				
41
			}
38 42
		})
39 43
		//收藏
40 44
		var oifCollect=document.getElementById("ifCollect");
@ -132,6 +136,7 @@ mui.ready(function() {
132 136
				"async": false,
133 137
				"dataType": "json",
134 138
				"success": function(data) {
139
					console.log(111111111111111111111)
135 140
					console.log(JSON.stringify(data));
136 141
					if(data.success) {
137 142
						var ws=plus.webview.currentWebview();
@ -148,7 +153,7 @@ mui.ready(function() {
148 153
						
149 154
						var strCon="";
150 155
						if($da.city){ strCon+='<div class="showTit">所在城市:<span class="showCon">'+$da.city+'</span></div>' }
151
						if($da.duration!=0){ strCon+='<div class="showTit">预期时长:<span class="showCon">'+demandDuration[$da.duration]+'</span></div>' }
156
						if($da.duration!=0){ strCon+='<div class="showTit">预计周期:<span class="showCon">'+demandDuration[$da.duration]+'</span></div>' }
152 157
						if($da.cost!=0){ strCon+='<div class="showTit">费用预算:<span class="showCon">'+demandCost[$da.cost]+'</span></div>' }
153 158
						if($da.invalidDay){ strCon+='<div class="showTit">有效期至:<span class="showCon">'+TimeTr($da.invalidDay)+'</span></div>' }
154 159
						document.getElementById("demandInfo").innerHTML=strCon;
@ -212,7 +217,7 @@ mui.ready(function() {
212 217
								}
213 218
							}
214 219
						}
215
						cmpFun($da.orgId);
220
						cmpFun($da.orgName);
216 221
						
217 222
						orgThis=$da.orgId;
218 223
						consuId = $da.creator;
@ -227,26 +232,36 @@ mui.ready(function() {
227 232
			});
228 233
			
229 234
		}
235
		var tiaoFlag=false;
230 236
		/*企业用户信息*/
231
		function cmpFun(id) {
232
			mui.ajax(baseUrl+"/ajax/org/" + id,{
237
		function cmpFun(par) {
238
			mui.ajax(baseUrl+"/ajax/org/queryByName",{
233 239
				"type": "get",
240
				'data': {
241
					name: par
242
				},
234 243
				"async": true,
235 244
				"success": function(data) {
236 245
					if(data.success && data.data) {
237
						if(data.data.forShort) {
238
							document.getElementById("cmpname").innerHTML=data.data.forShort;
239
						}else{
240
							document.getElementById("cmpname").innerHTML=data.data.name;
241
						}
242
						var img="../images/default-icon.jpg";
243
						if(data.data.hasOrgLogo==1){
244
							img=baseUrl+"/images/org/" + data.data.id + ".jpg";
245
						}
246
						document.getElementById("personAL").setAttribute("data-id",data.data.id);
247
						document.getElementById("companyImg").setAttribute("src",img);
248
						if(data.data.authStatus==3){
249
							document.getElementById("QauthFlag").classList.add("authicon-com-ok");
246
						if(data.data.name) {
247
							tiaoFlag = true;
248
							document.getElementById('attBtn').style.display = 'block';
249
							if(data.data.forShort) {
250
								document.getElementById("cmpname").innerHTML=data.data.forShort;
251
							}else{
252
								document.getElementById("cmpname").innerHTML=data.data.name;
253
							}
254
							var img="../images/default-icon.jpg";
255
							if(data.data.hasOrgLogo==1){
256
								img=baseUrl+"/images/org/" + data.data.id + ".jpg";
257
							}
258
							document.getElementById("personAL").setAttribute("data-id",data.data.id);
259
							document.getElementById("companyImg").setAttribute("src",img);
260
							if(data.data.authStatus==3){
261
								document.getElementById("QauthFlag").classList.add("authicon-com-ok");
262
							}
263
						} else {
264
							document.getElementById("cmpname").innerHTML = par;
250 265
						}
251 266
					}
252 267
				},