Authored by 马力

Merge branch 'gray' into dev_隐藏字段

# Conflicts:
#	dist/yohobuy-shops-fe/4.8.3/jquery/goods.netsale.Edit.js
#	dist/yohobuy-shops-fe/4.8.3/vue/libs.js
#	dist/yohobuy-shops-fe/4.8.3/vue/report.BusinessOverview.js
#	dist/yohobuy-shops-fe/4.8.3/vue/report.BusinessSale.js
#	dist/yohobuy-shops-fe/4.8.3/vue/report.Charts.js
#	dist/yohobuy-shops-fe/4.8.3/vue/report.ImportExportStock.js
#	dist/yohobuy-shops-fe/4.8.3/vue/report.Stock.js
#	server/libs/App.js
... ... @@ -82,7 +82,17 @@ module.exports = function (apiCofig) {
/*内置中间件 对Http请求解析*/
App.use(bodyParser.json());
App.use(bodyParser.urlencoded({extended: true}));
App.use(cookieParser());
App.use(cookieParser(), function (req, res, next) {
// console.log("xxxxxxxxxxxxxxxx");
if (req.cookies) {
var phpsess = req.cookies["PHPSESSID"];
if (phpsess && phpsess != "") {
res.cookie("PHPSESSID", phpsess, { maxAge: 7200000, httpOnly: true, domain: ".yohobuy.com" });
}
}
next();
});
App.use(multer());
App.use("/" + apiCofig.static.name, express.static(apiCofig.static.value));
... ...
... ... @@ -115,42 +115,32 @@ $(document).ready(function(){
});
function initInfo(basicInfo) {
$("#ageLevel").val(basicInfo.ageLevel);
$("#seasons").val(basicInfo.seasons);
$("#gender").val(basicInfo.gender);
$("#grade").val(basicInfo.grade);
$("#grade").val(basicInfo.grade||'0');
$("#isLimited").val(basicInfo.isLimited);
$("#isOutlets").val(basicInfo.isOutLets);
var ageLevel=basicInfo.ageLevel;
$(":checkbox[name=ageLevel]").each(function(){
if(ageLevel.indexOf($(this).val())>-1){
$(this).prop("checked",true)
}
});
$(":checkbox[name=seasons]").each(function(){
if(basicInfo.seasons.indexOf($(this).val())>-1){
$(this).prop("checked",true)
}
});
$(":radio[name=gender]").each(function(){
if(basicInfo.gender.indexOf($(this).val())>-1){
if(basicInfo.seasons!=null&&basicInfo.seasons!=undefined&&basicInfo.seasons!=''&&
basicInfo.seasons.indexOf($(this).val())>-1){
$(this).prop("checked",true)
}
});
$(":radio[name=grade]").each(function(){
if(basicInfo.grade.indexOf($(this).val())>-1){
if(basicInfo.grade!=null&&basicInfo.grade!=undefined&&basicInfo.grade!=''&&
basicInfo.grade.indexOf($(this).val())>-1){
$(this).prop("checked",true)
}
});
$(":radio[name=isLimited]").each(function(){
if(basicInfo.isLimited.indexOf($(this).val())>-1){
if(basicInfo.isLimited!=null&&basicInfo.isLimited!=undefined&&basicInfo.isLimited!=''&&
basicInfo.isLimited.indexOf($(this).val())>-1){
$(this).prop("checked",true)
}
});
$(":radio[name=isOutLets]").each(function(){
if(basicInfo.isOutLets.indexOf($(this).val())>-1){
if(basicInfo.isOutLets!=null&&basicInfo.isOutLets!=undefined&&basicInfo.isOutLets!=''&&
basicInfo.isOutLets.indexOf($(this).val())>-1){
$(this).prop("checked",true)
}
});
... ... @@ -218,22 +208,6 @@ common.util.__ajax({
}, true);
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
$(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();
... ... @@ -252,9 +226,6 @@ $(document).on("change",":checkbox[name=seasons]",function(){
$("#seasons").val(arr.join(','));
});
$(document).on("change",":radio[name=gender]",function(){
$("#gender").val($(this).val());
});
$(document).on("change",":radio[name=isOutLets]",function(){
$("#isOutlets").val($(this).val());
});
... ... @@ -299,8 +270,6 @@ GOLABDATA.on("LYbasicInfo", function () {
data.productSkn = $('#productSkn').val();
data.sellChannels = data.sellChannels.split('|').join(',');
data.shopIds = data.shopIds ? data.shopIds.split('|').join(',') : '';
data.ageLevel = common.util.__input('ageLevel');
data.gender = common.util.__input('gender');
data.grade = common.util.__input('grade')||'0';
data.isLimited = common.util.__input('isLimited')||'N';
data.isOutlets =$('#isOutlets').val()||'N';
... ...