Преглед на файлове

postproject.html Discipline 改为下拉框,保存时单独获取值

chenwen преди 3 години
родител
ревизия
305b9e7ef5
променени са 4 файла, в които са добавени 51 реда и са изтрити 44 реда
  1. 27 1
      assets/js/company-postproject.js
  2. 1 0
      assets/plugin/bootstrap-select/js/bootstrap-select.js
  3. 19 33
      html/company/postproject.html
  4. 4 10
      html/company/register.html

+ 27 - 1
assets/js/company-postproject.js

@@ -244,6 +244,8 @@ $(function(){
 				var key = $(this).attr("name")
 				postmoment[key] = $(this).val()
 			})
+			
+			postmoment['Discipline']=$("#Discipline").val();  //Discipline 改为下拉框后单独取值
 		
 			
 			$(".imginput").each(function(){
@@ -255,6 +257,30 @@ $(function(){
 			window.localStorage.setItem("postproject",JSON.stringify(postmoment))
 			
 		}
+	
+	initDisciplinesSelect();
 		
 	//页面初始化end
-})
+})
+
+function initDisciplinesSelect(){
+	
+	var opts = [" Masterplanning"," Architecture"," Interiors", "Lighting"," Landscape"," AV & Acoustics"," MEP"," Art work & Accessories"," Graphics & Signage"," Branding"," Furniture, Lighting"];
+	$("#selectDisciplines").empty();
+	let html=[];
+	opts.forEach(function(item) {
+		html.push(`<option>${item}</option>`);
+	})
+	$("#selectDisciplines").append(html.join(""));
+	
+	$('#selectDisciplines').selectpicker({
+		template: {
+			caret: '<span class="sel-icon glyphicon glyphicon-menu-down"></span>'
+		}
+	});
+	$('#selectDisciplines').on('changed.bs.select', function (e, clickedIndex, isSelected, prestate,currentVal) {
+	   console.log(currentVal);
+	   $("#Discipline").val(currentVal);
+	});
+
+}

+ 1 - 0
assets/plugin/bootstrap-select/js/bootstrap-select.js

@@ -2089,6 +2089,7 @@
       this.$element.on({
         'change': function () {
           that.render();
+		  changed_arguments.push(that.$element.val());
           that.$element.trigger('changed.bs.select', changed_arguments);
           changed_arguments = null;
         },

+ 19 - 33
html/company/postproject.html

@@ -11,6 +11,7 @@
 
 		<link rel="stylesheet" href="../../css/head.css">
 		<script src="../../assets/js/company-postproject.js"></script>
+		<link rel="stylesheet" type="text/css" href="../../assets/plugin/bootstrap-select/css/bootstrap-select.css"/>
 		<link rel="stylesheet" type="text/css" href="../../assets/plugin/zeroModal/css/zeroModal.css">
 		<link rel="stylesheet" type="text/css" href="../../assets/plugin/zeroModal/css/normalize.css" />
 
@@ -85,6 +86,13 @@
 							width: 20%;
 							height: 48px;
 						}
+						
+						.bootstrap-select > .dropdown-toggle {
+							padding-top:10px;
+							padding-bottom: 10px;
+							padding-right: 32px;
+						}
+						
 					</style>
 					<div class="row-fluid">
 						<div class="span12">
@@ -161,7 +169,10 @@
 											Disciplines
 										</dt>
 										<dd>
-											<input type="text" required name="Discipline" class="i18n-placeholder" i18n="company_postproject_Choose one discipline" placeholder="" />
+											<input type="hidden" name="Discipline" id="Discipline">
+											<select id="selectDisciplines" class="selectpicker" multiple data-width="100%">
+											 
+											</select>
 										</dd>
 										
 									</div>
@@ -196,41 +207,16 @@
 										
 										<div class="span7">
 											<div class="span4">
-												<!-- <div class="btn-group">
-													<button class="btn"><span class="showqu1">🇨🇳  China</span></button> <button data-toggle="dropdown"
-														class="btn dropdown-toggle"><span class="caret"></span></button>
-													<ul class="dropdown-menu showlistLocation1" >
-														 
-														 
-													</ul>
-												</div> -->
-												<!-- <select class="showlistLocation1 form-control" >
-													
-												</select> -->
-												<input type="text"  name="Country" class="i18n-placeholder" i18n="company_postproject_Country" placeholder="Country …" />
+												
+												<input type="text"  name="Country" class="i18n-placeholder showlistLocation1" i18n="company_postproject_Country" placeholder="Country …" />
 											</div>
 											<div class="span4">
 												
-												<!-- <select class="showlistLocation2 form-control"  >
-													
-												</select> -->
-												<input type="text"  name="Province" class="i18n-placeholder" i18n="company_postproject_Province" placeholder="Province …" />
+												<input type="text"  name="Province" class="i18n-placeholder showlistLocation2" i18n="company_postproject_Province" placeholder="Province …" />
 											</div>
 											<div class="span4">
-											<!-- 	<div class="btn-group">
-								
-													<button class="btn" style="width: 80%;"><span class="showqu3">city</span></button> <button style="width: 20%;"
-														data-toggle="dropdown" class="btn dropdown-toggle"><span
-															class="caret"></span></button>
-													<ul class="dropdown-menu showlistLocation3">
-													 
-														
-													</ul>
-												</div> -->
-												<!-- <select class="showlistLocation3 form-control"  >
-													
-												</select> -->
-												<input type="text"  name="City" class="i18n-placeholder" i18n="company_postproject_City" placeholder="City..." />
+											
+												<input type="text"  name="City" class="i18n-placeholder showlistLocation3" i18n="company_postproject_City" placeholder="City..." />
 											</div>
 										</div>
 										<div class="span5"> <input type="text"  name="Avenue" class="i18n-placeholder" i18n="company_postproject_Avenue" placeholder="Avenue …" />
@@ -296,8 +282,8 @@
 		</main>
 		<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
 			<script src="../../js/ie10-viewport-bug-workaround.js"></script>
-			
+			<script src="../../js/bootstrap.min.js"></script>
 			<script src="../../assets/plugin/zeroModal/js/zeroModal.js"></script>
-		
+			<script src="../../assets/plugin/bootstrap-select/js/bootstrap-select.js"></script>
 	</body>
 </html>

+ 4 - 10
html/company/register.html

@@ -237,24 +237,18 @@
 						<div class="span7">
 							<div class="span4">
 								 
-								<select class="showlistLocation1 form-control" >
-									
-								</select>
+								<input type="text"  name="Country" class="i18n-placeholder" i18n="company_postproject_Country" placeholder="Country …" />
 							</div>
 							<div class="span4">
 								
-								<select class="showlistLocation2 form-control"  >
-									
-								</select>
+								<input type="text"  name="Province" class="i18n-placeholder" i18n="company_postproject_Province" placeholder="Province …" />
 							</div>
 							<div class="span4">
 							 
-								<select class="showlistLocation3 form-control"  >
-									
-								</select>
+								<input type="text"  name="City" class="i18n-placeholder" i18n="company_postproject_City" placeholder="City..." />
 							</div>
 						</div>
-						<div class="span5"> <input type="text"  name="Avenue" required class="i18n-placeholder" i18n="company_register_Avenue …" placeholder="Avenue …" />
+						<div class="span5"> <input type="text"  name="Avenue"  class="i18n-placeholder" i18n="company_register_Avenue …" placeholder="Avenue …" />
 						</div>
 						</div>
 					</dd>