Authored by liuyue

页面崩溃bug fix

... ... @@ -116,9 +116,11 @@ $(document).on("click", "#saveAllInfo", function() {
$.extend(data, value, true);
});
e.submit('/goods/product/saveNetSaleAllInfo', function(option) {
option.data = data;
option.success = function(res) {
if (typeof data != 'string') {
common.util.__ajax({
url: '/goods/product/saveNetSaleAllInfo',
data: data
}, function(res) {
res = res.data;
if (res.code == '200') {
e.$tip(res.message, function() {
... ... @@ -128,8 +130,9 @@ $(document).on("click", "#saveAllInfo", function() {
e.$tip(res.message);
}
return false;
}
});
});
}
})
... ...
... ... @@ -174,20 +174,10 @@ $('#saveBasicInfo').on('click', function() {
});
GOLABDATA.on("LYbasicInfo", function() {
/*return e.submit('', function(option) {
var list = option.data.sellChannels.split('|').join(',');
return e.submit('', function(option) {
option.data.productSkn = $('#productSkn').val();
option.data.sellChannels = list;
option.data.shopIds = $('#shopIds').val() ? $('#shopIds').val().split('|').join(',') : '';
option.data.sellChannels = option.data.sellChannels.split('|').join(',');
option.data.shopIds = option.data.shopIds.split('|').join(',');
option.debug = true;
});*/
var data = {};
data.productSkn = $('#productSkn').val();
$('#basicInfoWrap').find('input').each(function() {
var key = $(this).attr('id');
if (key) {
data[key] = $(this).val().split('|').join(',');
}
});
return data;
});
\ No newline at end of file
... ...
var $ = require('jquery'),
common = require('../../common/common');
var e = new common.edit('#brandWrap'),
brandSelectArr = [];
common.util.__ajax({
url: '/goods/brands/queryBrandsByStatus'
}, function(res) {
var data = res.data,
map = {},
firstName = '';
$.each(data, function(i, item) {
firstName = item.brandAlif.toUpperCase();
if (/^[a-zA-Z]$/.test(firstName)) {
if (!map.hasOwnProperty(firstName)) {
map[firstName] = [];
}
map[firstName].push(item);
} else {
if (!map.hasOwnProperty('0-9')) {
map['0-9'] = [];
}
map['0-9'].push(item);
}
});
var brandHtml = common.util.__template2($('#brandTemp').html(), {
map: map
});
// var docFrag = new DocumentFragment();
// docFrag.firstChild.nodeValue = brandHtml;
$('#brand-list').html(brandHtml);
if (NETSALEDATA.brandRelationList) {
$('.selected-brand').html(common.util.__template2($('#brandShowTemp').html(), {
brandRelationList: NETSALEDATA.brandRelationList,
brandRelation: brandSelectArr.join('|')
}));
};
e.init();
if ($('.contentpanel').data('type') == 'info') {
$('.brand-list').find('input').attr('disabled', true);
}
}, true);
$.each(NETSALEDATA.brandRelationList, function(index, value) {
brandSelectArr.push(value.brandId);
});
$('#brandWrap').on('change', 'input[name="brandRelationList"]', function() {
var $val = parseInt($(this).val()),
position = brandSelectArr.indexOf($val);
if (position == -1) {
brandSelectArr.push($val);
$('<div class="col-sm-2" data-id="' + $val + '">' + $(this).data('name') + '</div>').appendTo($('.selected-brand'));
} else {
brandSelectArr.splice(position, 1);
$('div[data-id="' + $val + '"]').remove();
};
});
$('#saveBrandRelation').on('click', function() {
e.submit('/goods/product/saveBrandRelation', function(option) {
option.data = GOLABDATA.fire("LYbrandRelation");
option.success = function(res) {
res = res.data;
if (res.code == '200') {
e.$tip(res.message, function() {}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
}
});
});
GOLABDATA.on("LYbrandRelation", function() {
return {
productSkn: $('#productSkn').val(),
brandRelationList: JSON.stringify($('#brandRelationList').val().split('|'))
}
/*return e.submit('', function(option) {
option.data.productSkn = $('#productSkn').val();
option.data.brandRelationList = JSON.stringify(option.data.brandRelationList.split('|'));
option.debug = true;
});*/
var $ = require('jquery'),
common = require('../../common/common');
var e = new common.edit('#brandWrap'),
brandSelectArr = [];
common.util.__ajax({
url: '/goods/brands/queryBrandsByStatus'
}, function(res) {
var data = res.data,
map = {},
firstName = '';
$.each(data, function(i, item) {
firstName = item.brandAlif.toUpperCase();
if (/^[a-zA-Z]$/.test(firstName)) {
if (!map.hasOwnProperty(firstName)) {
map[firstName] = [];
}
map[firstName].push(item);
} else {
if (!map.hasOwnProperty('0-9')) {
map['0-9'] = [];
}
map['0-9'].push(item);
}
});
var brandHtml = common.util.__template2($('#brandTemp').html(), {
map: map
});
// var docFrag = new DocumentFragment();
// docFrag.firstChild.nodeValue = brandHtml;
$('#brand-list').html(brandHtml);
if (NETSALEDATA.brandRelationList) {
$('.selected-brand').html(common.util.__template2($('#brandShowTemp').html(), {
brandRelationList: NETSALEDATA.brandRelationList,
brandRelation: brandSelectArr.join('|')
}));
};
e.init();
if ($('.contentpanel').data('type') == 'info') {
$('.brand-list').find('input').attr('disabled', true);
}
}, true);
$.each(NETSALEDATA.brandRelationList, function(index, value) {
brandSelectArr.push(value.brandId);
});
$('#brandWrap').on('change', 'input[name="brandRelationList"]', function() {
var $val = parseInt($(this).val()),
position = brandSelectArr.indexOf($val);
if (position == -1) {
brandSelectArr.push($val);
$('<div class="col-sm-2" data-id="' + $val + '">' + $(this).data('name') + '</div>').appendTo($('.selected-brand'));
} else {
brandSelectArr.splice(position, 1);
$('div[data-id="' + $val + '"]').remove();
};
});
$('#saveBrandRelation').on('click', function() {
e.submit('/goods/product/saveBrandRelation', function(option) {
option.data = GOLABDATA.fire("LYbrandRelation");
option.success = function(res) {
res = res.data;
if (res.code == '200') {
e.$tip(res.message, function() {}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
}
});
});
GOLABDATA.on("LYbrandRelation", function() {
return {
productSkn: $('#productSkn').val(),
brandRelationList: JSON.stringify($('#brandRelationList').val().split('|'))
}
/*return e.submit('', function(option) {
option.data.productSkn = $('#productSkn').val();
option.data.brandRelationList = JSON.stringify(option.data.brandRelationList.split('|'));
option.debug = true;
});*/
});
\ No newline at end of file
... ...
... ... @@ -54,8 +54,8 @@ $(document).on("click", "#btn-recommand", function() {
return false;
});
GOLABDATA.on("bianjiqi", function() {
/*if (UMdescriptioner.getContent() != '') {
/*GOLABDATA.on("bianjiqi", function() {
if (UMdescriptioner.getContent() != '') {
return {
recommend: UMrecommender.getContent(),
productDesc: UMdescriptioner.getContent()
... ... @@ -64,14 +64,27 @@ GOLABDATA.on("bianjiqi", function() {
common.util.__tip('商品描述不可为空', 'warning');
return;
}
*/
$('#productDesc').val(UMdescriptioner.getContent());
return {
recommend: UMrecommender.getContent(),
productDesc: $('#productDesc').val()
}
});*/
GOLABDATA.on("LYrecommend", function() {
var recommendEdit = new common.edit('#recommenderWrap');
$('#recommend').val(UMrecommender.getContent());
return recommendEdit.submit('', function(option) {
option.productSkn = productSkn;
option.recommend = $('#recommend').val();
option.debug = true;
});
});
GOLABDATA.on("LYproductDesc", function() {
var descriptionEdit = new common.edit('#descriptionerWrap');
$('#productDesc').val(UMdescriptioner.getContent());
return descriptionEdit.submit('', function(option) {
option.productSkn = productSkn;
option.productDesc = $('#productDesc').val();
option.debug = true;
});
});
if (editType == 'info') {
... ...
... ... @@ -17,7 +17,7 @@ var config = {
// domain:'http://172.16.6.240:8088/platform',// 王书生
// domain: 'http://172.16.6.124:8088/platform',//陈超
//http://172.16.6.124:8088/platform/product/queryAllProductAttr
//domain: 'http://172.16.6.227:8088/platform', //玛丽
// domain: 'http://172.16.6.227:8088/platform', //玛丽
// domain: 'http://192.168.102.202:8088/platform',
//domain:'http://172.16.9.8:8080/yohobuy-platform-web',//葛超
domain: 'http://192.168.102.202:8088/platform',
... ...
... ... @@ -9,6 +9,7 @@
</div>
<div class="panel-body nopadding">
<script id="edit-recommender" type="text/plain" style="width:100%;height:500px;"></script>
<input id="recommend" type="hidden">
<p>
<span class="red">提示:与商品相关的逛信息自动抓取到下列各模块中,若要在商品详情中展示,请将其编辑在【小编推荐】中。
</span>
... ...
... ... @@ -8,7 +8,8 @@
<h2 class="panel-title">商品描述</h2>
</div>
<div class="panel-body nopadding">
<script id="edit-descriptioner" type="text/plain" style="width:100%;height:500px;"></script>
<script id="edit-descriptioner" type="text/plain" style="width:100%;height:500px;"></script>
<input id="productDesc" type="hidden" required>
</div>
<div class="panel-footer">
<input type="hidden" id="productDesc" required placeholder="商品描述">
... ...