Kaynağa Gözat

Merge branch 'developerB' into developerC

zhijiezhao 3 yıl önce
ebeveyn
işleme
d2e0e7cb7a

+ 31 - 0
src/main/java/com/caimei/modules/supervip/entity/CmSvipGive.java

@@ -0,0 +1,31 @@
+package com.caimei.modules.supervip.entity;
+
+import com.thinkgem.jeesite.common.persistence.DataEntity;
+
+public class CmSvipGive  extends DataEntity<CmSvipGive> {
+    private static final long serialVersionUID = 1L;
+    /**
+     * 赠送套餐月份数
+     */
+    private String month;
+    /**
+     * 机构id
+     */
+    private String clubId;
+
+    public String getMonth() {
+        return month;
+    }
+
+    public void setMonth(String month) {
+        this.month = month;
+    }
+
+    public String getClubId() {
+        return clubId;
+    }
+
+    public void setClubId(String clubId) {
+        this.clubId = clubId;
+    }
+}

+ 33 - 0
src/main/java/com/caimei/modules/supervip/web/CmSvipGiveController.java

@@ -0,0 +1,33 @@
+package com.caimei.modules.supervip.web;
+
+import com.caimei.modules.supervip.entity.CmSvipGive;
+import com.caimei.modules.supervip.entity.CmSvipHistory;
+import com.thinkgem.jeesite.common.persistence.Page;
+import com.thinkgem.jeesite.common.web.BaseController;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+@Controller
+@RequestMapping(value = "${adminPath}/svip/cmSvipGive")
+public class CmSvipGiveController  extends BaseController {
+
+
+    @ModelAttribute
+    public CmSvipGive get(@RequestParam(required = false) String id) {
+        CmSvipGive entity = new CmSvipGive();
+        return entity;
+    }
+
+    @RequestMapping(value = {"list", ""})
+    public String list(CmSvipGive cmSvipGive, HttpServletRequest request, HttpServletResponse response, Model model) {
+        model.addAttribute("cmSvipGive", cmSvipGive);
+        return "modules/super/cmSvipGiveForm";
+    }
+
+}

+ 110 - 0
src/main/webapp/WEB-INF/views/modules/super/cmSvipGiveForm.jsp

@@ -0,0 +1,110 @@
+<%@ page contentType="text/html;charset=UTF-8" %>
+<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
+<html>
+<head>
+    <title>赠送超级会员</title>
+    <meta name="decorator" content="default"/>
+    <script type="text/javascript">
+
+    </script>
+</head>
+<body>
+<ul class="nav nav-tabs">
+    <li class="active"><a href="${ctx}/svip/cmSvipHistory/">超级会员列表</a></li>
+    <li><a href="${ctx}/svip/cmSvipGive/">赠送超级会员</a></li>
+</ul>
+<br/>
+<form:form id="inputForm" modelAttribute="cmSvipGive" action="${ctx}/svip/cmSvipGive/save" method="post"
+           class="form-horizontal">
+    <sys:message content="${message}"/>
+
+    <div class="control-group" id="couponClub">
+        <label class="control-label"><font color="red">*</font>机构:</label>
+        <div class="controls">
+            <a href="javascript:void(0);" onclick="showSelectClub()" id="chooseClub">请选择机构</a>
+            <table id="contentTableClub" class="table table-striped table-bordered table-condensed" hidden="hidden">
+                <thead>
+                <tr>
+                    <th>机构名称</th>
+                    <th>机构简称</th>
+                    <th>联系人</th>
+                    <th>手机号</th>
+                    <th>操作</th>
+                </tr>
+                </thead>
+                <tbody id="hotSearchClub"></tbody>
+            </table>
+        </div>
+    </div>
+    <div class="control-group">
+        <label class="control-label"><span class="help-inline"><font color="red">*</font> </span>赠送套餐:</label>
+        <div class="controls">
+            <form:input path="month" htmlEscape="false" class="input-xlarge2" style="width: 60px"/> 个月
+        </div>
+    </div>
+
+    <div class="form-actions">
+        <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
+    </div>
+</form:form>
+</body>
+<script>
+    //点击添加机构
+    function showSelectClub() {
+        var url = "${ctx}/coupon/cmCoupon/toAddClub";
+        var title = '';
+        title = "选择机构";
+        top.$.jBox("iframe:" + url, {
+            iframeScrolling: 'yes',
+            width: $(top.document).width() - 400,
+            height: $(top.document).height() - 160,
+            persistent: true,
+            title: title,
+            buttons: {"确定": '1', "取消": '-1'},
+            submit: function (v, h, f) {
+                //确定
+                var $jboxFrame = top.$('#jbox-iframe');
+                var $mainFrame = top.$('#mainFrame');
+                if ('1' == v && 1 == $jboxFrame.size() && 1 == $mainFrame.size()) {
+                    var items = $jboxFrame[0].contentWindow.getCheckedItems();
+                    console.log(items);
+                    insertHtmlClub(items);
+                }
+                return true;
+            }
+        });
+    }
+
+    function insertHtmlClub(data) {
+        var html = '<tr>' +
+            '<td>' +
+            data.name +
+            '</td>' +
+            '<td>' +
+            data.shortName +
+            '</td>' +
+            '<td>' +
+            data.linkMan +
+            '</td>' +
+            '<td>' +
+            data.contractMobile +
+            '</td>' +
+            '<td>' +
+            '<a href="javascript:;" onclick="deleteClub()">删除</a>' +
+            '</td>' +
+            '</tr>';
+        $("#contentTableClub").show();
+        $("#chooseClub").hide();
+        $("#hotSearchClub").html(html);
+        $("#userId").val(data.userID);
+    }
+
+    function deleteClub() {
+        $("#hotSearchClub").html("");
+        $("#contentTableClub").hide();
+        $("#chooseClub").show();
+        $("#userId").val("");
+    }
+
+</script>
+</html>

+ 1 - 0
src/main/webapp/WEB-INF/views/modules/svip/cmSvipHistoryList.jsp

@@ -29,6 +29,7 @@
 <body>
 <ul class="nav nav-tabs">
     <li class="active"><a href="${ctx}/svip/cmSvipHistory/">超级会员列表</a></li>
+    <li class="active"><a href="${ctx}/svip/cmSvipGive/">赠送超级会员</a></li>
 </ul>
 <form:form id="searchForm" modelAttribute="cmSvipHistory" action="${ctx}/svip/cmSvipHistory/" method="post"
            class="breadcrumb form-search">