Authored by liuyue

template

... ... @@ -12,6 +12,9 @@ window.NETSALEDATA = require('./partials/data.js');
/*加载其他模块*/
require('./partials/editor_recommend');
require('./partials/model');
require('./partials/search-key.js');
require('./partials/size-info.js');
require('./partials/goods-sort.js')
... ...
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)
$("#brand-sort").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 2)
$("#aolai-sort").val(searchSortList[i].intValue);
else if(searchSortList[i].modelId == 3)
$("#search-sort").val(searchSortList[i].intValue);
}
$('#add-category').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();
}
common.util.__ajax({
url:'/netSale/saveSearchSort',
data:{"searchSortList":searchSortList}
},function() {
});
});
\ No newline at end of file
... ...
var $ = require('jquery'),
common = require('../../common/common');
$("#searchKeys").val(window.NETSALEDATA.productExtBo.searchKeys);
var g = new common.grid({
el: "#search-key",
columns: [
{display: "ID", name: "id"},
{display: "内容", name: "content"},
{
display: "操作", name: "", render: function (item) {
return '<a class="btn btn-info add" data-index="' + item.__index + '">添加</a>';
}
}
]
});
g.init('/netSale/queryHotSearchTerms');
$(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
... ...
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
... ...
var $ = require('jquery'),
common = require('../common/common');
var g = new common.grid({
el: "#product-pool",
parms: function () {
return {
id: common.util.__input('search-id'),
poolName: common.util.__input('search-name')
};
},
columns: [
{display: "商品池编号", name: "id"},
{display: "商品池名称", name: "poolName"},
{display: "说明", name: "comment"},
{display: "SKN个数", name: "total"},
{
display: "操作", name: "", render: function (item) {
return '<a class="btn btn-info detail" data-index="' + item.__index + '">详情</a>';
}
}
]
});
g.init('/market/productPool/queryProductPoolPage');
var Bll = {
toast:function(url) {
var e = new common.edit("#baseform", {bucket: "productPool"});
common.dialog.confirm("添加商品池",
common.util.__template($("#template").html(), {}),
function() {
e.submit(url,function(option){
//option.data;
option.success=function(){
g.reload();
};
option.error=function(){
}
});
});
e.init();
new common.dropDown({el: "#producttype"});
},
detailtoast:function(index) {
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"});
common.dialog.confirm("添加商品池",
common.util.__template($("#template1").html(), {}),
function() {
e.submit("/market/productPool/addProductPoolDetailBo",function(option){
//option.data;
option.success=function(){
g.reload();
};
option.error=function(){
}
});
});
e.init();
return false;
}}]
});
var grid = new common.grid({
el:"#faGrid",
parms: function() {
return {id: index};
},
columns:[
{display:"ID", name:"id"},
{display:"SKN",name:"productskn"},
{display:"名称", name:""},
{display:'品牌', name: "brandName"},
{display: '分类',name: "sortName"},
{display: '操作', name: "", render: function(item) {
return '<a class="btn btn-info delbtn" data-index="' + item.__index + '">删除</a>';
}}
]
});
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();
});
});
}
};
$("#add-pool").on('click', function() {
Bll.toast("/market/productPool/addProductPoolBo");
});
$(document).on("click", ".detail", function() {
var item=g.rows[$(this).data("index")];
Bll.detailtoast(item.id);
});
$(document).on("click","#filter-btn",function () {
g.reload(1);
});
\ No newline at end of file
... ...
... ... @@ -72,7 +72,7 @@ var $ = require('jquery'),
return date.getFullYear() + "-" + (mm < 10 ? "0" + mm : mm) + "-" + (dd < 10 ? "0" + dd : dd);
},
toast:function(url, item, hint) {
var e = new common.edit("#baseform");
var e = new common.edit("#baseform", {bucket:"activity"});
e.on("validate",function() {
var startTime=$("#startTime").val();
... ... @@ -140,12 +140,12 @@ var $ = require('jquery'),
if(hint == "专题编辑") {
common.util.__ajax({
url:'/runManage/subjectManage/queryBaseProductPoolListById',
data:{id:item.productPoolId}
},function(res) {
// console.log(res);
$("#select2-productPoolId-container").html(res.data[0].text);
});
url:'/runManage/subjectManage/queryBaseProductPoolListById',
data:{id:item.productPoolId}
},function(res) {
// console.log(res);
$("#select2-productPoolId-container").html(res.data[0].text);
});
} else {
$("#select2-productPoolId-container").html("选择商品池");
}
... ...
exports.domain = require('../config/common.js').domain;
exports.res = [
{
route:'/netSale/saveSearchSort',
method:'POST',
url: '/product/saveSearchSort',
params: [
{name: 'searchSortList', type: 'string'}
]
},
{
route:'/netSale/queryHotSearchTerms',
method:'POST',
url: '/searchWords/queryHotSearchTerms',
params: [
{name: 'page', type: 'number'},
{name: 'size', type: 'number', def: 10}
]
}
];
\ No newline at end of file
... ...
// exports.domain = require('../config/common.js').domain;
exports.domain = "http://192.168.102.201:8082/platform";
exports.res = [
{
//商品池管理 -> 页面渲染
route: '/market/productPool/index',
method: 'GET',
view: 'pages/market/productPool',
src: '/market/productPool'
}, {
//商品池管理 ->查询商品池分页
route: '/market/productPool/queryProductPoolPage',
method: 'POST',
url: '/pool/queryProductPoolPage',
params: [
{name: 'page', type: 'number'},
{name: 'size', type: 'number',def:10},
{name: 'id', type: 'number'},
{name: 'poolName', type: 'string'}
]
}, {
//添加商品池
route: '/market/productPool/addProductPoolBo',
method: 'POST',
url: '/pool/addProductPoolBo',
params: [
{name: 'activityid', type: 'number'},
{name: 'poolName', type: 'string'},
{name: 'comment', type: 'string'},
{name: 'producttype', type: 'string'},
{name: 'productSkn', type: 'string'}
]
}, {
//商品池详细列表分页
route: '/market/productPool/queryProductPoolDetailPage',
method: 'POST',
url: '/pool/queryProductPoolDetailPage',
params: [
{name: 'page', type: 'number'},
{name: 'size', type: 'number',def:10},
{name: 'id', type: 'number'}
]
}, {
//商品池详细列表删除
route: '/market/productPool/deleteProductPoolDetailBo',
method: 'POST',
url: '/pool/deleteProductPoolDetailBo',
params: [
{name: 'id', type: 'number'}
]
}, {
//商品池详细列表添加
route: '/market/productPool/addProductPoolDetailBo',
method: 'POST',
url: '/pool/addProductPoolDetailBo',
params: [
{name: 'activityid', type: 'number'},
{name: 'poolId', type: 'number'},
{name: 'productskn', type: 'number'},
{name: 'producttype', type: 'number'}
]
}];
\ No newline at end of file
... ...
<div class="pageheader">
<div class="media">
<div class="pageicon pull-left">
<i class="fa fa-th-list"></i>
</div>
<div class="media-body">
<ul class="breadcrumb">
<li><a href=""><i class="glyphicon glyphicon-home"></i></a></li>
<li><a href="">营销管理</a></li>
<li>商品池管理</li>
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>商品池管理</h4>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a class="btn btn-success " id="add-pool"><i class="fa fa-plus"></i> 添加商品池</a>
</div>
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input type="text" class="form-control" id="search-id" placeholder="编号" />
</div>
<div class="panel-col">
<input type="text" class="form-control" id="search-name" placeholder="名称" />
</div>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="filter-all" href="/market/productPool/index" class="btn btn-info">全部</a>
</div>
</div>
</div>
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom: 10px">
<div id="product-pool"></div>
</div>
</div>
<script type="text/template" id="template">
<div class="rows" id="baseform">
<div class="form-group">
<label class="col-sm-2 control-label" for="poolName">商品池名称<font color="#f00">*</font></label>
<input type="hidden" value="{id}" id="id" />
<div class="col-sm-8">
<input type="text" class="form-control" id="poolName" name="{poolName}" required="required" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="comment">说明</label>
<div class="col-sm-8">
<input type="text" value="{comment}" class="form-control" id="comment" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="producttype">商品<font color="#f00">*</font></label>
<div class="col-sm-8">
<select id="producttype" style="width:120px;" value="{producttype}">
<option value="-1">请选择</option>
<option value="1">SKN</option>
<option value="2">SKU</option>
<option value="3">SKC</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">上传</label>
<div class="col-sm-10">
<input type="file" id="productSkn" name="productSkn" />
</div>
</div>
</div>
</script>
<script type="text/template" id="template1">
<div class="rows" id="base-form">
<div class="form-group">
<label class="col-sm-2 control-label" for="productskn">SKN</label>
<div class="col-sm-8">
<input type="hidden" id="poolId" value="{poolId}" />
<input type="hidden" id="producttype" value="{producttype}" />
<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
... ...
... ... @@ -7,6 +7,36 @@
<h2 class="panel-title">商品参数</h2>
</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>
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
... ...
... ... @@ -6,10 +6,25 @@
</div>
<h2 class="panel-title">商品排序设置</h2>
</div>
<div class="panel-body nopadding">
<div class="panel-body nopadding" id="goods-sort">
<div class="form-group">
<label class="col-sm-1 control-label" for="brand-sort">品牌:</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="brand-sort" value="{brand-sort}" required="required" />
</div>
<label class="col-sm-1 control-label" for="aolai-sort">奥莱</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="aolai-sort" value="{aolai-sort}" required="required" />
</div>
<label class="col-sm-1 control-label" for="search-sort">搜索</label>
<div class="col-sm-2">
<input type="text" class="form-control" id="search-sort" value="{search-sort}" required="required" />
</div>
</div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>提示:商品在品牌商品列表中的排序,数字越大越靠前</div>
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
<button class="btn btn-primary" id="sort-save">保存</button>
</div>
</form>
</div>
\ No newline at end of file
... ...
... ... @@ -6,7 +6,24 @@
<h2 class="panel-title">搜索关键词</h2>
</div>
<div class="panel-body"></div>
<div class="panel-body">
<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" />
</div>
<div class="height40" style="color: red;">每个关键词请用英文“,”隔开</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label height40">搜索热词:</label>
<div class="col-sm-6" id="search-key">
</div>
</div>
</div>
</div>
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
</div>
... ...
... ... @@ -6,10 +6,31 @@
</div>
<h2 class="panel-title">尺码信息</h2>
</div>
<div class="panel-body nopadding">
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存</button>
<div class="panel-body nopadding" id="body">
</div>
</form>
</div>
\ No newline at end of file
</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>
[[each item.sortAttributes as item1 index1]]
<span>item1.sizeValue</span>
[[/each]]
</p>
[[/each]]
</p>
</div>
[[each sizeAttributeBos as item index]]
<div class="panel-col">
<p>[[item.attributeName]]</p>
<p>[[item.id]]</p>
</div>
[[/each]]
</div>
</script>
\ No newline at end of file
... ...