Authored by liuyue

限售bug

... ... @@ -38,6 +38,8 @@ var util={
res=res.data;
if (res.code != 200) {
util.__tip(res.message,"danger");
} else {
callback.bind(this,res)();
}
}
});
... ...
... ... @@ -123,6 +123,7 @@ var Bll={
});
},
definetoast:function(content,fn,fn1){
common.dialog({
title:"温馨提示",
content:content,
... ... @@ -131,19 +132,19 @@ var Bll={
{value:"确定" ,callback: function(){
common.util.__ajax({
url:'/market/coupon/auditPromotion',
data:fn()
data: fn()
},function(){
g.reload();
});
}},
{value:"发放列表" ,callback: function(){
{value:"发放列表", callback: function(){
common.dialog({
title:"发放列表",
content:'<div id="faGrid"></div>'
});
new common.grid({
el:"#faGrid",
parms:fn1(),
parms: fn1,
columns:[
{display:"批次号", name:"batchNo", render: function(item) {
return '<a href="/market/coupon/info/' + item.id + '">' + item.batchNo + '</a>';
... ... @@ -208,7 +209,7 @@ $('#basicTable').on('click', '.apply-success', function() {
};
}
Bll.definetoast("您确定要通过该申请吗?",data,function(){
return {auditTime:item.limitDateFrom};
return {auditTime: item.limitDateFrom};
});
});
... ...
... ... @@ -69,7 +69,6 @@ $('body').on('click', '#videoDialog', function() {
var limitAddForm = new common.edit("#limit-add-form");
limitAddForm.init();
limitAddForm.on("validate", function(){
var param = {
batchNo: $('#batchNo').val()
... ... @@ -77,78 +76,100 @@ limitAddForm.on("validate", function(){
if (type == 'update') {
param.id = $('#batchNo').data('id');
}
common.util.__ajax2({
url:'/limit/checkBatch',
async: false,
data: param
});
/*common.util.__ajax2({
});*/
});
//表单提交
$('.limit-add-btn').click(function () {
var $this = $(this);
var param = {
batchNo: $('#batchNo').val()
}
if (type == 'update') {
param.id = $('#batchNo').data('id');
}
limitAddForm.submit($('#limit-add-form').attr('action'), function(option, that) {
option.beforeSend = function () {
$this.attr('disabled', 'disabled');
};
option.success=function(res){
if (res.data.code == 200) {
//成功返回列表页
limitAddForm.$tip('提交成功',function(){
window.location.href = '/limit/product/index';
}, 'growl-success');
$this.removeAttr('disabled');
} else {
limitAddForm.$tip(res.data.message);
$this.removeAttr('disabled');
}
return false;
};
option.error=function(res){
limitAddForm.$tip(res.message);
$this.removeAttr('disabled');
};
//文字,图片,视频上传数据
option.data.attachmentContent = [];
option.data.attachmentContent.push({
attachUrl:option.data.coverImg,
isDefault: 1,
attachType: 1,
orderBy: 0
});
if ($('.quota-content').size() > 0) {
$('.quota-content').each(function(i) {
var editType = $(this).data('type'),
content = '',
obj = {
attachType: editType, //上传内容类型,1:图片, 2:视频,3:文字
isDefault: 0, //是否封面图
orderBy: i //排序
};
if (editType == 3) {
content = $(this).find('span').text();
obj.intro = content; //文字key为intro
} else if (editType == 1) {
content = $(this).find('img').attr('src');
obj.attachUrl = content; //图片key为attachUrl
common.util.__ajax2({
url:'/limit/checkBatch',
data: param
}, function(res) {
if (res.code == 200) {
limitAddForm.submit($('#limit-add-form').attr('action'), function(option, that) {
option.beforeSend = function () {
$this.attr('disabled', 'disabled');
var param = {
batchNo: $('#batchNo').val()
}
if (type == 'update') {
param.id = $('#batchNo').data('id');
}
};
option.success=function(res){
if (res.data.code == 200) {
//成功返回列表页
limitAddForm.$tip('提交成功',function(){
//window.location.href = '/limit/product/index';
}, 'growl-success');
$this.removeAttr('disabled');
} else {
limitAddForm.$tip(res.data.message);
$this.removeAttr('disabled');
}
return false;
};
option.error=function(res){
limitAddForm.$tip(res.message);
$this.removeAttr('disabled');
};
//文字,图片,视频上传数据
option.data.attachmentContent = [];
option.data.attachmentContent.push({
attachUrl:option.data.coverImg,
isDefault: 1,
attachType: 1,
orderBy: 0
});
if ($('.quota-content').size() > 0) {
$('.quota-content').each(function(i) {
var editType = $(this).data('type'),
content = '',
obj = {
attachType: editType, //上传内容类型,1:图片, 2:视频,3:文字
isDefault: 0, //是否封面图
orderBy: i //排序
};
if (editType == 3) {
content = $(this).find('span').text();
obj.intro = content; //文字key为intro
} else if (editType == 1) {
content = $(this).find('img').attr('src');
obj.attachUrl = content; //图片key为attachUrl
}
option.data.attachmentContent.push(obj)
});
}
option.data.attachmentContent.push(obj)
});
}
//因为只能传字符串,转换为字符串
option.data.attachmentContent = JSON.stringify(option.data.attachmentContent);
//因为只能传字符串,转换为字符串
option.data.attachmentContent = JSON.stringify(option.data.attachmentContent);
//时间上传为时间戳
option.data.saleTime = new Date(option.data.saleTime.replace('-',',')).getTime() / 1000;
console.log(option.data);
//时间上传为时间戳
option.data.saleTime = new Date(option.data.saleTime.replace('-',',')).getTime() / 1000;
console.log(option.data);
});
}
});
});
//编辑页,时间戳转换
... ...
... ... @@ -163,6 +163,7 @@ var loadtab=function(){
},true);
},400);
}
loadtab();
$("#filter-btn").click(function(){
loadtab();
... ...
//exports.domain = require('../config/common.js').domain;
exports.domain = 'http://172.16.6.240:8088/platform';
exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.240:8088/platform';
//路由配置
exports.res = [
... ...
... ... @@ -248,7 +248,7 @@ exports.res = [
reqDepartment: "零售运营部/平台运营",
limitTimes: 1,
userUseLimit: 1,
userTypeLimit: '1|2|3|4|5|6|7'
userTypeLimit: '1|2|3|4|5|6'
}
},
src:'/market/limitcode-edit'
... ...
... ... @@ -28,13 +28,27 @@
<div class="panel-col2">
<input id="skn" class="form-control panel-input" type="text" placeholder="请输入SKN">
</div>
<div class="panel-col2">
<div class="panel-col">
<label class="control-label pull-left">是否开启:</label>
<div class="label-leading pull-left">
<label class="radio-inline"><input type="radio" name="showFlag" value="1"></label>
<label class="radio-inline"><input type="radio" name="showFlag" value="0"></label>
</div>
</div>
<!-- <div class="panel-col">
<label class="control-label pull-left">热门:</label>
<div class="label-leading pull-left">
<label class="radio-inline"><input type="radio" name="hotFlag" value="1">是</label>
<label class="radio-inline"><input type="radio" name="hotFlag" value="0">否</label>
</div>
</div>
<div class="panel-col">
<label class="control-label pull-left">是否发售:</label>
<div class="label-leading pull-left">
<label class="radio-inline"><input type="radio" name="saleFlag" value="1">是</label>
<label class="radio-inline"><input type="radio" name="saleFlag" value="0">否</label>
</div>
</div> -->
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
</div>
... ...
... ... @@ -24,12 +24,7 @@
<!--required pattern="^[0-9]+$"-->
</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>
</div>
<div class="form-group">
... ... @@ -65,10 +60,10 @@
<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 >
<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 >
<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>
... ... @@ -140,12 +135,19 @@
<input type="checkbox" value="7" name="userTypeLimit"> 指定用户
</label>
</div>
<div class="col-sm-2">
<input type="text" class="form-control" id="UID" placeholder="UID">
</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>
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">指定商品</label>
... ...