Authored by lijian

网销优化

... ... @@ -104,6 +104,12 @@ module.exports={
params: [
{name: 'productSkn', type: 'number'},
{name: 'productName', type: 'string'},
{name: 'ageLevel', type: 'String'},
{name: 'gender', type: 'String'},
{name: 'grade', type: 'Number'},
{name: 'isLimited', type: 'String'},
{name: 'isOutlets', type: 'String'},
{name: 'seasons', type: 'String'},
{name: 'isNew', type: 'string'},
{name: 'sellChannels', type: 'string'},
{name: 'phrase', type: 'string'},
... ...
... ... @@ -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,90 @@
<div class="form-group">
<div class="col-sm-12">商品话题:[[productTag]]</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">性别 <span class="red">*</span></label>
<div class="col-sm-2">
<label class="radio-inline">
<input type="radio" name="gender" value="1"></label>
<label class="radio-inline">
<input type="radio" name="gender" value="2"></label>
<label class="radio-inline">
<input type="radio" name="gender" value="3">通用</label>
<input type="hidden" id="gender" name="gender" value="[[gender||'1']]" for="radio" required />
</div>
<label class="col-sm-1 control-label">年龄层 <span class="red">*</span></label>
<div class="col-sm-3">
<label class="radio-inline" style="padding-left: 0">
<input type="checkbox" name="ageLevel" value="1">成人</label>
<label class="radio-inline">
<input type="checkbox" name="ageLevel" value="2">大童</label>
<label class="radio-inline">
<input type="checkbox" name="ageLevel" value="3">小童</label>
<label class="radio-inline">
<input type="checkbox" name="ageLevel" value="4">中童</label>
<label class="radio-inline">
<input type="checkbox" name="ageLevel" value="5">幼童</label>
<input type="hidden" id="ageLevel" name="ageLevel" value="[[ageLevel]]" for="checkbox" placeholder="年龄层" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">重点款 <span class="red">*</span></label>
<div class="col-sm-2">
<label class="radio-inline">
<input type="radio" name="grade" value="1"></label>
<label class="radio-inline">
<input type="radio" name="grade" value="0"></label>
</div>
<input type="hidden" id="grade" value="[[grade||'0']]" for="radio" required/>
<label class="col-sm-1 control-label">适销季 <span class="red">*</span></label>
<div class="col-sm-4">
<label class="radio-inline" style="padding-left: 0">
<input type="checkbox" name="seasons" value="spring"></label>
<label class="radio-inline">
<input type="checkbox" name="seasons" value="summer"></label>
<label class="radio-inline">
<input type="checkbox" name="seasons" value="autumn"></label>
<label class="radio-inline">
<input type="checkbox" name="seasons" value="winter"></label>
<label class="radio-inline">
<input type="checkbox" name="seasons" value="seasons">四季</label>
<input type="hidden" id="seasons" name="seasons" value="[[seasons||'seasons']]" for="checkbox" placeholder="年龄层" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">限量款</label>
<div class="col-sm-3">
<label class="radio-inline">
<input type="radio" name="isLimited" value="Y"></label>
<label class="radio-inline">
<input type="radio" name="isLimited" value="N"></label>
</div>
<input id="isLimited" type="hidden" value="[[isLimited||'N']]" for="radio" />
<label class="col-sm-3 control-label">是否奥莱</label>
<div class="col-sm-3">
<label class="radio-inline">
<input type="radio" name="isOutLets" value="Y"></label>
<label class="radio-inline">
<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">年龄层:[[ageLevel]]</div>
<div class="col-sm-3">性别:[[gender]]</div>
<div class="col-sm-3">重点款:[[grade]]</div>
</div>
<div class="form-group">
</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>
</div>-->
<div class="form-group">
<div class="col-sm-3">是否预售:[[isAdvance]]</div>
[[if isAdvance=='是']]
... ...
... ... @@ -28,32 +28,9 @@ function sense() {
return '';
}
}
function attributeObj() {
var attributeArr = [];
$('.attribute-group').each(function() {
var id=$(this).find('[id]').attr('id');
attributeArr.push({
productSkn: basicInfo.productSkn,
attributeId: id,
attributeValueId: common.util.__input(id).split('|').join(',')
})
});
return attributeArr;
}
$('#saveAddInfo').on('click', function() {
common.util.__ajax({
url:'/goods/product/saveAfterSaleInfo',
data:{
productSkn:basicInfo.productSkn,
makeCrafts:common.util.__input('makeCrafts'),
salesPhrase:common.util.__input('salesPhrase'),
isHostsell:common.util.__input('[name=isHostsell]:checked'),
wearSense:sense(),
attributeProValuesTwo:JSON.stringify(attributeObj())
}
});
});
function inputDisabled(callback) {
if ($('.contentpanel').data('type') == 'info') {
$('.contentpanel').find('input').prop('disabled', true);
... ... @@ -148,6 +125,41 @@ common.util.__ajax({
});
},true);
$('#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,"");
});
});
function attributeObj() {
var attributeArr = [];
$('.attribute-group').each(function() {
var id=$(this).find('[id]').attr('id');
attributeArr.push({
productSkn: basicInfo.productSkn,
attributeId: id,
attributeValueId: common.util.__input(id).split('|').join(',')
})
});
return attributeArr;
}
$('#saveAddInfo').on('click', function() {
common.util.__ajax({
url:'/goods/product/saveAfterSaleInfo',
data:{
productSkn:basicInfo.productSkn,
makeCrafts:common.util.__input('makeCrafts'),
salesPhrase:common.util.__input('salesPhrase'),
isHostsell:common.util.__input('[name=isHostsell]:checked'),
wearSense:sense(),
attributeProValuesTwo:JSON.stringify(attributeObj())
}
});
});
//去编辑商品名称
$('#editProductName').on('click', function() {
$('#productName').focus();
... ...
... ... @@ -110,6 +110,7 @@ console.log('basic:' + JSON.stringify(basicInfoData));
basicInfohtml = common.util.__template2($('#basicInfo').html(), basicInfoData);
$('#basic-info').html(basicInfohtml);
//能否补货
var suppledTable = new common.grid({
el: '#suppled-table',
... ... @@ -164,6 +165,40 @@ common.util.__ajax({
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
}, true);
$(document).on("change", ":checkbox[name=ageLevel]", function () {
var value = $(this).val();
var c = $(":checkbox[name=ageLevel]");
if ($(this).is(":checked")) {
if (value == 1) {
c.slice(1, 5).prop("checked", false);
} else {
c.eq(0).prop("checked", false);
}
}
var arr = [];
$(":checked[name=ageLevel]").each(function () {
arr.push($(this).val())
});
$("#ageLevel").val(arr.join('|'));
});
$(document).on("change",":checkbox[name=seasons]",function(){
var value=$(this).val();
var c=$(":checkbox[name=seasons]");
if($(this).is(":checked")){
if(value=="seasons"){
c.slice(0,4).prop("checked",false);
}else{
c.eq(4).prop("checked",false);
}
}
var arr=[];
$(":checked[name=seasons]").each(function(){
arr.push($(this).val())
});
$("#seasons").val(arr.join('|'));
});
$('#saveBasicInfo').on('click', function() {
common.util.__ajax({
... ... @@ -176,7 +211,13 @@ $('#saveBasicInfo').on('click', function() {
phrase:common.util.__input('phrase'),
outSaleTime:common.util.__input('outSaleTime'),
shopIds:common.util.__input('[name=shopIds]:checked'),
delayArrivalNotice:common.util.__input('delayArrivalNotice')
delayArrivalNotice:common.util.__input('delayArrivalNotice'),
ageLevel:common.util.__input('ageLevel'),
gender:common.util.__input('gender'),
grade:common.util.__input('grade'),
isLimited:common.util.__input('isLimited'),
isOutlets:common.util.__input('isOutlets'),
seasons:common.util.__input('seasons')
}
})
})
... ...
... ... @@ -495,8 +495,15 @@ $(document).on("click", "#fenMainSave", function () {
common.util.__ajax({
url: '/product/manageProductImg',
data: data
});
return false;
}, function(res) {
if (res.code == 200) {
common.util.__tip(res.message, 'success');
} else {
common.util.__tip(res.message, 'danger');
}
}, true);
return false;
});
... ... @@ -527,7 +534,8 @@ function getFenManData () {
//if (map.goodsImagesBoList.length == 0) return;
map.goodsImagesBoList = JSON.stringify(map.goodsImagesBoList);
if(typeof(map.productSkc) == "undefined"){
return '<p>请设置商品默认封面</p>';
common.util.__tip("请设置商品默认封面", 'danger');
return 'fail';
}
if (msg != '') {
return {
... ...