Authored by liuyue

网销

... ... @@ -3,21 +3,10 @@ var $ = require('jquery'),
common = require('../common/common');
require('../util/custom.js');
/*
* 获取业务数据
*/
window.NETSALEDATA=require('./partials/data.js');
/*
* 获取业务数据
*/
window.NETSALEDATA = require('./partials/data.js');
// console.log(NETSALEDATA);
// window.NETSALEEDIT = new common.edit('#netsaleAllInfo', {
// bucket: 'goodsimg'
// });
//获取skn
$('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
... ... @@ -32,22 +21,8 @@ require('./partials/brand-relation');
require('./partials/add-info');
require('./partials/netsale-ty.js');
//初始化网销表单
// 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
... ...
... ... @@ -68,14 +68,15 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), {
goodsList: NETSALEDATA.goodsList
}));
var e = new common.edit('#basicInfoWrap');
e.init();
//上架必填
NETSALEDATA.productExtBo.renderType = $('.contentpanel').data('type');
NETSALEDATA.productExtBo.sellChannels = NETSALEDATA.productExtBo.sellChannels.replace(/,/g, "|");
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), NETSALEDATA.productExtBo));
var e = new common.edit('#basicInfoWrap');
e.init();
$('#saveBasicInfo').on('click', function() {
e.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
var list = option.data.sellChannels.split('|').join(',');
... ...
... ... @@ -2,7 +2,8 @@ var $ = require('jquery'),
common = require('../../common/common');
var e = new common.edit('#brandWrap');
var e = new common.edit('#brandWrap'),
brandSelectArr = [];
common.util.__ajax({
url: '/goods/brands/queryBrandsByStatus'
}, function(res) {
... ... @@ -30,16 +31,15 @@ common.util.__ajax({
if (NETSALEDATA.brandRelationList) {
$('#brandWrap').html(common.util.__template2($('#brandWrap').html(), {
brandRelation: NETSALEDATA.brandRelationList.join('|')
brandRelationList: NETSALEDATA.brandRelationList,
brandRelation: brandSelectArr.join('|')
}));
};
e.init();
}, true);
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'));
$.each(NETSALEDATA.brandRelationList, function(index, value) {
brandSelectArr.push(value.brandId);
});
$('#brandWrap').on('change', 'input[name="brandRelationList"]', function() {
... ...
... ... @@ -36,8 +36,8 @@
</div>
<div class="form-group">
<div class="col-sm-1 height40">商品名称<i class="red">*</i>:</div>
[[if renderType== 'edit']]
<div class="col-sm-8"><input id="productName" class="form-control" placeholder="基础商品名称" type="text" required></div>
[[if renderType=='edit']]
<div class="col-sm-8"><input id="productName" class="form-control" placeholder="基础商品名称" type="text" value="[[productName]]" required></div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div>
[[else]]
<div class="col-sm-8 height40">[[productName]]</div>
... ... @@ -115,8 +115,8 @@
<div class="form-group">
<div class="col-sm-1 height40">商品短评<i class="red">*</i>:</div>
<div class="col-sm-8 height40">
[[if renderType== 'edit']]
<input class="form-control" placeholder="商品短评" type="text" required>
[[if renderType=='edit']]
<input class="form-control" placeholder="商品短评" value="[[phrase]]" type="text" required>
[[else]]
<span>[[phrase]]</span>
[[/if]]
... ...
... ... @@ -8,6 +8,10 @@
<div id="brandWrap" class="panel-body">
<div class="form-group selected-brand" style="min-height: 60px;">
<input id="brandRelationList" type="hidden" value="[[brandRelation]]" for="checkbox">
[[each brandRelationList as a index]]
<div class="col-sm-2" data-id="[[a.brandId]]">[[a.brandName]]</div>
[[/each]]
</div>
<div class="form-group brand-list">
</div>
... ...