Authored by lijian

2.5网销优化

... ... @@ -145,7 +145,13 @@ module.exports={
{name: 'sellChannels',type: 'string'},
{name: 'phrase',type: 'string'},
{name: 'outSaleTime',type: 'number'},
{name: 'shopIds',type: 'string'}
{name: 'shopIds',type: 'string'},
{name: 'ageLevel',type: 'string'},
{name: 'gender',type: 'Number'},
{name: 'grade',type: 'string'},
{name: 'isLimited',type: 'string'},
{name: 'isOutlets',type: 'string'},
{name: 'seasons',type: 'string'}
]
},
saveAfterSaleInfo:{
... ...
... ... @@ -143,7 +143,7 @@
</div>
<input type="hidden" id="shopId" value="<%shopId%>">
<script type="text/template" id="onshelve-template">
<!--<script type="text/template" id="onshelve-template">
<form class="shelve-form form-horizontal ">
<div class="panel panel-default">
<div class="panel-body nopadding">
... ... @@ -167,8 +167,52 @@
</div>
</div>
</form>
</script>-->
<script type="text/template" id="common-onshelve-template">
<form class="shelve-form form-horizontal form-bordered">
<div class="panel panel-default">
<div class="panel-body nopadding">
<div class="form-group">
<span class="label label-success">共选中{num}skn</span>
</div>
<div class="form-group">
<div class="col-sm-3 height40">预上架时间:</div>
<div class="col-sm-6"><input id="shelveTime" class="form-control" jsaction="time" type="text" placeholder="预上架时间" readonly>
<span class="red">预上架请填写上架时间</span>
</div>
</div>
<div class="form-group">
<a class="btn btn-info" data-type="2" href="javascript:;">上架上新</a>
<a class="btn btn-info" data-type="1" href="javascript:;">上架不上新</a>
</div>
</div>
</div>
</form>
</script>
<script type="text/template" id="presell-onshelve-template">
<form class="shelve-form form-horizontal form-bordered">
<div class="panel panel-default">
<div class="panel-body nopadding">
<div class="form-group">
<span class="label label-success">共选中{num}skn</span>
</div>
<div class="form-group">
<div class="col-sm-3 height40">预售时间:</div>
<div class="col-sm-4"><input id="advanceBeginTime" class="form-control" jsaction="time:end:advanceEndTime" type="text" placeholder="预售上架时间" readonly></div>
<div class="col-sm-4"><input id="advanceEndTime" class="form-control" jsaction="time:start:advanceBeginTime" type="text" placeholder="预售下架时间" readonly></div>
<div class="panel-col" style="margin-top: 6px;"><a class="btn btn-info" data-type="5" href="javascript:;">确定</a>
<button id="cancelShelve" type="button" data-id="cancel" class="modal-cancel btn btn-default">取消</button>
</div>
</div>
</div>
</div>
</form>
</script>
<script type="text/template" id="offshelve-template">
<form class="shelve-form form-horizontal">
<div class="panel panel-default">
... ...
... ... @@ -12,6 +12,7 @@
</div>
<div class="panel-footer">
<a id="saveAddInfo" href="javascript:;" class="btn btn-primary">保存</a>
<a id="clearAddInfo" href="javascript:;" class="btn btn-primary">清空</a>
</div>
</div>
... ...
... ... @@ -63,16 +63,78 @@
<div class="form-group">
<div class="col-sm-12">商品话题:[[productTag]]</div>
</div>
<div class="form-group">
<div class="col-sm-3">年龄层:[[ageLevel]]</div>
<div class="col-sm-3">性别:[[gender]]</div>
<div class="col-sm-3">重点款:[[grade]]</div>
<div class="col-sm-3">
<label>性别<span class="red">*:</span>
<label>
<input type="radio" name="gender" value="1"></label>
<label >
<input type="radio" name="gender" value="2"></label>
<label>
<input type="radio" name="gender" value="3">通用</label>
<input type="hidden" id="gender" name="gender" value="[[gender||'1']]" for="radio" required />
</label>
</div>
<div class="col-sm-3">
<label>年龄层<span class="red">*:</span></label>
<label>
<input type="checkbox" name="ageLevel" value="1">成人</label>
<label >
<input type="checkbox" name="ageLevel" value="2">大童</label>
<label >
<input type="checkbox" name="ageLevel" value="3">小童</label>
<label >
<input type="checkbox" name="ageLevel" value="4">中童</label>
<label >
<input type="checkbox" name="ageLevel" value="5">幼童</label>
<input type="hidden" id="ageLevel" name="ageLevel" value="[[ageLevel]]" for="checkbox" placeholder="年龄层" required />
</div>
<div class="col-sm-3">
<label>重点款<span class="red">*:</span></label>
<label >
<input type="radio" name="grade" value="1"></label>
<label >
<input type="radio" name="grade" value="0"></label>
</div>
<input type="hidden" id="grade" value="[[grade||'0']]" for="radio" required/>
</div>
<div class="form-group">
<div class="col-sm-3">是否奥莱:[[isOutLets]]</div>
<div class="col-sm-3">限量款:[[isLimited]]</div>
<div class="col-sm-3">适销季:[[seasons]]</div>
<div class="col-sm-3">
<label>适销季<span class="red">*:</span></label>
<label>
<input type="checkbox" name="seasons" value="spring"></label>
<label >
<input type="checkbox" name="seasons" value="summer"></label>
<label >
<input type="checkbox" name="seasons" value="autumn"></label>
<label >
<input type="checkbox" name="seasons" value="winter"></label>
<label >
<input type="checkbox" name="seasons" value="seasons">四季</label>
<input type="hidden" id="seasons" name="seasons" value="[[seasons||'seasons']]" for="checkbox" placeholder="年龄层" />
</div>
<div class="col-sm-3">
<label>限量款:</label>
<label >
<input type="radio" name="isLimited" value="Y"></label>
<label >
<input type="radio" name="isLimited" value="N"></label>
</div>
<input id="isLimited" type="hidden" value="[[isLimited||'N']]" for="radio" />
<div class="col-sm-3">
<label>是否奥莱:</label>
<label >
<input type="radio" name="isOutLets" value="Y"></label>
<label >
<input type="radio" name="isOutLets" value="N"></label>
<input type="hidden" id="isOutlets" value="[[isOutLets||'N']]" for="radio" />
</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否预售:[[isAdvance]]</div>
[[if isAdvance=='是']]
... ... @@ -106,15 +168,15 @@
<div class="form-group">
<label class="col-sm-1 control-label">是否新品:</label>
<div class="col-sm-4">
<label class="radio-inline"><input type="radio" name="isNew" value="Y"></label>
<label class="radio-inline"><input type="radio" name="isNew" value="N"></label>
<label ><input type="radio" name="isNew" value="Y"></label>
<label ><input type="radio" name="isNew" value="N"></label>
<input id="isNew" type="hidden" value="[[isNew||'Y']]" for="radio">
</div>
<label class="col-sm-1 control-label">上架渠道:</label>
<div class="col-sm-4">
<label class="radio-inline"><input type="checkbox" name="sellChannels" value="1">网站</label>
<label class="radio-inline"><input type="checkbox" name="sellChannels" value="2">手机</label>
<label class="radio-inline"><input type="checkbox" name="sellChannels" value="3">场地</label>
<label ><input type="checkbox" name="sellChannels" value="1">网站</label>
<label ><input type="checkbox" name="sellChannels" value="2">手机</label>
<label ><input type="checkbox" name="sellChannels" value="3">场地</label>
<input id="sellChannels" value="[[sellChannels||'1|2']]" type="hidden" for="checkbox">
</div>
</div>
... ... @@ -136,7 +198,7 @@
<label class="col-sm-1 control-label">展示店铺:</label>
<div class="col-sm-4">
[[each shopList as a index]]
<label class="radio-inline"><input type="checkbox" name="shopIds" value="[[a.shopsId]]">[[a.shopName]]</label>
<label ><input type="checkbox" name="shopIds" value="[[a.shopsId]]">[[a.shopName]]</label>
[[/each]]
</div>
</div>
... ...
... ... @@ -105,9 +105,10 @@ $(document).on("click", "#saveAllInfo", function() {
}
$.extend(data, value, true);
});
if (error !== '') {
// alert(error);
if (error != '') {
common.util.__tip(error, 'warning');
return false;
} else {
e.submit('/product/saveNetSaleAllInfo', function(option) {
option.data = data;
... ...
... ... @@ -353,7 +353,7 @@ var g = new common.grid({
}else{
intValue=item.productSearch.intValue;
}
HtmArr.push('<br><br><input type="text" style="width:100px" name="brandSort" class="brandSortText" data-index="' + item.__index + '" value='+intValue+'>');
HtmArr.push('<br><br><input type="text" style="width:100px" id="brandSortId" name="brandSort" class="brandSortText" data-index="' + item.__index + '" value='+intValue+'>');
HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs brandSort-btn" data-index="' + item.__index + '" >品牌排序</a>');
if(typeof(item.shopsSearchSort) == "undefined"){
... ... @@ -361,7 +361,7 @@ var g = new common.grid({
}else{
intVal_shopsSearchSort = item.shopsSearchSort.intValue;
}
HtmArr.push('<br><br><input type="text" style="width:100px" name="shopsSort" class="brandSortText" data-index="' + item.__index + '" value='+ intVal_shopsSearchSort+'>');
HtmArr.push('<br><br><input type="text" style="width:100px" id="shopsSortId" name="shopsSort" class="brandSortText" data-index="' + item.__index + '" value='+ intVal_shopsSearchSort+'>');
HtmArr.push('<a href="javascript:;" class="btn btn-success btn-xs shopsSort-btn" data-index="' + item.__index + '" >店铺排序</a>');
return HtmArr.join('');
... ... @@ -405,20 +405,23 @@ function shelveModal(title, html) {
var selectedArr = g.selected,
len = selectedArr.length,
productSknList = [],
shelveLayer = null;
shelveLayer = null,
shelveData = {};
if (len <= 0) {
common.util.__tip('请选择要' + title + '的商品', 'warning');
return;
}
$.each(selectedArr, function(i, value) {
shelveData.num=selectedArr.length;
$.each(selectedArr, function(i, value) {
productSknList.push(value['productSkn']);
});
shelveLayer = common.dialog.open({
title: title,
content: html
content: common.util.__template(html, shelveData),
});
... ... @@ -434,7 +437,14 @@ function shelveModal(title, html) {
var e = new common.edit('.shelve-form');
e.init();
$('.shelve-form').on('click', '.btn', function() {
//取消
var nocancel=true;
$('#cancelShelve').on('click', function () {
nocancel=false;
});
$('.shelve-form').on('click', '.btn', function() {
var type = $(this).data('type');
$(this).closest('.form-group').find('input').attr('required', true)
.end().siblings('.form-group').find('input').attr('required', false);
... ... @@ -463,7 +473,7 @@ function shelveModal(title, html) {
data.type=type;
}
}
if(!isValidate){
if(!isValidate&&nocancel){
common.util.__ajax({
url:'/product/updateProductSknTimingInfo',
data:data
... ... @@ -477,7 +487,17 @@ function shelveModal(title, html) {
}
//批量skn上架
$('#onshelve').on('click', function() {
shelveModal('上架', $('#onshelve-template').html());
var selectedArr = g.selected;
if (selectedArr.length == 0) {
common.util.__tip("未选中任何SKN, 请核实!", 'warning');
return false;
} else {
if (selectedArr[0].isAdvance === 'N') {
shelveModal('普通商品上架', $('#common-onshelve-template').html());
} else {
shelveModal('预售商品上架', $('#presell-onshelve-template').html());
}
}
});
//批量skn下架
$('#offshelve').on('click', function() {
... ... @@ -694,6 +714,12 @@ $(document).on("click", ".chima-btn", function () {
/**
*品牌排序
*/
/*验证 hack*/
$(document).on('keyup', '#brandSortId', function() {
$(this).val($(this).val().replace(/\D/g, ''));
});
$(document).on("click", ".brandSort-btn", function () {
var item = g.rows[$(this).data("index")];
var num = $("input:text[name='brandSort']").eq($(this).data("index")).val();
... ... @@ -717,6 +743,12 @@ $(document).on("click", ".brandSort-btn", function () {
/**
*店铺商品排序
*/
/*验证 hack*/
$(document).on('keyup', '#shopsSortId', function() {
$(this).val($(this).val().replace(/\D/g, ''));
});
$(document).on("click", ".shopsSort-btn", function () {
var item = g.rows[$(this).data("index")];
var num = $("input:text[name='shopsSort']").eq($(this).data("index")).val();
... ...
... ... @@ -7,7 +7,13 @@ var e = new common.edit('#addinfo-wrap'),
productExtBo = NETSALEDATA.productExtBo || '',
comfort = NETSALEDATA.specialAttrBo ? NETSALEDATA.specialAttrBo.wearSenses : "";
$('#clearAddInfo').on('click', function() {
$("#addinfo-wrap").find("input[type='checkbox']").removeAttr('checked')
$('.attribute-group').each(function() {
var id=$(this).find('[id]').attr('id');
common.util.__setInput(id,"");
});
});
/*上架补全信息*/
$('#saveAddInfo').on('click', function() {
... ...