Authored by 姜敏

优惠券活动,发券管理(公开券管理)--基本完结

... ... @@ -104,7 +104,7 @@ components.prototype={
$('input[type="file"]', that.el).each(function() {
var bucket= $(this).data("bucket")||that.option.bucket;
var bucket= $(this).data("bucket")||that.option.bucket||$(this).attr("bucket");
if(!bucket){
alert("bucket 不存在");
... ...
... ... @@ -32,7 +32,7 @@ $.fn.ajaxfileupload = function(options) {
if(bucket){
settings.params.bucket=bucket;
}
console.log(settings.params);
//console.log(settings.params);
$element.change(function() {
uploading_file = false;
... ...
... ... @@ -21,6 +21,7 @@ var ENUM = {
status: {0: '待审核', 1: '审核通过', 2: '驳回', '-1': '过期', 3: '作废'},//全部
tips: {"0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "all": 0}
};
var couponIds = {};
/**
* 初始化下拉框
... ... @@ -30,7 +31,7 @@ common.util.__ajax({
url: "/coupon/queryList",//获取所有优惠券ID
data: {}
}, function (res) {
console.log("res",res);
//console.log("res",res);
$("#couponsIds").html(common.util.__template2($("#search-coupon").html(), res));
new common.dropDown({el: "#choose-coupon"});
couponIds = res.data;
... ... @@ -53,6 +54,7 @@ var t = new common.tab({
{name: "-1", display: "已过期"}
]
}).init(ENUM.tips);
var activeTip= t.active;
/**
* 通用方法
* @type {{getTime: Function, toast: Function, toastInfo: Function}}
... ... @@ -116,6 +118,7 @@ var Bll = {
var g = new common.grid({
el: '#basicTable',
parms: function () {
return {
couponId: common.util.__input("choose-coupon"),
couponName: common.util.__input("filter-couponName"),
... ... @@ -226,7 +229,7 @@ $(document).on('click', '.apply-cancel', function () {
*/
$(document).on('click', '.coupon-info', function () {
var item = g.rows[$(this).data("index")];
console.log(item);
console.log("item.options",item.options);
var item1 = $.extend(true, {}, item);
item1.createTime = Bll.getTime(item1.createTime);
item1.startTime = Bll.getTime(item1.startTime);
... ...
... ... @@ -56,6 +56,9 @@ var g = new common.grid({
HtmArr.push('<a href="/market/couponSend/send/'+ item.id +'" class="btn btn-primary btn-xs sendCoupon" data-index="'+ item.__index+'" href="javascript:;">发券</a>');
HtmArr.push('<a href="/market/couponSend/sendHistory/'+ item.id +'" class="btn btn-primary btn-xs sendHistory" data-index="'+ item.__index+'" href="javascript:;">发放记录</a>');
HtmArr.push('<a href="/market/couponSend/useHistory/'+ item.id +'" class="btn btn-primary btn-xs useHistory" data-index="'+ item.__index+'" href="javascript:;">使用记录</a>');
if(item.couponType==3){
HtmArr.push('<a href="/market/couponSend/pCouponSn/'+ item.id +'" class="btn btn-primary btn-xs pCouponSn" data-index="'+ item.__index+'" href="javascript:;">公开券码查看</a>');
}
return HtmArr.join('');
}}
]
... ...
/**
* Created by jiangmin on 2016/5/30.
*/
'use strict';
var $ = require('jquery'),
common=require('../common/common');
new common.dropDown({el: "#filter-status"});
var couponId = location.href.substring(location.href.lastIndexOf("/") + 1);
$("#filter-couponId").val(couponId);
var g = new common.grid({
el: '#content-list',
hash:false,
async:false,
parms:function(){
return {
couponId: couponId,
isUse: common.util.__input("filter-status")
};
},
columns:[
{display:"ID", name:"id"},
{display:"优惠券号",name:"couponCode"},
{display: '是否发放',name:"isUse"},
{
display:"创建时间",name:"createTimeStr"
}
]
});
g.init("/pCouponSn/queryCouponSnList");
$("#count").html(g.total);
$(document).on("click", "#filter-btn", function() {
g.reload(1);
});
//导出
$(document).on('click', '#export-btn', function() {
var queryConf = JSON.stringify({couponId:couponId});
window.open("/ajax/down?queryConf=" + queryConf + "&type=pCouponSnsExport");
});
... ...
... ... @@ -6,25 +6,10 @@
var $ = require('jquery');
common = require('../common/common');
var activity = require('./partials/activity');
new common.dropDown({
el: "#filter-activityType"
});
var startTimeObj;
var endTimeObj;
var e1 = new common.edit2("#basicForm",{
bucket: "couponImage"//真实的);
});
////分享图片
//var e2 = new common.edit("#couponImage", {
// //bucket: "couponImage"//真实的
// bucket: "goodsimg"//
//});
////背景图片
//var e3 = new common.edit("#couponBgImg", {
// //bucket: "couponBgImg"//真实的
// bucket: "goodsimg"//
//});
var e1 = new common.edit2("#basicForm");
/**
* 监听输入值的变化
*/
... ... @@ -34,21 +19,25 @@ $(document).on("change", ".observe", function () {
activity = common.util.__buildobj(name, '.', activity, function (obj, name) {
obj[name] = $this.val();
});
//console.log("activity",activity);
});
var Bll={
render:function(){
//通用对象
var Bll = {
//渲染界面
render: function () {
$("#basicForm").html(common.util.__template2($("#couponListAdd-template").html(), activity));
Bll.__editRender();
},
//转换时间格式
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
},
//验证
__editRender: function () {
e1.init();
//e1.init();
//e3.init();
new common.dropDown({
el: "#filter-activityType"
});
startTimeObj = $("#startTime").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
... ... @@ -57,9 +46,16 @@ var Bll={
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
e1.on("file_onComplete", function (obj) {
var names = obj.field;
activity = common.util.__buildobj(names, '.', activity, function (o, name) {
o[name] = obj.data;
});
});
}
};
Bll.render();
/*添加一行*/
$(document).on("click", ".addBtn", function () {
activity.couponIds.push({
... ... @@ -67,14 +63,13 @@ $(document).on("click", ".addBtn", function () {
});
Bll.render();
});
/**
* 删除行
*/
$(document).on("click", ".delBtn", function () {
var index = $(this).data("index");
if(activity.couponIds.length<=1){
common.util.__tip("至少有一张优惠券","warning")
if (activity.couponIds.length <= 1) {
common.util.__tip("至少有一张优惠券", "warning")
}
else {
activity.couponIds.splice(index, 1);
... ... @@ -82,14 +77,27 @@ $(document).on("click", ".delBtn", function () {
}
});
$(document).on('click',"#save_brand",function(){
console.log("保存数据",activity);
//if(e1.validate()&&e2.validate()&&e3.validate()){
// common.util.__ajax({
// url:"/couponActivity/add",
// data:activity
// }, function (){
//
// } )
//}
/**
* 保存
*/
$(document).on('click', "#save_brand", function () {
var ids = [];
if (activity.couponIds.length > 0) {
for (var index in activity.couponIds) {
ids.push(activity.couponIds[index].id)
}
}
if (ids.length > 0) {
activity.couponId = ids.join(",");
}
activity.startTime = ((new Date(activity.startTime).getTime())) / 1000 || "";
activity.endTime = ((new Date(activity.endTime).getTime())) / 1000 || "";
if (e1.validate()) {
common.util.__ajax({
url: "/couponActivity/add",
data: activity
}, function () {
location.href = "/couponActivity/index";
})
}
});
... ...
... ... @@ -6,32 +6,27 @@
var $ = require('jquery');
common = require('../common/common');
var ENUM = {
StatusEnum: {
1:'失效',
2:'有效',
1: '失效',
2: '有效'
}
};
//下拉框
new common.dropDown({
el: "#sel-status"
});
new common.dropDown({
el: "#sel-brandName",
ajax: 'brand',
ajax: 'brand'
});
var g = new common.grid({
el: '#basicTable',
size: 10,
parms: function () {
return {
brandId: common.util.__input('sel-brandName'),
status: common.util.__input('sel-status'),
... ... @@ -43,7 +38,6 @@ var g = new common.grid({
display: '品牌名称',
name: "brandName"
},
{
display: '优惠券ID',
name: "couponsId"
... ... @@ -54,7 +48,6 @@ var g = new common.grid({
}
}, {
display: "创建时间",
render: function (item) {
if (item.createTime && item.createTime !== 0) {
var t = new Date(item.createTime * 1000);
... ... @@ -64,11 +57,9 @@ var g = new common.grid({
else {
return "";
}
}
},{
}, {
display: "修改时间",
render: function (item) {
if (item.updateTime && item.updateTime !== 0) {
var t = new Date(item.updateTime * 1000);
... ... @@ -78,7 +69,6 @@ var g = new common.grid({
else {
return "";
}
}
}, {
display: '操作',
... ... @@ -86,10 +76,7 @@ var g = new common.grid({
name: "status",
render: function (items) {
var HtmArr = [];
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">编辑</a>');
//HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>');
return HtmArr.join('');
}
}]
... ... @@ -98,82 +85,48 @@ g.init('/brandCoupon/queryList');
//==================== 按钮点击事件 =====================//
$("#filter-btn").click(function() {
$("#filter-btn").click(function () {
g.reload(1);
});
//添加
$(document).on('click', '#add-btn', function() {
$(document).on('click', '#add-btn', function () {
articleCategoryOP("新增", '/brandCoupon/add', {});
});
//编辑
$(document).on('click', '.info-modify', function() {
$(document).on('click', '.info-modify', function () {
var item = g.rows[$(this).data("index")];
articleCategoryOP("修改", '/brandCoupon/update', item);
});
////删除
//$(document).on('click', '.info-del', function() {
// var item = g.rows[$(this).data("index")];
//
// common.dialog.confirm("温馨提示","确定要删除该标签?" , function() {
// common.util.__ajax({
// url: '/guang/tags/delTag',
// data: {
// id: item.id,
// }
// }, function(res) {
// if (res.code == 200) {
// g.reload();
// }
// });
// });
//});
function articleCategoryOP(prefix, url, item) {
var a =new common.edit(".confirm");
common.dialog.confirm(prefix+'标签', common.util.__template2($("#template").html(), item), function () {
//
return a.submit(url,function(option){
var _brandName = $('#brandId').find("option[value='"+option.data.brandId+"']").text();
var a = new common.edit(".confirm");
common.dialog.confirm(prefix + '标签', common.util.__template2($("#template").html(), item), function () {
return a.submit(url, function (option) {
var _brandName = $('#brandId').find("option[value='" + option.data.brandId + "']").text();
option.data.brandName = _brandName;
option.success=function(res){
res=res.data;
if(res.code=="200"){
a.$tip("提交成功", function() {
option.success = function (res) {
res = res.data;
if (res.code == "200") {
a.$tip("提交成功", function () {
g.reload();
}, 'growl-success');
}else{
} else {
a.$tip(res.message);
}
return false;
},
option.error=function(res){
a.$tip(res.message);
}
};
option.error = function (res) {
a.$tip(res.message);
}
});
});
a.init();
new common.dropDown({
el: "#brandId",
ajax: 'brand'
//el: "#classifyId",
//ajax: 'guangGetTagCategoryByStatus',
});
}
\ No newline at end of file
... ...
/**
* Created by Arthur on 16/5/26.
* Created by jiangmin on 16/5/26.
* 品牌发券管理
*/
var $ = require('jquery');
common = require('../common/common');
var e1 = new common.edit2("#basicForm");
var activity = {};
var activityId = location.href.substring(location.href.lastIndexOf("/") + 1);
var Bll={
/**
* 监听输入值的变化
*/
$(document).on("change", ".observe", function () {
var $this = $(this);
var name = $this.data("field");
activity = common.util.__buildobj(name, '.', activity, function (obj, name) {
obj[name] = $this.val();
});
});
//通用对象
var Bll = {
//获取数据,并转换相应格式
getData: function () {
common.util.__ajax({
url: "/couponActivity/queryById",
data: {id: activityId},
async:false
async: false
}, function (res) {
activity = res.data;
}, true);
var ids=[];
activity.couponIds=[];
if(activity.couponId){
ids = activity.couponId.split(",");
}
for (var i = 0; i < ids.length; i++) {
activity.couponIds.push({id: ids[i]});
}
if(activity.startTime){
activity.startTime=Bll.getTime(activity.startTime);
}
if(activity.endTime){
activity.endTime=Bll.getTime(activity.endTime);
}
},
//渲染界面
render: function () {
$("#basicForm").html(common.util.__template2($("#couponListAdd-template").html(), activity));
Bll.__editRender();
},
//转换时间格式
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
},
//验证
__editRender: function () {
e1.init();
new common.dropDown({
el: "#filter-activityType"
});
startTimeObj = $("#startTime").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
endTimeObj = $("#endTime").fdatepicker({
format: 'yyyy-mm-dd hh:ii:ss',
pickTime: true
}).data("datepicker");
e1.on("file_onComplete", function (obj) {
var names = obj.field;
activity = common.util.__buildobj(names, '.', activity, function (o, name) {
o[name] = obj.data;
});
});
}
};
Bll.getData();
console.log(activity);
$("#basicForm").html(common.util.__template2($("#couponListAdd-template").html(), activity));
\ No newline at end of file
Bll.render();
/*添加一行*/
$(document).on("click", ".addBtn", function () {
activity.couponIds.push({
"id": ""
});
Bll.render();
});
/**
* 删除行
*/
$(document).on("click", ".delBtn", function () {
var index = $(this).data("index");
if (activity.couponIds.length <= 1) {
common.util.__tip("至少有一张优惠券", "warning")
}
else {
activity.couponIds.splice(index, 1);
Bll.render();
}
});
/**
* 保存
*/
$(document).on('click', "#save_brand", function () {
var ids = [];
if (activity.couponIds.length > 0) {
for (var index in activity.couponIds) {
ids.push(activity.couponIds[index].id)
}
}
if (ids.length > 0) {
activity.couponId = ids.join(",");
}
activity.startTime=((new Date(activity.startTime).getTime()))/1000||"";
activity.endTime=((new Date(activity.endTime).getTime()))/1000||"";
if(e1.validate()){
common.util.__ajax({
url:"/couponActivity/update",
data:activity
}, function (){
location.href = "/couponActivity/index";
} )
}
});
... ...
... ... @@ -22,9 +22,9 @@ var config = {
// domain: 'http://172.16.6.146:8088/platform', //玛丽
//domain:'http://172.16.6.157:8080/yohobuy-platform-web',//葛超
// domain: 'http://192.168.102.216:8086/platform',
//domain: 'http://192.168.102.202:8088/platform',
domain: 'http://192.168.102.202:8088/platform',
//domain: 'http://172.16.6.146:8088/platform',
domain:'http://172.16.6.120:8080/platform',//曹艳
//domain:'http://172.16.6.120:8080/platform',//曹艳
//domain:'http://172.16.6.231:8080/platform',//王伟
//domain: 'http://172.16.6.239:8080', //孙杰翔
//domain:'http://172.16.6.189:8088/platform', //李健1
... ...
... ... @@ -2,6 +2,7 @@
* Created by Arthur on 16/5/26.
*/
exports.domain = require('../config/common.js').domain;
//exports.domain ='http://172.16.6.120:8088/platform';//曹燕
exports.res = [
{// 品牌发券空白页
route: '/brandCoupons/index',
... ...
//exports.domain = require('../config/common.js').domain;
exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.240:8088/platform';
//exports.domain = 'http://172.16.6.162:8088/platform';
//exports.domain = 'http://172.16.6.108:8088/platform';//谭玲
//exports.domain = 'http://172.16.6.201:8088/platform';//谭玲
exports.domain = 'http://172.16.6.250:2081/platform';//庞洁
//exports.domain = 'http://172.16.6.250:2081/platform';//庞洁
//exports.domain = 'http://172.16.6.189:8088/platform';//李建
//营销管理路由配置
... ... @@ -738,6 +738,27 @@ exports.res = [
{name: "id", type: "number"}
]
},
/****************************************公开券--李建********************/
{
//公开券查询页面渲染
route:"/market/couponSend/pCouponSn/:param",
method: "GET",
view: "pages/market/pCouponSn",
src: "/market/pCouponSn"
},
{
//公开券列表
route: "/pCouponSn/queryCouponSnList",
method: "POST",
url: "/pCouponSn/queryCouponSnList",
params: [
{name: "page", type: "number"},
{name: "size", type: "number"},
{name: "couponId", type: "number"},
{name: "isUse", type: "string"}
]
},
/****************************************优惠券管理--庞洁********************/
{
//优惠券管理页面渲染
... ...
... ... @@ -18,6 +18,13 @@ var errBackMsg = {
// var domain = 'http://172.16.6.162:8088/platform';
//var domain = 'http://172.16.6.240:8088/platform';
//var domain= 'http://172.16.6.189:8088/platform';//李建
//var domain ='http://172.16.6.120:8088/platform';//曹燕
/**
* 获取请求头
* @param req
* @param res
* @returns {{}}
*/
function getHeader(req,res){
var headers = {};
if (req.session && req.session.user) {
... ... @@ -39,7 +46,11 @@ function getHeader(req,res){
}
return headers;
}
/**
* 上传文件
* @param req
* @param res
*/
exports.uploadFile = function (req, res) {
var headers = getHeader(req, res);
if (req.is("multipart/form-data")) {
... ... @@ -47,6 +58,7 @@ exports.uploadFile = function (req, res) {
for (var key in req.body) {
url.push(key + "=" + req.body[key]);
}
//上传excel文件
if (req.body.__type == "batch-import") {
req.body.file = fs.createReadStream(req.files[req.body.filename].path);
request.post({
... ... @@ -69,11 +81,6 @@ exports.uploadFile = function (req, res) {
//上传txt文本文件
else if(req.body.__type == "import-txt"){
req.body.file = fs.createReadStream(req.files[req.body.filename].path);
//var data={
// couponId:req.body.couponId,
// file:req.body.file
//};
//console.log("上传的数据",data);
request.post({
url: "http://172.16.6.250:2081/platform/couponSendFile/upload",
formData: req.body,
... ... @@ -85,13 +92,13 @@ exports.uploadFile = function (req, res) {
if (!error && httpResponse.statusCode == 200) {
var json = JSON.parse(body);
json.status = true;
console.info("请求结果json",json);
res.json(json);
} else {
res.json(errBackMsg);
}
});
}
//上传图片
else {
var files = req.files[req.body.filename];
//判断是单张传还是多张传
... ... @@ -107,10 +114,8 @@ exports.uploadFile = function (req, res) {
req.body.files[index] = fs.createReadStream(files[index].path);
req.body.fileNames[index] = files[index].name;
}
//如果是goodsimg(商品)的图片,灰度到老系统的上传地址
if (req.body.bucket === 'goodsimg') {
//req.body.filename = req.files[req.body.filename].path;
request.post({
url: oldUploadUrl,
formData: {
... ... @@ -121,7 +126,6 @@ exports.uploadFile = function (req, res) {
if (!error && resd.statusCode == 200) {
var ret = JSON.parse(body);
if (ret.code === 200) {
//var imgUrl = ret.data.imagesList[0];
var imgs = ret.data.imagesList || [];
var datas = [];
for (var i = 0; i < imgs.length; i++) {
... ... @@ -140,9 +144,10 @@ exports.uploadFile = function (req, res) {
}
res.json(errBackMsg);
});
} else {
}
//其余图片
else {
req.body.file = fs.createReadStream(req.files[req.body.filename].path);
// delete req.body.files;
request.post({
url: domain + '/fileupload/upload',
formData: req.body
... ...
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">营销管理</a></li>
<li>发券管理</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>公开券</h4>
</div>
</div>
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-body">
<div class="row">
<div class="panel-col">
<select id="filter-status" tabindex="-1" class="select2-offscreen brandBtn-group">
<option value="-1">状态</option>
<option value="Y">已发放</option>
<option value="N">未发放</option>
</select>
</div>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="export-btn" href="" class="btn btn-info">导出</a>
</div>
</div>
</div>
<div class="panel panel-primary-head">
<div class="basicTable_wrapper" id="content-list">
</div>
<div>
<label>总数:<span id="count"></span></label>
</div>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -47,7 +47,7 @@
<label class="col-sm-2 control-label">活动类型 </label>
<div class="col-sm-8">
<select id="filter-activityType" tabindex="-1" class="select2-offscreen observe"
<select id="filter-activityType" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[activityType]]" data-field="activityType" >
<option value="-1">活动类型</option>
<option value="1">普通活动</option>
... ... @@ -78,11 +78,11 @@
</div>
</div>
</div>
<div class="form-group" id="couponBgImg">
<div class="form-group">
<label class="col-sm-2 control-label">背景图片</label>
<div class="col-sm-8">
<input type="file" placeholder="背景图片" class="form-control observe number" data-field="bgImageUrl"
value="[[bgImageUrl]]">
<input type="file" bucket="couponBgImg" placeholder="背景图片" class="form-control"
data-field="bgImageUrl" value="[[bgImageUrl]]" name="couponBgImg">
<p>图片不是必选项 ,活动类型为APP活动时添加</p>
</div>
</div>
... ... @@ -91,7 +91,7 @@
<div class="col-sm-8">
<input type="text" placeholder="分享标题" prompt="名称" class="form-control observe"
data-field="shareTitile" maxlength="30" value="[[shareTitile]]">
data-field="shareTitle" maxlength="30" value="[[shareTitle]]">
</div>
</div>
<div class="form-group">
... ... @@ -102,11 +102,11 @@
placeholder="分享描述" style="resize: none">[[shareDescribe]]</textarea>
</div>
</div>
<div class="form-group" id="couponImage">
<div class="form-group">
<label class="col-sm-2 control-label">分享图片</label>
<div class="col-sm-8">
<input type="file" value="[[sharePic]]" class="form-control obsserve" id="sharePic" data-field="sharePic" name="sharePic"
placeholder="分享图片" >
<input type="file" bucket="couponImage" class="form-control"
data-field="sharePic" value="[[sharePic]]" name="couponImage">
<p>支持jpg/png/gif,建议尺寸:640 x 1038,图片不是必选项</p>
</div>
</div>
... ... @@ -122,8 +122,8 @@
<label class="col-sm-2 control-label">是否授权</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="Y" class="observe"></label>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="N" class="observe"></label>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="Y" class="observe" data-field="isVerify"></label>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="N" class="observe" data-field="isVerify"></label>
</div>
<input type="hidden" id="isVerify" value="[[isVerify]]" for="radio" data-field="isVerify">
</div>
... ... @@ -139,15 +139,14 @@
<label class="col-sm-2 control-label">限制新老客户</label>
<div class="col-sm-8">
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="0" class="observe">不限制</label>
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="1" class="observe">限制新用户</label>
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="0" class="observe" data-field="isNewUser">不限制</label>
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="1" class="observe" data-field="isNewUser">限制新用户</label>
</div>
<input type="hidden" id="isNewUser" value="[[isNewUser]]" for="radio" data-field="isNewUser">
</div>
[[each couponIds as item index]]
<div class="form-group">
<label class="col-sm-2 control-label">优惠券</label>
<div class="col-sm-2">
<input type="text" id="couponId" class="form-control observe" value="[[item.id]]"
placeholder="ID" data-field="couponIds.[[index]].id">
... ...
... ... @@ -36,15 +36,9 @@
</select>
</div>
<!--<div class="panel-col">-->
<!--<select id="sel-status" class="form-control" >-->
<!--<option value="-1">选择状态</option>-->
<!--</select>-->
<!--</div>-->
<div class="panel-col">
<select id="sel-status" class="form-control">
<option value="-1">选择状态</option>
<option value="-1">是否生效</option>
<option value="1">失效</option>
<option value="2">有效</option>
</select>
... ... @@ -82,35 +76,24 @@
<input type="number" value="[[couponsId]]" name="content" id="couponsId" placeholder="优惠券ID" required="required" class="form-control">
</div>
</div>
<!--<div class="form-group" id="maxsord">-->
<!--<label for="brandId" class="col-sm-2 control-label">品牌<span style="color: red;"> *</span>:</label>-->
<!--<div class="col-sm-10">-->
<!--<input type="hidden" name="" value="[[id]]" id="id" required="required" class="form-control" pattern="" title="">-->
<!--<select id="brandId" value="[[brandId]]" required="required" class="form-control">-->
<!--&lt;!&ndash;<option value="-1">请选择分类</option>&ndash;&gt;-->
<!--<option value="[[brandId||-1]]">[[brandName||"请选择品牌"]]</option>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<div class="form-group" id="maxsord">
<label for="brandId" class="col-sm-2 control-label">品牌<span style="color: red;"> *</span>:</label>
<div class="col-sm-10">
<input type="hidden" name="" value="[[id]]" id="id" class="form-control" pattern="" title="">
<select id="brandId" value="[[brandId]]" required="required" class="form-control">
<!--<option value="-1">请选择分类</option>-->
<option value="[[brandId||-1]]">[[brandName||"请选择品牌"]]</option>
</select>
</div>
</div>
<div class="form-group">
<label for="status" class="col-sm-2 control-label">是否热门<span style="color: red;"> *</span>:</label>
<label for="status" class="col-sm-2 control-label">是否生效<span style="color: red;"> *</span>:</label>
<div class="radio">
<label><input type="radio" value="1" name="status" kl_vkbd_parsed="true">失效</label>
<label><input type="radio" value="1" name="status" kl_vkbd_parsed="true" checked>失效</label>
<label><input type="radio" value="2" name="status" kl_vkbd_parsed="true">有效</label>
</div>
<input id="status" type="hidden" required="required" value="[[status]]" for="radio" kl_vkbd_parsed="true">
<input id="status" type="hidden" required="required" value="[[status||'1']]" for="radio" kl_vkbd_parsed="true">
</div>
... ...
... ... @@ -31,7 +31,7 @@
<script type="text/template" id="couponListAdd-template">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">编辑活动</h4>
<h4 class="panel-title">添加活动</h4>
</div>
<div class="panel-body">
<div class="row">
... ... @@ -39,29 +39,28 @@
<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"
<input type="text" placeholder="活动名称" prompt="活动名称" class="form-control observe"
data-field="actName" required maxlength="30" value="[[actName]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动类型</label>
<label class="col-sm-2 control-label">活动类型 </label>
<div class="col-sm-8">
<select id="activityType" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[activityType]]" data-field="activityType" required>
<select id="filter-activityType" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[activityType]]" data-field="activityType" >
<option value="-1">活动类型</option>
<option value="1">普通活动</option>
<option value="2">APP活动</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动地址</label>
<div class="col-sm-8">
<input type="text" placeholder="活动地址" class="form-control observe number" data-field="actUrl"
required value="[[actUrl]]">
value="[[actUrl]]">
</div>
</div>
<div class="form-group">
... ... @@ -70,44 +69,36 @@
<div class="col-sm-6">
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="startTime" id="startTime"
placeholder="开始时间" value="[[startTime]]" readonly required>
placeholder="开始时间" value="[[startTime]]" readonly >
</div>
<div class="col-sm-6">
<input type="text" class="form-control observe" data-field="endTime" id="endTime"
placeholder="结束时间" value="[[endTime]]" readonly required>
placeholder="结束时间" value="[[endTime]]" readonly >
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">背景图片</label>
<div class="col-sm-8">
<input type="file" placeholder="背景图片" class="form-control observe number" data-field="bgImageUrl"
required value="[[bgImageUrl]]">
<input type="file" bucket="couponBgImg" placeholder="背景图片" class="form-control observe"
data-field="bgImageUrl" value="[[bgImageUrl]]" name="couponBgImg">
<p>图片不是必选项 ,活动类型为APP活动时添加</p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享标题 <span class="red">*</span></label>
<label class="col-sm-2 control-label">分享标题</label>
<div class="col-sm-8">
<input type="text" placeholder="分享标题" prompt="名称" class="form-control observe"
data-field="shareTitile" required maxlength="30" value="[[shareTitile]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享描述</label>
<div class="col-sm-8">
<textarea class="form-control observe" prompt="分享描述" data-field="shareDescribe" maxlength="100"
placeholder="分享描述" required style="resize: none">[[shareDescribe]]</textarea>
data-field="shareTitle" maxlength="30" value="[[shareTitle]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">分享图片</label>
<div class="col-sm-8">
<input type="file" placeholder="背景图片" class="form-control observe number" data-field="sharePic"
required value="[[sharePic]]">
<input type="file" bucket="couponImage" class="form-control observe"
data-field="sharePic" value="[[sharePic]]" name="couponImage">
<p>支持jpg/png/gif,建议尺寸:640 x 1038,图片不是必选项</p>
</div>
</div>
<div class="form-group">
... ... @@ -115,39 +106,48 @@
<div class="col-sm-8">
<input type="text" placeholder="分享地址" class="form-control observe number" data-field="shareUrl"
required value="[[shareUrl]]">
value="[[shareUrl]]">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否授权</label>
<div class="col-sm-8">
<div class="col-sm-2 radio-inline"><input type="radio"class="form-control observe " data-field="isVerify"
required value="Y">
<label></label></div>
<div class="col-sm-2 radio-inline"><input type="radio"class="form-control observe " data-field="isVerify"
required value="N">
<label></label></div>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="Y" class="observe" data-field="isVerify"></label>
<label style="cursor: pointer;"><input type="radio" name="isVerify" value="N" class="observe" data-field="isVerify"></label>
</div>
<input type="hidden" id="isVerify" value="[[isVerify]]" for="radio" data-field="isVerify">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">活动说明</label>
<div class="col-sm-8">
<textarea class="form-control observe" prompt="分享描述" data-field="instructions" maxlength="100"
placeholder="分享描述" required style="resize: none">[[instructions]]</textarea>
placeholder="分享描述" style="resize: none">[[instructions]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">限制新老客户</label>
<div class="col-sm-8">
<input type="radio"class="form-control observe " data-field="isVerify"
required value=0>不限制
<input type="radio"class="form-control observe " data-field="isVerify"
required value=1>限制新用户
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="0" class="observe" data-field="isNewUser">不限制</label>
<label style="cursor: pointer;"><input type="radio" name="isNewUser" value="1" class="observe" data-field="isNewUser">限制新用户</label>
</div>
<input type="hidden" id="isNewUser" value="[[isNewUser]]" for="radio" data-field="isNewUser">
</div>
[[each couponIds as item index]]
<div class="form-group">
<label class="col-sm-2 control-label">优惠券</label>
<div class="col-sm-2">
<input type="text" id="couponId" class="form-control observe" value="[[item.id]]"
placeholder="ID" data-field="couponIds.[[index]].id">
</div>
<div class="col-sm-2">
<a class="col-sm-4 btn btn-primary addBtn" data-index="[[index]]">+</a>
<a class="col-sm-4 col-sm-offset-2 btn btn-danger delBtn" data-index="[[index]]">-</a>
</div>
</div>
[[/each]]
</div>
</div>
<div class="panel-footer">
... ...