Authored by liuyue

网销

var $ = require('jquery');
$.fn.ajaxfileupload = function(options) {
var settings = {
params: {},
... ...
... ... @@ -2,4 +2,14 @@
var $ = require('jquery'),
common = require('../common/common');
require('../util/custom.js');
\ No newline at end of file
require('../util/custom.js');
var e = new common.edit('#basicForm');
e.init();
common.edit.ajaxfileupload('.goods-img', {
action: '/ajax/upload',
onComplete: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -92,11 +92,15 @@ var g = new common.grid({
}, {
display: '操作',
render: function(item) {
return '<a href="javascript:;" class="btn btn-info btn-xs edit-btn">编辑</a>' +
return '<a href="/goods/netsale/edit/' + item.productSkn + '" class="btn btn-info btn-xs edit-btn">编辑</a>' +
'<a href="javascript:;" class="btn btn-info btn-xs edit-btn">上架</a>' +
'<a href="javascript:;" class="btn btn-info btn-xs info-btn">查看</a>';
}
}]
});
g.init($("#gridurl").val());
\ No newline at end of file
g.init($("#gridurl").val());
$("#filter-btn").click(function() {
g.reload(1);
});
\ No newline at end of file
... ...
/*
*@time: 2016/2/15
*@author: chenglong
*/
var $ = require('jquery'),
common = require('../common/common');
... ... @@ -111,17 +105,12 @@ e.on("validate", function() {
}
});
e.on("validate", function() {
var orderBy = $("#orderBy").val();
if (!/^(?:[1-9][0-9]*|0)$/.test(orderBy)) {
return '热门排序值输入格式不正确';
}
});
e.on("validate", function() {
var notSaleOrderBy = $('#notSaleOrderBy').val();
if (!/^(?:[1-9][0-9]*|0)$/.test(notSaleOrderBy)) {
return '未发售排序值输入格式不正确';
var orderBy = $.trim($("#orderBy").val());
if (orderBy && !/^(?:[1-9][0-9]*|0)$/.test(orderBy)) {
return '排序值输入格式不正确';
}
});
e.on("validate", function() {
var limitProductType = $("#limitProductType").val();
var activityId = $.trim($("#activityId").val());
... ... @@ -130,6 +119,19 @@ e.on("validate", function() {
}
});
function orderByIsRequired(val) {
if (val == 1) {
$('.order-by').find('.red').show().end().find('#orderBy').attr('required', true);
} else {
$('.order-by').find('.red').hide().end().find('#orderBy').attr('required', false);
};
}
orderByIsRequired($('#hotFlag').val());
$('input[name="hotFlag"]').on('click', function() {
orderByIsRequired($(this).val());
});
e.init();
//添加修改
... ...
... ... @@ -85,24 +85,9 @@ var tableGird = new common.grid({
display: "限购商品code",
name: "limitProductCode"
}, {
display: "热门排序",
name: "hotSort",
display: "排序",
render: function(item) {
if (item.hotFlag) {
return ('<input class="order-input width50" data-id="' + item.id + '" data-type="orderBy" type="text" value="' + item.orderBy + '"/>');
} else {
return '-';
}
}
}, {
display: "未发售排序",
name: "notSaleSort",
render: function(item) {
if (item.saleFlag == 1) {
return '-';
} else {
return ('<input class="order-input width50" data-id="' + item.id + '" data-type="notSaleOrderBy" type="text" value="' + item.notSaleOrderBy + '"/>');
}
return ('<input class="order-input width50" data-id="' + item.id + '" data-type="orderBy" type="text" value="' + item.orderBy + '"/>');
}
}, {
display: "封面图",
... ... @@ -222,7 +207,7 @@ $('#export-btn').on('click', function() {
common.util.__ajax({
url: '/limit/batch/export',
data: {
queryConf: '2016022517335568',
queryConf: '201603071608087|2016030711350185',
type: 'limitProductReminder'
}
}, function(res) {
... ...
... ... @@ -26,3 +26,40 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
.tao-border{
border:1px solid #ccc;
}
.cover-image-list {
li {
float: left;
width: auto;
height: auto;
border: none;
}
.btn {
padding: 2px 5px;
}
.goods-img {
margin: 0 auto;
border: 2px dashed #CCC;
}
input[type="file"] {
width: 100%;
height: 100%;
}
}
.goods-img {
position: relative;
width: 110px;
height: 150px;
.fileinput-button-icon {
width: 100%;
height: 100%;
line-height: 150px;
}
}
\ No newline at end of file
... ...
... ... @@ -122,13 +122,18 @@ exports.res = [
}, ]
}, {
//网销信息 -> 编辑页页面渲染
route: '/goods/netsale/edit',
route: '/goods/netsale/edit/:param',
method: 'GET',
view: 'pages/goods/netsale-edit',
url: '/product/getNetSaleInfo',
src: '/goods/netsale-edit',
data: {
data: {}
}
action: ''
},
params: [{
name: 'param',
type: 'number'
}]
}, {
//价格管理 -> 代销变价页面渲染
route: '/goods/pricechange/index',
... ...
... ... @@ -17,25 +17,32 @@
</div>
<div class="contentpanel">
<form id="basicForm" class="form-horizontal form-bordered" type="{{type}}" action="{{action}}">
{{# data}}
{{# data}}
<div class="panel panel-danger">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title="" data-original-title="Minimize Panel"><i class="fa fa-minus"></i></a>
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
<h2 class="panel-title">上架前必填</h2>
</div>
<div class="panel-body">
<div class="panel panel-default">
<form id="basicForm" class="form-horizontal form-bordered" type="{{type}}" action="{{action}}">
<div class="panel-heading">
<div class="panel-btns" style="display: none;">
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title="" data-original-title="Minimize Panel"><i class="fa fa-minus"></i></a>
<a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
</div>
<h2 class="panel-title">基本信息</h2>
</div>
<div class="panel-body nopadding">
{{# baseProductInfo}}
{{# baseProduct}}
<div class="form-group">
<blockquote>基本信息:</blockquote>
</div>
<div class="form-group">
<div class="col-sm-3">店铺:{{shopName}}</div>
<div class="col-sm-3">品牌:{{brandName}}</div>
... ... @@ -56,13 +63,142 @@
<div class="col-sm-8"><input class="form-control" placeholder="基础商品名称" type="text"></div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div>
</div>
<div class="form-group">
<div class="col-sm-12">商品话题:{{productTag}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">年龄层:{{ageLevel}}</div>
<div class="col-sm-3">性别:{{gender}}</div>
<div class="col-sm-3">重点款:{{grade}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否奥莱:{{isOutLets}}</div>
<div class="col-sm-3">限量款:{{isLimited}}</div>
<div class="col-sm-3">促销礼品:{{isPromotionalGifts}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否预售:{{isAdvance}}</div>
<div class="col-sm-3" style="color: #ccc;">预售库存:{{stock}}</div>
<div class="col-sm-3">预计到货时间:{{expectArrivalTime}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否限购:{{isLimitbuy}}</div>
<div class="col-sm-3">适销季:{{seasons}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">吊牌价:{{retailPrice}}</div>
<div class="col-sm-3">销售价:{{salesPrice}}</div>
</div>
<div class="form-group">
<div class="col-sm-3">是否VIP:</div>
<div class="col-sm-3">预计上架时间:{{expectShelfTime}}</div>
</div>
{{/ baseProduct}}
{{/ baseProductInfo}}
{{# goodsList}}
<div class="form-group">
<div class="col-sm-12">
<h4>能否补货:</h4>
<table class="table table-bordered">
<thead>
<tr>
<th>SKC(厂家颜色)</th>
<th>SKU(尺码)</th>
<th>能否补货</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{productSkc}}({{goodsName}})</td>
<td>{{# goodsSizeList}}{{productSku}}({{sizeName}})<br>{{/ goodsSizeList}}</td>
<td>{{# goodsSizeList}}{{isSuppled}}</br>{{/ goodsSizeList}}</td>
</tr>
</tbody>
</table>
</div>
</div>
{{/ goodsList}}
<div class="form-group">
<blockquote>上架必填:</blockquote>
</div>
<div class="form-group">
<div class="col-sm-1 height40">商品短评<i class="red">*</i></div>
<div class="col-sm-8"><input class="form-control" placeholder="商品短评" type="text" required></div>
</div>
<div class="form-group">
<div class="col-sm-6">
<label>是否新品:</label>
<label class="radio-inline"><input type="radio" name="dayFlag" value="1"></label>
<label class="radio-inline"><input type="radio" name="dayFlag" value="0"></label>
</div>
<div class="col-sm-6">
<label>上架渠道:</label>
<label style="cursor: pointer;"><input type="checkbox" name="brandStyle" value="网站">网站</label>
<label style="cursor: pointer;"><input type="checkbox" name="brandStyle" value="手机">手机</label>
<label style="cursor: pointer;"><input type="checkbox" name="brandStyle" value="场地">场地</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-12">下架时间:售罄0天下架</div>
</div>
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存文本</button>
</div>
</form>
</div>
<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>
<div class="panel-body nopadding">
{{# goodsImagesList}}
<div class="form-group">
<div class="col-sm-1">
<div class="goods-img">
<p>SKC: {{productSkc}}</p>
<p>{{goodsName}}色</p>
</div>
<div class="cover-color height40">颜色封面:</div>
<div class="goods-color height40">商品封面:</div>
</div>
<div class="col-sm-11">
<ul class="cover-image-list col-sm-12">
<li class="cover-image-item fileinput-button">
<div class="goods-img">
<a class="fileinput-button-icon" href="javascript:void(0);">+</a>
<input type="file" class="goods-img-upload">
</div>
<div class="cover-color height40">
<a href="javascript:;" class="btn btn-default btn-metro">默认</a>
<a href="javascript:;" class="btn btn-default btn-metro">男封</a>
<a href="javascript:;" class="btn btn-default btn-metro">女封</a>
</div>
<div class="goods-color height40">
<a href="javascript:;" class="btn btn-default btn-metro">设置默认</a>
<a href="javascript:;" class="btn btn-default btn-metro">调用图片</a>
</div>
</li>
</ul>
</div>
</div>
{{/ goodsImagesList}}
</div>
<div class="panel-footer">
<button class="btn btn-primary">保存封面</button>
</div>
</form>
</div>
</div>
</div>
{{/ data}}
</form>
</div>
... ...
... ... @@ -27,7 +27,7 @@
<div class="panel-body">
<div class="row">
<div class="panel-col">
<input id="skn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')">
<input id="productSkn" class="form-control panel-input height40" type="text" placeholder="请输入SKN" onkeyup="this.value=this.value.replace(/\D/gi,'')">
</div>
<div class="panel-col">
<input id="skc" class="form-control panel-input height40" type="text" placeholder="请输入SKC" onkeyup="this.value=this.value.replace(/\D/gi,'')">
... ... @@ -118,6 +118,7 @@
<option value="0">已下架</option>
</select>
</div>
<div class="panel-col">
<select name="jit" id="jit" tabindex="-1" title="" class="form-control height40">
<option value="-1">是否JIT商品</option>
... ... @@ -135,8 +136,10 @@
<option value="100">100条</option>
</select>
</div>
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
<div class="panel-col height40">
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="javascript:;" class="btn btn-info">全部</a>
</div>
</div>
<div class="row" style="margin: 0 0 0 -5px;">
... ...
... ... @@ -86,15 +86,11 @@
<label class="radio-inline"><input type="radio" name="hotFlag" value="0"></label>
<input type="hidden" value="{{hotFlag}}" id="hotFlag" for="radio">
</div>
<div class="col-md-3 height60">
<label>热门发售排序<span class="red">*</span></label>
<label><input id="orderBy" value="{{orderBy}}" type="text" class="form-control" placeholder="热门发售排序" placeholder="" required></label>
<div class="col-md-3 height60 order-by">
<label>排序<span class="red">*</span></label>
<label><input id="orderBy" value="{{orderBy}}" type="text" class="form-control" placeholder="排序" required></label>
<p>(提示:数字越大越靠前)</p>
</div>
<div class="col-md-3">
<label>未发售排序:</label>
<label><input id="notSaleOrderBy" value="{{notSaleOrderBy}}" placeholder="未发售排序" type="text" class="form-control" placeholder=""></label>
</div>
</div>
</div>
</div>
... ...