Enford 5 years atrás
parent
commit
153cd83118

+ 19 - 1
src/main/java/com/jeeplus/modules/wexintheorder/web/TheOrderController.java

@@ -29,7 +29,25 @@ public class TheOrderController extends BaseController {
     @Autowired
     private TheLeadershipService theLeadershipService;
 
-
+    @RequestMapping(value = "orderFromTest")
+    public String getOrderForm(Model model){
+        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
+        String userId = "XuShuai";
+        //回显
+        TheOrder userOrderEcho = getUserOrderEcho(userId);
+        //验证今天是否预定过餐
+        //获取工作日 -- 第二天
+        String addOrMinusDayString = OrderUtils.getAddOrMinusDayString(1, dateFormat);
+        //验证是否存在订单  --true未为存在
+        boolean planOrder = getPlanOrder(userId, addOrMinusDayString);
+        if (planOrder){
+            userOrderEcho.setExits("0");//已经选择过了
+        }else {
+            userOrderEcho.setExits("1");//未预定
+        }
+        model.addAttribute("theOrder",userOrderEcho);
+        return "modules/weixin/theorder/orderMeal";//返回一个界面
+    }
     //页面显示
     @RequestMapping(value = "orderFrom")
     public String getOrderFrom(Model model, HttpServletRequest request,@RequestParam String code){

+ 6 - 15
src/main/webapp/static/wechat/wechat-btn.css

@@ -2,48 +2,44 @@
 			color: #d9eef7;
 			border: solid 1px #0076a3;
 			background: #0095cd;
-			height: 20px;
 			background: -webkit-gradient(linear, left top, left bottom, from(#00adee), to(#0078a5));
 			background: -moz-linear-gradient(top,  #00adee,  #0078a5);
 			filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');
 		}
 		.blue:hover {
 			background: #007ead;
-			height: 20px;
 			background: -webkit-gradient(linear, left top, left bottom, from(#0095cc), to(#00678e));
 			background: -moz-linear-gradient(top,  #0095cc,  #00678e);
 			filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#0095cc', endColorstr='#00678e');
 		}
 		.blue:active {
 			color: #80bed6;
-			height: 20px;
 			background: -webkit-gradient(linear, left top, left bottom, from(#0078a5), to(#00adee));
 			background: -moz-linear-gradient(top,  #0078a5,  #00adee);
 			filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#0078a5', endColorstr='#00adee');
 		}
-		.button {
+		.button-2 {
 			display: inline-block;
 			outline: none;
 			cursor: pointer;
 			text-align: center;
-			height: 20px;
 			text-decoration: none;
+			height: 150px;
+			width:150px;
 			font: 11px/100% 'Microsoft yahei',Arial, Helvetica, sans-serif;
 			padding: .5em 2em .55em;
 			text-shadow: 0 1px 1px rgba(0,0,0,.3);
-			-webkit-border-radius: .5em; 
+			-webkit-border-radius: .5em;
 			-moz-border-radius: .5em;
 			border-radius: 50%;
 			-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
 			-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
 			box-shadow: 0 1px 2px rgba(0,0,0,.2);
 		}
-		.button:hover {
+		.button-2:hover {
 			text-decoration: none;
-			height: 20px;
 		}
-		.button:active {
-			height: 20px;
+		.button-2:active {
 			position: relative;
 			top: 1px;
 		}
@@ -56,8 +52,3 @@
 
 
 
-
-
-
-
-

+ 47 - 11
src/main/webapp/webpage/modules/weixin/theorder/orderMeal.jsp

@@ -16,9 +16,24 @@
     <link rel="stylesheet" href="/static/wechat/wechat-btn.css"/>
 </head>
 <style>
-
+    .bottem_div{
+        position: fixed;
+        bottom: 10px;
+        width: 100%;
+        margin: auto;
+        text-align: center;
+        font-size: 12px;
+        color: #333;
+    }
+    .btn_span_list{
+        height: 20px;
+        line-height: 20px;
+    }
 </style>
 <body>
+    <div style="text-align: center;padding: 10px;">
+        江苏兴光临时订餐系统
+    </div>
     <%--<div class="weui-cells weui-cells_form">--%>
         <form id="subForm" method="post">
             <div class="weui-cell">
@@ -78,18 +93,27 @@
         </form>
         <div class="weui-cell">
         </div>
-        <div style="height: 10px"></div>
     <%--</div>--%>
-    <div class="" style="text-align: center">
-        <div class="weui-cells__title"><h4>预订餐</h4></div>
-        <div class="weui-cells__tips">请预定工作日的用餐,0-16点可以预订</div>
-        <c:if test="${theOrder.exits == '1'}">
-            <button class="button blue" id="buttonPlan" onclick="plan()"><span id="plan">预订餐</span><br><span id="spantime"></span></button>
-        </c:if>
-        <c:if test="${theOrder.exits == '0'}">
-            <button class="button blue" id="buttonPlan" style="background:#999999;height: 7em;width: 7em" disabled><span>已预定</span></button>
-        </c:if>
+    <div class="" style="text-align: center;">
+        <div class="weui-cells__title"><h4>预定<span id="currentDate"></span>订工作餐</h4></div>
+                <c:if test="${theOrder.exits == '1'}">
+                    <div class="button-2 blue" id="buttonPlan" onclick="plan()">
+                        <div style="line-height: 150px;height:150px;padding-top: 55px">
+                            <span class="btn_span_list" id="plan">预订餐</span><br><span class="btn_span_list" id="spantime"></span>
+                        </div>
+                    </div>
+                        </c:if>
+                <c:if test="${theOrder.exits == '0'}">
+                    <div class="button-2 blue" id="buttonPlan" style="background:#999999;" disabled>
+                        <div style="line-height: 150px;height:150px;padding-top: 55px">
+                            <span class="btn_span_list">已订餐</span>
+                        </div>
+                    </div>
+                </c:if>
+            </div>
+        <div class="weui-cells__tips"style="width: 100%;text-align: center">请在0:00-16:00前预订第二天的用餐</div>
     </div>
+    <div class="bottem_div">兴光信息技术支持</div>
 </body>
 <script type="text/javascript">
     var d=new Date();
@@ -123,6 +147,8 @@
     timer = setInterval("CountDown()", 1000);
 </script>
 <script>
+    var currDate = GetDate();
+    $("#currentDate").html(currDate);
 //订餐方法
     function plan() {
         changeStatus();
@@ -219,5 +245,15 @@
             $("#specific").val("");
         }
     }
+    //获取年月日
+    function GetDate(){
+        var currDate = new Date();
+        var now = new Date();
+        now.setTime(currDate.getTime()+24*60*60*1000)
+        var year = now.getFullYear();         //年
+        var month = now.getMonth() + 1;     //月
+        var day = now.getDate();              //日
+        return year+"年"+month+"月"+day+"日";
+    }
 </script>
 </html>