Commit 4abd9a76 by chongli

优惠券创建增加分享限制

parent ccdc0493
......@@ -191,6 +191,11 @@ public class VoucherRuleDto {
*/
private int shared;//是否可分享:1是;0否
/**
* 分享领取限制
*/
private int userLimit;//分享领取限制0:不限 2社员
public VoucherRuleDto(MultipleCourseConditionBean multipleCourseConditionBean) {
super();
......@@ -498,4 +503,12 @@ public class VoucherRuleDto {
this.multipleCourseConditionBean = multipleCourseConditionBean;
}
public int getUserLimit() {
return userLimit;
}
public void setUserLimit(int userLimit) {
this.userLimit = userLimit;
}
}
......@@ -184,21 +184,7 @@
</div>
</div>
<div class="long_content_div control-group" id="voucherRuleTypeValue1show">
<label class="control-label" for="type">是否有效</label>
<div class="controls">
<#if dto.valid??>
<input style="margin-bottom: 5px;" type="radio" name="valid" value="0" <#if dto.valid == 0>checked</#if>>
<span style="padding-right: 20px;">否</span>
<input style="margin-bottom: 5px;" type="radio" name="valid" value="1" <#if dto.valid == 1>checked</#if> >
<span style="padding-right: 20px;">是</span>
<#else>
<input style="margin-bottom: 5px;" type="radio" name="valid" value="0" >
<span style="padding-right: 20px;">否</span>
<input style="margin-bottom: 5px;" type="radio" name="valid" value="1" checked >
<span style="padding-right: 20px;">是</span>
</#if>
</div>
</div>
</div>
......
......@@ -23,13 +23,14 @@
<thead>
<tr>
<th style="width:5%">ID</th>
<th style="width:13%">活动名称</th>
<th style="width:10%">社员价</th>
<th style="width:10%">嘉宾价</th>
<th style="width:10%">购买限制</th>
<th style="width:6%">是否有效</th>
<th style="width:4%">限制购买次数</th>
<th style="width:15%">创建日期</th>
<th style="width:16%">活动名称</th>
<th style="width:6%">社员价</th>
<th style="width:6%">嘉宾价</th>
<th style="width:7%">购买限制</th>
<th style="width:14%">活动开始时间</th>
<th style="width:14%">活动结束时间</th>
<th style="width:9%">限制购买次数</th>
<th style="width:14%">创建日期</th>
<th style="width:5%">操作</th>
</tr>
</thead>
......@@ -53,13 +54,8 @@
<#default>
未知
</#switch>
<td>
<#if item.valid==0>
<#else>
</#if>
</td>
<td>${item.activityStart?string("yyyy-MM-dd HH:mm:ss")}</td>
<td>${item.activityEnd?string("yyyy-MM-dd HH:mm:ss")}</td>
<td>${item.buyLimitTimes!}</td>
<td>${item.createdTime?string("yyyy-MM-dd HH:mm:ss")}</td>
<td><a href="/buyVoucherActivity/update?id=${item.id!}&page=${paginationData.pageNumber!}">编辑</a></td>
......
......@@ -101,6 +101,13 @@ function getResourceList(page){
$(function(){
//如果是可分享,点击选择是否限社员领取
$("#canShareInput").click(function(){
$("#userGetLimit").css('display','block');
});
$("#notCanShareInput").click(function(){
$("#userGetLimit").css('display','none');
});
//添加行
$("#addRowBtn").click(function(){
var tableObj = document.getElementById("conditions");
......@@ -243,7 +250,7 @@ $(function(){
}
}
$("#courseRuleCondition_value").next().click(function (e) {
$(e.currentTarget).prev().addClass("activeProduct");
......@@ -480,15 +487,28 @@ $(function(){
<span style="padding-right: 20px;">是</span>
</div>
</div>
<div class="long_content_div control-group" id="voucherRuleTypeValue1show">
<div class="long_content_div control-group" id="canShareDiv">
<label class="control-label" for="type">可分享</label>
<div class="controls">
<input style="margin-bottom: 5px;" type="radio" name="shared" value="0" checked>
<input style="margin-bottom: 5px;" type="radio" id="notCanShareInput" name="shared" value="0" checked>
<span style="padding-right: 20px;">否</span>
<input style="margin-bottom: 5px;" type="radio" name="shared" value="1">
<input style="margin-bottom: 5px;" type="radio" id="canShareInput" name="shared" value="1" >
<span style="padding-right: 20px;">是</span>
</div>
</div>
<div class="long_content_div control-group" id="userGetLimit" style="display:none">
<label class="control-label" for="type">限会员可领</label>
<div class="controls">
<input style="margin-bottom: 5px;" type="radio" name="userLimit" value="2">
<span style="padding-right: 20px;">是</span>
<input style="margin-bottom: 5px;" type="radio" name="userLimit" value="0">
<span style="padding-right: 20px;">否</span>
</div>
</div>
<#if dto.voucherRuleType == 1>
<div class="long_content_div control-group" id="voucherRuleTypeValue1show">
<label class="control-label" for="type">发放用户选择</label>
......
<#include "../common/pageJsContent.ftl"/>
<@com.layout title="已成交订单" module="communeOrder" current="list_paysuccess" pageJs=pageJsContent>
<#include "../common/communeOrderSearchForm.ftl"/>
<table class="table table-bordered table-striped table-font">
......@@ -13,6 +17,7 @@
<th>推荐人</th>
<th>推荐人手机号</th>
<th>接管人</th>
<th>修改推荐人</th>
</tr>
<#list list as item>
......@@ -38,6 +43,8 @@
<td>${item.recommendName!}</td>
<td>${item.recommendPhone!}</td>
<td>${item.receiver!}</td>
<td><a href="javascript:void(0);" target="_blank" onclick="changeMobilePhoneToEdit4CommuneOrder('${item.orderId!}')">修改开单人</a></td>
</tr>
</#list>
......@@ -57,4 +64,118 @@
<@paginator.statistics />
</div>
</div>
<div class="modal hide fade" id="changeMobilePhoneToEdit">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>修改开单人</h3>
</div>
<div class="modal-body" id='courseSelector'>
<div class="input-append">
<input type="hidden" id="voucherOrderId" value="111111111111111111" />
<input type="hidden" name="recommendUid" value="" />
<input type="text" name="recommendPhone" value="" placeholder="开单人手机号" class="input-medium" autocomplete="off"/>
<button class="btn" data-toggle="modal" onclick="queryMobilePhoneInModal4CommuneOrder()">开单人信息确认</button> <button style="margin-left:50px;" class="btn" data-toggle="modal" onclick="updateMobilePhone4CommuneOrder()">确认修改</button>
</div>
<table class="table table-bordered table-striped">
<tbody id="tableList">
</tbody>
</table>
<div class="pagination pagination-mini">
<p style="color:red;">
1. 请先核实开单人信息再确认
</p>
</div>
</div>
</div>
<script id="table_course" type="text/x-handlebars-template">
<tr>
<td>用户名:{{userName}}</td> <td>性别:{{gender}}</td>
</tr>
<tr>
<td>生日:{{birth}}</td> <td>手机号归属地:{{city}} {{province}}</td>
</tr>
<tr>
<td>UID:<a href="/system/user/{{uid}}/detailByUid" target="_Blank" >{{uid}}</a></td> <td>余额:{{prePayCardAmount}}</td>
</tr>
<tr>
<td>注册时间:{{registerTime}}</td> <td>昵称:{{umNickName}}</td>
</tr>
<tr>
<td>邮箱:{{email}}</td> <td>最后登录时间:{{lastLoginTime}}</td>
</tr>
</script>
<script>
function changeMobilePhoneToEdit4CommuneOrder(voucherOrderId){
$("#voucherOrderId").val(voucherOrderId);
$("#tableList").empty();
$("#changeMobilePhoneToEdit").modal('show');
}
function queryMobilePhoneInModal4CommuneOrder(){
var recommendPhone = $("#courseSelector").find("input[name=recommendPhone]").val();
if(recommendPhone==""){
alert("请输入开单人手机号");
return
}
$.ajax({
url: "/j/getUserInfoByPhone",
type: "get",
data: {
mobilePhone: recommendPhone
},
success: function (obj) {
if(obj.body==null){
$("#courseSelector").find("input[name=recommendUid]").val("");
}else{
$("#courseSelector").find("input[name=recommendUid]").val(obj.body.uid);
}
var source = $("#table_course").html();
var template = Handlebars.compile(source);
$('#tableList').html(template(obj.body))
}
});
}
function updateMobilePhone4CommuneOrder(){
var voucherOrderId = $("#voucherOrderId").val();
var recommendPhone = $("#courseSelector").find("input[name=recommendUid]").val();
$('#changeMobilePhoneToEdit').modal('hide');
if(recommendPhone==""){
alert("该开单人不存在,请确认");
return;
}
jQuery.ajax({
type:"POST",
contentType:"application/x-www-form-urlencoded",
url:"/j/voucherOrder/" + voucherOrderId + "/updateOpenOrderPerson",
data:{
recommendPhone:recommendPhone.trim()
},
success:function(data){
data = eval(data);
if(data.status == 0){
alert("修改成功");
window.location.reload();
}else{
alert("修改失败!" + data.message);
}
},
error:function(){
alert("修改失败!");
}
});
}
</script>
</@com.layout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment