Browse Source

需求修正

LIPENGTAO1313 6 years ago
parent
commit
47ff6e5f5f

+ 8 - 2
app/html/demandModify.html

48
		    </div>
48
		    </div>
49
		     <div class="mui-input-group mainbox">
49
		     <div class="mui-input-group mainbox">
50
				<div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix" id="ExpecteDuration">
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
    			</div>
53
    			</div>
54
		    </div>
54
		    </div>
55
		    <div class="mui-input-group mainbox">
55
		    <div class="mui-input-group mainbox">
58
				    <span class="rightword" id="yearResult">请选择需求的截止日期</span>
58
				    <span class="rightword" id="yearResult">请选择需求的截止日期</span>
59
    			</div>
59
    			</div>
60
		    </div>
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
		   <div class="mui-input-group mainbox">
67
		   <div class="mui-input-group mainbox">
62
		   		<div class="infocontit infocontitM">联系电话<span class="requiredThis"> *</span></div>
68
		   		<div class="infocontit infocontitM">联系电话<span class="requiredThis"> *</span></div>
63
				<div class="infocon">
69
				<div class="infocon">

+ 9 - 9
app/html/demandPublish.html

36
		<div class="mui-content" style="padding-top:34px;">
36
		<div class="mui-content" style="padding-top:34px;">
37
			<div class="mui-input-group mainbox">
37
			<div class="mui-input-group mainbox">
38
				<div class="littip-top">只能发布您所在机构的需求<br />您可以使用【修改资料】功能,变更您的所在机构</div>
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
			<div class="mui-input-group mainbox">
40
			<div class="mui-input-group mainbox">
47
				<div class="infocontit infocontitM">需求主题<span class="requiredThis"> *</span></div>
41
				<div class="infocontit infocontitM">需求主题<span class="requiredThis"> *</span></div>
48
				<div class="infocon">
42
				<div class="infocon">
72
		    </div>
66
		    </div>
73
		     <div class="mui-input-group mainbox">
67
		     <div class="mui-input-group mainbox">
74
				<div class="infocontit infocontitM OnetitM mui-navigate-right mui-clearfix" id="ExpecteDuration">
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
    			</div>
71
    			</div>
78
		    </div>
72
		    </div>
79
		    <div class="mui-input-group mainbox">
73
		    <div class="mui-input-group mainbox">
82
				    <span class="rightword" id="yearResult">请选择需求的截止日期</span>
76
				    <span class="rightword" id="yearResult">请选择需求的截止日期</span>
83
    			</div>
77
    			</div>
84
		    </div>
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
		   <div class="mui-input-group mainbox">
85
		   <div class="mui-input-group mainbox">
86
		   		<div class="infocontit infocontitM">联系电话<span class="requiredThis"> *</span></div>
86
		   		<div class="infocontit infocontitM">联系电话<span class="requiredThis"> *</span></div>
87
				<div class="infocon">
87
				<div class="infocon">

+ 1 - 1
app/html/needShow.html

67
									<p class="h3Font" id="oTime"></p>
67
									<p class="h3Font" id="oTime"></p>
68
								</div>
68
								</div>
69
				            </div>
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
				        </li>
71
				        </li>
72
				    </ul>
72
				    </ul>
73
	    		</div>
73
	    		</div>

+ 12 - 2
app/js/demondModify.js

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

+ 15 - 26
app/js/demondPublish.js

