Authored by liuyue

网销

... ... @@ -3,21 +3,11 @@ var $ = require('jquery'),
common = require('../common/common');
require('../util/custom.js');
/*
* 获取业务数据
*/
window.NETSALEDATA=require('./partials/data.js');
require('./partials/netsale-ty.js');
/*
* 获取业务数据
*/
window.NETSALEDATA = require('./partials/data.js');
// console.log(NETSALEDATA);
// window.NETSALEEDIT = new common.edit('#netsaleAllInfo', {
// bucket: 'goodsimg'
// });
require('./partials/netsale-ty.js');
console.log(window.NETSALEDATA);
//获取skn
$('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
... ... @@ -29,28 +19,11 @@ require('./partials/basic-info');
require('./partials/editor_recommend');
require('./partials/model');
require('./partials/search-key.js');
require('./partials/size-info.js');
require('./partials/goods-sort.js');
require('./partials/video.js');
require('./partials/brand-relation');
require('./partials/add-info');
//初始化网销表单
// NETSALEEDIT.init();
// var e = new common.edit('#basicForm');
// e.init();
// common.edit.ajaxfileupload('.goods-img', {
// action: '/ajax/upload',
// onComplete: function() {
// }
// })
if ($('.contentpanel').data('type') == 'info') {
$('form').find('input').prop('disabled', true);
$('form').find('.btn').addClass('disabled');
}
}
\ No newline at end of file
... ...
... ... @@ -69,20 +69,23 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), {
}));
var e = new common.edit('#basicInfoWrap');
e.init();
//上架必填
NETSALEDATA.productExtBo.sellChannels = NETSALEDATA.productExtBo.sellChannels.replace(/,/g, "|");
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), NETSALEDATA.productExtBo));
$('#saveBasicInfo').on('click', function() {
NETSALEEDIT.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
e.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
var list = option.data.sellChannels.split('|').join(',');
option.data.sellChannels = list;
option.success = function(res) {
res = res.data;
if (res.code == '200') {
NETSALEEDIT.$tip(res.message, function() {}, 'growl-success');
e.$tip(res.message, function() {}, 'growl-success');
} else {
NETSALEEDIT.$tip(res.message);
e.$tip(res.message);
}
return false;
}
... ...
... ... @@ -37,12 +37,16 @@ common.util.__ajax({
}, true);
var brandSelectArr = [];
var brandSelectArr = NETSALEDATA.brandRelationList;
$.each(NETSALEDATA.relationBrandNameList, function(i, value) {
$('<div class="col-sm-2" data-id="' + NETSALEDATA.brandRelationList[i] + '">' + NETSALEDATA.relationBrandNameList[i] + '</div>').appendTo($('.selected-brand'));
});
$('#brandWrap').on('change', 'input[name="brandRelationList"]', function() {
var $val = $(this).val(),
var $val = parseInt($(this).val()),
position = brandSelectArr.indexOf($val);
console.log($val, position);
if (position == -1) {
brandSelectArr.push($val);
$('<div class="col-sm-2" data-id="' + $val + '">' + $(this).data('name') + '</div>').appendTo($('.selected-brand'));
... ... @@ -60,9 +64,9 @@ $('#saveBrandRelation').on('click', function() {
option.success = function(res) {
res = res.data;
if (res.code == '200') {
NETSALEEDIT.$tip(res.message, function() {}, 'growl-success');
e.$tip(res.message, function() {}, 'growl-success');
} else {
NETSALEEDIT.$tip(res.message);
e.$tip(res.message);
}
return false;
}
... ...
... ... @@ -3,7 +3,7 @@ var $ = require('jquery'),
common = require('../../common/common');
NETSALEEDIT.on('validate', function() {
/*NETSALEEDIT.on('validate', function() {
var val = $.trim($('#videofile').attr('value'));
if (val == '') {
return '请上传视频'
... ... @@ -29,4 +29,4 @@ $('#saveVideo').on('click', function() {
return false;
}
});
});
\ No newline at end of file
});*/
\ No newline at end of file
... ...
... ... @@ -5,7 +5,7 @@
</div>
<h2 class="panel-title">基本信息</h2>
</div>
<div class="panel-body nopadding">
<div id="basicInfoWrap" class="panel-body nopadding">
<div id="basic-info"></div>
<div id="goods-table"></div>
<div id="product-ext"></div>
... ...
... ... @@ -10,7 +10,6 @@
<input id="brandRelationList" type="hidden" value="[[brandRelation]]" for="checkbox">
</div>
<div class="form-group brand-list">
</div>
</div>
<div class="panel-footer">
... ...