Parcourir la source

侧拉菜单完成部分

U102328 il y a 7 ans
Parent
commit
afe0f1cf70
4 fichiers modifiés avec 129 ajouts et 14 suppressions
  1. 29 0
      index.php
  2. 20 11
      userWeb/UI/control.html
  3. 25 2
      userWeb/UI/css/control.css
  4. 55 1
      userWeb/UI/js/control.js

+ 29 - 0
index.php

@@ -0,0 +1,29 @@
+<?php
+
+$date = date('Ym');
+$arr = array();
+$arr[] = $date;
+for($i=1;$i<6;$i++){
+    $arr[] = date("Ym",strtotime("$date - $i month "));
+}
+var_dump($arr[0]);
+echo "<br />";
+var_dump($arr[1]);
+echo "<br />";
+var_dump($arr[2]);
+echo "<br />";
+var_dump($arr[3]);
+echo "<br />";
+var_dump($arr[4]);
+echo "<br />";
+var_dump($arr[5]);
+echo "<br />";
+echo "<br />";
+echo "<br />";
+echo "<br />";
+echo "<br />";
+echo "<br />";
+echo "<br />";
+echo "<br />";
+var_dump($date );
+?>

+ 20 - 11
userWeb/UI/control.html

@@ -47,17 +47,26 @@
 			<p class="shut">&times;</p>
 			<div>
 				<div class="one">
-					<div class="lang">
-						<p class="tit">Language</p>
-						<p>en</p>
-						<p>cn</p>
-					</div>
-					<div class="money">
-						<p class="tit">Currencies</p>
-						<p>USD</p>
-						<p>EUR</p>
-						<p>Chinese Yuan</p>
-					</div>
+					<table>
+						<tbody>
+							<tr class="tit">
+								<th>Language</th>
+								<th>Currencies</th>
+							</tr>
+							<tr>
+								<td class="lan_en">English</td>
+								<td class="money">USD</td>
+							</tr>
+							<tr>
+								<td class="lan_cn">中文</td>
+								<td class="money">EUR</td>
+							</tr>
+							<tr>
+								<td></td>
+								<td class="money">Chinese Yuan</td>
+							</tr>
+						</tbody>
+					</table>
 				</div>
 				<div class="contact">
 					<p class="tit">Contact Us</p>

+ 25 - 2
userWeb/UI/css/control.css

@@ -242,19 +242,42 @@
     text-align:right;
 }
 #control_menu .main{
-    width: 29%;
+    width: 27%;
     height: 100%;
     display: inline-block;
     background-color: #fff;
 }
 #control_menu .shut{
     text-align: left;
-    margin: 4rem 0 0 2rem;
+    margin: 4rem 88.5% 42px 2rem;
     font-size: 50px;
     color: #D1D5DA;
     line-height: 28px;
     font-weight: 300;
 }
+#control_menu .one{
+    text-align: left;
+    width: 90%;
+    margin: auto 5%;
+    height: 168px;
+}
+#control_menu .one table{
+    width: 100%;
+}
+#control_menu .one th{
+    width: 50%;
+    padding-bottom: 35px;
+    font-size: 16px;
+}
+#control_menu .one td{
+    width: 50%;
+    padding-bottom: 19px;
+    font-size: 14px;
+    cursor: pointer;
+}
+.in{
+    color: #007AFF;
+}
 
 /*页脚*/
 #uiLayer>footer{

+ 55 - 1
userWeb/UI/js/control.js

@@ -59,6 +59,60 @@ function controlF(){
 	//菜单侧拉按钮
 	$("#control header .menu")[0].onclick=function(){
 		$("#control_menu").css('display', 'block');
-		console.log("菜单侧拉按钮")
+
+		// 语言---------------------------------------------
+		var lanM = GetQueryString(languageMark);
+		var en = $("#control_menu .one td.lan_en");
+		var cn = $("#control_menu .one td.lan_cn");
+		if (lanM==null) {
+			en.addClass('in');
+			Lanclick()
+		}else if (lanM==1) {
+			cn.addClass('in');
+			Lanclick(1)
+		}
+		function Lanclick(inde){
+			en[0].onclick = function(){
+				if (inde==1)return;
+				var url = window.location.href;
+
+				if (url.indexOf("?")>0) {
+					var url = url+"&languageMark=0"
+				}else{
+					var url = url+"?languageMark=0"
+				}
+				window.location.href=url; 
+			}
+			cn[0].onclick = function(){
+				if (inde==1)return;
+				var url = window.location.href;
+				if (url.indexOf("?")>0) {
+					var url = url+"&languageMark=1"
+				}else{
+					var url = url+"?languageMark=1"
+
+				}
+				window.location.href=url; 
+			}
+		}
+
+		// 语言---------------------------------------------end
+
+		// 货币---------------------------------------------
+		var tdArr = $("#control_menu .one td.money");
+		for (var i = 0; i < tdArr.length; i++) {
+			// 闭包特性循环绑定
+			(function(){
+				var p = i;
+				tdArr[i].onclick=function(){
+					tdArr.not( $(tdArr[p]) ).removeClass('in');
+					$(tdArr[p]).toggleClass('in');
+				}
+			})();
+		}
+		// 货币---------------------------------------------end
+		$("#control_menu .shut")[0].onclick=function() {
+			$("#control_menu").css('display', 'none');
+		}
 	}
 }