3
 	$.plusReady(function() {
3
 	$.plusReady(function() {
4

4

5
 		var userid = plus.storage.getItem('userid');
5
 		var userid = plus.storage.getItem('userid');
6
 		var oRd="";
7
 		
8
 		/**
6
 		/**
9
 		 * 获取对象属性的值
7
 		 * 获取对象属性的值
10
 		 * 主要用于过滤三级联动中,可能出现的最低级的数据不存在的情况,实际开发中需要注意这一点;
8
 		 * 主要用于过滤三级联动中,可能出现的最低级的数据不存在的情况,实际开发中需要注意这一点;
153
 					if( data.data.province ) {
151
 					if( data.data.province ) {
154
 						document.querySelector("#cityResult").innerHTML = data.data.province + "-" + data.data.address ;
152
 						document.querySelector("#cityResult").innerHTML = data.data.province + "-" + data.data.address ;
155
 						cityResult.setAttribute('city', data.data.address );
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
 					if( data.data.phone ) {
160
 					if( data.data.phone ) {
159
 						document.querySelector("#phone").value = data.data.phone ;
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
 			error: function() {
166
 			error: function() {
187
 			}
168
 			}
188
 		});
169
 		});
189
 	}
170
 	}
171
 	
190
 	/*检查格式是否合格*/
172
 	/*检查格式是否合格*/
191
 	function  checkout() {
173
 	function  checkout() {
192
 		var arr=[];
174
 		var arr=[];
215
 				length : 2
197
 				length : 2
216
 			},
198
 			},
217
 			arr[4] = {
199
 			arr[4] = {
200
 				demand : document.querySelector("#org"),
201
 				fontNum : 50,
202
 				alertTitle : "您所在的企业" ,
203
 				length : 3
204
 			};
205
 			arr[5] = {
218
 				demand : document.querySelector("#phone"),
206
 				demand : document.querySelector("#phone"),
219
 				fontNum : 50,
207
 				fontNum : 50,
220
 				alertTitle : "联系电话" ,
208
 				alertTitle : "联系电话" ,
259
				"invalidDay": btns.getAttribute('flag'),
247
				"invalidDay": btns.getAttribute('flag'),
260
				"contactNum": document.querySelector("#phone").value,
248
				"contactNum": document.querySelector("#phone").value,
261
				"creator": userid,
249
				"creator": userid,
262
				"orgId": oRd
250
				'orgName':document.querySelector("#org").value,
251
				'source' :'ekexiuApp'
263
 			},
252
 			},
264
 			timeout: 10000,
253
 			timeout: 10000,
265
 			async: true,
254
 			async: true,

+ 8 - 60
app/js/index.js

18
		checkVersion();
18
		checkVersion();
19
	}, false)
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
document.getElementById("demandP").addEventListener("tap", function() {
21
document.getElementById("demandP").addEventListener("tap", function() {
81
	var userid = plus.storage.getItem('userid');
22
	var userid = plus.storage.getItem('userid');
82
	if(userid == null) {
23
	if(userid == null) {
86
		})
27
		})
87
		return;
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
document.getElementById("improfessor").addEventListener("tap", function() {
40
document.getElementById("improfessor").addEventListener("tap", function() {

+ 32 - 17
app/js/needShow.js

23
		moreMes();//更多
23
		moreMes();//更多
24
		
24
		
25
		document.getElementById("personAL").addEventListener("tap", function() {//企业详情
25
		document.getElementById("personAL").addEventListener("tap", function() {//企业详情
26
			if(tiaoFlag) {
27
			
26
			var cmpId=this.getAttribute("data-id");
28
			var cmpId=this.getAttribute("data-id");
27
			mui.openWindow({
29
			mui.openWindow({
28
				url: '../html/cmpInforShow.html',
30
				url: '../html/cmpInforShow.html',
35
					cmpId: cmpId
37
					cmpId: cmpId
36
				}
38
				}
37
			});
39
			});
40
				
41
			}
38
		})
42
		})
39
		//收藏
43
		//收藏
40
		var oifCollect=document.getElementById("ifCollect");
44
		var oifCollect=document.getElementById("ifCollect");
132
				"async": false,
136
				"async": false,
133
				"dataType": "json",
137
				"dataType": "json",
134
				"success": function(data) {
138
				"success": function(data) {
139
					console.log(111111111111111111111)
135
					console.log(JSON.stringify(data));
140
					console.log(JSON.stringify(data));
136
					if(data.success) {
141
					if(data.success) {
137
						var ws=plus.webview.currentWebview();
142
						var ws=plus.webview.currentWebview();
148
						
153
						
149
						var strCon="";
154
						var strCon="";
150
						if($da.city){ strCon+='<div class="showTit">所在城市:<span class="showCon">'+$da.city+'</span></div>' }
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
						if($da.cost!=0){ strCon+='<div class="showTit">费用预算:<span class="showCon">'+demandCost[$da.cost]+'</span></div>' }
157
						if($da.cost!=0){ strCon+='<div class="showTit">费用预算:<span class="showCon">'+demandCost[$da.cost]+'</span></div>' }
153
						if($da.invalidDay){ strCon+='<div class="showTit">有效期至:<span class="showCon">'+TimeTr($da.invalidDay)+'</span></div>' }
158
						if($da.invalidDay){ strCon+='<div class="showTit">有效期至:<span class="showCon">'+TimeTr($da.invalidDay)+'</span></div>' }
154
						document.getElementById("demandInfo").innerHTML=strCon;
159
						document.getElementById("demandInfo").innerHTML=strCon;
212
								}
217
								}
213
							}
218
							}
214
						}
219
						}
215
						cmpFun($da.orgId);
220
						cmpFun($da.orgName);
216
						
221
						
217
						orgThis=$da.orgId;
222
						orgThis=$da.orgId;
218
						consuId = $da.creator;
223
						consuId = $da.creator;
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
				"type": "get",
239
				"type": "get",
240
				'data': {
241
					name: par
242
				},
234
				"async": true,
243
				"async": true,
235
				"success": function(data) {
244
				"success": function(data) {
236
					if(data.success && data.data) {
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
				},