Authored by liuyue

网销

... ... @@ -163,9 +163,11 @@ var util = {
var aps = params[i].split(/\+|\-|\*|\/|\=|\!|\~|'|"/g);
for (var j in aps) {
var ap = aps[j].replace(/^\s+|\s+$/, '');
// console.log(":" + ap + ":");
if (!/^[0-9]+$/.test(ap) && !/^\s*$/.test(ap) && !/\./g.test(ap)) {
if (!source.hasOwnProperty(ap)) {
source[ap] = "";
// console.log(":" + ap + ":");
}
}
}
... ... @@ -182,6 +184,7 @@ var util = {
var header = "var " + keys.join(',') + ";";
html = html.replace(/(^|\]\])(.*?)(\[\[|$)/igm, function(name, $1, $2) {
var trim = $2.replace(/^\s+|\s+$/, '');
return trim ? formstr($2) : '';
... ... @@ -198,6 +201,7 @@ var util = {
}
result += "return p.join('');\n";
console.log(result);
var fn = new Function(header + result);
var b = fn.call(source);
... ...
... ... @@ -7,8 +7,10 @@ require('../util/custom.js');
*/
window.NETSALEDATA = require('./partials/data.js');
//初始化网销表单
window.NETSALEEDIT = new common.edit('#netsaleAllInfo');
window.NETSALEEDIT = new common.edit('#netsaleAllInfo', {
bucket: 'goodsimg'
});
//获取skn
$('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
... ... @@ -18,12 +20,15 @@ console.log(NETSALEDATA);
/*加载其他模块*/
require('./partials/basic-info');
require('./partials/editor_recommend');
require('./partials/model');
require('./partials/search-key.js');
require('./partials/size-info.js');
require('./partials/goods-sort.js')
require('./partials/video.js')
require('./partials/goods-sort.js');
require('./partials/video.js');
require('./partials/brand-relation');
//初始化网销表单
NETSALEEDIT.init();
... ...
... ... @@ -72,7 +72,6 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), {
NETSALEDATA.productExtBo.sellChannels = NETSALEDATA.productExtBo.sellChannels.replace(/,/g, "|");
$('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), NETSALEDATA.productExtBo));
NETSALEEDIT.init();
$('#saveBasicInfo').on('click', function() {
NETSALEEDIT.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
var list = option.data.sellChannels.split('|').join(',');
... ...
var $ = require('jquery'),
common = require('../../common/common');
common.util.__ajax({
url: '/goods/brands/queryBrandsByStatus'
}, function(res) {
//console.log(res);
var data = res.data;
var html = '',
brandHtml = '';
var aLif = null;
$.each(data, function(i, value) {
//console.log(aLif, value.brandAlif);
aLif = value.brandAlif;
/*if (aLif != value.brandAlif) {
aLif = value.brandAlif;
html += '<div class="col-sm-2">' + aLif + '</div>';
brandHtml += '<div class="col-sm-10"><label><input tyoe="checkbox" value="' + value.id + '">' + value.brandName + '</label>';
} else {
brandHtml += '<label><input tyoe="checkbox" value="' + value.id + '">' + value.brandName + '</label>';
}*/
});
//$('.brand-list').html(html + brandHtml);
}, true);
\ No newline at end of file
... ...
... ... @@ -2,14 +2,9 @@
var $ = require('jquery'),
common = require('../../common/common');
var e = new common.edit('#video', {
bucket: 'goodsvideo'
});
e.init();
e.on('validate', function() {
var val = $.trim($('video').attr('src'));
NETSALEEDIT.on('validate', function() {
var val = $.trim($('#videofile').attr('value'));
if (val == '') {
return '请上传视频'
}
... ... @@ -17,14 +12,19 @@ e.on('validate', function() {
return true;
});
var videoTemp = '<input id="videofile" name="videofile" type="file" bucket="goodsvideo" value="[[vedioUrl]]" extend="mp4,rmvb,avi,mov">',
videoHtml = common.util.__template2(videoTemp, NETSALEDATA.productExtBo);
$('.video-file-wrap').html(videoHtml);
$('#saveVideo').on('click', function() {
e.submit('/goods/product/saveNetSaleVideo', function(option) {
NETSALEEDIT.submit('/goods/product/saveNetSaleVideo', function(option) {
option.success = function(res) {
res = res.data;
if (res.code == '200') {
e.$tip(res.message, function() {}, 'growl-success');
NETSALEEDIT.$tip(res.message, function() {}, 'growl-success');
} else {
e.$tip(res.message);
NETSALEEDIT.$tip(res.message);
}
return false;
}
... ...
//exports.domain = require('../config/common.js').domain;
exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //变价
//exports.domain = 'http://172.16.6.162:8088/platform'; //品牌合作
//exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力
exports.domain = 'http://172.16.6.236:8080/platform'; //钱军
//exports.domain = 'http://172.16.6.162:8088/platform'; //李建
//商品管理路由配置
exports.res = [
... ... @@ -314,6 +315,39 @@ exports.res = [
type: 'string'
}]
}, {
//网销信息 -> 保存上架后补全信息
route: '/product/saveAfterSaleInfo',
method: 'POST',
url: '/product/saveAfterSaleInfo',
params: [{
name: 'productSkn',
type: 'number'
}, {
name: 'brandModel',
type: 'string'
}, {
name: 'brandSeries',
type: 'string'
}, {
name: 'makeCrafts',
type: 'string'
}, {
name: 'pattern',
type: 'string'
}, {
name: 'style',
type: 'string'
}, {
name: 'salesPhrase',
type: 'string'
}, {
name: 'isHostsell',
type: 'string'
}, {
name: 'wearSense',
type: 'string'
}]
}, {
//网销信息 -> 保存视频接口
route: '/goods/product/saveNetSaleVideo',
method: 'POST',
... ... @@ -326,6 +360,12 @@ exports.res = [
type: 'string'
}]
}, {
//网销信息 -> 品牌关联列表
route: '/goods/brands/queryBrandsByStatus',
method: 'POST',
url: '/erpproduct/brands/queryBrandsByStatus ',
params: []
}, {
//价格管理 -> 代销变价页面渲染
route: '/goods/pricechange/index',
method: 'GET',
... ...
... ... @@ -15,9 +15,9 @@
</div>
</div>
</div>
<form id="netsaleAllInfo" class="form-horizontal form-bordered">
<div class="contentpanel" data-type="{{type}}">
<form id="netsaleAllInfo" class="form-horizontal form-bordered">
<input id="productSkn" type="hidden">
<div class="panel panel-danger">
<div class="panel-heading">
... ... @@ -30,56 +30,54 @@
<div class="panel-body">
{{> netsale/basic_info}}
<div class="panel panel-default">
<form 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-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">
<div class="col-sm-1">
<div class="goods-img">
{{# goodsImagesList}}
<p>SKC: {{productSkc}}</p>
<p>{{goodsName}}色</p>
{{/ goodsImagesList}}
</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">
{{# goodsImagesList}}
{{/ goodsImagesList}}
<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>
<h2 class="panel-title">封面设置</h2>
</div>
<div class="panel-body nopadding">
<div class="form-group">
<div class="col-sm-1">
<div class="goods-img">
{{# goodsImagesList}}
<p>SKC: {{productSkc}}</p>
<p>{{goodsName}}色</p>
{{/ goodsImagesList}}
</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">
{{# goodsImagesList}}
{{/ goodsImagesList}}
<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>
<div class="panel-footer">
<button class="btn btn-pass">通过</button>
<button class="btn btn-reject">驳回</button>
</div>
</form>
</div>
<div class="panel-footer">
<button class="btn btn-pass">通过</button>
<button class="btn btn-reject">驳回</button>
</div>
</div>
{{> netsale/goods_description}}
{{> netsale/size_info}}
{{> netsale/goods_params}}
... ... @@ -107,9 +105,9 @@
{{> netsale/video}}
</div>
</div>
</form>
</div>
</form>
<script type="text/template" id="picDialogTemp">
<div class="row">
... ...
<div class="panel panel-default">
<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">
</div>
<div class="panel-footer">
<a id="" href="javascript:;" class="btn btn-primary">保存</a>
</div>
</div>
<script type="text/template" id="addInfoTemp">
<div class="form-group">
<div class="col-sm-1">商品风格:</div>
<div class="clo-sm-11">
[[each data]]
<label><input type="checkbox" name="" value="[[id]]">[[text]]</label>
[[each]]
</div>
</div>
</script>
\ No newline at end of file
... ...
... ... @@ -36,7 +36,7 @@
</div>
<div class="form-group">
<div class="col-sm-1 height40">商品名称<i class="red">*</i>:</div>
[[if renderType == 'edit']]
[[if renderType== 'edit']]
<div class="col-sm-8"><input id="productName" class="form-control" placeholder="基础商品名称" type="text" required></div>
<div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div>
[[else]]
... ... @@ -115,7 +115,7 @@
<div class="form-group">
<div class="col-sm-1 height40">商品短评<i class="red">*</i>:</div>
<div class="col-sm-8 height40">
[[if renderType == 'edit']]
[[if renderType== 'edit']]
<input class="form-control" placeholder="商品短评" type="text" required>
[[else]]
<span>[[phrase]]</span>
... ...
<div class="panel panel-default">
<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">
<div class="form-group selected-brand"></div>
<div class="form-group brand-list">
</div>
</div>
<div class="panel-footer">
<a id="saveBrandRelation" href="javascript:;" class="btn btn-primary">保存</a>
</div>
</div>
\ No newline at end of file
... ...
<div class="panel panel-default">
<form id="video" 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-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">
<h4>请上传视频</h4>
<div class="video-file-wrap">
<input id="videofile" name="videofile" type="file" extend="mp4,rmvb,avi,mov">
</div>
<h2 class="panel-title">视频</h2>
</div>
<div class="panel-body">
<h4>请上传视频</h4>
<div class="video-file-wrap">
</div>
<div class="panel-footer">
<a id="saveVideo" href="javascript:;" class="btn btn-primary">保存</a>
</div>
</form>
</div>
<div class="panel-footer">
<a id="saveVideo" href="javascript:;" class="btn btn-primary">保存</a>
</div>
</div>
\ No newline at end of file
... ...