Authored by 陶雨

网销尺码信息、商品参数、商品排序设置、搜索关键词

... ... @@ -11,11 +11,12 @@ require('./partials/search-key.js');
require('./partials/size-info.js');
require('./partials/goods-sort.js');
require('./partials/goods-params.js');
/*
* 获取业务数据
*/
window.NETSALEDATA = require('./partials/data.js');
//console.log(NETSALEDATA);
// console.log(NETSALEDATA);
/*加载其他模块*/
require('./partials/editor_recommend');
... ...
var $ = require('jquery'),
common = require('../common/common');
common = require('../../common/common');
var washTipsList = window.NETSALEDATA.washTipsList;
for(var i = 0; i < washTipsList.length; i++) {
var specialAttrBo = window.NETSALEDATA.specialAttrBo
|| {productSkn:window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,washTipsList:[],materialList:[]};
var washTipsList = specialAttrBo.washTipsList;
var materialList = specialAttrBo.materialList;
}
\ No newline at end of file
console.log(window.NETSALEDATA);
var e=new common.edit("#taoyu1");
common.util.__ajax({
url:'/netSale/queryAllBySortId4Select',
data:{param:window.NETSALEDATA.baseProductInfo.baseProduct.maxSortId}
},function(res) {
$("#material-group").html(common.util.__template2($("#material-params").html(),res||{}));
var materials = [];
for (var i = 0; i < materialList.length; i++) {
materials[i] = materialList[i].id;
}
$("#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:{}
},function(res) {
$("#washTip-group").html(common.util.__template2($("#washTip-params").html(),res||{}));
var washTips = [];
for (var i = 0; i < washTipsList.length; i++) {
washTips[i] = washTipsList[i].sortId;
}
$("#washTips").val(washTips.join("|"));
e.init();
$(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() {
var washTips = $("#washTips").val() || "";
var productMaterial = $("#material").val() || "";
common.util.__ajax({
url:'/netSale/saveProductParam',
data:{
productSkn:specialAttrBo.productSkn,
washTips:washTips.replace(/\|/g, ","),
productMaterial:productMaterial.replace(/\|/g, ",")
}
},function() {
// body...
});
});
... ...
... ... @@ -5,34 +5,51 @@ var searchSortList = window.NETSALEDATA.searchSortList;
for(var i = 0; i < searchSortList.length; i++) {
if(searchSortList[i].modelId == 1)
$("#brand-sort").val(searchSortList[i].intValue);
$("#sort0").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 2)
$("#aolai-sort").val(searchSortList[i].intValue);
$("#sort1").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 3)
$("#search-sort").val(searchSortList[i].intValue);
$("#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())
};
}
$('#sort-save').on('click', function () {
var item = window.NETSALEDATA.searchSortList;
console.log(item);
for(var i = 0; i < searchSortList.length; i++) {
if(searchSortList[i].modelId == 1)
searchSortList[i].intValue = $("#brand-sort").val();
else if(searchSortList[i].modelId == 2)
searchSortList[i].intValue = $("#aolai-sort").val();
else if(searchSortList[i].modelId == 3)
searchSortList[i].intValue = $("#search-sort").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":searchSortList}
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 || "";
$("#searchKeys").val(window.NETSALEDATA.productExtBo.searchKeys);
$("#searchKeys").val(searchKeys);
var g = new common.grid({
el: "#search-key",
columns: [
... ... @@ -18,9 +19,26 @@ var $ = require('jquery'),
g.init('/netSale/queryHotSearchTerms');
$("#searchKeys").on('change',function() {
searchKeys = $("#searchKeys").val();
});
$(document).on('click', '.add', function() {
var item = g.rows[$(this).data("index")];
var value = $("#searchKeys").val();
if(value) value+=",";
$("#searchKeys").val(value + item.content);
});
\ No newline at end of file
searchKeys = $("#searchKeys").val();
});
$("#save-searchKey").on('click', function() {
common.util.__ajax({
url:'/netSale/saveNetSaleSearchKeys',
data:{
productSkn: window.NETSALEDATA.baseProductInfo.baseProduct.productSkn,
searchKeys: searchKeys
}
},function(res) {
});
});
... ...
var $ = require('jquery'),
common = require('../../common/common');
// window.NETSALEDATA=require('./data.js');
// var referenceSize = "";
// for(var i = 0; i < window.NETSALEDATA.sizeInfo.sizeBoList.length; i++) {
// referenceSize += window.NETSALEDATA.sizeInfo.sizeBoList[i].sizeName + " ";
// var sec = window.NETSALEDATA.sizeInfo.sizeBoList[i].sortAttributes;
// for(var j = 0; j < window.NETSALEDATA.sizeInfo.sizeBoList[i].sortAttributes.length; j++) {
// if(j > 0
// && window.NETSALEDATA.sizeInfo.sizeBoList[i].sortAttributes[j].sizeValue != ""
// && window.NETSALEDATA.sizeInfo.sizeBoList[i].sortAttributes[j].sizeValue != null) referenceSize += "/";
// referenceSize += window.NETSALEDATA.sizeInfo.sizeBoList[i].sortAttributes[j].sizeValue;
// }
// referenceSize += "\t";
// }
// var html = "<table style='width:100%;valign:top;'>";
// for (var x = 0; x < machines.length; x++) {
// if ($(this).attr("id") == machines[x].ID.substring(0, 3))
// html += ("<tr><td><input type='checkbox' id='" + machines[x].ID + "' />" + machines[x].ID + "</td></tr>");
// }
// html += "</table>";
// $("#grid_machines td[id=" + $(this).attr("id") + "]").append(html);
// $("#reference-size").val(referenceSize);
// for(var sizeAttributeBo in window.NETSALEDATA.sizeInfo.sizeAttributeBos) {
// if(sizeAttributeBo.attributeNam == "厚") {
// $("#height").val(sizeAttributeBo.id);
// } else if(sizeAttributeBo.attributeNam == "宽") {
// $("#width").val(sizeAttributeBo.id);
// } else if(sizeAttributeBo.attributeNam == "长") {
// $("#length").val(sizeAttributeBo.id);
// }
// }
$("#body").html(common.util.__template2($("#template").html(),window.NETSALEDATA.sizeInfo));
\ No newline at end of file
$("#body").html(common.util.__template2($("#template").html(),window.NETSALEDATA.sizeInfo||{}));
\ No newline at end of file
... ...
... ... @@ -47,15 +47,15 @@ var $ = require('jquery'),
new common.dropDown({el: "#producttype"});
},
detailtoast:function(index) {
detailtoast:function(obj) {
common.dialog({
title:"商品池详情",
content:'<div id="faGrid" style="height: 600px;overflow:auto;"></div>',
button:[{value:"添加", callback:function() {
var e = new common.edit("#baseform", {bucket: "productPool"});
var e = new common.edit("#base-form", {bucket: "productPool"});
common.dialog.confirm("添加商品池",
common.util.__template($("#template1").html(), {}),
common.dialog.confirm("添加商品池记录",
common.util.__template($("#template1").html(), {poolId:obj.id,producttype:obj.producttype}),
function() {
e.submit("/market/productPool/addProductPoolDetailBo",function(option){
//option.data;
... ... @@ -75,7 +75,7 @@ var $ = require('jquery'),
var grid = new common.grid({
el:"#faGrid",
parms: function() {
return {id: index};
return {id: obj.id};
},
columns:[
{display:"ID", name:"id"},
... ... @@ -91,12 +91,17 @@ var $ = require('jquery'),
grid.init('/market/productPool/queryProductPoolDetailPage');
$(document).on('click', '.delbtn', function() {
var item = grid.rows[$(this).data("index")];
common.util.__ajax({
url:'/market/productPool/deleteProductPoolDetailBo',
data:{id:item.id}
},function(res) {
grid.reload();
});
common.dialog.confirm("警告",
"确认删除?",
function() {
common.util.__ajax({
url:'/market/productPool/deleteProductPoolDetailBo',
data:{id:item.id}
},function(res) {
grid.reload();
});
});
});
}
};
... ... @@ -107,7 +112,8 @@ var $ = require('jquery'),
$(document).on("click", ".detail", function() {
var item=g.rows[$(this).data("index")];
Bll.detailtoast(item.id);
console.log(item);
Bll.detailtoast(item);
});
$(document).on("click","#filter-btn",function () {
... ...
... ... @@ -17,5 +17,46 @@ exports.res = [
{name: 'page', type: 'number'},
{name: 'size', type: 'number', def: 10}
]
},
{
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',
params: [
{name: 'param', type: 'number'}
]
},
{
route:'/netSale/saveNetSaleSearchKeys',
method:'POST',
url: '/product/saveNetSaleSearchKeys',
params: [
{name: 'productSkn', type: 'number'},
{name: 'searchKeys', type: 'string'}
]
},
{
route:'/netSale/saveProductParam',
method:'POST',
url: '/product/saveProductParam',
params: [
{name: 'productSkn', type: 'number'},
{name: 'washTips', type: 'string'},
{name: 'productMaterial', type: 'string'}
]
}
];
\ No newline at end of file
... ...
... ... @@ -88,23 +88,5 @@
<input type="text" class="form-control" id="productskn" value="{productskn}" required="required" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="name">名称</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="name" value="{name}" required="required" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="brandName">品牌</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="brandName" value="{brandName}" required="required" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="sortName">分类</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="sortName" value="{sortName}" required="required" />
</div>
</div>
</div>
</script>
\ No newline at end of file
... ...
<div class="panel panel-default">
<form action="" class="form-horizontal form-bordered">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
<h2 class="panel-title">商品参数</h2>
<div class="panel panel-default" id="taoyu1">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
<div class="panel-body nopadding">
<div class="form-group">
<label class="col-sm-2 control-label">材质</label>
<div class="col-sm-8 height40">
<label style="cursor: pointer;"><input type="checkbox" name="material" value="1">反光</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="2">雪纺</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="3">太空棉</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="4">PU</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="5"></label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="6">毛呢</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="7">羊毛/羊绒</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="8">尼龙/棉纶</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="9"></label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="10">涤纶/聚酯纤维</label>
<label style="cursor: pointer;"><input type="checkbox" name="material" value="11">丹宁</label>
</div>
<input type="hidden" id="material" value="{material}" for="checkbox">
</div>
<div class="form-group">
<label class="col-sm-2 control-label">洗涤提示</label>
<div class="col-sm-8 height40">
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="1">不可熨烫</label>
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="2">不可转笼翻转干燥</label>
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="3">30度水温弱速洗</label>
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="4">不可氯漂</label>
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="5">不可干洗</label>
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="6">不可拧干</label>
<label style="cursor: pointer;"><input type="checkbox" name="alert" value="7">分色洗涤</label>
</div>
<input type="hidden" id="alert" value="{alert}" for="checkbox">
</div>
<h2 class="panel-title">商品参数</h2>
</div>
<div class="panel-body nopadding">
<div class="form-group" id="material-group">
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
<div class="form-group" id="washTip-group">
</div>
</form>
</div>
\ No newline at end of file
</div>
<div class="panel-footer">
<button class="btn btn-primary" id="propertySave">保存</button>
</div>
</div>
<script type="text/template" id="material-params">
<label class="col-sm-2 control-label">材质</label>
<div class="col-sm-8 height40">
[[each data as item index]]
<label style="cursor: pointer;"><input type="checkbox" name="material" class="material" value=[[item.id]]>[[item.text]]</label>
[[/each]]
</div>
<input type="hidden" id="material" value="{material}" for="checkbox">
</script>
<script type="text/template" id="washTip-params">
<label class="col-sm-2 control-label">洗涤提示</label>
<div class="col-sm-8 height40">
[[each data as item index]]
<label style="cursor: pointer;"><input type="checkbox" name="washTips" class="washTips" value=[[item.id]]>[[item.text]]</label>
[[/each]]
</div>
<input type="hidden" id="washTips" value="{washTips}" for="checkbox">
</script>
\ No newline at end of file
... ...
... ... @@ -8,17 +8,17 @@
</div>
<div class="panel-body nopadding" id="goods-sort">
<div class="form-group">
<label class="col-sm-1 control-label" for="brand-sort">品牌:</label>
<label class="col-sm-1 control-label" for="sort0">品牌</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="brand-sort" value="{brand-sort}" required="required" />
<input type="text" class="form-control" id="sort0" value="0" required="required" />
</div>
<label class="col-sm-1 control-label" for="aolai-sort">奥莱</label>
<label class="col-sm-1 control-label" for="sort1">奥莱</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="aolai-sort" value="{aolai-sort}" required="required" />
<input type="text" class="form-control" id="sort1" value="0" required="required" />
</div>
<label class="col-sm-1 control-label" for="search-sort">搜索</label>
<label class="col-sm-1 control-label" for="sort2">搜索</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="search-sort" value="{search-sort}" required="required" />
<input type="text" class="form-control" id="sort2" value="0" required="required" />
</div>
</div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>提示:商品在品牌商品列表中的排序,数字越大越靠前</div>
... ...
... ... @@ -25,6 +25,6 @@
</div>
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
<button class="btn btn-primary" id="save-searchKey">保存</button>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -12,25 +12,30 @@
</form>
</div>
<script type="text/template" id="template">
<div class="row">
<div class="panel-col">
<p>参考尺码</p>
<p>
[[each sizeBoList as item index]]
<span>[[item.sizeName]]</span>
<p>
<table class="table table-striped table-bordered responsive dataTable no-footer">
<thead>
<tr>
<td>参考尺码</td>
[[each sizeAttributeBos as item index]]
<td>[[item.attributeName]]</td>
[[/each]]
</tr>
</thead>
<tbody>
<tr>
<td>
[[each sizeBoList as item index]]
<def>[[item.sizeName]]</def>
[[each item.sortAttributes as item1 index1]]
<span>item1.sizeValue</span>
<def>[[item1.sizeValue]]</def>/
[[/each]]
</p>
[[/each]]
</td>
[[each sizeAttributeBos as item index]]
<td>[[item.id]]</td>
[[/each]]
</p>
</div>
[[each sizeAttributeBos as item index]]
<div class="panel-col">
<p>[[item.attributeName]]</p>
<p>[[item.id]]</p>
</div>
[[/each]]
</div>
</tr>
</tbody>
</table>
</script>
\ No newline at end of file
... ...