Authored by liuyue

网销

@@ -163,9 +163,11 @@ var util = { @@ -163,9 +163,11 @@ var util = {
163 var aps = params[i].split(/\+|\-|\*|\/|\=|\!|\~|'|"/g); 163 var aps = params[i].split(/\+|\-|\*|\/|\=|\!|\~|'|"/g);
164 for (var j in aps) { 164 for (var j in aps) {
165 var ap = aps[j].replace(/^\s+|\s+$/, ''); 165 var ap = aps[j].replace(/^\s+|\s+$/, '');
  166 + // console.log(":" + ap + ":");
166 if (!/^[0-9]+$/.test(ap) && !/^\s*$/.test(ap) && !/\./g.test(ap)) { 167 if (!/^[0-9]+$/.test(ap) && !/^\s*$/.test(ap) && !/\./g.test(ap)) {
167 if (!source.hasOwnProperty(ap)) { 168 if (!source.hasOwnProperty(ap)) {
168 source[ap] = ""; 169 source[ap] = "";
  170 + // console.log(":" + ap + ":");
169 } 171 }
170 } 172 }
171 } 173 }
@@ -182,6 +184,7 @@ var util = { @@ -182,6 +184,7 @@ var util = {
182 var header = "var " + keys.join(',') + ";"; 184 var header = "var " + keys.join(',') + ";";
183 185
184 186
  187 +
185 html = html.replace(/(^|\]\])(.*?)(\[\[|$)/igm, function(name, $1, $2) { 188 html = html.replace(/(^|\]\])(.*?)(\[\[|$)/igm, function(name, $1, $2) {
186 var trim = $2.replace(/^\s+|\s+$/, ''); 189 var trim = $2.replace(/^\s+|\s+$/, '');
187 return trim ? formstr($2) : ''; 190 return trim ? formstr($2) : '';
@@ -198,6 +201,7 @@ var util = { @@ -198,6 +201,7 @@ var util = {
198 } 201 }
199 result += "return p.join('');\n"; 202 result += "return p.join('');\n";
200 203
  204 + console.log(result);
201 205
202 var fn = new Function(header + result); 206 var fn = new Function(header + result);
203 var b = fn.call(source); 207 var b = fn.call(source);
@@ -7,8 +7,10 @@ require('../util/custom.js'); @@ -7,8 +7,10 @@ require('../util/custom.js');
7 */ 7 */
8 window.NETSALEDATA = require('./partials/data.js'); 8 window.NETSALEDATA = require('./partials/data.js');
9 9
10 -//初始化网销表单  
11 -window.NETSALEEDIT = new common.edit('#netsaleAllInfo'); 10 +window.NETSALEEDIT = new common.edit('#netsaleAllInfo', {
  11 + bucket: 'goodsimg'
  12 +});
  13 +
12 14
13 //获取skn 15 //获取skn
14 $('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn); 16 $('#productSkn').val(NETSALEDATA.baseProductInfo.baseProduct.productSkn);
@@ -18,12 +20,15 @@ console.log(NETSALEDATA); @@ -18,12 +20,15 @@ console.log(NETSALEDATA);
18 /*加载其他模块*/ 20 /*加载其他模块*/
19 require('./partials/basic-info'); 21 require('./partials/basic-info');
20 require('./partials/editor_recommend'); 22 require('./partials/editor_recommend');
21 -  
22 require('./partials/model'); 23 require('./partials/model');
23 require('./partials/search-key.js'); 24 require('./partials/search-key.js');
24 require('./partials/size-info.js'); 25 require('./partials/size-info.js');
25 -require('./partials/goods-sort.js')  
26 -require('./partials/video.js') 26 +require('./partials/goods-sort.js');
  27 +require('./partials/video.js');
  28 +require('./partials/brand-relation');
  29 +
  30 +//初始化网销表单
  31 +NETSALEEDIT.init();
27 32
28 33
29 34
@@ -72,7 +72,6 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), { @@ -72,7 +72,6 @@ $('#goods-table').html(common.util.__template2($('#goodsList').html(), {
72 NETSALEDATA.productExtBo.sellChannels = NETSALEDATA.productExtBo.sellChannels.replace(/,/g, "|"); 72 NETSALEDATA.productExtBo.sellChannels = NETSALEDATA.productExtBo.sellChannels.replace(/,/g, "|");
73 $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), NETSALEDATA.productExtBo)); 73 $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), NETSALEDATA.productExtBo));
74 74
75 -NETSALEEDIT.init();  
76 $('#saveBasicInfo').on('click', function() { 75 $('#saveBasicInfo').on('click', function() {
77 NETSALEEDIT.submit('/goods/product/saveNetSaleBaseInfo', function(option) { 76 NETSALEEDIT.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
78 var list = option.data.sellChannels.split('|').join(','); 77 var list = option.data.sellChannels.split('|').join(',');
  1 +var $ = require('jquery'),
  2 + common = require('../../common/common');
  3 +
  4 +common.util.__ajax({
  5 + url: '/goods/brands/queryBrandsByStatus'
  6 +}, function(res) {
  7 + //console.log(res);
  8 + var data = res.data;
  9 +
  10 + var html = '',
  11 + brandHtml = '';
  12 + var aLif = null;
  13 + $.each(data, function(i, value) {
  14 + //console.log(aLif, value.brandAlif);
  15 + aLif = value.brandAlif;
  16 + /*if (aLif != value.brandAlif) {
  17 + aLif = value.brandAlif;
  18 + html += '<div class="col-sm-2">' + aLif + '</div>';
  19 + brandHtml += '<div class="col-sm-10"><label><input tyoe="checkbox" value="' + value.id + '">' + value.brandName + '</label>';
  20 + } else {
  21 + brandHtml += '<label><input tyoe="checkbox" value="' + value.id + '">' + value.brandName + '</label>';
  22 + }*/
  23 +
  24 + });
  25 +
  26 + //$('.brand-list').html(html + brandHtml);
  27 +}, true);
@@ -2,14 +2,9 @@ @@ -2,14 +2,9 @@
2 var $ = require('jquery'), 2 var $ = require('jquery'),
3 common = require('../../common/common'); 3 common = require('../../common/common');
4 4
5 -var e = new common.edit('#video', {  
6 - bucket: 'goodsvideo'  
7 -});  
8 -  
9 -e.init();  
10 5
11 -e.on('validate', function() {  
12 - var val = $.trim($('video').attr('src')); 6 +NETSALEEDIT.on('validate', function() {
  7 + var val = $.trim($('#videofile').attr('value'));
13 if (val == '') { 8 if (val == '') {
14 return '请上传视频' 9 return '请上传视频'
15 } 10 }
@@ -17,14 +12,19 @@ e.on('validate', function() { @@ -17,14 +12,19 @@ e.on('validate', function() {
17 return true; 12 return true;
18 }); 13 });
19 14
  15 +var videoTemp = '<input id="videofile" name="videofile" type="file" bucket="goodsvideo" value="[[vedioUrl]]" extend="mp4,rmvb,avi,mov">',
  16 + videoHtml = common.util.__template2(videoTemp, NETSALEDATA.productExtBo);
  17 +
  18 +$('.video-file-wrap').html(videoHtml);
  19 +
20 $('#saveVideo').on('click', function() { 20 $('#saveVideo').on('click', function() {
21 - e.submit('/goods/product/saveNetSaleVideo', function(option) { 21 + NETSALEEDIT.submit('/goods/product/saveNetSaleVideo', function(option) {
22 option.success = function(res) { 22 option.success = function(res) {
23 res = res.data; 23 res = res.data;
24 if (res.code == '200') { 24 if (res.code == '200') {
25 - e.$tip(res.message, function() {}, 'growl-success'); 25 + NETSALEEDIT.$tip(res.message, function() {}, 'growl-success');
26 } else { 26 } else {
27 - e.$tip(res.message); 27 + NETSALEEDIT.$tip(res.message);
28 } 28 }
29 return false; 29 return false;
30 } 30 }
1 //exports.domain = require('../config/common.js').domain; 1 //exports.domain = require('../config/common.js').domain;
2 -exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //变价  
3 -//exports.domain = 'http://172.16.6.162:8088/platform'; //品牌合作 2 +//exports.domain = 'http://172.16.6.227:8083/yohobuy-platform-web'; //马力
  3 +exports.domain = 'http://172.16.6.236:8080/platform'; //钱军
  4 +//exports.domain = 'http://172.16.6.162:8088/platform'; //李建
4 5
5 //商品管理路由配置 6 //商品管理路由配置
6 exports.res = [ 7 exports.res = [
@@ -314,6 +315,39 @@ exports.res = [ @@ -314,6 +315,39 @@ exports.res = [
314 type: 'string' 315 type: 'string'
315 }] 316 }]
316 }, { 317 }, {
  318 + //网销信息 -> 保存上架后补全信息
  319 + route: '/product/saveAfterSaleInfo',
  320 + method: 'POST',
  321 + url: '/product/saveAfterSaleInfo',
  322 + params: [{
  323 + name: 'productSkn',
  324 + type: 'number'
  325 + }, {
  326 + name: 'brandModel',
  327 + type: 'string'
  328 + }, {
  329 + name: 'brandSeries',
  330 + type: 'string'
  331 + }, {
  332 + name: 'makeCrafts',
  333 + type: 'string'
  334 + }, {
  335 + name: 'pattern',
  336 + type: 'string'
  337 + }, {
  338 + name: 'style',
  339 + type: 'string'
  340 + }, {
  341 + name: 'salesPhrase',
  342 + type: 'string'
  343 + }, {
  344 + name: 'isHostsell',
  345 + type: 'string'
  346 + }, {
  347 + name: 'wearSense',
  348 + type: 'string'
  349 + }]
  350 + }, {
317 //网销信息 -> 保存视频接口 351 //网销信息 -> 保存视频接口
318 route: '/goods/product/saveNetSaleVideo', 352 route: '/goods/product/saveNetSaleVideo',
319 method: 'POST', 353 method: 'POST',
@@ -326,6 +360,12 @@ exports.res = [ @@ -326,6 +360,12 @@ exports.res = [
326 type: 'string' 360 type: 'string'
327 }] 361 }]
328 }, { 362 }, {
  363 + //网销信息 -> 品牌关联列表
  364 + route: '/goods/brands/queryBrandsByStatus',
  365 + method: 'POST',
  366 + url: '/erpproduct/brands/queryBrandsByStatus ',
  367 + params: []
  368 + }, {
329 //价格管理 -> 代销变价页面渲染 369 //价格管理 -> 代销变价页面渲染
330 route: '/goods/pricechange/index', 370 route: '/goods/pricechange/index',
331 method: 'GET', 371 method: 'GET',
@@ -15,9 +15,9 @@ @@ -15,9 +15,9 @@
15 </div> 15 </div>
16 </div> 16 </div>
17 </div> 17 </div>
18 - 18 +<form id="netsaleAllInfo" class="form-horizontal form-bordered">
19 <div class="contentpanel" data-type="{{type}}"> 19 <div class="contentpanel" data-type="{{type}}">
20 - <form id="netsaleAllInfo" class="form-horizontal form-bordered"> 20 +
21 <input id="productSkn" type="hidden"> 21 <input id="productSkn" type="hidden">
22 <div class="panel panel-danger"> 22 <div class="panel panel-danger">
23 <div class="panel-heading"> 23 <div class="panel-heading">
@@ -30,56 +30,54 @@ @@ -30,56 +30,54 @@
30 <div class="panel-body"> 30 <div class="panel-body">
31 {{> netsale/basic_info}} 31 {{> netsale/basic_info}}
32 <div class="panel panel-default"> 32 <div class="panel panel-default">
33 - <form class="form-horizontal form-bordered">  
34 - <div class="panel-heading">  
35 - <div class="panel-btns" style="display: none;">  
36 - <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>  
37 - </div>  
38 - <h2 class="panel-title">封面设置</h2> 33 + <div class="panel-heading">
  34 + <div class="panel-btns" style="display: none;">
  35 + <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
39 </div> 36 </div>
40 - <div class="panel-body nopadding">  
41 -  
42 - <div class="form-group">  
43 - <div class="col-sm-1">  
44 - <div class="goods-img">  
45 - {{# goodsImagesList}}  
46 - <p>SKC: {{productSkc}}</p>  
47 - <p>{{goodsName}}色</p>  
48 - {{/ goodsImagesList}}  
49 - </div>  
50 - <div class="cover-color height40">颜色封面:</div>  
51 - <div class="goods-color height40">商品封面:</div>  
52 - </div>  
53 - <div class="col-sm-11">  
54 - <ul class="cover-image-list col-sm-12">  
55 - {{# goodsImagesList}}  
56 - {{/ goodsImagesList}}  
57 - <li class="cover-image-item fileinput-button">  
58 - <div class="goods-img">  
59 - <a class="fileinput-button-icon" href="javascript:void(0);">+</a>  
60 - <input type="file" class="goods-img-upload">  
61 - </div>  
62 - <div class="cover-color height40">  
63 - <a href="javascript:;" class="btn btn-default btn-metro">默认</a>  
64 - <a href="javascript:;" class="btn btn-default btn-metro">男封</a>  
65 - <a href="javascript:;" class="btn btn-default btn-metro">女封</a>  
66 - </div>  
67 - <div class="goods-color height40">  
68 - <a href="javascript:;" class="btn btn-default btn-metro">设置默认</a>  
69 - <a href="javascript:;" class="btn btn-default btn-metro">调用图片</a>  
70 - </div>  
71 - </li>  
72 - </ul> 37 + <h2 class="panel-title">封面设置</h2>
  38 + </div>
  39 + <div class="panel-body nopadding">
  40 +
  41 + <div class="form-group">
  42 + <div class="col-sm-1">
  43 + <div class="goods-img">
  44 + {{# goodsImagesList}}
  45 + <p>SKC: {{productSkc}}</p>
  46 + <p>{{goodsName}}色</p>
  47 + {{/ goodsImagesList}}
73 </div> 48 </div>
  49 + <div class="cover-color height40">颜色封面:</div>
  50 + <div class="goods-color height40">商品封面:</div>
  51 + </div>
  52 + <div class="col-sm-11">
  53 + <ul class="cover-image-list col-sm-12">
  54 + {{# goodsImagesList}}
  55 + {{/ goodsImagesList}}
  56 + <li class="cover-image-item fileinput-button">
  57 + <div class="goods-img">
  58 + <a class="fileinput-button-icon" href="javascript:void(0);">+</a>
  59 + <input type="file" class="goods-img-upload">
  60 + </div>
  61 + <div class="cover-color height40">
  62 + <a href="javascript:;" class="btn btn-default btn-metro">默认</a>
  63 + <a href="javascript:;" class="btn btn-default btn-metro">男封</a>
  64 + <a href="javascript:;" class="btn btn-default btn-metro">女封</a>
  65 + </div>
  66 + <div class="goods-color height40">
  67 + <a href="javascript:;" class="btn btn-default btn-metro">设置默认</a>
  68 + <a href="javascript:;" class="btn btn-default btn-metro">调用图片</a>
  69 + </div>
  70 + </li>
  71 + </ul>
74 </div> 72 </div>
75 </div> 73 </div>
76 - <div class="panel-footer">  
77 - <button class="btn btn-pass">通过</button>  
78 - <button class="btn btn-reject">驳回</button>  
79 - </div>  
80 - </form> 74 + </div>
  75 + <div class="panel-footer">
  76 + <button class="btn btn-pass">通过</button>
  77 + <button class="btn btn-reject">驳回</button>
  78 + </div>
81 </div> 79 </div>
82 - 80 +
83 {{> netsale/goods_description}} 81 {{> netsale/goods_description}}
84 {{> netsale/size_info}} 82 {{> netsale/size_info}}
85 {{> netsale/goods_params}} 83 {{> netsale/goods_params}}
@@ -107,9 +105,9 @@ @@ -107,9 +105,9 @@
107 {{> netsale/video}} 105 {{> netsale/video}}
108 </div> 106 </div>
109 </div> 107 </div>
110 - </form> 108 +
111 </div> 109 </div>
112 - 110 +</form>
113 111
114 <script type="text/template" id="picDialogTemp"> 112 <script type="text/template" id="picDialogTemp">
115 <div class="row"> 113 <div class="row">
  1 +<div class="panel panel-default">
  2 + <div class="panel-heading">
  3 + <div class="panel-btns" style="display: none;">
  4 + <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
  5 + </div>
  6 + <h2 class="panel-title">补全信息</h2>
  7 + </div>
  8 + <div class="panel-body">
  9 +
  10 + </div>
  11 + <div class="panel-footer">
  12 + <a id="" href="javascript:;" class="btn btn-primary">保存</a>
  13 + </div>
  14 +</div>
  15 +
  16 +<script type="text/template" id="addInfoTemp">
  17 + <div class="form-group">
  18 + <div class="col-sm-1">商品风格:</div>
  19 + <div class="clo-sm-11">
  20 + [[each data]]
  21 + <label><input type="checkbox" name="" value="[[id]]">[[text]]</label>
  22 + [[each]]
  23 + </div>
  24 + </div>
  25 +</script>
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 </div> 36 </div>
37 <div class="form-group"> 37 <div class="form-group">
38 <div class="col-sm-1 height40">商品名称<i class="red">*</i>:</div> 38 <div class="col-sm-1 height40">商品名称<i class="red">*</i>:</div>
39 - [[if renderType == 'edit']] 39 + [[if renderType== 'edit']]
40 <div class="col-sm-8"><input id="productName" class="form-control" placeholder="基础商品名称" type="text" required></div> 40 <div class="col-sm-8"><input id="productName" class="form-control" placeholder="基础商品名称" type="text" required></div>
41 <div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div> 41 <div class="col-sm-12" style="color: red;"><div class="col-sm-1"></div>建议名称:【品牌英文+性别+图案纹理+版型+风格+三级类目+商家款号+(款型)】,如此可增加商品在搜索页的展示。</div>
42 [[else]] 42 [[else]]
@@ -115,7 +115,7 @@ @@ -115,7 +115,7 @@
115 <div class="form-group"> 115 <div class="form-group">
116 <div class="col-sm-1 height40">商品短评<i class="red">*</i>:</div> 116 <div class="col-sm-1 height40">商品短评<i class="red">*</i>:</div>
117 <div class="col-sm-8 height40"> 117 <div class="col-sm-8 height40">
118 - [[if renderType == 'edit']] 118 + [[if renderType== 'edit']]
119 <input class="form-control" placeholder="商品短评" type="text" required> 119 <input class="form-control" placeholder="商品短评" type="text" required>
120 [[else]] 120 [[else]]
121 <span>[[phrase]]</span> 121 <span>[[phrase]]</span>
  1 +<div class="panel panel-default">
  2 + <div class="panel-heading">
  3 + <div class="panel-btns" style="display: none;">
  4 + <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
  5 + </div>
  6 + <h2 class="panel-title">商品关联</h2>
  7 + </div>
  8 + <div class="panel-body">
  9 + <div class="form-group selected-brand"></div>
  10 + <div class="form-group brand-list">
  11 +
  12 + </div>
  13 + </div>
  14 + <div class="panel-footer">
  15 + <a id="saveBrandRelation" href="javascript:;" class="btn btn-primary">保存</a>
  16 + </div>
  17 +</div>
1 <div class="panel panel-default"> 1 <div class="panel panel-default">
2 - <form id="video" class="form-horizontal form-bordered">  
3 - <div class="panel-heading">  
4 - <div class="panel-btns" style="display: none;">  
5 - <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>  
6 - </div>  
7 - <h2 class="panel-title">视频</h2> 2 + <div class="panel-heading">
  3 + <div class="panel-btns" style="display: none;">
  4 + <a href="" class="panel-minimize tooltips" data-toggle="tooltip" title=""><i class="fa fa-minus"></i></a>
8 </div> 5 </div>
9 - <div class="panel-body">  
10 - <h4>请上传视频</h4>  
11 - <div class="video-file-wrap">  
12 - <input id="videofile" name="videofile" type="file" extend="mp4,rmvb,avi,mov">  
13 - </div>  
14 - 6 + <h2 class="panel-title">视频</h2>
  7 + </div>
  8 + <div class="panel-body">
  9 + <h4>请上传视频</h4>
  10 + <div class="video-file-wrap">
  11 +
15 </div> 12 </div>
16 - <div class="panel-footer">  
17 - <a id="saveVideo" href="javascript:;" class="btn btn-primary">保存</a>  
18 - </div>  
19 - </form> 13 +
  14 + </div>
  15 + <div class="panel-footer">
  16 + <a id="saveVideo" href="javascript:;" class="btn btn-primary">保存</a>
  17 + </div>
20 </div> 18 </div>