Authored by liuyue

编辑器全屏,关联店铺全选

@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 **************************提示********************************/ 10 **************************提示********************************/
11 11
12 12
13 -(function () { 13 +(function() {
14 /** 14 /**
15 * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。 15 * 编辑器资源文件根路径。它所表示的含义是:以编辑器实例化页面为当前路径,指向编辑器资源文件(即dialog等文件夹)的路径。
16 * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。 16 * 鉴于很多同学在使用编辑器的时候出现的种种路径问题,此处强烈建议大家使用"相对于网站根目录的相对路径"进行配置。
@@ -19,8 +19,8 @@ @@ -19,8 +19,8 @@
19 * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。 19 * 因此,UEditor提供了针对不同页面的编辑器可单独配置的根路径,具体来说,在需要实例化编辑器的页面最顶部写上如下代码即可。当然,需要令此处的URL等于对应的配置。
20 * window.UMEDITOR_HOME_URL = "/xxxx/xxxx/"; 20 * window.UMEDITOR_HOME_URL = "/xxxx/xxxx/";
21 */ 21 */
22 - window.UMEDITOR_HOME_URL="http://"+location.host+"/";  
23 - var URL = window.UMEDITOR_HOME_URL || (function(){ 22 + window.UMEDITOR_HOME_URL = "http://" + location.host + "/";
  23 + var URL = window.UMEDITOR_HOME_URL || (function() {
24 24
25 function PathStack() { 25 function PathStack() {
26 26
@@ -34,83 +34,83 @@ @@ -34,83 +34,83 @@
34 this.path = this.documentURL; 34 this.path = this.documentURL;
35 this.stack = []; 35 this.stack = [];
36 36
37 - this.push( this.documentURL ); 37 + this.push(this.documentURL);
38 38
39 } 39 }
40 40
41 - PathStack.isParentPath = function( path ){ 41 + PathStack.isParentPath = function(path) {
42 return path === '..'; 42 return path === '..';
43 }; 43 };
44 44
45 - PathStack.hasProtocol = function( path ){  
46 - return !!PathStack.getProtocol( path ); 45 + PathStack.hasProtocol = function(path) {
  46 + return !!PathStack.getProtocol(path);
47 }; 47 };
48 48
49 - PathStack.getProtocol = function( path ){ 49 + PathStack.getProtocol = function(path) {
50 50
51 - var protocol = /^[^:]*:\/*/.exec( path ); 51 + var protocol = /^[^:]*:\/*/.exec(path);
52 52
53 return protocol ? protocol[0] : null; 53 return protocol ? protocol[0] : null;
54 54
55 }; 55 };
56 56
57 PathStack.prototype = { 57 PathStack.prototype = {
58 - push: function( path ){ 58 + push: function(path) {
59 59
60 this.path = path; 60 this.path = path;
61 61
62 - update.call( this );  
63 - parse.call( this ); 62 + update.call(this);
  63 + parse.call(this);
64 64
65 return this; 65 return this;
66 66
67 }, 67 },
68 - getPath: function(){ 68 + getPath: function() {
69 return this + ""; 69 return this + "";
70 }, 70 },
71 - toString: function(){  
72 - return this.protocol + ( this.stack.concat( [''] ) ).join( this.separator ); 71 + toString: function() {
  72 + return this.protocol + (this.stack.concat([''])).join(this.separator);
73 } 73 }
74 }; 74 };
75 75
76 function update() { 76 function update() {
77 77
78 - var protocol = PathStack.getProtocol( this.path || '' ); 78 + var protocol = PathStack.getProtocol(this.path || '');
79 79
80 - if( protocol ) { 80 + if (protocol) {
81 81
82 //根协议 82 //根协议
83 this.protocol = protocol; 83 this.protocol = protocol;
84 84
85 //local 85 //local
86 - this.localSeparator = /\\|\//.exec( this.path.replace( protocol, '' ) )[0]; 86 + this.localSeparator = /\\|\//.exec(this.path.replace(protocol, ''))[0];
87 87
88 this.stack = []; 88 this.stack = [];
89 } else { 89 } else {
90 - protocol = /\\|\//.exec( this.path ); 90 + protocol = /\\|\//.exec(this.path);
91 protocol && (this.localSeparator = protocol[0]); 91 protocol && (this.localSeparator = protocol[0]);
92 } 92 }
93 93
94 } 94 }
95 95
96 - function parse(){ 96 + function parse() {
97 97
98 - var parsedStack = this.path.replace( this.currentDirPattern, '' ); 98 + var parsedStack = this.path.replace(this.currentDirPattern, '');
99 99
100 - if( PathStack.hasProtocol( this.path ) ) {  
101 - parsedStack = parsedStack.replace( this.protocol , ''); 100 + if (PathStack.hasProtocol(this.path)) {
  101 + parsedStack = parsedStack.replace(this.protocol, '');
102 } 102 }
103 103
104 - parsedStack = parsedStack.split( this.localSeparator ); 104 + parsedStack = parsedStack.split(this.localSeparator);
105 parsedStack.length = parsedStack.length - 1; 105 parsedStack.length = parsedStack.length - 1;
106 106
107 - for(var i= 0,tempPath,l=parsedStack.length,root = this.stack;i<l;i++){ 107 + for (var i = 0, tempPath, l = parsedStack.length, root = this.stack; i < l; i++) {
108 tempPath = parsedStack[i]; 108 tempPath = parsedStack[i];
109 - if(tempPath){  
110 - if( PathStack.isParentPath( tempPath ) ) { 109 + if (tempPath) {
  110 + if (PathStack.isParentPath(tempPath)) {
111 root.pop(); 111 root.pop();
112 } else { 112 } else {
113 - root.push( tempPath ); 113 + root.push(tempPath);
114 } 114 }
115 } 115 }
116 116
@@ -121,9 +121,9 @@ @@ -121,9 +121,9 @@
121 121
122 var currentPath = document.getElementsByTagName('script'); 122 var currentPath = document.getElementsByTagName('script');
123 123
124 - currentPath = currentPath[ currentPath.length -1 ].src; 124 + currentPath = currentPath[currentPath.length - 1].src;
125 125
126 - return new PathStack().push( currentPath ) + ""; 126 + return new PathStack().push(currentPath) + "";
127 127
128 128
129 })(); 129 })();
@@ -134,21 +134,24 @@ @@ -134,21 +134,24 @@
134 window.UMEDITOR_CONFIG = { 134 window.UMEDITOR_CONFIG = {
135 135
136 //为编辑器实例添加一个路径,这个不能被注释 136 //为编辑器实例添加一个路径,这个不能被注释
137 - UMEDITOR_HOME_URL : URL 137 + UMEDITOR_HOME_URL: URL
138 138
139 //图片上传配置区 139 //图片上传配置区
140 - ,imageUrl:URL+"ajax/ueditor" //图片上传提交地址  
141 - ,imagePath:"" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置  
142 - ,imageFieldName:"upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数 140 + ,
  141 + imageUrl: URL + "ajax/ueditor" //图片上传提交地址
  142 + ,
  143 + imagePath: "" //图片修正地址,引用了fixedImagePath,如有特殊需求,可自行配置
  144 + ,
  145 + imageFieldName: "upfile" //图片数据的key,若此处修改,需要在后台对应文件修改对应参数
143 146
144 147
145 //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义 148 //工具栏上的所有的功能按钮和下拉框,可以在new编辑器的实例时选择自己需要的从新定义
146 - ,toolbar:[ 149 + ,
  150 + toolbar: [
147 'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |', 151 'source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |',
148 - 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize' , 152 + 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontfamily fontsize',
149 '| justifyleft justifycenter justifyright justifyjustify |', 153 '| justifyleft justifycenter justifyright justifyjustify |',
150 - 'link unlink | emotion image video | map',  
151 - '| horizontal print preview fullscreen', 'drafts', 'formula' 154 + 'link unlink | emotion image video | map', 'drafts', 'formula'
152 ] 155 ]
153 156
154 //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件: 157 //语言配置项,默认是zh-cn。有需要的话也可以使用如下这样的方式来自动多语言切换,当然,前提条件是lang文件夹下存在对应的语言文件:
@@ -203,9 +206,9 @@ @@ -203,9 +206,9 @@
203 206
204 //fontfamily 207 //fontfamily
205 //字体设置 208 //字体设置
206 -// ,'fontfamily':[  
207 -// { name: 'songti', val: '宋体,SimSun'},  
208 -// ] 209 + // ,'fontfamily':[
  210 + // { name: 'songti', val: '宋体,SimSun'},
  211 + // ]
209 212
210 //fontsize 213 //fontsize
211 //字号 214 //字号
@@ -247,4 +250,4 @@ @@ -247,4 +250,4 @@
247 //填写过滤规则 250 //填写过滤规则
248 //,filterRules: {} 251 //,filterRules: {}
249 }; 252 };
250 -})(); 253 +})();
@@ -33,9 +33,11 @@ window.GOLABDATA = { @@ -33,9 +33,11 @@ window.GOLABDATA = {
33 } 33 }
34 } else { 34 } else {
35 var map = {}, 35 var map = {},
36 - args = [].slice.call(arguments, 1); 36 + args = [].slice.call(arguments, 1),
  37 + listeners = null;
  38 +
37 for (var key in that.registerEvent) { 39 for (var key in that.registerEvent) {
38 - var listeners = that.registerEvent[key]; 40 + listeners = that.registerEvent[key];
39 for (var i in listeners) { 41 for (var i in listeners) {
40 map[key] = listeners[i].apply(this, args); 42 map[key] = listeners[i].apply(this, args);
41 } 43 }
@@ -101,7 +103,9 @@ if ($('.contentpanel').data('type') == 'info') { @@ -101,7 +103,9 @@ if ($('.contentpanel').data('type') == 'info') {
101 var e = new common.edit('#netsaleAllInfo'); 103 var e = new common.edit('#netsaleAllInfo');
102 $(document).on("click", "#saveAllInfo", function() { 104 $(document).on("click", "#saveAllInfo", function() {
103 var data = {}; 105 var data = {};
104 - $.each(GOLABDATA.fire(), function(key, value) { 106 + var allData = GOLABDATA.fire();
  107 +
  108 + $.each(allData, function(key, value) {
105 if (typeof value == 'string') { 109 if (typeof value == 'string') {
106 data = value; 110 data = value;
107 return; 111 return;
@@ -109,15 +113,6 @@ $(document).on("click", "#saveAllInfo", function() { @@ -109,15 +113,6 @@ $(document).on("click", "#saveAllInfo", function() {
109 $.extend(data, value, true); 113 $.extend(data, value, true);
110 }); 114 });
111 115
112 - /*common.util.__ajax({  
113 - url: '/goods/product/saveNetSaleAllInfo',  
114 - data: data  
115 - }, function(res) {  
116 -  
117 -  
118 -  
119 - });*/  
120 -  
121 e.submit('/goods/product/saveNetSaleAllInfo', function(option) { 116 e.submit('/goods/product/saveNetSaleAllInfo', function(option) {
122 option.data = data; 117 option.data = data;
123 option.success = function(res) { 118 option.success = function(res) {
@@ -131,7 +126,7 @@ $(document).on("click", "#saveAllInfo", function() { @@ -131,7 +126,7 @@ $(document).on("click", "#saveAllInfo", function() {
131 } 126 }
132 return false; 127 return false;
133 } 128 }
134 - }) 129 + });
135 }) 130 })
136 131
137 132
@@ -202,4 +197,11 @@ $('.floatnav').on('mouseenter', function() { @@ -202,4 +197,11 @@ $('.floatnav').on('mouseenter', function() {
202 $('.floatnav').addClass('show'); 197 $('.floatnav').addClass('show');
203 }).on('mouseleave', function() { 198 }).on('mouseleave', function() {
204 $('.floatnav').removeClass('show'); 199 $('.floatnav').removeClass('show');
205 -});  
  200 +});
  201 +if (location.hash) {
  202 + var hashPos = location.hash.substring(1);
  203 + setTimeout(function() {
  204 + $('.floatnav').find('li[name="' + hashPos + '"]').trigger('click');
  205 + }, 500);
  206 +
  207 +}
@@ -75,6 +75,8 @@ var t = new common.tab({ @@ -75,6 +75,8 @@ var t = new common.tab({
75 75
76 if (columnname == 1 || columnname == 2) { 76 if (columnname == 1 || columnname == 2) {
77 editPostion = '#position9'; 77 editPostion = '#position9';
  78 + } else {
  79 + editPostion = '';
78 } 80 }
79 81
80 g.init($("#gridurl").val()); 82 g.init($("#gridurl").val());
@@ -339,7 +341,12 @@ function shelveModal(title, html) { @@ -339,7 +341,12 @@ function shelveModal(title, html) {
339 g.reload(); 341 g.reload();
340 }, 'growl-success'); 342 }, 'growl-success');
341 } else { 343 } else {
342 - e.$tip(res.data.message); 344 + //e.$tip(res.data.message);
  345 + var html = '';
  346 + $.each(res.data.data, function(key, value) {
  347 + html += key + ':' + value + '<br>';
  348 + });
  349 + e.$tip(html);
343 } 350 }
344 } 351 }
345 }); 352 });
@@ -123,7 +123,7 @@ suppledTable.init(NETSALEDATA.goodsList, 'goodsSizeList') @@ -123,7 +123,7 @@ suppledTable.init(NETSALEDATA.goodsList, 'goodsSizeList')
123 //上架必填 123 //上架必填
124 productExtBo.renderType = $('.contentpanel').data('type'); 124 productExtBo.renderType = $('.contentpanel').data('type');
125 productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : ''; 125 productExtBo.sellChannels = productExtBo.sellChannels ? productExtBo.sellChannels.replace(/,/g, "|") : '';
126 -productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : ''; 126 +
127 //productExtBo.shopList = 127 //productExtBo.shopList =
128 common.util.__ajax({ 128 common.util.__ajax({
129 url: '/goods/ShopsRest/queryShopsByBrandId', 129 url: '/goods/ShopsRest/queryShopsByBrandId',
@@ -132,12 +132,23 @@ common.util.__ajax({ @@ -132,12 +132,23 @@ common.util.__ajax({
132 } 132 }
133 }, function(res) { 133 }, function(res) {
134 productExtBo.shopList = res.data; 134 productExtBo.shopList = res.data;
  135 + productExtBo.shopIds = '';
  136 + if (productExtBo.shopIdList && productExtBo.shopIdList.length > 0) {
  137 + //如有选择店铺
  138 + productExtBo.shopIds = productExtBo.shopIdList ? productExtBo.shopIdList.join('|') : '';
  139 + } else if (res.data.length > 0) {
  140 + //如没有已选择店铺,默认选择全部
  141 + $.each(res.data, function(i, value) {
  142 + productExtBo.shopIds += value.shopsId + '|';
  143 + });
  144 + }
  145 + //
135 $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); 146 $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
136 e.init(); 147 e.init();
137 }, true); 148 }, true);
138 $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo)); 149 $('#product-ext').html(common.util.__template2($('#productExtBoTemp').html(), productExtBo));
139 150
140 - 151 +//如果是info页,所有input btn置灰
141 if ($('.contentpanel').data('type') == 'info') { 152 if ($('.contentpanel').data('type') == 'info') {
142 $('.contentpanel').find('input').prop('disabled', true); 153 $('.contentpanel').find('input').prop('disabled', true);
143 $('.contentpanel').find('.btn').addClass('disabled'); 154 $('.contentpanel').find('.btn').addClass('disabled');
@@ -146,6 +157,7 @@ if ($('.contentpanel').data('type') == 'info') { @@ -146,6 +157,7 @@ if ($('.contentpanel').data('type') == 'info') {
146 var e = new common.edit('#basicInfoWrap'); 157 var e = new common.edit('#basicInfoWrap');
147 e.init(); 158 e.init();
148 159
  160 +//保存基本信息
149 $('#saveBasicInfo').on('click', function() { 161 $('#saveBasicInfo').on('click', function() {
150 e.submit('/goods/product/saveNetSaleBaseInfo', function(option) { 162 e.submit('/goods/product/saveNetSaleBaseInfo', function(option) {
151 option.data = GOLABDATA.fire("LYbasicInfo");; 163 option.data = GOLABDATA.fire("LYbasicInfo");;
@@ -177,6 +189,5 @@ GOLABDATA.on("LYbasicInfo", function() { @@ -177,6 +189,5 @@ GOLABDATA.on("LYbasicInfo", function() {
177 data[key] = $(this).val().split('|').join(','); 189 data[key] = $(this).val().split('|').join(',');
178 } 190 }
179 }); 191 });
180 - console.log(data);  
181 return data; 192 return data;
182 }); 193 });
@@ -35,11 +35,12 @@ $(document).on("click", "#btn-descriptioner", function() { @@ -35,11 +35,12 @@ $(document).on("click", "#btn-descriptioner", function() {
35 return false; 35 return false;
36 }); 36 });
37 37
38 -window.UMrecommender = UM.getEditor('edit-recommender');  
39 /*小编推荐*/ 38 /*小编推荐*/
  39 +window.UMrecommender = UM.getEditor('edit-recommender');
40 if (window.NETSALEDATA && window.NETSALEDATA.productExtBo && window.NETSALEDATA.productExtBo.recommend) { 40 if (window.NETSALEDATA && window.NETSALEDATA.productExtBo && window.NETSALEDATA.productExtBo.recommend) {
41 UMrecommender.setContent(window.NETSALEDATA.productExtBo.recommend); 41 UMrecommender.setContent(window.NETSALEDATA.productExtBo.recommend);
42 } 42 }
  43 +
43 $(document).on("click", "#btn-recommand", function() { 44 $(document).on("click", "#btn-recommand", function() {
44 common.util.__ajax({ 45 common.util.__ajax({
45 url: '/netSale/saveNetSaleRecommend', 46 url: '/netSale/saveNetSaleRecommend',
@@ -355,7 +356,7 @@ $(document).on('click', '.remove-item-btn', function() { @@ -355,7 +356,7 @@ $(document).on('click', '.remove-item-btn', function() {
355 $(document).on("click", "#fenMainSave", function() { 356 $(document).on("click", "#fenMainSave", function() {
356 357
357 var data = GOLABDATA.fire("fenmian"); 358 var data = GOLABDATA.fire("fenmian");
358 - if(typeof data == "undefined") { 359 + if (typeof data == "undefined") {
359 return false; 360 return false;
360 } 361 }
361 common.util.__ajax({ 362 common.util.__ajax({
@@ -420,7 +420,10 @@ ul { @@ -420,7 +420,10 @@ ul {
420 padding: 0 38px 0 10px; 420 padding: 0 38px 0 10px;
421 color: #333; 421 color: #333;
422 z-index: 99; 422 z-index: 99;
423 - white-space: nowrap 423 + width: 100%;
  424 + overflow: hidden;
  425 + white-space: nowrap;
  426 + text-overflow: ellipsis;
424 } 427 }
425 428
426 .citySelect .cityboxbtn:hover { 429 .citySelect .cityboxbtn:hover {
@@ -142,8 +142,8 @@ @@ -142,8 +142,8 @@
142 </div> 142 </div>
143 143
144 <div class="row" style="margin: 0 0 0 -5px;"> 144 <div class="row" style="margin: 0 0 0 -5px;">
145 - <a id="onshelve" href="javascript:;" class="btn btn-info disabled" >上架</a>  
146 - <a id="offshelve" href="javascript:;" class="btn btn-info disabled">下架</a> 145 + <a id="onshelve" href="javascript:;" class="btn btn-info" >上架</a>
  146 + <a id="offshelve" href="javascript:;" class="btn btn-info">下架</a>
147 <a id="export-btn" href="javascript:;" class="btn btn-info">导出</a> 147 <a id="export-btn" href="javascript:;" class="btn btn-info">导出</a>
148 <a id="import-btn" href="/goods/netsale/batch" class="btn btn-info">批量(排序、款型系列)</a> 148 <a id="import-btn" href="/goods/netsale/batch" class="btn btn-info">批量(排序、款型系列)</a>
149 </div> 149 </div>
@@ -141,7 +141,7 @@ @@ -141,7 +141,7 @@
141 <input id="salesPhrase" class="form-control" type="text" value="[[salesPhrase]]" style="display: inline-block;width: 280px;"> 141 <input id="salesPhrase" class="form-control" type="text" value="[[salesPhrase]]" style="display: inline-block;width: 280px;">
142 </div> 142 </div>
143 <div class="form-group"> 143 <div class="form-group">
144 - <label>是否销:</label> 144 + <label>是否销:</label>
145 <span> 145 <span>
146 <label class="radio-inline"><input type="radio" name="isHostsell" value="Y"></label> 146 <label class="radio-inline"><input type="radio" name="isHostsell" value="Y"></label>
147 <label class="radio-inline"><input type="radio" name="isHostsell" value="N"></label> 147 <label class="radio-inline"><input type="radio" name="isHostsell" value="N"></label>