Browse Source

发布需求及修改

jack 7 years ago
parent
commit
3904f56beb
3 changed files with 45 additions and 36 deletions
  1. 7 7
      demandModify.html
  2. 16 11
      js/demandModify.js
  3. 22 18
      js/postDemand.js

+ 7 - 7
demandModify.html

@ -44,15 +44,15 @@
44 44
				<div class="contentCon clearfix conBlock">
45 45
					<div class="leftconBox floatL h3Font">
46 46
						<div class="showDetail">
47
							<div class="h1Font" id="demandTitle">Microstructure and superconducting properties of(BaTiO,YO)-doped YBCO films under different firing temperatures</div>
47
							<div class="h1Font" id="demandTitle"></div>
48 48
							<div class="operateBlock bottomShow">
49 49
								<ul class="clearfix">
50
									<li><span id="publishTime">5月8日 18:00</span></li>
51
									<li><span>浏览量</span> <span id="pageView">280</span></li>
50
									<li><span id="publishTime"></span></li>
51
									<li><span>浏览量</span> <span id="pageView"></span></li>
52 52
								</ul>
53 53
							</div>
54 54
							<div class="showMain showMainP" id="demandContent">
55
								<div class="showCon">sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. Proin gravida dolor sit amet lacus accumsan et viverra justo commodo. Proin sodales pulvinar tempor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam fermentum, nulla luctus pharetra vulputate, felis tellus mollis orci, sed rhoncus sapien nunc eget odio.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean euismod bibendum laoreet. </div>
55
								<div class="showCon"></div>
56 56
							</div>
57 57
						</div>
58 58
						<ul class="clearfix postUl">
@ -84,7 +84,7 @@
84 84
							<li class="floatL col-w-6">
85 85
								<p class="demandTit">费用预算</p>
86 86
								<select class="frmcontype" id="spendCost">
87
									<option value="">请选择预算范围</option>
87
									<option value="0" selected="selected">请选择预算范围</option>
88 88
									<option value="1">一万元以内</option>
89 89
									<option value="2">1-5万元</option>
90 90
									<option value="3">5-10万元</option>
@ -97,7 +97,7 @@
97 97
							<li class="floatR col-w-6 postChild">
98 98
								<p class="demandTit">预期时长</p>
99 99
								<select class="frmcontype" id="budget">
100
									<option value="">请选择预期时长</option>
100
									<option value="0">请选择预期时长</option>
101 101
									<option value="1">1个月内</option>
102 102
									<option value="2">1-3个月</option>
103 103
									<option value="3">3-6个月</option>
@ -131,7 +131,7 @@
131 131
						<div class="last_postCenter">
132 132
							<button class="btnModel posted outN" id="modia">保存修改</button>
133 133
							<button class="btnModel posted outN" id="complete">需求已完成</button>
134
							<span class="lastDemand" id="closeDemand">关闭该需求</span>
134
							<span class="lastDemand" id="closeDemand" style="cursor:pointer;">关闭该需求</span>
135 135
						</div>
136 136
					</div>
137 137
					<div class="rightconBox floatR">

+ 16 - 11
js/demandModify.js

