Authored by 陶雨

网销部分修改 ---ty

var $ = require('jquery'),
common = require('../../common/common');
var specialAttrBo = window.NETSALEDATA.specialAttrBo
|| {productSkn:window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,washTipsList:[],materialList:[]};
var washTipsList = specialAttrBo.washTipsList;
var materialList = specialAttrBo.materialList;
console.log(window.NETSALEDATA);
if(window.NETSALEDATA) {
var baseProduct = window.NETSALEDATA.baseProductInfo.baseProduct;
var specialAttrBo = {productSkn:baseProduct.productSkn,washTipsList:[],materialList:[]};
if(window.NETSALEDATA.specialAttrBo) {
specialAttrBo = window.NETSALEDATA.specialAttrBo;
}
var washTipsList = specialAttrBo.washTipsList || [];
var materialList = specialAttrBo.materialList || [];
var e=new common.edit("#taoyu1");
//材质初始化
common.util.__ajax({
url:'/netSale/queryAllBySortId4Select',
data:{param:window.NETSALEDATA.baseProductInfo.baseProduct.maxSortId}
data:{param:baseProduct.maxSortId}
},function(res) {
$("#material-group").html(common.util.__template2($("#material-params").html(),res||{}));
var materials = [];
... ... @@ -21,15 +24,9 @@ var $ = require('jquery'),
}
$("#material").val(materials.join("|"));
e.init();
$(document).on('change','.material', function() {
var items = $("#material").val().split("|");
for (var i = 0; i < items.length; i++) {
materialList[i] = {"id":parseInt(items[i])};
}
});
});
//洗涤提示初始化
common.util.__ajax({
url:'/netSale/getAll4Select',
data:{}
... ... @@ -41,16 +38,24 @@ var $ = require('jquery'),
}
$("#washTips").val(washTips.join("|"));
e.init();
$(document).on('change','.washTips', function() {
});
$(document).on('change','.material', function() {
var items = $("#material").val().split("|");
for (var i = 0; i < items.length; i++) {
materialList[i] = {"id":parseInt(items[i])};
}
});
$(document).on('change','.washTips', function() {
var items = $("#washTips").val().split("|");
for (var i = 0; i < items.length; i++) {
washTipsList[i] = {"sortId":parseInt(items[i])};
}
});
});
$("#propertySave").on('click',function() {
$(document).on('click', "#propertySave", function() {
var washTips = $("#washTips").val() || "";
var productMaterial = $("#material").val() || "";
... ... @@ -66,3 +71,4 @@ var $ = require('jquery'),
// body...
});
});
}
\ No newline at end of file
... ...
var $ = require('jquery'),
common = require('../../common/common');
var searchSortList = window.NETSALEDATA.searchSortList;
for(var i = 0; i < searchSortList.length; i++) {
if(searchSortList[i].modelId == 1)
$("#sort0").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 2)
$("#sort1").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 3)
$("#sort2").val(searchSortList[i].intValue);
}
var item = [];
for (var i = 0; i < 3; i++) {
item[i] = {
productSkn:window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,
modelId:i + 1,
projectId:1,
intValue:parseInt($("#sort" + i).val())
};
}
for(var i = 0; i < 3; i++) {
for (var j = 0; j < searchSortList.length; j++) {
if(searchSortList[j].modelId == item[i].modelId) {
item[i].id = searchSortList[j].id;
break;
if(window.NETSALEDATA) {
var searchSortList = [];
if(window.NETSALEDATA.searchSortList) {
searchSortList = window.NETSALEDATA.searchSortList;
}
for(var i = 0; i < searchSortList.length; i++) {
if(searchSortList[i].modelId == 1)
$("#sort0").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 2)
$("#sort1").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 3)
$("#sort2").val(searchSortList[i].intValue);
}
var item = [];
for (var i = 0; i < 3; i++) {
item[i] = {
productSkn:window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,
modelId:i + 1,
projectId:1,
intValue:parseInt($("#sort" + i).val())
};
}
for(var i = 0; i < 3; i++) {
for (var j = 0; j < searchSortList.length; j++) {
if(searchSortList[j].modelId == item[i].modelId) {
item[i].id = searchSortList[j].id;
break;
}
}
}
}
window.NETSALEDATA.searchSortList = item;
$('#sort-save').on('click', function () {
common.util.__ajax({
url:'/netSale/saveSearchSort',
data:{searchSortList:JSON.stringify(window.NETSALEDATA.searchSortList)}
},function() {
});
});
$("#sort0").on('change', function() {
window.NETSALEDATA.searchSortList[0].intValue = parseInt($("#sort0").val());
});
$("#sort1").on('change', function() {
window.NETSALEDATA.searchSortList[1].intValue = parseInt($("#sort1").val());
});
$("#sort2").on('change', function() {
window.NETSALEDATA.searchSortList[2].intValue = parseInt($("#sort2").val());
});
\ No newline at end of file
window.NETSALEDATA.searchSortList = item;
$('#sort-save').on('click', function () {
common.util.__ajax({
url:'/netSale/saveSearchSort',
data:{searchSortList:JSON.stringify(window.NETSALEDATA.searchSortList)}
},function() {
});
});
$("#sort0").on('change', function() {
window.NETSALEDATA.searchSortList[0].intValue = parseInt($("#sort0").val());
});
$("#sort1").on('change', function() {
window.NETSALEDATA.searchSortList[1].intValue = parseInt($("#sort1").val());
});
$("#sort2").on('change', function() {
window.NETSALEDATA.searchSortList[2].intValue = parseInt($("#sort2").val());
});
}
\ No newline at end of file
... ...
var $ = require('jquery'),
common = require('../../common/common');
var searchKeys = window.NETSALEDATA.productExtBo.searchKeys || "";
var searchKeys = "";
if(window.NETSALEDATA && window.NETSALEDATA.productExtBo) {
searchKeys = window.NETSALEDATA.productExtBo.searchKeys || "";
}
$("#searchKeys").val(searchKeys);
var g = new common.grid({
... ...
var $ = require('jquery'),
common = require('../../common/common');
$("#body").html(common.util.__template2($("#template").html(),window.NETSALEDATA.sizeInfo||{}));
\ No newline at end of file
var sizeInfo = {};
if(window.NETSALEDATA && window.NETSALEDATA.sizeInfo) {
sizeInfo = window.NETSALEDATA.sizeInfo;
}
$("#body").html(common.util.__template2($("#template").html(),sizeInfo));
\ No newline at end of file
... ...
... ... @@ -2,6 +2,7 @@ exports.domain = require('../config/common.js').domain;
exports.res = [
{
//保存搜索顺序
route:'/netSale/saveSearchSort',
method:'POST',
url: '/product/saveSearchSort',
... ... @@ -10,6 +11,7 @@ exports.res = [
]
},
{
//查找热搜词
route:'/netSale/queryHotSearchTerms',
method:'POST',
url: '/searchWords/queryHotSearchTerms',
... ... @@ -19,20 +21,14 @@ exports.res = [
]
},
{
route:'/netSale/queryHotSearchTerms',
method:'POST',
url: '/searchWords/queryHotSearchTerms',
params: [
{name: 'page', type: 'number'}
]
},
{
//查找洗涤提示
route:'/netSale/getAll4Select',
method:'POST',
url: '/washTips/getAll4Select/',
params: []
},
{
//查找材质参数
route:'/netSale/queryAllBySortId4Select',
method:'POST',
url: 'productMaterial/queryAllBySortId4Select',
... ... @@ -41,6 +37,24 @@ exports.res = [
]
},
{
//查找所有商品参数信息 //暂时没用
route:'/netSale/queryAllGoodsParams',
method:'POST',
apis: {
washTipsList: {
url: '/washTips/getAll4Select/'
},
materialList: {
url: 'productMaterial/queryAllBySortId4Select',
params: [
{name: 'param', type: 'number'}
],
isJsonRaw: true
}
}
},
{
//保存搜索关键词
route:'/netSale/saveNetSaleSearchKeys',
method:'POST',
url: '/product/saveNetSaleSearchKeys',
... ... @@ -50,6 +64,7 @@ exports.res = [
]
},
{
//保存商品参数
route:'/netSale/saveProductParam',
method:'POST',
url: '/product/saveProductParam',
... ...
exports.domain = "http://172.16.6.127:9090";
// exports.domain = require('../config/common.js').domain;
// exports.domain = "http://172.16.6.127:9090";
exports.domain = require('../config/common.js').domain;
// exports.domain = 'http://localhost:30012';
exports.res = [
... ...
// exports.domain = require('../config/common.js').domain;
exports.domain = require('../config/common.js').domain;
// exports.domain = "http://192.168.102.201:8082/platform";
exports.domain = "http://172.16.6.210:8083/platform";
// exports.domain = "http://172.16.6.210:8083/platform";
exports.res = [
{
... ...
... ... @@ -10,7 +10,7 @@
<div class="form-group">
<label class="col-sm-1 control-label height40" for="searchKeys">商品关键词</label>
<div class="col-sm-6">
<input type="text" class="form-control" id="searchKeys" value="{searchKeys}" required="required" />
<input type="text" class="form-control" id="searchKeys" required="required" />
</div>
<div class="height40" style="color: red;">每个关键词请用英文“,”隔开</div>
... ...