| <!DOCTYPE HTML> | 
| <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> | 
| <head> | 
| <meta charset="utf-8"> | 
| <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> | 
| <meta name="renderer" content="webkit|ie-comp|ie-stand"> | 
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | 
| <meta name="viewport" | 
|     content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> | 
| <meta http-equiv="Cache-Control" content="no-siteapp" /> | 
| <!-- 本框架基本脚本和样式 --> | 
| <script type="text/javascript" | 
|     th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> | 
| <script type="text/javascript" | 
|     th:src="@{/js/systools/MBase.js}"></script> | 
| </head> | 
| <body class="container-fluid"> | 
| <div class="pd-10"> | 
|     <!-- 搜索框部分start --> | 
|             <div class="row form-head"> | 
|                 <form class="form-inline" id="serchform"> | 
|                     <div class="input-group"> | 
| <!--                        <div class="btn-group search-list " data-for="search-text">--> | 
| <!--                            <button type="button"--> | 
| <!--                                class="btn btn-default dropdown-toggle searchlist"--> | 
| <!--                                data-toggle="dropdown">--> | 
| <!--                                用户姓名 <span class="caret "></span>--> | 
| <!--                            </button>--> | 
| <!--                            <ul class="dropdown-menu" role="menu">--> | 
| <!--                                <li data-field="suName"><a>用户姓名</a></li>--> | 
| <!--                                <li data-field="suAccount"><a>账号 </a></li>--> | 
| <!--                            </ul>--> | 
| <!--                        </div>--> | 
|                         <div class="form-group mr-20 ml-20"> | 
|                             <input id="search-text" name="actName" placeholder="输入活动名称" | 
|                                 type="text" class="form-control"> | 
|                         </div> | 
|                         <div class="form-group mr-20"> | 
|                             <label>时间</label> | 
|                             <input autocomplete="off"   name="beginTime" type="text" class="form-control datetimepicker" id="beginTime">- | 
|                             <input autocomplete="off"   name="endTime"  type="text" class="form-control datetimepicker" id="endTime"> | 
|                         </div> | 
|   | 
|                         <div class="form-group mr-20"> | 
|                             <label>活动类型</label> | 
|                             <select class="form-control autoFull select2" name="actType"> | 
|                                 <option value=''>请选择</option> | 
|                                 <option value=1>拼团</option> | 
|                                 <option value=2>秒杀</option> | 
|                                 <option value=3>沙龙</option> | 
|                             </select> | 
|                         </div> | 
|                         <div class="form-group mr-20"> | 
|                             <label>状态</label> | 
|                             <select class="form-control autoFull select2" name="actStatus"> | 
|                                 <option value=''>请选择</option> | 
|                                 <option value=1>打开</option> | 
|                                 <option value=2>关闭</option> | 
|                             </select> | 
|                         </div> | 
|                         <div class="form-group"> | 
|                             <button onclick="myGrid.serchData(1)" type="button" | 
|                                 class="btn btn-info"> | 
|                                 <i class="fa fa-search "></i> 搜索 | 
|                             </button> | 
|                             <button type="reset" class="btn btn-info "> | 
|                                 <i class="fa fa-refresh "></i> 重置 | 
|                             </button> | 
|                         </div> | 
|                     </div> | 
|                 </form> | 
|             </div> | 
|                  | 
|     <div class="row mt-10" > | 
|         <div id="option-bar"> | 
|             <!-- 功能按钮部分 --> | 
|             <button  matrix:btn="activities-pt" onclick="openAdd(1)" type="button" class="btn btn-info btn-sm"><i class="fa fa-add" ></i>新建拼团</button> | 
|             <button matrix:btn="activities-ms" onclick="openSecKill()" type="button" class="btn btn-info btn-sm"><i class="fa fa-add" ></i>新建秒杀</button> | 
|             <button matrix:btn="activities-sl" onclick="openSalon()" type="button" class="btn btn-info btn-sm"><i class="fa fa-add" ></i>新建沙龙</button> | 
|   | 
|         </div> | 
|         <table id="mgrid"> | 
|             <thead> | 
|                 <tr> | 
|                     <th data-checkbox="true"></th> | 
|                     <th data-formatter="MGrid.indexfn" data-align="center"  data-width="30px" >序号</th> | 
|                     <th data-field="id" data-align="center" data-formatter="buidOperate">操作</th> | 
|                     <th data-field="actType" data-align="center" data-formatter="formatterType">活动类型</th> | 
|                     <th data-field="actName" data-align="center">活动名称</th> | 
|                     <th data-field="actStatus" data-align="center" data-formatter="formatterActStatus">状态</th> | 
|                     <th data-field="actBeginTime" data-formatter="MGrid.getTime" data-align="center">开始时间</th> | 
|                     <th data-field="actEndTime" data-formatter="MGrid.getTime" data-align="center">结束时间</th> | 
|                     <th data-field="createBy" data-align="center">创建人</th> | 
|                 </tr> | 
|             </thead> | 
|         </table> | 
|     </div> | 
| </div> | 
| <script type="text/javascript" | 
|     th:src="@{/js/systools/MJsBase.js}"></script> | 
|     <script type="text/javascript"> | 
|          var myGrid; | 
|         $(function(){ | 
|             MTools.ininDatetimepicker(".datetimepicker"); | 
|             var delUrl=""; | 
|             delUrl=basePath+"/admin/shopActivities/del" ; | 
|             myGrid=MGrid.initGrid({ | 
|                  url:basePath+"/admin/shopActivities/showList", | 
|                  delUrl:delUrl, | 
|              }); | 
|              | 
|         }); | 
|   | 
|   | 
|         function del() { | 
|             var i = $("#mgrid").bootstrapTable('getSelections').length; | 
|             if (i > 1) { | 
|                 layer.msg("仅可选择一条记录", { | 
|                     icon: 5 | 
|                 }); | 
|                 return false; | 
|             } | 
|             myGrid.delItems(); | 
|         } | 
|   | 
|          var btns=[]; | 
|          btns[0]="",btns[1]="",btns[2]="",btns[3]=""; | 
|          function buidOperate(value, row, index){ | 
|             var html = ""; | 
|             var type = row.actType; | 
|             var name = row.actName; | 
|             html+= btns[0].replace('VALUE',value).replace('TYPE',type) | 
|             + btns[1].replace('VALUE',value).replace('TYPE',type).replace('NAME',name) | 
|             + btns[2].replace('VALUE',value) | 
|             + btns[3].replace('VALUE',value); | 
|             return html;  | 
|         }  | 
|         // 打新增拼团界面 | 
|         function openAdd(value) { | 
|             layer.full(layer.open({ | 
|                 type : 2, | 
|                 title : "新建拼团", | 
|                 area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                 maxmin : true, | 
|                 content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form'] | 
|             })); | 
|         } | 
|   | 
|         // 打开新增秒杀界面 | 
|         function openSecKill() { | 
|             layer.full(layer.open({ | 
|                 type : 2, | 
|                 title : "新建秒杀", | 
|                 area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                 maxmin : true, | 
|                 content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form'] | 
|             })); | 
|         } | 
|   | 
|         // 打开新增沙龙界面 | 
|         function openSalon() { | 
|              layer.full(layer.open({ | 
|                  type : 2, | 
|                  title : "新建秒杀", | 
|                  area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                  maxmin : true, | 
|                  content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form'] | 
|              })); | 
|         } | 
|   | 
|         // 活动统计 | 
|         function activityStatistics(id, type, name) { | 
|             console.log("-------"); | 
|             if (type == 2) { | 
|                 layer.full(layer.open({ | 
|                     type : 2, | 
|                     title : name + "-活动统计", | 
|                     area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                     maxmin : true, | 
|                     content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSecKill-list?id=' + id] | 
|                 })); | 
|             } | 
|   | 
|             if (type == 1) { | 
|                 layer.full(layer.open({ | 
|                     type : 2, | 
|                     title : name + "-活动统计", | 
|                     area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                     maxmin : true, | 
|                     content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesGroupBuy-list?id=' + id] | 
|                 })); | 
|             } | 
|   | 
|             if (type == 3) { | 
|                 layer.full(layer.open({ | 
|                     type : 2, | 
|                     title : name + "-活动统计", | 
|                     area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                     maxmin : true, | 
|                     content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSalon-list?id=' + id] | 
|                 })); | 
|             } | 
|         } | 
|   | 
|         //打开编辑界面 | 
|         function openEdit(id, type) { | 
|             if (type == 1) { | 
|                 layer.full(layer.open({ | 
|                     type : 2, | 
|                     title : "编辑拼团", | 
|                     area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                     maxmin : true, | 
|                     content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form?id=' + id] | 
|                 })); | 
|             } else if (type == 2) { | 
|                 editSecKill(id); | 
|             } else if (type == 3) { | 
|                 editSalon(id); | 
|             } | 
|         }; | 
|   | 
|         function editSecKill(id) { | 
|             layer.full(layer.open({ | 
|                 type : 2, | 
|                 title : "编辑秒杀", | 
|                 area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                 maxmin : true, | 
|                 content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form?id=' + id] | 
|             })); | 
|         } | 
|   | 
|         function editSalon(id) { | 
|             layer.full(layer.open({ | 
|                 type : 2, | 
|                 title : "编辑沙龙", | 
|                 area : [ MUI.SIZE_L, MUI.SIZE_L ], | 
|                 maxmin : true, | 
|                 content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form?id=' + id] | 
|             })); | 
|         } | 
|   | 
|         function closeAct(value) { | 
|             $.AjaxProxy().invoke(basePath + "/admin/shopActivities/closeAct?id="+value, function(loj) { | 
|                 if (loj[0].result.status == '200') { | 
|                     layer.msg(loj[0].result.info, { | 
|                         icon: 1 | 
|                     }); | 
|                 } | 
|                 myGrid.serchData(); | 
|             }) | 
|         } | 
|   | 
|         function formatterActStatus(value) { | 
|             if (value == 1) { | 
|                 return "开启"; | 
|             } else if (value == 2) { | 
|                 return "关闭"; | 
|             } else { | 
|                 return "-"; | 
|             } | 
|         } | 
|   | 
|         function formatterType(value) { | 
|             if (value == 1) { | 
|                 return "拼团"; | 
|             } else if (value == 2) { | 
|                 return "秒杀"; | 
|             } else if (value == 3) { | 
|                 return "沙龙"; | 
|             } else { | 
|                 return "-"; | 
|             } | 
|         } | 
|     </script> | 
|   | 
|   | 
|   | 
| <script matrix:btn="activities-look"  > | 
|     btns[0]=' <button class="btn btn-default btn-sm mr-5" onClick="openEdit(\'VALUE\',\'TYPE\')"  title="编辑"><i class="fa fa-edit fa-trash-o">编辑</i></buttoun>' | 
| </script> | 
| <script matrix:btn="activities-payment"  > | 
|     btns[1]='<button class="btn btn-default btn-sm mr-5" onclick="activityStatistics(\'VALUE\',\'TYPE\',\'NAME\')" title=活动统计"><i class="fa fa-sign-in">活动统计</i></button>' | 
| </script> | 
| <script matrix:btn="activities-gathering"  > | 
|     btns[2]='<button class="btn btn-default btn-sm mr-5" onclick="closeAct(\'VALUE\')" title="关闭"><i class="fa fa-edit">关闭</i></button>' | 
| </script> | 
| <script matrix:btn="activities-edit"  > | 
|     btns[3]=' <button class="btn btn-default btn-sm mr-5" onclick="myGrid.delItem(\'VALUE\')" title="删除"><i class="fa fa-edit">删除</i></button>' | 
| </script> | 
|   | 
|   | 
|   | 
| </body> | 
| </html> |