@ -1,5 +1,8 @@
1 1
$(document).ready(function() {
2
	loginStatus(); //判断个人是否登录
3
	valUser();
2 4
	var userid = $.cookie("userid");
5
	personMess()
3 6
	var demandId = GetQueryString("demandId");
4 7
	var a = new Date();
5 8
	var c = a.getFullYear() + "-" + (Number(a.getMonth()) + 1) + "-" + (Number(a.getDate()) + 1);
@ -23,6 +26,7 @@ $(document).ready(function() {
23 26
			$(this).siblings().find("span").hide();
24 27
		}
25 28
	})
29
	queryOnedemand()
26 30

27 31
	function queryOnedemand() {
28 32
		$.ajax({
@ -38,14 +42,14 @@ $(document).ready(function() {
38 42
				if(data.success) {
39 43
					var $data = data.data;
40 44
					$("#demandTitle").text($data.title);
41
					$("#publishTime").text(commenTime(createTime));
45
					$("#publishTime").text(commenTime($data.createTime));
42 46
					$("#pageView").text($data.pageViews);
43 47
					$("#demandContent").text($data.descp);
44 48
					$("#oprovince").text($data.province);
45 49
					$("#ocity").text($data.city);
46 50
					$("#spendCost").val($data.cost);
47 51
					$("#budget").val($data.duration);
48
					$("#createTime").val(changeTime($data.createTime));
52
					$("#createTime").val(changeTime($data.invalidDay));
49 53
					$("#phone").val($data.contactNum);
50 54
				}
51 55
			},
@ -77,7 +81,7 @@ $(document).ready(function() {
77 81
			$.MsgBox.Alert('提示', '请选择需求有效期');
78 82
			return;
79 83
		} else {
80
			if(formatDate(c) > $("#createTime").val()) {
84
			if(formatDate(a) > $("#createTime").val()) {
81 85
				$.MsgBox.Alert('提示', '该需求已过期,请修改有效期,若已解决请点击「需求已完成」按钮');
82 86
				return;
83 87
			}
@ -108,8 +112,8 @@ $(document).ready(function() {
108 112
			"url": "/ajax/demand/over",
109 113
			"type": "POST",
110 114
			"data": {
111
				"id": userid,
112
				"uid": demandId
115
				"id": demandId,
116
				"uid": userid
113 117
			},
114 118
			"contentType": "application/x-www-form-urlencoded",
115 119
			"traditional": true,
@ -130,8 +134,8 @@ $(document).ready(function() {
130 134
			"url": "/ajax/demand/close",
131 135
			"type": "POST",
132 136
			"data": {
133
				"id": userid,
134
				"uid": demandId
137
				"id": demandId,
138
				"uid": userid
135 139
			},
136 140
			"contentType": "application/x-www-form-urlencoded",
137 141
			"traditional": true,
@ -159,11 +163,12 @@ $(document).ready(function() {
159 163
			"data": {
160 164
				"province": $("#oprovince").text(),
161 165
				"city": $("#ocity").text(),
162
				"cost": $("#spendCost").val(),
163
				"duration": $("#budget").val(),
166
				"cost": $("#spendCost").val() != "0" ? $("#spendCost").val() : "",
167
				"duration": $("#budget").val() != "0" ? $("#budget").val() : "",
164 168
				"invalidDay": st6($("#createTime").val()),
165 169
				"contactNum": $("#phone").val(),
166 170
				"modifier": userid,
171
				"id": demandId
167 172
			},
168 173
			"contentType": "application/x-www-form-urlencoded",
169 174
			"traditional": true,
@ -194,7 +199,7 @@ $(document).ready(function() {
194 199
						} else {
195 200
							$("#Qname").text($data.name)
196 201
						}
197
						$("#Qname").attr("href", "cmpInforShow.html?orgId=" + $data.id);
202
						$("#Qname,.qiyego").attr("href", "cmpInforShow.html?orgId=" + $data.id);
198 203
						if($data.authStatus == 3) {
199 204
							$("#QauthFlag").addClass("authicon-com-ok").attr("title", "科袖认证企业");
200 205
						}
@ -232,7 +237,7 @@ $(document).ready(function() {
232 237
					}
233 238
					var oT = ($data.title) ? $data.title : ($data.office ? $data.office : "");
234 239
					$("#brief").text(oT);
235
					queryOrg(orgId);
240
					queryOrg($data.orgId);
236 241
				}
237 242
			},
238 243
			"error": function() {

+ 22 - 18
js/postDemand.js

@ -1,6 +1,8 @@
1 1
$(document).ready(function() {
2
	loginStatus(); //判断个人是否登录
3
	valUser();
2 4
	var userid = $.cookie("userid");
3
	var orgId="";
5
	var orgId = "";
4 6
	$("body").on("click", function(event) {
5 7
		var event = event ? event : window.event;
6 8
		var obj = event.srcElement ? event.srcElement : event.target;
@ -130,7 +132,7 @@ $(document).ready(function() {
130 132
			"dataType": "json",
131 133
			"success": function(data) {
132 134
				if(data.success) {
133
					location.href="myDemand.html";
135
					location.href = "myDemand.html";
134 136
				}
135 137
			},
136 138
			"error": function() {
@ -141,29 +143,29 @@ $(document).ready(function() {
141 143
	/*查询企业信息*/
142 144
	function queryOrg() {
143 145
		$.ajax({
144
			"url": "/ajax/org/"+orgId,
146
			"url": "/ajax/org/" + orgId,
145 147
			"type": "GET",
146 148
			"traditional": true,
147 149
			"dataType": "json",
148 150
			"success": function(data) {
149 151
				if(data.success) {
150
					var $data=data.data;
151
					if($data.isJoin==1) {
152
					var $data = data.data;
153
					if($data.isJoin == 1) {
152 154
						if($data.forShort) {
153 155
							$("#Qname").text($data.forShort)
154
						}else{
156
						} else {
155 157
							$("#Qname").text($data.name)
156 158
						}
157
						$("#Qname").attr("href","cmpInforShow.html?orgId="+$data.id);
158
						if($data.authStatus==3) {
159
							$("#QauthFlag").addClass("authicon-com-ok").attr("title","科袖认证企业");
159
						$("#Qname,.qiyego").attr("href", "cmpInforShow.html?orgId=" + $data.id);
160
						if($data.authStatus == 3) {
161
							$("#QauthFlag").addClass("authicon-com-ok").attr("title", "科袖认证企业");
160 162
						}
161 163
						if($data.hasOrgLogo) {
162
							$("#companyImg").attr("src","/images/org/"+$data.id+".jpg");
163
						}else{
164
							$("#companyImg").attr("src", "/images/org/" + $data.id + ".jpg");
165
						} else {
164 166
							$("#companyImg").attr("src", "/images/default-icon.jpg");
165 167
						}
166
					}else{
168
					} else {
167 169
						$("#Qname").text($data.name);
168 170
						$("#companyImg").attr("src", "/images/default-icon.jpg");
169 171
					}
@ -174,24 +176,26 @@ $(document).ready(function() {
174 176
			}
175 177
		});
176 178
	}
179
	personMess()
180

177 181
	function personMess() {
178 182
		$.ajax({
179
			"url": "/ajax/professor/baseInfo/"+userid,
183
			"url": "/ajax/professor/baseInfo/" + userid,
180 184
			"type": "GET",
181 185
			"traditional": true,
182 186
			"dataType": "json",
183 187
			"success": function(data) {
184 188
				if(data.success) {
185
					var $data=data.data;
189
					var $data = data.data;
186 190
					var userType = autho($data.authType, $data.orgAuth, $data.authStatus);
187 191
					$("#auth").attr("title", userType.title).addClass(userType.sty);
188 192
					$("#proName").text($data.name);
189 193
					if($data.hasHeadImage) {
190
								$("#proImg").attr("style", "background-image: url(/images/head/" + $data.id + "_l.jpg);");
191
						}
192
					var oT=($data.title)?$data.title:($data.office?$data.office:"");
194
						$("#proImg").attr("style", "background-image: url(/images/head/" + $data.id + "_l.jpg);");
195
					}
196
					var oT = ($data.title) ? $data.title : ($data.office ? $data.office : "");
193 197
					$("#brief").text(oT);
194
					orgId=$data.orgId;
198
					orgId = $data.orgId;
195 199
					queryOrg();
196 200
				}
197 201
			},