Authored by 陶雨

限购码和抽奖活动改变设计模式

... ... @@ -2,13 +2,37 @@
'use strict';
var $ = require('jquery'),
common=require('../common/common');
var e = new common.edit("#activityForm", {
var e = new common.edit2("#activityForm", {
"bucket" : "activity"
});
var drawlineBean = require('./partials/DrawlineActivityBean'),
action = $("#activityForm").attr("action");
e.on("render", function() {
});
if(action.indexOf("updatesave") != -1) {
var id = location.href.substring(location.href.lastIndexOf("/") + 1);
common.util.__ajax({
url: "/DrawlineActivityRest/getDrawlineActivityDetail",
data: {activityId:id}
}, function (res) {
//drawlineBean = res.data;
//drawlineBean.reqDepartment = editBean.reqDepartment.split("/");
//if(!editBean.reqDepartment.length) {
// editBean.reqDepartment = [
// "零售部",
// "营销策划"
// ];
//}
//$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
//e.init();
console.log(res);
}, function () {
editBean.reqDepartment = editBean.reqDepartment.split("/");
});
}
var bgStyle = $("#backgroundStyle").val();
var prizeList = $("#prizeList").val();
... ... @@ -46,6 +70,28 @@ $("#beginTimeStr,#endTimeStr").change(function() {
});
e.init();
e.on("file_onComplete", function (obj) {
var names = obj.field;
var fn = new Function("drawlineBean", "drawlineBean." + names + "=" + $(this).attr("value"));
fn(drawlineBean);
console.log(drawlineBean);
});
common.edit.ajaxfileupload("#productSkn",{
params: {
type: "productPool",
__type: "batch-import"
},
onComplete:function(res){
if(res.code == 200) {
util.__tip(res.message, 'success');
$("#sknVal").val(JSON.stringify(res.data.productSkn));
$("#path").val($("#productSkn").val());
} else {
util.__tip(res.message);
}
}
});
e.on("validate",function() {
var bkStyle = [];
... ...
/**
* Created by ty on 2016/4/21.
*/
var drawlineBean = {
activityId:"",
activityName:"",
activityDesc:"",
backgroundStyle:"",
beginTimeStr:"",
endTimeStr:"",
prize:"",
prizeId:"",
prizeList:[],
prizeType:"",
realUserNum:"",
sockUserNum:"",
status:"",
topBanner:"",
whiteList:""
};
module.exports = drawlineBean;
\ No newline at end of file
... ...
... ... @@ -42,6 +42,7 @@ components.prototype={
this.__fileRender();
this.__dropDownRender();
this.__checkboxRadioRender();
this.__timeRender();
return this;
},
validate:function(){
... ... @@ -57,15 +58,15 @@ components.prototype={
var name = $(this).attr("prompt") || $(this).attr("placeholder");
var value = $.trim($(this).val());
if ($(this).attr("required")) {
new Validator.init($(this)[0], {
rules: {
required: true
}
}).validate(function(obj) {
if ($(this).attr("required") && !value) {
//new Validator.init($(this)[0], {
// rules: {
// required: true
// }
//}).validate(function(obj) {
err.push("<p>" + name + "不可为空</p>");
});
return false;
//});
//return false;
}
});
... ... @@ -106,6 +107,10 @@ components.prototype={
if(!bucket){
alert("bucket 不存在");
}
if($(this).hasClass("excel-upload")) {
return true ;
}
$(this).wrap("<div class='fileinput-button'></div>");
var parent=$(this).parent(".fileinput-button");
... ... @@ -179,6 +184,40 @@ components.prototype={
}
});
},
__timeRender:function() {
/*时间插件初始化*/
var that = this;
var fdatepicker = {};
$("input[jsaction]", that.el)
.add("input[jsaction]", that.el)
.each(function() {
var $this = $(this);
var name = $this.attr("id"),
arr = String.prototype.split.call($this.attr("jsaction"), ':');
var obj = $("#" + name).fdatepicker({
format: arr[0] == "date" ? 'yyyy-mm-dd' : 'yyyy-mm-dd hh:ii:ss',
pickTime: arr[0] == "date" ? false : true
}).data("datepicker");
fdatepicker[name] = {
obj: obj,
action: arr[1] ? (arr[1] === "end" ? "setEndDate" : "setStartDate") : false,
target: arr[2] ? "#" + arr[2] : false
};
});
for (var key in fdatepicker) {
var obj = fdatepicker[key].obj;
var action = fdatepicker[key].action;
var target = fdatepicker[key].target;
if (action) {
(function(obj, action, target) {
$("#" + key).click(function() {
obj[action]($(target).val().replace(/\s.*/, ''));
});
})(obj, action, target);
}
}
},
__listen: function(key, o, callback) {
var __self = this;
if (__self.registerEvent[key] && __self.registerEvent[key].length > 0) {
... ...
var $ = require('jquery');
var edit = require('../common/edit');
var e = new edit("#basicForm");
var type = $("#basicForm").attr("role");
if (type == 'edit') {
$('#name, #limitTimes, #userUseLimit, #department1, #department2, #limitDateFrom, #limitDateTo, #describe, #UID').prop('disabled', true);
$('input[name="userTypeLimit"]').prop('disabled', true);
}
e.on("render", function() {
if ($("#reqDepartment").val()) {
var departmentArr = String.prototype.split.call($("#reqDepartment").val(), '/'),
$department1 = $("#department1"),
$department2 = $("#department2");
$department1.val(departmentArr[0]);
if (departmentArr[1]) {
$department2.val(departmentArr[1]).show();
} else {
$department2.hide();
var common = require('../common/common');
var editBean = require('./partials/limitcode-edit-bean');
var e = new common.edit2("#basicForm");
var type = $("#basicForm").attr("role"),
action = $("#basicForm").data("action");
if(type != "add") {
var id = location.href.substring(location.href.lastIndexOf("/") + 1);
common.util.__ajax({
url: "/limitCode/getLimitCode",
data: {id: id}
}, function (res) {
editBean = res.data;
editBean.reqDepartment = editBean.reqDepartment.split("/");
if(!editBean.reqDepartment.length) {
editBean.reqDepartment = [
"零售部",
"营销策划"
];
}
}
});
e.on("bind", function() {
if ($("#reqDepartment").val()) {
var departmentArr = String.prototype.split.call($("#reqDepartment").val(), '/'),
$department1 = $("#department1"),
$department2 = $("#department2");
$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
e.init();
if (type == 'edit') {
//$('#name, #limitTimes, #userUseLimit, #department1, #department2, #limitDateFrom, #limitDateTo, #describe, #UID').prop('disabled', true);
$(".noEdit").prop("disabled", true);
$('input[name="userTypeLimit"]').prop('disabled', true);
$("#indetify").hide();
$("#limit-userUseLimit").hide();
}
},true);
} else {
$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
e.init();
$("#indetify").hide();
$("#limit-userUseLimit").hide();
}
//var e = new edit("#basicForm");
$("select").change(function() {
if ($(this).is($department1)) {
departmentArr.length = 0;
departmentArr[0] = $(this).val();
if ($(this).val() === "零售部") {
$department2.show();
departmentArr[1] = $department2.val();
} else {
$department2.hide();
}
} else {
departmentArr[1] = $(this).val();
}
$("#reqDepartment").val(departmentArr.join('/'));
});
}
});
//
e.on("validate", function() {
var num = $.trim($("#limitTimes").val());
if (+num > 100000 || +num < 1) {
return "数量(范围:1-100000)";
}
return true;
});
e.on("validate", function() {
var skn = $.trim($("#limitSkn").val());
if (skn.length > 8) {
return "skn长度不能超过8位";
}
return true;
$(document).on("change", ".observe", function () {
var val = $(this).val();
var fn = new Function("editBean", "val", "editBean." + $(this).data("field") + "= val;");
fn(editBean, val);
console.log(editBean);
});
e.on("validate", function() {
var startTime = $('#limitDateFrom').val(),
endTime = $('#limitDateTo').val();
$(document).on("change", "#limitSkn", function() {
var val = $(this).val();
if($("#sknsku").val() == "SKU" && val && val.length == 8) {
if (startTime > endTime) {
return '结束时间不能小于开始时间';
}
});
e.init();
var submit = function(callback) {
e.submit($("#basicForm").attr("action"), function(option) {
$("#save_brand").addClass('disabled');
option.success = function(res) {
res = res.data;
if (res.code == "200") {
e.$tip('提交成功', function() {
location.href = "/market/limitcode/index";
}, 'growl-success');
} else {
e.$tip(res.message);
$("#save_brand").removeClass('disabled');
};
return false;
};
option.error = function(res) {
$("#save_brand").removeClass('disabled');
e.$tip("提交失败");
}
console.log(option.data);
callback && callback(option.data);
});
}
//
//
//e.on("render", function() {
// if ($("#reqDepartment").val()) {
// var departmentArr = String.prototype.split.call($("#reqDepartment").val(), '/'),
// $department1 = $("#department1"),
// $department2 = $("#department2");
//
// $department1.val(departmentArr[0]);
// if (departmentArr[1]) {
// $department2.val(departmentArr[1]).show();
// } else {
// $department2.hide();
// }
// }
//});
//
//e.on("bind", function() {
// if ($("#reqDepartment").val()) {
// var departmentArr = String.prototype.split.call($("#reqDepartment").val(), '/'),
// $department1 = $("#department1"),
// $department2 = $("#department2");
//
// $("select").change(function() {
// if ($(this).is($department1)) {
// departmentArr.length = 0;
// departmentArr[0] = $(this).val();
// if ($(this).val() === "零售部") {
// $department2.show();
// departmentArr[1] = $department2.val();
// } else {
// $department2.hide();
// }
// } else {
// departmentArr[1] = $(this).val();
// }
// $("#reqDepartment").val(departmentArr.join('/'));
// });
// }
//});
//
//e.on("validate", function() {
// var num = $.trim($("#limitTimes").val());
// if (+num > 100000 || +num < 1) {
// return "数量(范围:1-100000)";
// }
// return true;
//});
//e.on("validate", function() {
// var skn = $.trim($("#limitSkn").val());
// if (skn.length > 8) {
// return "skn长度不能超过8位";
// }
// return true;
//});
//
//e.on("validate", function() {
// var startTime = $('#limitDateFrom').val(),
// endTime = $('#limitDateTo').val();
//
// if (startTime > endTime) {
// return '结束时间不能小于开始时间';
// }
//});
//
//e.init();
//
//var submit = function(callback) {
//
// e.submit($("#basicForm").attr("action"), function(option) {
// $("#save_brand").addClass('disabled');
// option.success = function(res) {
// res = res.data;
// if (res.code == "200") {
// e.$tip('提交成功', function() {
// location.href = "/market/limitcode/index";
// }, 'growl-success');
// } else {
// e.$tip(res.message);
// $("#save_brand").removeClass('disabled');
// };
//
// return false;
// };
// option.error = function(res) {
// $("#save_brand").removeClass('disabled');
// e.$tip("提交失败");
// }
// console.log(option.data);
// callback && callback(option.data);
// });
//}
//
//
$("#save_brand").click(function() {
submit(function(data) {
// 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废
if (+data.status == 1) {
//不改
} else {
data.status = 0;
//submit(function(data) {
// // 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废
// if (+data.status == 1) {
// //不改
// } else {
// data.status = 0;
// }
//});
if(e.validate()) {
editBean.limitDateFrom = $("#limitDateFrom").val();
editBean.limitDateTo = $("#limitDateTo").val();
editBean.reqDepartment = editBean.reqDepartment.join("/");
editBean.creatorId = $("#auth_id").val();
editBean.creatorName = $("#auth_name").val();
if (editBean.status != 1) {
editBean.status = 0;
}
});
console.log(editBean);
common.util.__ajax({
url: action,
data: editBean
}, function (res) {
location.href = "/market/limitcode/index";
//editBean = res.data;
//editBean.reqDepartment = editBean.reqDepartment.split("/");
//if(!editBean.reqDepartment.length) {
// editBean.reqDepartment = [
// "零售部",
// "营销策划"
// ];
//}
//$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
//e.init();
},function() {
editBean.reqDepartment = editBean.reqDepartment.split("/");
});
}
return false;
});
\ No newline at end of file
... ...
/**
* Created by ty on 2016/4/20.
*/
var limitcode_bean = {
name:"",
limitTimes:1,
reqDepartment:[
"零售部",
"营销策划"
],
limitDateFrom:"",
limitDateTo:"",
describe:"",
userUseLimit:1,
userTypeLimit:"新注册|注册未购买|普通会员|银卡会员|金卡会员|白金会员",
limitSkn:"",
creatorName:"",
creatorId:"",
status:"",
id:""
};
module.exports = limitcode_bean;
\ No newline at end of file
... ...
... ... @@ -119,5 +119,13 @@ exports.res = [
type:'Number'
}],
src:'/activity/data'
},
{
route:"/DrawlineActivityRest/getDrawlineActivityDetail",
method:"POST",
url:"/DrawlineActivityRest/getDrawlineActivityDetail",
params:[
{name: 'activityId', type:"number"}
]
}
];
... ...
... ... @@ -247,6 +247,7 @@ exports.res = [
type: 'String'
}]
},
/*******************************************************************/
{
//限购码管理 -> 页面渲染
route: '/market/limitcode/index',
... ... @@ -373,13 +374,20 @@ exports.res = [
type: 'String'
}]
}, {
route:'/limitCode/getLimitCode',
method:'POST',
url:'/limitCode/getLimitCode',
params:[
{name:'id', type:'string'}
]
},{
//限购码管理 -> 编辑限购码页面渲染
route: '/market/limitcode/edit/:id',
method: 'GET',
view: 'pages/market/limitcode-edit',
url: "/limitCode/getLimitCode",
//url: "/limitCode/getLimitCode",
src: '/market/limitcode-edit',
isJsonRaw: true,
//isJsonRaw: true,
data: {
action: "/market/limitcode/updateLimitCode",
type: "edit",
... ... @@ -470,7 +478,9 @@ exports.res = [
name: 'batchNo',
type: 'Number'
}]
}, {
},
/*************************************************************************/
{
//vip累计金额翻倍 -> 列表页面渲染
route: '/market/vipamount/index',
method: 'GET',
... ...
... ... @@ -23,11 +23,11 @@
<div class="row">
<div class="col-md-12">
<div id="activityForm" role="form" class="form-horizontal form-bordered" method="post" action="{{action}}">
<input type="hidden" id="activityId" value="{{data.activityId}}" />
<input type="hidden" id="prizeId" value="{{data.prizeId}}" />
<input type="hidden" id="backgroundStyle" value="{{data.backgroundStyle}}" />
<input type="hidden" id="prizeList" value="{{data.prizeList}}" />
<input type="hidden" id="status" value="{{data.status}}" />
<input type="hidden" value="{{data.activityId}}" />
<input type="hidden" value="{{data.prizeId}}" />
<input type="hidden" value="{{data.backgroundStyle}}" />
<input type="hidden" value="{{data.prizeList}}" />
<input type="hidden" value="{{data.status}}" />
<div class="panel panel-default">
{{# data}}
<div class="panel-heading">
... ... @@ -38,10 +38,16 @@
<div class="form-group">
<label class="col-sm-2 control-label">活动名称<span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" id="activityName" placeholder="活动名称" class="form-control" required value="{{activityName}}">
<input type="text" placeholder="活动名称" class="form-control observe" data-field="activityName" required value="{{activityName}}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">页面title<span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" placeholder="页面title" class="form-control observe" data-field="title" required value="{{title}}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动时间<span class="red">*</span></label>
<div class="col-sm-3">
<input type="text" class="form-control" jsaction="time:end:endTimeStr" id="beginTimeStr" required placeholder="活动开始时间" value="{{beginTimeStr}}" readonly>
... ... @@ -54,7 +60,23 @@
</div>
<!-- readonly require-->
</div>
<div class="form-group">
<label class="col-sm-2"></label>
<div class="input-group col-sm-6">
<span class="input-group-addon">人数上限:</span>
<input type="text" form="activityForm" class="form-control observe" data-field="limitHum" value="{{limitHum}}" placeholder="人数上限">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">开奖时间<span class="red">*</span></label>
<div class="col-sm-3">
<input type="text" class="form-control" jsaction="time:start:endTimeStr" id="lottoTimeStr" required placeholder="开奖时间" value="{{beginTimeStr}}" readonly>
</div>
<!-- readonly require-->
</div>
<div class="form-group">
<label class="col-sm-2 control-label">奖品类型<span class="red">*</span></label>
<div class="col-sm-3">
... ... @@ -64,27 +86,41 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">奖品设置<span class="red">*</span></label>
<div class="col-sm-6">
<div class="input-group">
<span class="input-group-addon">限购码ID:<span class="red">*</span></span>
<input type="text" form="activityForm" name="prize" id="prize" class="form-control" value="{{ prize}}" placeholder="限购码ID" required>
</div>
<div class="input-group">
<span class="input-group-addon">白名单:</span>
<input type="text" form="activityForm" name="whiteList" id="whiteList" class="form-control" value="{{ whiteList}}" placeholder="请输入UID,用逗号隔开">
</div>
<div class="input-group">
<span class="input-group-addon">真实用户中奖数:<span class="red">*</span></span>
<input type="number" form="activityForm" name="realUserNum" id="realUserNum" class="form-control" value="{{ realUserNum}}" placeholder="请输入数量" required>
<div class="col-sm-12">
<label class="col-sm-2 control-label">奖品设置<span class="red">*</span></label>
<div class="col-sm-6">
<div class="input-group">
<span class="input-group-addon">限购码批次号:<span class="red">*</span></span>
<input type="text" form="activityForm" name="prize" id="prize" class="form-control" value="{{ prize}}" placeholder="限购码批次号" required>
</div>
<!--<div class="input-group">-->
<!--<span class="input-group-addon">白名单:</span>-->
<!--<input type="text" form="activityForm" name="whiteList" id="whiteList" class="form-control" value="{{ whiteList}}" placeholder="请输入UID,用逗号隔开">-->
<!--</div>-->
<!--<div class="input-group">-->
<!--<span class="input-group-addon">真实用户中奖数:<span class="red">*</span></span>-->
<!--<input type="number" form="activityForm" name="realUserNum" id="realUserNum" class="form-control" value="{{ realUserNum}}" placeholder="请输入数量" required>-->
<!--</div>-->
<!--<div class="input-group">-->
<!--<span class="input-group-addon">马甲用户中奖数:</span>-->
<!--<input type="number" form="activityForm" name="sockUserNum" id="sockUserNum" class="form-control" value="{{ sockUserNum}}" placeholder="请输入数量">-->
<!--</div>-->
</div>
<div class="input-group">
<span class="input-group-addon">马甲用户中奖数:</span>
<input type="number" form="activityForm" name="sockUserNum" id="sockUserNum" class="form-control" value="{{ sockUserNum}}" placeholder="请输入数量">
</div>
<div class="col-sm-12">
<label class="col-sm-2 control-label">人工抽奖</label>
<div class="col-sm-6">
<div>
<input id="productSkn" name="productSkn" class="btn btn-default excel-upload" type="file">
<div class="file-name btn btn-default">导入uid</div>
<input type="hidden" id="sknVal" />
</div><br>
<span>导入结果: 总计(uid数量)</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">内容管理<span class="red">*</span></label>
<div class="col-sm-10">
... ... @@ -101,28 +137,28 @@
<label class="">背景样式:</label>
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle1" name="backgroundStyle1" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[0]" id="backgroundStyle1" name="backgroundStyle1" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle2" name="backgroundStyle2" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[1]" id="backgroundStyle2" name="backgroundStyle2" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle3" name="backgroundStyle3" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[2]" id="backgroundStyle3" name="backgroundStyle3" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle4" name="backgroundStyle4" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[3]" id="backgroundStyle4" name="backgroundStyle4" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle5" name="backgroundStyle5" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[4]" id="backgroundStyle5" name="backgroundStyle5" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle6" name="backgroundStyle6" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[5]" id="backgroundStyle6" name="backgroundStyle6" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle7" name="backgroundStyle7" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[6]" id="backgroundStyle7" name="backgroundStyle7" placeholder="背景样式" />
</div>
<div class="col-sm-1">
<input type="file" id="backgroundStyle8" name="backgroundStyle8" placeholder="背景样式" />
<input type="file" class="observe" data-field="backgroundStyle[7]" id="backgroundStyle8" name="backgroundStyle8" placeholder="背景样式" />
</div>
</div>
</div>
... ... @@ -148,10 +184,8 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<form id="basicForm" role="{{type}}" class="form-horizontal form-bordered" method="get" action="{{action}}">
<div class="panel panel-default">
{{# data}}
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
</div><!-- panel-heading -->
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">名称 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" id="name" placeholder="名称建议30字以内" class="form-control" required maxlength="30" value="{{name}}">
</div>
</div>
<div id="basicForm" role="{{type}}" data-action="{{action}}" class="form-horizontal form-bordered">
<div class="form-group">
<label for="numbers" class="col-sm-2 control-label">数量<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" id="limitTimes" placeholder="数量" class="form-control" required pattern="^[0-9]+$" value="{{limitTimes}}">
</div>
<!--required pattern="^[0-9]+$"-->
</div>
<div class="form-group">
<label class="col-sm-2 control-label">申请部门</label>
<div class="col-sm-3">
<select id="department1" class="form-control">
<option value="零售部">零售部</option>
<option value="市场部">市场部</option>
<option value="会员部">会员部</option>
<option value="品牌合作部">品牌合作部</option>
<option value="潮流资源部">潮流资源部</option>
<option value="其他">其他</option>
</select>
</div>
<div class="col-sm-3">
<select id="department2" class="form-control">
<option value="营销策划">营销策划</option>
<option value="类目运营">类目运营</option>
<option value="店铺运营">店铺运营</option>
</select>
</div>
<input type="hidden" id="reqDepartment" value="{{reqDepartment}}">
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">使用期限<span class="red">*</span></label>
<div class="col-sm-6">
<!-- <div class="col-sm-2">
<label><input name="limitTimeType" type="radio" value="1">指定时间</label>
</div> -->
<div class="col-sm-6">
<input type="text" class="form-control" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="{{limitDateFrom}}" readonly required>
</div>
<div class="col-sm-6">
<input type="text" class="form-control" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="结束时间" value="{{limitDateTo}}" readonly required>
</div>
<!-- <div class="col-sm-6">
<label id="no-limit-time"><input name="limitTimeType" type="radio" value="2">不指定</label>
</div> -->
</div>
<!-- <input type="hidden" value="{{limitTimeType}}" id="limitTimeType" for="radio" required placeholder="使用期限"> -->
<!-- readonly require-->
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">限购码说明<i class="red">*</i></label>
<div class="col-sm-8">
<textarea class="form-control" id="describe" maxlength="100" placeholder="限购码使用条件简介,最多100个字" required>{{describe}}</textarea>
</div>
<!-- require-->
</div>
</div>
</div>
<script type="text/template" id="limitcodeEdit-template">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
</div><!-- panel-heading -->
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">名称 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" placeholder="名称建议30字以内" prompt="名称" class="form-control observe noEdit" data-field="name" required maxlength="30" value="[[name]]">
</div>
</div>
<div class="panel-heading">
<h4 class="panel-title">使用条件</h4>
<div class="form-group">
<label class="col-sm-2 control-label">数量<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" placeholder="数量" class="form-control observe noEdit" data-field="limitTimes" required pattern="^[0-9]+$" value="[[limitTimes]]">
</div>
<!-- <div class="form-group">
<label for="userSourceLimit" class="col-sm-2 control-label">用户来源<i class="red">*</i></label>
<div class="col-sm-8">
<label class="checkbox-inline">
<input type="checkbox" value="1" name="userSourceLimit" > IOS
</label>
<label class="checkbox-inline">
<input type="checkbox" value="2" name="userSourceLimit" > 安卓
</label>
<label class="checkbox-inline">
<input type="checkbox" value="3" name="userSourceLimit" > PC
</label>
<label class="checkbox-inline">
<input type="checkbox" value="4" name="userSourceLimit" > WAP
</label>
<label class="checkbox-inline">
<input type="checkbox" value="5" name="userSourceLimit" > IPAD
</label>
</div>
<input type="hidden" value="{{userSourceLimit}}" id="userSourceLimit" for="checkbox" required placeholder="用户来源">
</div> -->
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">会员身份<i class="red">*</i></label>
<div class="col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" value="新注册" name="userTypeLimit" > 新注册
</label>
<label class="checkbox-inline">
<input type="checkbox" value="注册未购买" name="userTypeLimit"> 注册未购买
</label>
<label class="checkbox-inline">
<input type="checkbox" value="普通会员" name="userTypeLimit"> 普通会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="银卡会员" name="userTypeLimit"> 银卡会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="金卡会员" name="userTypeLimit"> 金卡会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="白金会员" name="userTypeLimit"> 白金会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="指定用户" name="userTypeLimit"> 指定用户
</label>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">申请部门</label>
<div class="col-sm-3">
<select value="[[reqDepartment[0] ]]" class="form-control observe noEdit" data-field="reqDepartment[0]">
<option value="零售部">零售部</option>
<option value="市场部">市场部</option>
<option value="会员部">会员部</option>
<option value="品牌合作部">品牌合作部</option>
<option value="潮流资源部">潮流资源部</option>
<option value="其他">其他</option>
</select>
</div>
<div class="col-sm-3">
<select value="[[reqDepartment[1] ]]" class="form-control observe noEdit" data-field="reqDepartment[1]">
<option value="营销策划">营销策划</option>
<option value="类目运营">类目运营</option>
<option value="店铺运营">店铺运营</option>
</select>
</div>
</div>
<div class="col-sm-2">
<input type="text" class="form-control" id="UID" placeholder="UID">
<div class="form-group">
<label class="col-sm-2 control-label">使用期限<span class="red">*</span></label>
<div class="col-sm-6">
<div class="col-sm-6">
<input type="text" class="form-control noEdit" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="开始时间" value="[[limitDateFrom]]" readonly required>
</div>
<input type="hidden" value="{{userTypeLimit}}" id="userTypeLimit" for="checkbox" required placeholder="会员身份">
</div>
<div class="form-group">
<label for="userUseLimit" class="col-sm-2 control-label">限用次数<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" id="userUseLimit" placeholder="0 表示不限制" class="form-control" required pattern="^[0-9]+$" value="{{userUseLimit}}">
<div class="col-sm-6">
<input type="text" class="form-control noEdit" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="结束时间" value="[[limitDateTo]]" readonly required>
</div>
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">指定商品</label>
<div class="col-sm-2">
<input type="number" id="limitSkn" placeholder="SKN/SKU/SKC" class="form-control" value="{{limitSkn}}">
</div>
</div>
</div>
<!-- <div class="form-group">
<label for="name" class="col-sm-2 control-label">限制次数<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" id="userUseLimit" placeholder="限制次数" class="form-control" value="{{userUseLimit}}" required pattern="^[1-9]+$">
</div>
</div> -->
<div class="form-group">
<label class="col-sm-2 control-label">限购码说明<i class="red">*</i></label>
<div class="col-sm-8">
<textarea class="form-control observe noEdit" prompt="限购码说明" data-field="describe" maxlength="100" placeholder="限购码使用条件简介,最多100个字" required>[[describe]]</textarea>
</div>
</div>
</div>
</div>
<!-- <div class="form-group">
<label for="name" class="col-sm-2 control-label">商品性别</label>
<div class="col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" value="1" name="userSex" > 男
</label>
<label class="checkbox-inline">
<input type="checkbox" value="2" name="userSex"> 女
</label>
<label class="checkbox-inline">
<input type="checkbox" value="3" name="userSex"> 通用
</label>
</div>
<input type="hidden" value="{{userSex}}" id="userSex" for="checkbox">
</div> -->
<div class="panel-heading">
<h4 class="panel-title">使用条件</h4>
</div>
<!-- <div class="panel-heading">
<h4 class="panel-title">优惠互斥</h4>
</div>
<div class="form-group" id="indetify">
<label class="col-sm-2 control-label">会员身份<i class="red">*</i></label>
<div class="col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" value="新注册" name="userTypeLimit" > 新注册
</label>
<label class="checkbox-inline">
<input type="checkbox" value="注册未购买" name="userTypeLimit"> 注册未购买
</label>
<label class="checkbox-inline">
<input type="checkbox" value="普通会员" name="userTypeLimit"> 普通会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="银卡会员" name="userTypeLimit"> 银卡会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="金卡会员" name="userTypeLimit"> 金卡会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="白金会员" name="userTypeLimit"> 白金会员
</label>
<label class="checkbox-inline">
<input type="checkbox" value="指定用户" name="userTypeLimit"> 指定用户
</label>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">SKN除外</label>
<div class="col-sm-2">
<input class="form-control" type="text" placeholder="SKN">
</div>
</div>
<div class="col-sm-2">
<input type="text" class="form-control observe noEdit" data-field="UID" value="[[UID]]" placeholder="UID">
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">优惠互斥</label>
<div class="col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" value="1" name="discountReject" > 销售折扣
</label>
<label class="checkbox-inline">
<input type="checkbox" value="2" name="discountReject" > VIP折扣-商品
</label>
<label class="checkbox-inline">
<input type="checkbox" value="3" name="discountReject" > VIP折扣-运营
</label>
<label class="checkbox-inline">
<input type="checkbox" value="4" name="discountReject" > 促销活动
</label>
<label class="checkbox-inline">
<input type="checkbox" value="5" name="discountReject" > YOHO币-商品
</label>
<label class="checkbox-inline">
<input type="checkbox" value="6" name="discountReject" > YOHO币-运营
</label>
<label class="checkbox-inline">
<input type="checkbox" value="7" name="discountReject" > 优惠券
</label>
<label class="checkbox-inline">
<input type="checkbox" value="8" name="discountReject" > 红包
</label>
<label class="checkbox-inline">
<input type="checkbox" value="9" name="discountReject" > 优惠码
</label>
</div>
<input type="hidden" value="{{discountReject}}" id="discountReject" for="checkbox">
</div> -->
<input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" required placeholder="会员身份">
</div>
<div class="form-group" id="limit-userUseLimit">
<label class="col-sm-2 control-label">限用次数<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" prompt="限用次数" placeholder="0 表示不限制" class="form-control observe noEdit" data-field="userUseLimit" required pattern="^[0-9]+$" value="[[userUseLimit]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">指定商品</label>
<div class="col-sm-4">
<input type="radio" value="SKN" name="sknsku" checked />SKN
<input type="radio" value="SKU" name="sknsku" />SKU
<input type="hidden" id="sknsku" for="radio" value="[[SKN]]"/>
</div>
<div class="col-sm-2">
<input type="number" maxlength="8" id="limitSkn" placeholder="SKN" class="form-control" value="[[limitSkn]]">
</div>
</div>
<input type="hidden" value="[[status]]">
<input type="hidden" value="[[id]]">
<input type="hidden" value="[[batchNo]]">
<input type="hidden" value="{{status}}" id="status" >
<input type="hidden" value="{{id}}" id="id" >
<input type="hidden" value="{{batchNo}}" id="batchNo" >
{{/ data}}
<div class="form-group">
<label class="col-sm-2 control-label">申请人</label>
<div class="col-sm-8">
<label class="form-label control-label" id="creatorName">{{auth.name}}</label>
</div>
</div>
<input type="hidden" value="{{auth.uid}}" id="creatorId" >
<input type="hidden" value="{{auth.name}}" id="creatorName" >
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
<button id="save_brand" type="submit" data-loading-text="保存中..." class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">申请人</label>
<div class="col-sm-8">
<label class="form-label control-label" id="creatorName">{{auth.name}}</label>
</div>
</div>
<input id="auth_id" type="hidden" value="{{auth.uid}}">
<input id="auth_name" type="hidden" value="{{auth.name}}">
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
<button id="save_brand" type="button" data-loading-text="保存中..." class="btn btn-primary">保存</button>
</div>
</div>
</div>
</div>
</div>
</script>
... ...
... ... @@ -30,14 +30,14 @@
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">限购码说明 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">{{ describe}}</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">会员身份 :</div>
<div id="userUseLimit" class="col-xs-8 col-sm-8 col-md-8 col-lg-8">{{ userTypeLimit}}</div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">限用次数 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">{{ userUseLimit}}</div>
</div>
<!--<div class="row show-grid">-->
<!--<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">会员身份 :</div>-->
<!--<div id="userUseLimit" class="col-xs-8 col-sm-8 col-md-8 col-lg-8">{{ userTypeLimit}}</div>-->
<!--</div>-->
<!--<div class="row show-grid">-->
<!--<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">限用次数 :</div>-->
<!--<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">{{ userUseLimit}}</div>-->
<!--</div>-->
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">指定商品 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8">{{limitSkn}}</div>
... ...