Enford 5 anos atrás
pai
commit
bcee38bbde

+ 12 - 6
src/main/java/com/jeeplus/modules/wexintheorder/web/TheOrderController.java

@@ -88,6 +88,12 @@ public class TheOrderController extends BaseController {
                 }else {
                     userOrderEcho.setExits("1");//未预定
                 }
+                boolean isforDate = OrderUtils.isforDate();
+                if (isforDate){
+                    userOrderEcho.setDateStart("0");//未预定
+                }else {
+                    userOrderEcho.setDateStart("1");//以预定
+                }
                 model.addAttribute("theOrder",userOrderEcho);
                 return "modules/weixin/theorder/orderMeal";//返回一个界面
             }
@@ -136,12 +142,12 @@ public class TheOrderController extends BaseController {
         DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
         Date date = new Date();//当前时间
         try {
-            boolean isforDate = OrderUtils.isforDate();
-            if (isforDate){
-                ajaxJson.setSuccess(false);
-                ajaxJson.setMsg("超出预订时间!");
-                return ajaxJson;
-            }
+//            boolean isforDate = OrderUtils.isforDate();
+//            if (isforDate){
+//                ajaxJson.setSuccess(false);
+//                ajaxJson.setMsg("超出预订时间!");
+//                return ajaxJson;
+//            }
             //获取工作日 -- 第二天
             String addOrMinusDayString = OrderUtils.getAddOrMinusDayString(1, dateFormat);
             //验证是否存在订单  --true未为存在

+ 18 - 9
src/main/webapp/webpage/modules/weixin/theorder/orderMeal.jsp

@@ -127,12 +127,21 @@
         <div class="" style="text-align: center;border-radius: 50%;">
             <div class="weui-cells__title"><h4 style="font-weight: 100;">预订<span id="currentDate" style="color:#666;"></span>工作餐</h4></div>
                     <c:if test="${theOrder.exits == '1'}">
-                        <div class="button-2 blue" id="buttonPlan" onclick="plan()">
-                            <div class="btn_div_list" id="inDate" style="line-height: 90px;height:90px;padding-top: 55px;">
-                                <span class="btn_span_list" id="plan">预订</span><br><span class="btn_span_list" id="spantime"></span>
+                        <c:if test="${theOrder.dateStart == '1'}">
+                            <div class="button-2 blue" id="buttonPlan" onclick="plan()">
+                                <div class="btn_div_list" id="inDate" style="line-height: 90px;height:90px;padding-top: 55px;">
+                                    <span class="btn_span_list" id="plan">预订</span><br><span class="btn_span_list" id="spantime"></span>
+                                </div>
                             </div>
-                        </div>
-                            </c:if>
+                        </c:if>
+                        <c:if test="${theOrder.dateStart == '0'}">
+                            <div class="button-2 blue notclick" id="buttonPlanNo" style="background:#dcdbdb;">
+                                <div style="line-height: 130px;height:130px;padding-top: 65px">
+                                    <span class="btn_span_list" style="color: #0b61a4">未订餐</span>
+                                </div>
+                            </div>
+                        </c:if>
+                    </c:if>
                     <c:if test="${theOrder.exits == '0'}">
                         <div class="button-2 blue notclick" id="buttonPlan" style="background:#dcdbdb;">
                             <div style="line-height: 130px;height:130px;padding-top: 65px">
@@ -170,10 +179,10 @@
             --maxtime;
         } else{
             clearInterval(timer);
-            $("#plan").text("未预订");
-            $("#plan").attr("style","color: #0b61a4");
-            $("#inDate").attr("style","padding-top: 65px");
-            changeStatus();
+            // $("#plan").text("未预订");
+            // $("#plan").attr("style","color: #0b61a4");
+            // $("#inDate").attr("style","padding-top: 65px");
+            // changeStatus();
             $.toast("订餐时间已结束!", "text");
         }
     }