Merge branch 'develop' of git.dev.yoho.cn:platform/yohobuy-portal-fe into develop
Showing
100 changed files
with
1271 additions
and
332 deletions
Too many changes to show.
To preserve performance only 100 of 100+ files are displayed.
@@ -30,8 +30,7 @@ var server_dir = '../server'; | @@ -30,8 +30,7 @@ var server_dir = '../server'; | ||
30 | var dist_dir = { | 30 | var dist_dir = { |
31 | js: 'dist/' + config.name + '/' + config.version, | 31 | js: 'dist/' + config.name + '/' + config.version, |
32 | css: 'dist/' + config.name + '/' + config.version, | 32 | css: 'dist/' + config.name + '/' + config.version, |
33 | - image: assets_dir + '/images', | ||
34 | - font: assets_dir + '/fonts' | 33 | + assets: assets_dir, |
35 | }; | 34 | }; |
36 | 35 | ||
37 | var cdn_domain = 'http://cdn.yoho.cn/'; | 36 | var cdn_domain = 'http://cdn.yoho.cn/'; |
@@ -82,30 +81,17 @@ gulp.task("clean",function(){ | @@ -82,30 +81,17 @@ gulp.task("clean",function(){ | ||
82 | gulp.task("buildjs",["js"],function(){ | 81 | gulp.task("buildjs",["js"],function(){ |
83 | gulp.src(path.join(public_dir,"dist") + '/*.js') | 82 | gulp.src(path.join(public_dir,"dist") + '/*.js') |
84 | .pipe(uglify()) | 83 | .pipe(uglify()) |
85 | - // .pipe(rename({ | ||
86 | - // suffix:md5 | ||
87 | - // })) | ||
88 | .pipe(gulp.dest(dist_dir.js)); | 84 | .pipe(gulp.dest(dist_dir.js)); |
89 | }); | 85 | }); |
90 | //发布静态资源 | 86 | //发布静态资源 |
91 | gulp.task('assets', function() { | 87 | gulp.task('assets', function() { |
92 | - gulp.src(public_dir + '/images/**') | ||
93 | - .pipe(gulp.dest(dist_dir.image)); | ||
94 | - gulp.src(public_dir + '/fonts/*') | ||
95 | - .pipe(gulp.dest(dist_dir.font)); | 88 | + gulp.src(public_dir + '/assets/**') |
89 | + .pipe(gulp.dest(dist_dir.assets)); | ||
96 | 90 | ||
97 | gulp.src(path.join(public_dir,"dist") + '/*.css') | 91 | gulp.src(path.join(public_dir,"dist") + '/*.css') |
98 | .pipe(minifycss()) | 92 | .pipe(minifycss()) |
99 | .pipe(gulp.dest(dist_dir.css)); | 93 | .pipe(gulp.dest(dist_dir.css)); |
100 | 94 | ||
101 | - // var str=fs.readFileSync(public_dir + '/css/all.css','utf-8'); | ||
102 | - // attr=str.replace(/(\n|\r)*/g,'').replace(/(\n)+@import url\(\'/g,function(name){ | ||
103 | - // return public_dir + '/css/'; | ||
104 | - // }).replace(/\'\)/g,'').split(';'); | ||
105 | - // gulp.src(attr) | ||
106 | - // .pipe(concat('all.css')) | ||
107 | - // .pipe(minifycss()) | ||
108 | - // .pipe(gulp.dest(dist_dir.css)) | ||
109 | }); | 95 | }); |
110 | 96 | ||
111 | //配置静态资源文件 | 97 | //配置静态资源文件 |
@@ -39,6 +39,7 @@ function batchExport(el, type) { | @@ -39,6 +39,7 @@ function batchExport(el, type) { | ||
39 | 39 | ||
40 | console.log("params",params); | 40 | console.log("params",params); |
41 | loadModal = common.dialog.load(); | 41 | loadModal = common.dialog.load(); |
42 | + $("#message").html(''); | ||
42 | 43 | ||
43 | //$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", "")); | 44 | //$(el).parents('td').find('.file-name').text($(el).val().replace("C:\\fakepath\\", "")); |
44 | }, | 45 | }, |
@@ -76,3 +77,19 @@ $(document).on("change","#brandId",function(){ | @@ -76,3 +77,19 @@ $(document).on("change","#brandId",function(){ | ||
76 | } | 77 | } |
77 | }); | 78 | }); |
78 | 79 | ||
80 | + | ||
81 | +function __ajaxExeclById(unquid){ | ||
82 | + var fn=arguments.callee; | ||
83 | + common.util.__ajax({ | ||
84 | + url:'', | ||
85 | + data:{unquid:unquid} | ||
86 | + },function(res){ | ||
87 | + if(res.data){ | ||
88 | + $("#message").html(''); | ||
89 | + //成功操作 | ||
90 | + | ||
91 | + }else{ | ||
92 | + fn.call(null,unquid); | ||
93 | + } | ||
94 | + }); | ||
95 | +} |
@@ -6,12 +6,18 @@ var $ = require('jquery'), | @@ -6,12 +6,18 @@ var $ = require('jquery'), | ||
6 | var RESPONSEDATA={}; | 6 | var RESPONSEDATA={}; |
7 | 7 | ||
8 | /*获取基础商品数据*/ | 8 | /*获取基础商品数据*/ |
9 | -var param = location.href.match(/(add|update|update2)\/(\d+)/); | ||
10 | -if(param){ | 9 | +var param = location.href.slice(location.href.indexOf("update")).match(/\/\d+/g); |
10 | +// console.log(param); | ||
11 | +if(param&¶m.length==2){ | ||
12 | + param[0]=param[0].replace(/\//,''); | ||
13 | + param[1]=param[1].replace(/\//,''); | ||
11 | common.util.__ajax({ | 14 | common.util.__ajax({ |
12 | url:'/base/goods/getData', | 15 | url:'/base/goods/getData', |
13 | async:false, | 16 | async:false, |
14 | - data:{productSkn:param[2]} | 17 | + data:{ |
18 | + productSkn:param[0], | ||
19 | + isAuditing:param[1] | ||
20 | + } | ||
15 | },function(res){ | 21 | },function(res){ |
16 | RESPONSEDATA=res.data; | 22 | RESPONSEDATA=res.data; |
17 | },true); | 23 | },true); |
@@ -229,6 +235,11 @@ var g=new common.grid({ | @@ -229,6 +235,11 @@ var g=new common.grid({ | ||
229 | warp.find(".w-goods-text").prop("readonly",true).prop("disabled",true); | 235 | warp.find(".w-goods-text").prop("readonly",true).prop("disabled",true); |
230 | warp.find("input[name=file]").prop("readonly",true).prop("disabled",true); | 236 | warp.find("input[name=file]").prop("readonly",true).prop("disabled",true); |
231 | warp.find(".modelCode").prop("readonly",true).prop("disabled",true); | 237 | warp.find(".modelCode").prop("readonly",true).prop("disabled",true); |
238 | + // 如果为undefind,则清除require,并且设置为空 | ||
239 | + if(warp.find(".modelCode").val()=="undefined"){ | ||
240 | + warp.find(".modelCode").removeAttr("required").val(''); | ||
241 | + } | ||
242 | + // | ||
232 | warp.find(".sortdelete").remove(); | 243 | warp.find(".sortdelete").remove(); |
233 | } | 244 | } |
234 | } | 245 | } |
@@ -422,6 +433,7 @@ e.on("validate",function(){ | @@ -422,6 +433,7 @@ e.on("validate",function(){ | ||
422 | return "请选择完整的分类目录"; | 433 | return "请选择完整的分类目录"; |
423 | }); | 434 | }); |
424 | e.on("validate",function(){ | 435 | e.on("validate",function(){ |
436 | + console.log(g.__gsm); | ||
425 | if(g.__rows.length==0){ | 437 | if(g.__rows.length==0){ |
426 | return "请添加销售属性"; | 438 | return "请添加销售属性"; |
427 | } | 439 | } |
@@ -435,11 +447,41 @@ e.on("validate",function(){ | @@ -435,11 +447,41 @@ e.on("validate",function(){ | ||
435 | _count++; | 447 | _count++; |
436 | return; | 448 | return; |
437 | } | 449 | } |
450 | + | ||
451 | + //RESPONSEDATA.productSkn | ||
452 | + console.log("item1.barCode",item1.barCode) | ||
438 | map[gname+"_"+item1.sizeId]=""; | 453 | map[gname+"_"+item1.sizeId]=""; |
439 | - if(map2.hasOwnProperty(item1.barCode)){ | ||
440 | - _count1++; | 454 | + //修改 |
455 | + if(RESPONSEDATA.productSkn){ | ||
456 | + if(index1>g.__gsm[index]-1){ | ||
457 | + //大于原来的计算 | ||
458 | + if(map2.hasOwnProperty(item1.barCode)){ | ||
459 | + _count1++; | ||
460 | + } | ||
461 | + map2[item1.barCode]=""; | ||
462 | + console.log("大于原来的计算",item1.barCode+":"+_count1); | ||
463 | + }else{ | ||
464 | + //小于原来,并且有值 | ||
465 | + if(item1.barCode){ | ||
466 | + if(map2.hasOwnProperty(item1.barCode)){ | ||
467 | + _count1++; | ||
468 | + } | ||
469 | + map2[item1.barCode]=""; | ||
470 | + console.log("小于原来,并且有值",_count1); | ||
471 | + } | ||
472 | + console.log("没值",_count1); | ||
473 | + } | ||
474 | + }else{ | ||
475 | + //添加时候计算 | ||
476 | + if(item1.barCode){ | ||
477 | + if(map2.hasOwnProperty(item1.barCode)){ | ||
478 | + _count1++; | ||
479 | + } | ||
480 | + map2[item1.barCode]=""; | ||
481 | + } | ||
482 | + console.log("添加时候计算",_count1); | ||
441 | } | 483 | } |
442 | - map2[item1.barCode]=""; | 484 | + |
443 | if(g.__gsm[index]&&index1<g.__gsm[index]){ | 485 | if(g.__gsm[index]&&index1<g.__gsm[index]){ |
444 | return; | 486 | return; |
445 | } | 487 | } |
@@ -450,11 +492,16 @@ e.on("validate",function(){ | @@ -450,11 +492,16 @@ e.on("validate",function(){ | ||
450 | if(_count>0){ | 492 | if(_count>0){ |
451 | return "同一颜色包含两组相同尺码"; | 493 | return "同一颜色包含两组相同尺码"; |
452 | } | 494 | } |
495 | + | ||
453 | if(_count1>0){ | 496 | if(_count1>0){ |
454 | return "商品条码不能重复"; | 497 | return "商品条码不能重复"; |
455 | }else{ | 498 | }else{ |
456 | if(map3.length>0){ | 499 | if(map3.length>0){ |
457 | var ispass=true; | 500 | var ispass=true; |
501 | + if(map3.indexOf("")>-1){ | ||
502 | + ispass="商品条码不能为空"; | ||
503 | + return ispass; | ||
504 | + } | ||
458 | common.util.__ajax2({ | 505 | common.util.__ajax2({ |
459 | url:'/goods/base/checkSkuBarCodeExist', | 506 | url:'/goods/base/checkSkuBarCodeExist', |
460 | async:false, | 507 | async:false, |
@@ -483,15 +530,20 @@ e.on("validate",function(){ | @@ -483,15 +530,20 @@ e.on("validate",function(){ | ||
483 | 530 | ||
484 | 531 | ||
485 | $(document).on("click","#btnReview",function(){ | 532 | $(document).on("click","#btnReview",function(){ |
533 | + $("#btnReview").prop("disabled",true); | ||
534 | + | ||
486 | if(e.validate()){ | 535 | if(e.validate()){ |
487 | common.dialog.confirm("温馨提示","<p>你确定提交吗?</p>",function(){ | 536 | common.dialog.confirm("温馨提示","<p>你确定提交吗?</p>",function(){ |
537 | + setTimeout(function(){ | ||
538 | + $("#btnReview").prop("disabled",false); | ||
539 | + },3000); | ||
488 | e.submit($("#basicForm").attr("action"),function(option){ | 540 | e.submit($("#basicForm").attr("action"),function(option){ |
489 | var select=tabTree.getAddress(); | 541 | var select=tabTree.getAddress(); |
490 | 542 | ||
491 | option.data.supplierId=common.util.__input("supplierId")?$("#supplierId").val():"0"; | 543 | option.data.supplierId=common.util.__input("supplierId")?$("#supplierId").val():"0"; |
492 | option.data.shopId=common.util.__input("shopId")?$("#shopId").val():"0"; | 544 | option.data.shopId=common.util.__input("shopId")?$("#shopId").val():"0"; |
493 | 545 | ||
494 | - option.data.productSkn=param?param[2]:""; | 546 | + option.data.productSkn=param?param[0]:""; |
495 | option.data.maxSortId=select[0]?select[0].id:""; | 547 | option.data.maxSortId=select[0]?select[0].id:""; |
496 | option.data.middleSortId=select[1]?select[1].id:""; | 548 | option.data.middleSortId=select[1]?select[1].id:""; |
497 | option.data.smallSortId=select[2]?select[2].id:""; | 549 | option.data.smallSortId=select[2]?select[2].id:""; |
@@ -6,9 +6,12 @@ | @@ -6,9 +6,12 @@ | ||
6 | var $ = require('jquery'), | 6 | var $ = require('jquery'), |
7 | common = require('../common/common'); | 7 | common = require('../common/common'); |
8 | 8 | ||
9 | -var param = location.href.match(/(info)\/(\d+)/); | 9 | +/*获取基础商品数据*/ |
10 | +var param = location.href.slice(location.href.indexOf("info")).match(/\/\d+/g); | ||
11 | +param[0]=param[0].replace(/\//,''); | ||
12 | +param[1]=param[1].replace(/\//,''); | ||
10 | 13 | ||
11 | -common.util.__ajax({url: '/base/goods/getData', data:{productSkn:param[2]}},function(data){ | 14 | +common.util.__ajax({url: '/base/goods/getData', data:{productSkn:param[0],isAuditing:param[1]}},function(data){ |
12 | 15 | ||
13 | console.log(data.data); | 16 | console.log(data.data); |
14 | data.data.attribute={"1":"普通商品","2":"赠品","3":"虚拟商品"}[""+data.data.attribute]; | 17 | data.data.attribute={"1":"普通商品","2":"赠品","3":"虚拟商品"}[""+data.data.attribute]; |
@@ -183,7 +183,7 @@ var g = new common.grid({ | @@ -183,7 +183,7 @@ var g = new common.grid({ | ||
183 | { | 183 | { |
184 | display: "SKN", render: function (item) { | 184 | display: "SKN", render: function (item) { |
185 | var html = []; | 185 | var html = []; |
186 | - html.push('<a data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '" class="btn btn-info btn-xs edit-class-btn">' + item.productSkn + '</a>'); | 186 | + html.push('<a data-index="' + item.__index + '" href="/base/goods/info/' + item.productSkn + '/'+item.isAuditing+'" class="btn btn-info btn-xs edit-class-btn">' + item.productSkn + '</a>'); |
187 | 187 | ||
188 | return html.join(''); | 188 | return html.join(''); |
189 | } | 189 | } |
@@ -247,14 +247,21 @@ var g = new common.grid({ | @@ -247,14 +247,21 @@ var g = new common.grid({ | ||
247 | var html = []; | 247 | var html = []; |
248 | //判断是否是预售商品 | 248 | //判断是否是预售商品 |
249 | if (item.isAdvance === "Y") { | 249 | if (item.isAdvance === "Y") { |
250 | - var t = new Date(item.createTime * 1000); | ||
251 | - var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | 250 | + var formatted=""; |
251 | + if(item.expectArrivalTime){ | ||
252 | + var t = new Date(item.expectArrivalTime * 1000); | ||
253 | + formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | ||
254 | + } | ||
255 | + | ||
252 | html.push("<p>是</p>"); | 256 | html.push("<p>是</p>"); |
253 | html.push("<p>预售库存:" + item.stock + "</p>"); | 257 | html.push("<p>预售库存:" + item.stock + "</p>"); |
254 | html.push("<p>预计到货时间:" + formatted + "</p>"); | 258 | html.push("<p>预计到货时间:" + formatted + "</p>"); |
255 | } else { | 259 | } else { |
256 | - var t = new Date(item.createTime * 1000); | ||
257 | - var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | 260 | + var formatted=""; |
261 | + if(item.expectShelfTime){ | ||
262 | + var t = new Date(item.expectShelfTime * 1000); | ||
263 | + formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | ||
264 | + } | ||
258 | html.push("<p>否</p>"); | 265 | html.push("<p>否</p>"); |
259 | html.push("<p>预计上架时间:" + formatted + "</p>"); | 266 | html.push("<p>预计上架时间:" + formatted + "</p>"); |
260 | } | 267 | } |
@@ -390,7 +397,7 @@ var g = new common.grid({ | @@ -390,7 +397,7 @@ var g = new common.grid({ | ||
390 | display: "操作", render: function (item) { | 397 | display: "操作", render: function (item) { |
391 | var html = []; | 398 | var html = []; |
392 | if (item.isAuditing != 100) { | 399 | if (item.isAuditing != 100) { |
393 | - html.push('<a data-index="' + item.__index + '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/' + item.productSkn + '">修改</a>'); | 400 | + html.push('<a data-index="' + item.__index + '" class="btn btn-info btn-xs edit-class-btn" href="/base/goods/update/' + item.productSkn + '/'+item.isAuditing+'">修改</a>'); |
394 | } | 401 | } |
395 | if (item.isAuditing == 100) { | 402 | if (item.isAuditing == 100) { |
396 | html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn apply-success">通过</a>'); | 403 | html.push('<a data-index="' + item.__index + '" href="JavaScript:;" class="btn operation btn-success btn-xs edit-class-btn apply-success">通过</a>'); |
@@ -76,6 +76,13 @@ toast.prototype.init = function(options) { | @@ -76,6 +76,13 @@ toast.prototype.init = function(options) { | ||
76 | width: _o.width, | 76 | width: _o.width, |
77 | height: _o.height | 77 | height: _o.height |
78 | }); | 78 | }); |
79 | + if(__self.dom.body){ | ||
80 | + __self.dom.body.css({ | ||
81 | + "max-height":($(window).height()-300) + "px", | ||
82 | + overflow: "auto" | ||
83 | + }); | ||
84 | + } | ||
85 | + | ||
79 | 86 | ||
80 | __self.dom.wrap.on('click', '[data-id]', function(event) { | 87 | __self.dom.wrap.on('click', '[data-id]', function(event) { |
81 | var $this = $(this); | 88 | var $this = $(this); |
@@ -35,7 +35,7 @@ var urlObj = { | @@ -35,7 +35,7 @@ var urlObj = { | ||
35 | 'guangGetSortList':'/guang/article/getSortList', // 逛-获取作者 | 35 | 'guangGetSortList':'/guang/article/getSortList', // 逛-获取作者 |
36 | 'guangGetTagCategoryByStatus':'/guang/tagSort/getTagItems', | 36 | 'guangGetTagCategoryByStatus':'/guang/tagSort/getTagItems', |
37 | 'guangCommentGetFilterItems':'/guang/comment/getItems', // 逛-评论列表-获取筛选条件 | 37 | 'guangCommentGetFilterItems':'/guang/comment/getItems', // 逛-评论列表-获取筛选条件 |
38 | - | 38 | + 'guangPlusSatrChannel':'/guang/plustarcategory/getCategoryNames', // 逛-plus star 频道 |
39 | 'queryBrandByShopId': '/query/brandByshopId', //查询店铺下关联品牌 | 39 | 'queryBrandByShopId': '/query/brandByshopId', //查询店铺下关联品牌 |
40 | 'querySupplierByShopId': '/query/supplierByshopId' //查询店铺下关联供应商 | 40 | 'querySupplierByShopId': '/query/supplierByshopId' //查询店铺下关联供应商 |
41 | }; | 41 | }; |
@@ -382,13 +382,18 @@ edit.prototype = { | @@ -382,13 +382,18 @@ edit.prototype = { | ||
382 | dataType: "json", | 382 | dataType: "json", |
383 | success: function(res) { | 383 | success: function(res) { |
384 | return false; | 384 | return false; |
385 | - }, | ||
386 | - error: function(err) { | ||
387 | - console.log(err); | ||
388 | - return false; | ||
389 | } | 385 | } |
390 | }; | 386 | }; |
391 | callback && callback(options); | 387 | callback && callback(options); |
388 | + var error=options.error; | ||
389 | + options.error=function(err){ | ||
390 | + console.log(err); | ||
391 | + error&&error(err); | ||
392 | + if(err.status==200){ | ||
393 | + location.href="/login"; | ||
394 | + } | ||
395 | + return false; | ||
396 | + } | ||
392 | if (!options.debug) { | 397 | if (!options.debug) { |
393 | $.ajax(options); | 398 | $.ajax(options); |
394 | } else { | 399 | } else { |
@@ -116,7 +116,7 @@ grid.prototype = { | @@ -116,7 +116,7 @@ grid.prototype = { | ||
116 | param.page = urlParam.page; | 116 | param.page = urlParam.page; |
117 | } | 117 | } |
118 | 118 | ||
119 | - if (param.size == p.size) { | 119 | + if (!param.size) { |
120 | param.size = urlParam.size; | 120 | param.size = urlParam.size; |
121 | } | 121 | } |
122 | 122 | ||
@@ -203,6 +203,7 @@ grid.prototype = { | @@ -203,6 +203,7 @@ grid.prototype = { | ||
203 | ajax: function(param) { | 203 | ajax: function(param) { |
204 | var g = this, | 204 | var g = this, |
205 | p = this.options; | 205 | p = this.options; |
206 | + var timeid; | ||
206 | var ajaxOptions = { | 207 | var ajaxOptions = { |
207 | type: 'POST', | 208 | type: 'POST', |
208 | url: p.url, | 209 | url: p.url, |
@@ -225,8 +226,14 @@ grid.prototype = { | @@ -225,8 +226,14 @@ grid.prototype = { | ||
225 | console.log("complete~~"); | 226 | console.log("complete~~"); |
226 | // p.complete && p.complete(); | 227 | // p.complete && p.complete(); |
227 | }, | 228 | }, |
228 | - error: function() { | ||
229 | - console.log("error~~"); | 229 | + error: function(res) { |
230 | + console.log("error~~",res); | ||
231 | + clearTimeout(timeid); | ||
232 | + if (res.status==429) { | ||
233 | + timeid=setTimeout(function(){ | ||
234 | + g.reload(); | ||
235 | + },800); | ||
236 | + } | ||
230 | g.__pagination({ | 237 | g.__pagination({ |
231 | total: 0, | 238 | total: 0, |
232 | page: 0 | 239 | page: 0 |
@@ -30,6 +30,8 @@ tab.prototype = { | @@ -30,6 +30,8 @@ tab.prototype = { | ||
30 | } | 30 | } |
31 | g.index = index; | 31 | g.index = index; |
32 | this.render(data); | 32 | this.render(data); |
33 | + g.active = index; | ||
34 | + p._init && p._init(g.active); | ||
33 | this.bind(p.click); | 35 | this.bind(p.click); |
34 | return this; | 36 | return this; |
35 | }, | 37 | }, |
@@ -43,8 +45,12 @@ tab.prototype = { | @@ -43,8 +45,12 @@ tab.prototype = { | ||
43 | g.active = $(this).find("a").attr("columnname"); | 45 | g.active = $(this).find("a").attr("columnname"); |
44 | g.key = $(this).find("a").attr("key"); | 46 | g.key = $(this).find("a").attr("key"); |
45 | g.value = $(this).find("a").attr("value"); | 47 | g.value = $(this).find("a").attr("value"); |
48 | + | ||
49 | + this._init = p._init; | ||
46 | callback && callback.call(this); | 50 | callback && callback.call(this); |
47 | }); | 51 | }); |
52 | + | ||
53 | + | ||
48 | }, | 54 | }, |
49 | render: function(data) { | 55 | render: function(data) { |
50 | var g = this, | 56 | var g = this, |
@@ -22,6 +22,9 @@ var util = { | @@ -22,6 +22,9 @@ var util = { | ||
22 | } | 22 | } |
23 | }, | 23 | }, |
24 | error: function(err) { | 24 | error: function(err) { |
25 | + if(err.status==200){ | ||
26 | + location.href="/login"; | ||
27 | + } | ||
25 | console.log("ajax.ERROR", err); | 28 | console.log("ajax.ERROR", err); |
26 | return false; | 29 | return false; |
27 | } | 30 | } |
@@ -205,4 +205,20 @@ if (location.hash) { | @@ -205,4 +205,20 @@ if (location.hash) { | ||
205 | $('.floatnav').find('li[name="' + hashPos + '"]').trigger('click'); | 205 | $('.floatnav').find('li[name="' + hashPos + '"]').trigger('click'); |
206 | }, 500); | 206 | }, 500); |
207 | 207 | ||
208 | +} | ||
209 | + | ||
210 | +// alert(location.hash.replace(/^#/,'').split(',')[0]); | ||
211 | +try { | ||
212 | + $(".floatnav li").each(function() { | ||
213 | + var name = $.trim($(this).data('pos')), | ||
214 | + that = this; | ||
215 | + console.log(name); | ||
216 | + if (name == location.hash.replace(/^#/, '')) { | ||
217 | + setTimeout(function() { | ||
218 | + $(that).click(); | ||
219 | + }, 500); | ||
220 | + } | ||
221 | + }); | ||
222 | +} catch (e) { | ||
223 | + | ||
208 | } | 224 | } |
@@ -26,7 +26,8 @@ var ENUM = { | @@ -26,7 +26,8 @@ var ENUM = { | ||
26 | }, | 26 | }, |
27 | attribute: { | 27 | attribute: { |
28 | 1: '普通', | 28 | 1: '普通', |
29 | - 2: '赠品' | 29 | + 2: '赠品', |
30 | + 3: '虚拟商品' | ||
30 | }, | 31 | }, |
31 | tab: { | 32 | tab: { |
32 | '1': 0, | 33 | '1': 0, |
@@ -59,68 +60,6 @@ new common.dropDown({ | @@ -59,68 +60,6 @@ new common.dropDown({ | ||
59 | hash: true | 60 | hash: true |
60 | }); | 61 | }); |
61 | 62 | ||
62 | - | ||
63 | -var editPostion = ''; | ||
64 | - | ||
65 | -var t = new common.tab({ | ||
66 | - el: "#basicTab", | ||
67 | - click: function() { | ||
68 | - g.options.columns[11].hidden = true; | ||
69 | - g.options.columns[8].hidden = true; | ||
70 | - g.options.page = 1; | ||
71 | - var columnname = $(this).find('a').attr('columnname'); | ||
72 | - if (columnname == 3) { | ||
73 | - g.options.columns[11].hidden = false; | ||
74 | - } else if (columnname == 2) { | ||
75 | - g.options.columns[8].hidden = false; | ||
76 | - }; | ||
77 | - | ||
78 | - if (columnname == 1 || columnname == 2) { | ||
79 | - editPostion = '#position9'; | ||
80 | - } else { | ||
81 | - editPostion = ''; | ||
82 | - } | ||
83 | - | ||
84 | - g.init($("#gridurl").val()); | ||
85 | - }, | ||
86 | - columns: [{ | ||
87 | - name: "0", | ||
88 | - value: '8,3,2', | ||
89 | - display: "上架前({1})" | ||
90 | - }, { | ||
91 | - name: "1", | ||
92 | - value: '4,1,0,5,6', | ||
93 | - display: "上架后({2})" | ||
94 | - }, { | ||
95 | - name: "2", | ||
96 | - value: '1', | ||
97 | - display: "搜索/标签({3})" | ||
98 | - }, { | ||
99 | - name: "3", | ||
100 | - value: '1', | ||
101 | - display: "上架后信息缺失({4})" | ||
102 | - }, { | ||
103 | - name: "all", | ||
104 | - value: 'all', | ||
105 | - display: "全部商品({all})" | ||
106 | - }] | ||
107 | -}).init(ENUM.tab); | ||
108 | - | ||
109 | -//tab | ||
110 | -var loadtab = function() { | ||
111 | - t.active = undefined; | ||
112 | - setTimeout(function() { | ||
113 | - common.util.__ajax({ | ||
114 | - url: '/goods/product/queryTabProductNum', | ||
115 | - data: g.options.parms() | ||
116 | - }, function(res) { | ||
117 | - var __dt = $.extend({}, ENUM.tab, res.data); | ||
118 | - t.init(__dt); | ||
119 | - }, true); | ||
120 | - }, 400); | ||
121 | -} | ||
122 | -loadtab(); | ||
123 | - | ||
124 | var g = new common.grid({ | 63 | var g = new common.grid({ |
125 | el: "#basicTable", | 64 | el: "#basicTable", |
126 | parms: function() { | 65 | parms: function() { |
@@ -273,7 +212,17 @@ var g = new common.grid({ | @@ -273,7 +212,17 @@ var g = new common.grid({ | ||
273 | display: '缺失信息', | 212 | display: '缺失信息', |
274 | hidden: true, | 213 | hidden: true, |
275 | render: function(item) { | 214 | render: function(item) { |
276 | - return '<p style="color: red;">' + item.missInfo + '</p>' | 215 | + var html = []; |
216 | + html.push('<p style="color: red;">'); | ||
217 | + var arr = item.missInfo.split(','); | ||
218 | + for (var i in arr) { | ||
219 | + var item1 = $.trim(arr[i]); | ||
220 | + if (item) { | ||
221 | + html.push('<a href="/goods/netsale/edit/' + item.productSkn + editPostion + '#' + item1 + '">' + item1 + '</a>'); | ||
222 | + } | ||
223 | + } | ||
224 | + html.push('</p>'); | ||
225 | + return html.join(''); | ||
277 | } | 226 | } |
278 | }, { | 227 | }, { |
279 | display: '操作', | 228 | display: '操作', |
@@ -292,6 +241,69 @@ var g = new common.grid({ | @@ -292,6 +241,69 @@ var g = new common.grid({ | ||
292 | } | 241 | } |
293 | }] | 242 | }] |
294 | }); | 243 | }); |
244 | + | ||
245 | +var editPostion = ''; | ||
246 | + | ||
247 | +var t = new common.tab({ | ||
248 | + el: "#basicTab", | ||
249 | + _init: function(active) { | ||
250 | + g.options.columns[11].hidden = true; | ||
251 | + g.options.columns[8].hidden = true; | ||
252 | + g.options.page = 1; | ||
253 | + if (active == 3) { | ||
254 | + g.options.columns[11].hidden = false; | ||
255 | + } else if (active == 2) { | ||
256 | + g.options.columns[8].hidden = false; | ||
257 | + }; | ||
258 | + | ||
259 | + if (active == 1 || active == 2) { | ||
260 | + editPostion = '#position9'; | ||
261 | + } else { | ||
262 | + editPostion = ''; | ||
263 | + } | ||
264 | + }, | ||
265 | + click: function() { | ||
266 | + this._init(t.active); | ||
267 | + g.init($("#gridurl").val()); | ||
268 | + }, | ||
269 | + columns: [{ | ||
270 | + name: "0", | ||
271 | + value: '8,3,2', | ||
272 | + display: "上架前({1})" | ||
273 | + }, { | ||
274 | + name: "1", | ||
275 | + value: '4,1,0,5,6', | ||
276 | + display: "上架后({2})" | ||
277 | + }, { | ||
278 | + name: "2", | ||
279 | + value: '1', | ||
280 | + display: "搜索/标签({3})" | ||
281 | + }, { | ||
282 | + name: "3", | ||
283 | + value: '1', | ||
284 | + display: "上架后信息缺失({4})" | ||
285 | + }, { | ||
286 | + name: "all", | ||
287 | + value: 'all', | ||
288 | + display: "全部商品({all})" | ||
289 | + }] | ||
290 | +}).init(ENUM.tab); | ||
291 | + | ||
292 | +//tab | ||
293 | +var loadtab = function() { | ||
294 | + t.active = undefined; | ||
295 | + setTimeout(function() { | ||
296 | + common.util.__ajax({ | ||
297 | + url: '/goods/product/queryTabProductNum', | ||
298 | + data: g.options.parms() | ||
299 | + }, function(res) { | ||
300 | + var __dt = $.extend({}, ENUM.tab, res.data); | ||
301 | + t.init(__dt); | ||
302 | + }, true); | ||
303 | + }, 400); | ||
304 | +} | ||
305 | +loadtab(); | ||
306 | + | ||
295 | g.init($("#gridurl").val()); | 307 | g.init($("#gridurl").val()); |
296 | 308 | ||
297 | //筛选 | 309 | //筛选 |
@@ -315,6 +327,7 @@ function shelveModal(title, html) { | @@ -315,6 +327,7 @@ function shelveModal(title, html) { | ||
315 | return; | 327 | return; |
316 | } | 328 | } |
317 | 329 | ||
330 | + console.log(g.selected); | ||
318 | $.each(selectedArr, function(i, value) { | 331 | $.each(selectedArr, function(i, value) { |
319 | productSknList.push(value['productSkn']); | 332 | productSknList.push(value['productSkn']); |
320 | }); | 333 | }); |
@@ -324,6 +337,10 @@ function shelveModal(title, html) { | @@ -324,6 +337,10 @@ function shelveModal(title, html) { | ||
324 | content: html | 337 | content: html |
325 | }); | 338 | }); |
326 | 339 | ||
340 | + | ||
341 | + if (len === 1 && g.selected[0].isAdvance === 'N') { | ||
342 | + $('#advanceBeginTime, #advanceEndTime').prop('disabled', true); | ||
343 | + } | ||
327 | var e = new common.edit('.shelve-form'); | 344 | var e = new common.edit('.shelve-form'); |
328 | e.init(); | 345 | e.init(); |
329 | 346 | ||
@@ -416,7 +433,6 @@ var shelveTable = new common.grid({ | @@ -416,7 +433,6 @@ var shelveTable = new common.grid({ | ||
416 | }, { | 433 | }, { |
417 | display: '<div class="subhhead"><span>SKU</span><span>尺码</span><span>库存</span><span>SKU上架操作</span><span>SKU上架操作</span></div>', | 434 | display: '<div class="subhhead"><span>SKU</span><span>尺码</span><span>库存</span><span>SKU上架操作</span><span>SKU上架操作</span></div>', |
418 | render: function(item) { | 435 | render: function(item) { |
419 | - console.log(item); | ||
420 | return common.util.__template2($("#template2").html(), item) | 436 | return common.util.__template2($("#template2").html(), item) |
421 | } | 437 | } |
422 | }] | 438 | }] |
@@ -462,7 +478,6 @@ function getdata(Skn, callback) { | @@ -462,7 +478,6 @@ function getdata(Skn, callback) { | ||
462 | 478 | ||
463 | $(document).on("click", ".btnskc", function() { | 479 | $(document).on("click", ".btnskc", function() { |
464 | var item = goodsList[$(this).data("index")]; | 480 | var item = goodsList[$(this).data("index")]; |
465 | - console.log(item); | ||
466 | common.util.__ajax({ | 481 | common.util.__ajax({ |
467 | url: '/goods/product/updateGoodsStatus', | 482 | url: '/goods/product/updateGoodsStatus', |
468 | data: { | 483 | data: { |
@@ -475,7 +490,7 @@ $(document).on("click", ".btnskc", function() { | @@ -475,7 +490,7 @@ $(document).on("click", ".btnskc", function() { | ||
475 | goodsList = res.data.goodsList; | 490 | goodsList = res.data.goodsList; |
476 | shelveTable.init(res.data.goodsList); | 491 | shelveTable.init(res.data.goodsList); |
477 | }); | 492 | }); |
478 | - | 493 | + g.init($("#gridurl").val()); |
479 | } | 494 | } |
480 | }) | 495 | }) |
481 | }); | 496 | }); |
@@ -76,6 +76,7 @@ function inputDisabled(callback) { | @@ -76,6 +76,7 @@ function inputDisabled(callback) { | ||
76 | $('.contentpanel').find('input').prop('disabled', true); | 76 | $('.contentpanel').find('input').prop('disabled', true); |
77 | $('.contentpanel').find('select').prop('disabled', true); | 77 | $('.contentpanel').find('select').prop('disabled', true); |
78 | $('.contentpanel').find('.btn').addClass('disabled'); | 78 | $('.contentpanel').find('.btn').addClass('disabled'); |
79 | + $(".attr_checkobx_class").hide(); | ||
79 | callback && callback(); | 80 | callback && callback(); |
80 | } | 81 | } |
81 | } | 82 | } |
@@ -167,7 +167,7 @@ var t = new common.tab({ | @@ -167,7 +167,7 @@ var t = new common.tab({ | ||
167 | }, { | 167 | }, { |
168 | name: "3", | 168 | name: "3", |
169 | display: "通过({3})", | 169 | display: "通过({3})", |
170 | - value: '4,7' | 170 | + value: '1,4,7' |
171 | }, { | 171 | }, { |
172 | name: "all", | 172 | name: "all", |
173 | display: "全部商品", | 173 | display: "全部商品", |
@@ -79,7 +79,7 @@ $(document).on('click', '.info-del', function() { | @@ -79,7 +79,7 @@ $(document).on('click', '.info-del', function() { | ||
79 | function articleCategoryOP(prefix, url, item) { | 79 | function articleCategoryOP(prefix, url, item) { |
80 | 80 | ||
81 | var a =new common.edit(".confirm", { | 81 | var a =new common.edit(".confirm", { |
82 | - "bucket" : "color" | 82 | + "bucket" : "author" |
83 | }); | 83 | }); |
84 | 84 | ||
85 | common.dialog.confirm(prefix+'作者', common.util.__template2($("#template").html(), item), function () { | 85 | common.dialog.confirm(prefix+'作者', common.util.__template2($("#template").html(), item), function () { |
client/js/guang/brandConcern.js
0 → 100644
1 | +/** | ||
2 | + * Created by wangqianjun on 16/3/30. | ||
3 | + */ | ||
4 | + | ||
5 | +var $ = require('jquery'); | ||
6 | +common = require('../common/common'); | ||
7 | + | ||
8 | +var imgArr = []; | ||
9 | + | ||
10 | +var ENUM = { | ||
11 | + HotEnum: { | ||
12 | + '1': '是', | ||
13 | + '0': '否', | ||
14 | + }, | ||
15 | + | ||
16 | + StatusEnum: { | ||
17 | + 1:'可用', | ||
18 | + 2:'不可用', | ||
19 | + }, | ||
20 | + | ||
21 | + GenderEnum: { | ||
22 | + 1:'男', | ||
23 | + 2:'女', | ||
24 | + 3:'通用', | ||
25 | + }, | ||
26 | +} | ||
27 | + | ||
28 | +//下拉框 | ||
29 | +new common.dropDown({ | ||
30 | + el: "#g-brandId", | ||
31 | + ajax: 'brand', | ||
32 | + params : { | ||
33 | + status: 1 | ||
34 | + } | ||
35 | +}); | ||
36 | + | ||
37 | +var g = new common.grid({ | ||
38 | + el: '#basicTable', | ||
39 | + size: 10, | ||
40 | + parms: function () { | ||
41 | + | ||
42 | + return { | ||
43 | + brandId: common.util.__input('g-brandId'), | ||
44 | + }; | ||
45 | + }, | ||
46 | + columns: [ | ||
47 | + { | ||
48 | + display: 'ID', | ||
49 | + name: "id" | ||
50 | + }, { | ||
51 | + display: '品牌名称', | ||
52 | + name: "brandName" | ||
53 | + }, { | ||
54 | + display: '新品', | ||
55 | + render: function (item) { | ||
56 | + var value = (item.brandType == 1) ? "是" : "否"; | ||
57 | + | ||
58 | + return "<p>" + value + "</p>"; | ||
59 | + } | ||
60 | + },{ | ||
61 | + display: '折扣', | ||
62 | + render: function (item) { | ||
63 | + var value = (item.brandType == 2) ? "是" : "否"; | ||
64 | + | ||
65 | + return "<p>" + value + "</p>"; | ||
66 | + } | ||
67 | + },{ | ||
68 | + display: '推荐', | ||
69 | + render: function (item) { | ||
70 | + var value = (item.brandType == 3) ? "是" : "否"; | ||
71 | + | ||
72 | + return "<p>" + value + "</p>"; | ||
73 | + } | ||
74 | + },{ | ||
75 | + display: '活动', | ||
76 | + render: function (item) { | ||
77 | + var value = (item.brandType == 4) ? "是" : "否"; | ||
78 | + | ||
79 | + return "<p>" + value + "</p>"; | ||
80 | + } | ||
81 | + },{ | ||
82 | + display: '折扣价', | ||
83 | + name: "discount" | ||
84 | + }, { | ||
85 | + display: '时间', | ||
86 | + render: function (item) { | ||
87 | + var t = new Date(item.createTime * 1000); | ||
88 | + var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | ||
89 | + return "<p>" + formatted + "</p>"; | ||
90 | + } | ||
91 | + }, | ||
92 | + | ||
93 | + { | ||
94 | + display: '操作', | ||
95 | + //} | ||
96 | + name: "status", | ||
97 | + render: function (items) { | ||
98 | + var HtmArr = []; | ||
99 | + | ||
100 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">编辑</a>'); | ||
101 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>'); | ||
102 | + | ||
103 | + return HtmArr.join(''); | ||
104 | + } | ||
105 | + }] | ||
106 | +}); | ||
107 | +g.init('/guang/relationship/getList'); | ||
108 | + | ||
109 | +//==================== 按钮点击事件 =====================// | ||
110 | + | ||
111 | +$("#filter-btn").click(function() { | ||
112 | + g.reload(1); | ||
113 | +}); | ||
114 | + | ||
115 | +//添加 | ||
116 | +$(document).on('click', '#add-btn', function() { | ||
117 | + plusStarOP("新增", '/guang/relationship/addRel', {}); | ||
118 | + | ||
119 | +}); | ||
120 | + | ||
121 | +//编辑 | ||
122 | +$(document).on('click', '.info-modify', function() { | ||
123 | + var item = g.rows[$(this).data("index")]; | ||
124 | + plusStarOP("编辑", '/guang/relationship/updateRel', item); | ||
125 | +}); | ||
126 | + | ||
127 | +//删除 | ||
128 | +$(document).on('click', '.info-del', function() { | ||
129 | + var item = g.rows[$(this).data("index")]; | ||
130 | + | ||
131 | + common.dialog.confirm("温馨提示","确定要删除该品牌?" , function() { | ||
132 | + common.util.__ajax({ | ||
133 | + url: '/guang/relationship/delRel', | ||
134 | + data: { | ||
135 | + id: item.id, | ||
136 | + } | ||
137 | + }, function(res) { | ||
138 | + if (res.code == 200) { | ||
139 | + g.reload(); | ||
140 | + } | ||
141 | + }); | ||
142 | + }); | ||
143 | +}); | ||
144 | + | ||
145 | + | ||
146 | +// 根据选择的类型来动态展示页面 | ||
147 | +$(document).on('click', 'input[name="brandType"]', function () { | ||
148 | + console.log(); | ||
149 | + var val = $(this).val(); | ||
150 | + | ||
151 | + $('#discount').css('display', 'none'); | ||
152 | + $('#activity').css('display', 'none'); | ||
153 | + $('#activity-name').css('display', 'none'); | ||
154 | + switch (val) { | ||
155 | + // 折扣 | ||
156 | + case '2': | ||
157 | + { | ||
158 | + $('#discount').css('display', 'inline'); | ||
159 | + | ||
160 | + } | ||
161 | + break; | ||
162 | + | ||
163 | + // 活动 | ||
164 | + case '4': | ||
165 | + { | ||
166 | + $('#activity').css('display', 'block'); | ||
167 | + $('#activity-name').css('display', 'block'); | ||
168 | + } | ||
169 | + break; | ||
170 | + | ||
171 | + default : | ||
172 | + break; | ||
173 | + } | ||
174 | + | ||
175 | +}) | ||
176 | + | ||
177 | +function plusStarOP(prefix, url, item) { | ||
178 | + | ||
179 | + if(prefix == "编辑") { | ||
180 | + imgArr = item.activityImg||[]; | ||
181 | + } else { | ||
182 | + imgArr = []; | ||
183 | + } | ||
184 | + | ||
185 | + var a = new common.edit('#templete-top'); | ||
186 | + common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () { | ||
187 | + | ||
188 | + return a.submit(url,function(option){ | ||
189 | + //设置图片 | ||
190 | + if(imgArr.length) { | ||
191 | + option.data.activityImg = imgArr.toString(); | ||
192 | + } | ||
193 | + imgArr = []; | ||
194 | + option.success=function(res){ | ||
195 | + res=res.data; | ||
196 | + if(res.code=="200"){ | ||
197 | + a.$tip("提交成功", function() { | ||
198 | + g.reload(); | ||
199 | + }, 'growl-success'); | ||
200 | + }else{ | ||
201 | + a.$tip(res.message); | ||
202 | + } | ||
203 | + return false; | ||
204 | + }, | ||
205 | + option.error=function(res){ | ||
206 | + a.$tip(res.message); | ||
207 | + } | ||
208 | + }); | ||
209 | + | ||
210 | + }); | ||
211 | + | ||
212 | + a.init(); | ||
213 | + | ||
214 | + var val = $('#brandType').val(); | ||
215 | + $('#discount').css('display', 'none'); | ||
216 | + $('#activity').css('display', 'none'); | ||
217 | + $('#activity-name').css('display', 'none'); | ||
218 | + $('input[name="brandType"][value="' + val + '"]').trigger('click'); | ||
219 | + | ||
220 | + | ||
221 | + rendBoList(imgArr); | ||
222 | + | ||
223 | + | ||
224 | + // 图片上传 | ||
225 | + uploadImage(); | ||
226 | + | ||
227 | + new common.dropDown({ | ||
228 | + el: "#brandId", | ||
229 | + ajax: 'brand', | ||
230 | + params : { | ||
231 | + status: 1 | ||
232 | + } | ||
233 | + | ||
234 | + }); | ||
235 | + | ||
236 | +} | ||
237 | + | ||
238 | +function rendBoList (pictureBoList) { | ||
239 | + $(".image-list").html(''); | ||
240 | + $("#addPic").append(common.util.__template2($("#imgeUpload").html(), | ||
241 | + { | ||
242 | + pictureBoList: pictureBoList | ||
243 | + } | ||
244 | + )); | ||
245 | +} | ||
246 | + | ||
247 | +function uploadImage() { | ||
248 | + common.edit.ajaxfileupload(".picfile", { | ||
249 | + params: { | ||
250 | + __type: "upload", | ||
251 | + bucket: "relationship" | ||
252 | + }, | ||
253 | + valid_extensions: ['png', 'jpg', 'jpeg'], | ||
254 | + onComplete: function (response) { | ||
255 | + | ||
256 | + if (response.status && response.code == 200) { | ||
257 | + console.log("response", response); | ||
258 | + | ||
259 | + if(response.data) { | ||
260 | + imgArr.push(response.data); | ||
261 | + rendBoList(imgArr); | ||
262 | + } | ||
263 | + | ||
264 | + } | ||
265 | + else { | ||
266 | + common.util.__tip(response.message, 'warning'); | ||
267 | + } | ||
268 | + } | ||
269 | + }); | ||
270 | +} | ||
271 | + | ||
272 | +//删除单张图片 | ||
273 | +$(document).on('click', '.remove1', function () { | ||
274 | + var index = $(this).data("index"); | ||
275 | + imgArr.splice(index, 1); | ||
276 | + rendBoList(imgArr); | ||
277 | +}); |
client/js/guang/contentEdit.js
0 → 100644
client/js/guang/plusStarCategory.js
0 → 100644
1 | +/** | ||
2 | + * Created by wangqianjun on 16/3/30. | ||
3 | + */ | ||
4 | + | ||
5 | +var $ = require('jquery'); | ||
6 | +common = require('../common/common'); | ||
7 | + | ||
8 | + | ||
9 | +var ENUM = { | ||
10 | + HotEnum: { | ||
11 | + '1': '是', | ||
12 | + '0': '否', | ||
13 | + }, | ||
14 | + | ||
15 | + StatusEnum: { | ||
16 | + 1:'可用', | ||
17 | + 2:'不可用', | ||
18 | + }, | ||
19 | + | ||
20 | + GenderEnum: { | ||
21 | + 1:'男', | ||
22 | + 2:'女', | ||
23 | + 3:'通用', | ||
24 | + }, | ||
25 | + | ||
26 | +} | ||
27 | + | ||
28 | +//下拉框 | ||
29 | +new common.dropDown({ | ||
30 | + el: "#g-brandId", | ||
31 | + ajax: 'brand', | ||
32 | + params : { | ||
33 | + status: 1 | ||
34 | + } | ||
35 | +}); | ||
36 | + | ||
37 | +var g = new common.grid({ | ||
38 | + el: '#basicTable', | ||
39 | + size: 10, | ||
40 | + parms: function () { | ||
41 | + | ||
42 | + return { | ||
43 | + brandType: common.util.__input('g-brandType'), | ||
44 | + status: common.util.__input('g-status'), | ||
45 | + brandId: common.util.__input('g-brandId'), | ||
46 | + gender: common.util.__input('g-gender'), | ||
47 | + }; | ||
48 | + }, | ||
49 | + columns: [ | ||
50 | + { | ||
51 | + display: 'ID', | ||
52 | + name: "id" | ||
53 | + }, { | ||
54 | + display: '品牌名称', | ||
55 | + name: "brandName" | ||
56 | + }, { | ||
57 | + display: '品牌ID', | ||
58 | + name: "brandId" | ||
59 | + }, { | ||
60 | + display: '频道名称', | ||
61 | + name: "categoryName" | ||
62 | + }, { | ||
63 | + display: '性别', | ||
64 | + render: function (item) { | ||
65 | + return "<p>" + ENUM.GenderEnum[item.gender] + "</p>"; | ||
66 | + } | ||
67 | + }, { | ||
68 | + display: '是否可用', | ||
69 | + render: function (item) { | ||
70 | + return "<p>" + ENUM.StatusEnum[item.status] + "</p>"; | ||
71 | + } | ||
72 | + }, | ||
73 | + { | ||
74 | + display: '更新时间', | ||
75 | + render: function (item) { | ||
76 | + var t = new Date(item.updateTime * 1000); | ||
77 | + var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | ||
78 | + return "<p>" + formatted + "</p>"; | ||
79 | + } | ||
80 | + }, | ||
81 | + | ||
82 | + { | ||
83 | + display: '操作', | ||
84 | + //} | ||
85 | + name: "status", | ||
86 | + render: function (items) { | ||
87 | + var HtmArr = []; | ||
88 | + | ||
89 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-copy">复制链接</a>'); | ||
90 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">查看/编辑</a>'); | ||
91 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>'); | ||
92 | + | ||
93 | + return HtmArr.join(''); | ||
94 | + } | ||
95 | + }] | ||
96 | +}); | ||
97 | +g.init('/guang/plustar/getList'); | ||
98 | + | ||
99 | +//==================== 按钮点击事件 =====================// | ||
100 | + | ||
101 | +$("#filter-btn").click(function() { | ||
102 | + g.reload(1); | ||
103 | +}); | ||
104 | + | ||
105 | +//添加 | ||
106 | +$(document).on('click', '#add-btn', function() { | ||
107 | + plusStarOP("新增", '/guang/plustar/addPlustar', {}); | ||
108 | + | ||
109 | +}); | ||
110 | + | ||
111 | +//编辑 | ||
112 | +$(document).on('click', '.info-modify', function() { | ||
113 | + var item = g.rows[$(this).data("index")]; | ||
114 | + plusStarOP("编辑", '/guang/plustar/updatePlustar', item); | ||
115 | +}); | ||
116 | + | ||
117 | +//删除 | ||
118 | +$(document).on('click', '.info-del', function() { | ||
119 | + var item = g.rows[$(this).data("index")]; | ||
120 | + | ||
121 | + common.dialog.confirm("温馨提示","确定要删除该品牌?" , function() { | ||
122 | + common.util.__ajax({ | ||
123 | + url: '/guang/plustar/delPlustar', | ||
124 | + data: { | ||
125 | + id: item.id, | ||
126 | + } | ||
127 | + }, function(res) { | ||
128 | + if (res.code == 200) { | ||
129 | + g.reload(); | ||
130 | + } | ||
131 | + }); | ||
132 | + }); | ||
133 | +}); | ||
134 | + | ||
135 | + | ||
136 | +function plusStarOP(prefix, url, item) { | ||
137 | + | ||
138 | + var a =new common.edit(".confirm"); | ||
139 | + | ||
140 | + common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () { | ||
141 | + | ||
142 | + // | ||
143 | + return a.submit(url,function(option){ | ||
144 | + option.success=function(res){ | ||
145 | + res=res.data; | ||
146 | + if(res.code=="200"){ | ||
147 | + a.$tip("提交成功", function() { | ||
148 | + g.reload(); | ||
149 | + }, 'growl-success'); | ||
150 | + }else{ | ||
151 | + a.$tip(res.message); | ||
152 | + } | ||
153 | + return false; | ||
154 | + }, | ||
155 | + option.error=function(res){ | ||
156 | + a.$tip(res.message); | ||
157 | + } | ||
158 | + }); | ||
159 | + | ||
160 | + }); | ||
161 | + | ||
162 | + a.init(); | ||
163 | + | ||
164 | + | ||
165 | + new common.dropDown({ | ||
166 | + el: "#brandType", | ||
167 | + ajax: 'guangPlusSatrChannel', | ||
168 | + params : { | ||
169 | + status: 1 | ||
170 | + } | ||
171 | + | ||
172 | + }); | ||
173 | + | ||
174 | + new common.dropDown({ | ||
175 | + el: "#brandId", | ||
176 | + ajax: 'brand', | ||
177 | + params : { | ||
178 | + status: 1 | ||
179 | + } | ||
180 | + | ||
181 | + }); | ||
182 | + | ||
183 | + | ||
184 | + | ||
185 | +} |
client/js/guang/plusStarManager.js
0 → 100644
1 | +/** | ||
2 | + * Created by wangqianjun on 16/3/30. | ||
3 | + */ | ||
4 | + | ||
5 | +var $ = require('jquery'); | ||
6 | +common = require('../common/common'); | ||
7 | + | ||
8 | +var imgArr = []; | ||
9 | + | ||
10 | +var ENUM = { | ||
11 | + HotEnum: { | ||
12 | + '1': '是', | ||
13 | + '0': '否', | ||
14 | + }, | ||
15 | + | ||
16 | + StatusEnum: { | ||
17 | + 1:'可用', | ||
18 | + 2:'不可用', | ||
19 | + }, | ||
20 | + | ||
21 | + GenderEnum: { | ||
22 | + 1:'男', | ||
23 | + 2:'女', | ||
24 | + 3:'通用', | ||
25 | + }, | ||
26 | + | ||
27 | +} | ||
28 | + | ||
29 | +//下拉框 | ||
30 | +new common.dropDown({ | ||
31 | + el: "#g-status" | ||
32 | +}); | ||
33 | + | ||
34 | +new common.dropDown({ | ||
35 | + el: "#g-gender" | ||
36 | +}); | ||
37 | + | ||
38 | + | ||
39 | +new common.dropDown({ | ||
40 | + el: "#g-brandType", | ||
41 | + ajax: 'guangPlusSatrChannel', | ||
42 | + params : { | ||
43 | + status: 1 | ||
44 | + } | ||
45 | + | ||
46 | +}); | ||
47 | + | ||
48 | +new common.dropDown({ | ||
49 | + el: "#g-brandId", | ||
50 | + ajax: 'brand', | ||
51 | + params : { | ||
52 | + status: 1 | ||
53 | + } | ||
54 | + | ||
55 | +}); | ||
56 | + | ||
57 | +var g = new common.grid({ | ||
58 | + el: '#basicTable', | ||
59 | + size: 10, | ||
60 | + parms: function () { | ||
61 | + | ||
62 | + return { | ||
63 | + brandType: common.util.__input('g-brandType'), | ||
64 | + status: common.util.__input('g-status'), | ||
65 | + brandId: common.util.__input('g-brandId'), | ||
66 | + gender: common.util.__input('g-gender'), | ||
67 | + }; | ||
68 | + }, | ||
69 | + columns: [ | ||
70 | + { | ||
71 | + display: 'ID', | ||
72 | + name: "id" | ||
73 | + }, | ||
74 | + | ||
75 | + { | ||
76 | + display: '品牌ID', | ||
77 | + name: "brandId" | ||
78 | + }, { | ||
79 | + display: '品牌名称', | ||
80 | + name: "brandName" | ||
81 | + },{ | ||
82 | + display: '频道名称', | ||
83 | + name: "categoryName" | ||
84 | + }, { | ||
85 | + display: '性别', | ||
86 | + render: function (item) { | ||
87 | + return "<p>" + ENUM.GenderEnum[item.gender] + "</p>"; | ||
88 | + } | ||
89 | + }, { | ||
90 | + display: '是否可用', | ||
91 | + render: function (item) { | ||
92 | + return "<p>" + ENUM.StatusEnum[item.status] + "</p>"; | ||
93 | + } | ||
94 | + }, | ||
95 | + { | ||
96 | + display: '更新时间', | ||
97 | + render: function (item) { | ||
98 | + var t = new Date(item.updateTime * 1000); | ||
99 | + var formatted = common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss"); | ||
100 | + return "<p>" + formatted + "</p>"; | ||
101 | + } | ||
102 | + }, | ||
103 | + | ||
104 | + { | ||
105 | + display: '操作', | ||
106 | + //} | ||
107 | + name: "status", | ||
108 | + render: function (items) { | ||
109 | + var HtmArr = []; | ||
110 | + | ||
111 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-copy">复制链接</a>'); | ||
112 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-primary btn-xs info-modify">查看/编辑</a>'); | ||
113 | + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-danger btn-xs info-del">删除</a>'); | ||
114 | + | ||
115 | + return HtmArr.join(''); | ||
116 | + } | ||
117 | + }] | ||
118 | +}); | ||
119 | +g.init('/guang/plustar/getList'); | ||
120 | + | ||
121 | +//==================== 按钮点击事件 =====================// | ||
122 | + | ||
123 | +$("#filter-btn").click(function() { | ||
124 | + g.reload(1); | ||
125 | +}); | ||
126 | + | ||
127 | +//添加 | ||
128 | +$(document).on('click', '#add-btn', function() { | ||
129 | + plusStarOP("新增", '/guang/plustar/addPlustar', {}); | ||
130 | + | ||
131 | +}); | ||
132 | + | ||
133 | +//编辑 | ||
134 | +$(document).on('click', '.info-modify', function() { | ||
135 | + var item = g.rows[$(this).data("index")]; | ||
136 | + common.util.__ajax( | ||
137 | + { | ||
138 | + url: '/guang/plustar/getDetail', | ||
139 | + data: { | ||
140 | + id: item.id, | ||
141 | + } | ||
142 | + }, function(res) { | ||
143 | + | ||
144 | + //var item = res.data; | ||
145 | + plusStarOP("编辑", '/guang/plustar/updatePlustar', res.data); | ||
146 | + }); | ||
147 | + | ||
148 | +}); | ||
149 | + | ||
150 | +//删除 | ||
151 | +$(document).on('click', '.info-del', function() { | ||
152 | + var item = g.rows[$(this).data("index")]; | ||
153 | + | ||
154 | + common.dialog.confirm("温馨提示","确定要删除该品牌?" , function() { | ||
155 | + common.util.__ajax({ | ||
156 | + url: '/guang/plustar/delPlustar', | ||
157 | + data: { | ||
158 | + id: item.id, | ||
159 | + } | ||
160 | + }, function(res) { | ||
161 | + if (res.code == 200) { | ||
162 | + g.reload(); | ||
163 | + } | ||
164 | + }); | ||
165 | + }); | ||
166 | +}); | ||
167 | + | ||
168 | + | ||
169 | +function plusStarOP(prefix, url, item) { | ||
170 | + | ||
171 | + if(prefix == "编辑") { | ||
172 | + imgArr = item.bannerImg||[]; | ||
173 | + } else { | ||
174 | + imgArr = []; | ||
175 | + } | ||
176 | + | ||
177 | + var a =new common.edit("#templete-top", { | ||
178 | + "bucket" : "plustar" | ||
179 | + }); | ||
180 | + | ||
181 | + common.dialog.confirm(prefix+'品牌', common.util.__template2($("#template").html(), item), function () { | ||
182 | + | ||
183 | + // | ||
184 | + return a.submit(url,function(option){ | ||
185 | + | ||
186 | + if(imgArr.length) { | ||
187 | + option.data.bannerImg = imgArr.toString(); | ||
188 | + } | ||
189 | + imgArr = []; | ||
190 | + | ||
191 | + option.success=function(res){ | ||
192 | + res=res.data; | ||
193 | + if(res.code=="200"){ | ||
194 | + a.$tip("提交成功", function() { | ||
195 | + g.reload(); | ||
196 | + }, 'growl-success'); | ||
197 | + }else{ | ||
198 | + a.$tip(res.message); | ||
199 | + } | ||
200 | + return false; | ||
201 | + }, | ||
202 | + option.error=function(res){ | ||
203 | + a.$tip(res.message); | ||
204 | + } | ||
205 | + }); | ||
206 | + | ||
207 | + }); | ||
208 | + | ||
209 | + a.init(); | ||
210 | + | ||
211 | + uploadImage(); | ||
212 | + rendBoList(imgArr); | ||
213 | + | ||
214 | + | ||
215 | + new common.dropDown({ | ||
216 | + el: "#brandType", | ||
217 | + ajax: 'guangPlusSatrChannel', | ||
218 | + params : { | ||
219 | + status: 1 | ||
220 | + } | ||
221 | + | ||
222 | + }); | ||
223 | + | ||
224 | + new common.dropDown({ | ||
225 | + el: "#brandId", | ||
226 | + ajax: 'brand', | ||
227 | + params : { | ||
228 | + status: 1 | ||
229 | + } | ||
230 | + | ||
231 | + }); | ||
232 | + | ||
233 | +} | ||
234 | + | ||
235 | +// 图片上传 | ||
236 | +function uploadImage() { | ||
237 | + common.edit.ajaxfileupload(".picfile", { | ||
238 | + params: { | ||
239 | + __type: "upload", | ||
240 | + bucket: "plustar" | ||
241 | + }, | ||
242 | + valid_extensions: ['png', 'jpg', 'jpeg'], | ||
243 | + onComplete: function (response) { | ||
244 | + | ||
245 | + if (response.status && response.code == 200) { | ||
246 | + console.log("response", response); | ||
247 | + if(response.data) { | ||
248 | + imgArr.push(response.data); | ||
249 | + rendBoList(imgArr); | ||
250 | + } | ||
251 | + } | ||
252 | + else { | ||
253 | + common.util.__tip(response.message, 'warning'); | ||
254 | + } | ||
255 | + } | ||
256 | + }); | ||
257 | +} | ||
258 | + | ||
259 | +function rendBoList (pictureBoList) { | ||
260 | + $(".image-list").html(''); | ||
261 | + $("#addPic").append(common.util.__template2($("#imgeUpload").html(), | ||
262 | + { | ||
263 | + pictureBoList: pictureBoList | ||
264 | + } | ||
265 | + )); | ||
266 | +} | ||
267 | + | ||
268 | +//删除单张图片 | ||
269 | +$(document).on('click', '.remove1', function () { | ||
270 | + var index = $(this).data("index"); | ||
271 | + imgArr.splice(index, 1); | ||
272 | + rendBoList(imgArr); | ||
273 | +}); |
@@ -47,7 +47,7 @@ var g = new common.grid({ | @@ -47,7 +47,7 @@ var g = new common.grid({ | ||
47 | name: "classifyName" | 47 | name: "classifyName" |
48 | }, { | 48 | }, { |
49 | display: '所属标签数', | 49 | display: '所属标签数', |
50 | - name: "classifyName" | 50 | + name: "sortNum" |
51 | }, { | 51 | }, { |
52 | display: '状态', | 52 | display: '状态', |
53 | render: function (item) { | 53 | render: function (item) { |
@@ -5,39 +5,100 @@ | @@ -5,39 +5,100 @@ | ||
5 | 'use strict'; | 5 | 'use strict'; |
6 | 6 | ||
7 | var $ = require('jquery'); | 7 | var $ = require('jquery'); |
8 | -require('yoho.bootstrap'); | ||
9 | 8 | ||
9 | +var isMenuShow = false; | ||
10 | +var localStorage = window.localStorage; | ||
10 | 11 | ||
11 | /*左侧导航*/ | 12 | /*左侧导航*/ |
12 | $('.leftpanel .nav .parent>a').click(function() { | 13 | $('.leftpanel .nav .parent>a').click(function() { |
13 | - var coll = $(this).parents('.collapsed').length, | ||
14 | - child = $(this).parent().find('.children'); | ||
15 | - | ||
16 | - if (!coll) { | ||
17 | - $('.leftpanel .nav .parent-focus').each(function() { | ||
18 | - $(this).find('.children').slideUp('fast'); | ||
19 | - $(this).removeClass('parent-focus'); | ||
20 | - }); | ||
21 | - | ||
22 | - if (!child.is(':visible')) { | ||
23 | - child.slideDown('fast'); | ||
24 | - if (!child.parent().hasClass('active')) | ||
25 | - child.parent().addClass('parent-focus'); | ||
26 | - } else { | ||
27 | - child.slideUp('fast'); | ||
28 | - child.parent().removeClass('parent-focus'); | ||
29 | - } | 14 | + var coll = $(this).parents('.collapsed').length, |
15 | + child = $(this).parent().find('.children'); | ||
16 | + | ||
17 | + $(".parent ").removeClass("active"); | ||
18 | + $('.children').removeClass("active").slideUp('fast'); | ||
19 | + | ||
20 | + | ||
21 | + $(this).parent(".parent ").addClass("active"); | ||
22 | + child.slideDown('fast').addClass("active"); | ||
23 | + isMenuShow = true; | ||
24 | + return false; | ||
25 | +}); | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | +$(".leftpanel .nav .children a").each(function() { | ||
30 | + var attr = $(this).attr('href'); | ||
31 | + | ||
32 | + if (!isMenuShow && attr == window.location.pathname + window.location.search) { | ||
33 | + $(this).parents(".children").show(); | ||
34 | + $(this).parent("li").addClass("active"); | ||
35 | + $(this).parents(".parent").addClass("active"); | ||
36 | + localStorage.setItem("router", attr); | ||
37 | + localStorage.getItem("router"); | ||
38 | + isMenuShow = true; | ||
39 | + } | ||
40 | +}); | ||
41 | + | ||
42 | +if (!isMenuShow && localStorage.getItem("router")) { | ||
43 | + $(".leftpanel .nav .children a").each(function() { | ||
44 | + var attr = $(this).attr('href'); | ||
45 | + | ||
46 | + if (localStorage.getItem("router") == attr) { | ||
47 | + $(this).parents(".children").show(); | ||
48 | + $(this).parent("li").addClass("active"); | ||
49 | + $(this).parents(".parent").addClass("active"); | ||
50 | + isMenuShow = true; | ||
30 | } | 51 | } |
31 | - return false; | 52 | + |
53 | + }); | ||
54 | +} | ||
55 | + | ||
56 | + | ||
57 | +// LocalStorage.setItem("router",); | ||
58 | + | ||
59 | +$('.panel-heading').hover(function() { | ||
60 | + $(this).find('.panel-btns').fadeIn('fast'); | ||
61 | +}, function() { | ||
62 | + $(this).find('.panel-btns').fadeOut('fast'); | ||
32 | }); | 63 | }); |
33 | 64 | ||
65 | +$('.panel .panel-close').click(function() { | ||
66 | + $(this).closest('.panel').fadeOut(200); | ||
67 | + return false; | ||
68 | +}); | ||
69 | + | ||
70 | +// Minimize Panel | ||
71 | +$('.panel .panel-minimize').click(function() { | ||
72 | + var t = $(this); | ||
73 | + var p = t.closest('.panel'); | ||
74 | + if (!$(this).hasClass('maximize')) { | ||
75 | + p.find('.panel-body, .panel-footer').slideUp(200); | ||
76 | + t.addClass('maximize'); | ||
77 | + t.find('i').removeClass('fa-minus').addClass('fa-plus'); | ||
78 | + } else { | ||
79 | + p.find('.panel-body, .panel-footer').slideDown(200); | ||
80 | + t.removeClass('maximize'); | ||
81 | + t.find('i').removeClass('fa-plus').addClass('fa-minus'); | ||
82 | + } | ||
83 | + return false; | ||
84 | +}); | ||
34 | 85 | ||
35 | -// $(".leftpanel .nav .children a").each(function() { | ||
36 | -// var attr = $(this).attr('href'); | 86 | +var timer = null; |
87 | +$('.dropdown-toggle').on('mouseenter', function() { | ||
88 | + $('.dropdown-menu').hide(); | ||
89 | + $(this).siblings('.dropdown-menu').show(); | ||
90 | +}).on('mouseleave', function() { | ||
91 | + var that = this; | ||
92 | + clearTimeout(timer); | ||
93 | + timer = setTimeout(function() { | ||
94 | + $(that).siblings('.dropdown-menu').hide(); | ||
95 | + }, 1000); | ||
96 | + | ||
97 | +}); | ||
37 | 98 | ||
38 | -// if (attr == window.location.pathname + window.location.search) { | ||
39 | -// $(this).parents(".children").show(); | ||
40 | -// $(this).parent("li").addClass("active"); | ||
41 | -// $(this).parents(".parent").addClass("parent-focus"); | ||
42 | -// } | ||
43 | -// }); | ||
99 | +$('.dropdown-menu').on('mouseenter', function() { | ||
100 | + clearTimeout(timer); | ||
101 | + $(this).show(); | ||
102 | +}).on('mouseleave', function() { | ||
103 | + $(this).hide(); | ||
104 | +}) |
@@ -34,7 +34,7 @@ var tableGird = new common.grid({ | @@ -34,7 +34,7 @@ var tableGird = new common.grid({ | ||
34 | var propsStr=""; | 34 | var propsStr=""; |
35 | if (common.util.__isJsonString(propType)) { | 35 | if (common.util.__isJsonString(propType)) { |
36 | var props = JSON.parse(propType); | 36 | var props = JSON.parse(propType); |
37 | - props.forEach(function(prop){ | 37 | + [].slice.call(props,0).forEach(function(prop){ |
38 | propsStr += prop.name + ","; | 38 | propsStr += prop.name + ","; |
39 | }); | 39 | }); |
40 | } else { | 40 | } else { |
@@ -144,9 +144,12 @@ $(document).on('click', '.prop-del-btn', function () { | @@ -144,9 +144,12 @@ $(document).on('click', '.prop-del-btn', function () { | ||
144 | propValueGrid.__rows.splice($(this).data('index'),1); | 144 | propValueGrid.__rows.splice($(this).data('index'),1); |
145 | propValueGrid.reload(); | 145 | propValueGrid.reload(); |
146 | }); | 146 | }); |
147 | - | 147 | +var timeid; |
148 | sortmenu.init(function () { | 148 | sortmenu.init(function () { |
149 | - tableGird.init('/product/attr/queryProductAttributeList'); | 149 | + clearTimeout(timeid); |
150 | + timeid=setTimeout(function(){ | ||
151 | + tableGird.init('/product/attr/queryProductAttributeList'); | ||
152 | + },600); | ||
150 | }); | 153 | }); |
151 | 154 | ||
152 | $('#add-attri').click(function () { | 155 | $('#add-attri').click(function () { |
@@ -11,6 +11,7 @@ var shopType = 1; //店铺类型 1:单品牌,2:多品牌 | @@ -11,6 +11,7 @@ var shopType = 1; //店铺类型 1:单品牌,2:多品牌 | ||
11 | var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑 | 11 | var shopOperate = 'view'; //操作 editor:可编辑, view:查看不可编辑 |
12 | var ENUM = { | 12 | var ENUM = { |
13 | "editor-largePic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}, | 13 | "editor-largePic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}, |
14 | + "editor-largePic2":{"position":"", "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}, | ||
14 | "editor-smallPic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}, | 15 | "editor-smallPic":{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}, |
15 | "editor-brand":{"position":"", "name":"", "url":""}, | 16 | "editor-brand":{"position":"", "name":"", "url":""}, |
16 | "editor-recommend": {"position":"", "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"}, | 17 | "editor-recommend": {"position":"", "name":"", "enName":"", "src":"", "url":"","isShowInApp":"Y"}, |
@@ -24,7 +25,7 @@ var ENUM = { | @@ -24,7 +25,7 @@ var ENUM = { | ||
24 | var resourcesNew = { | 25 | var resourcesNew = { |
25 | "shopTopBanner":{ | 26 | "shopTopBanner":{ |
26 | "id":"", | 27 | "id":"", |
27 | - "data": [{"shopSrc": "","shopSrc0":"", "detailSrc": "", "isShowShopName": "Y"}] | 28 | + "data": [{"shopSrc0":"","detailSrc0": "", "isShowShopName0": "Y", "shopSrc": "", "detailSrc": "", "isShowShopName": "Y"}] |
28 | }, | 29 | }, |
29 | "navigationBar":{ | 30 | "navigationBar":{ |
30 | "id":"", | 31 | "id":"", |
@@ -33,10 +34,6 @@ var resourcesNew = { | @@ -33,10 +34,6 @@ var resourcesNew = { | ||
33 | "largeSlideImg":{ | 34 | "largeSlideImg":{ |
34 | "id":"", | 35 | "id":"", |
35 | "data": [ | 36 | "data": [ |
36 | - {"position": 5, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}, | ||
37 | - {"position": 4, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}, | ||
38 | - {"position": 3, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}, | ||
39 | - {"position": 2, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]}, | ||
40 | {"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]} | 37 | {"position": 1, "data":[{"src": "", "url": "", "startTime": "", "endTime": "", "publishStatus": 0}]} |
41 | ] | 38 | ] |
42 | }, | 39 | }, |
@@ -127,6 +124,12 @@ function showMain(){ | @@ -127,6 +124,12 @@ function showMain(){ | ||
127 | }else if(shopType == 1){ | 124 | }else if(shopType == 1){ |
128 | $(".model-brand").hide(); | 125 | $(".model-brand").hide(); |
129 | } | 126 | } |
127 | + //标签长度样式自适应 | ||
128 | + $.each($(".contentpanel-pc .model-showTitle .showTab"),function(){ | ||
129 | + if($(this).width() > 280){ | ||
130 | + $(this).css("right",(280-($(this).width()))+"px"); | ||
131 | + } | ||
132 | + }) | ||
130 | showEditorIconEvent(); | 133 | showEditorIconEvent(); |
131 | } | 134 | } |
132 | //弹窗编辑主流程 | 135 | //弹窗编辑主流程 |
@@ -141,6 +144,7 @@ function editorIconEvent(title,id){ | @@ -141,6 +144,7 @@ function editorIconEvent(title,id){ | ||
141 | if(!(curDialogId == "editor-largePic-app" || curDialogId == "editor-recommend-app" || curDialogId == "editor-brand-app")){ | 144 | if(!(curDialogId == "editor-largePic-app" || curDialogId == "editor-recommend-app" || curDialogId == "editor-brand-app")){ |
142 | freshJson(id, g.__rows, 1); | 145 | freshJson(id, g.__rows, 1); |
143 | } | 146 | } |
147 | + console.log(g.__rows); | ||
144 | showMain(); | 148 | showMain(); |
145 | }else{ | 149 | }else{ |
146 | return false; | 150 | return false; |
@@ -170,20 +174,25 @@ function findDecoration(){ | @@ -170,20 +174,25 @@ function findDecoration(){ | ||
170 | } | 174 | } |
171 | }, | 175 | }, |
172 | function(rs) { | 176 | function(rs) { |
173 | - console.log(rs.data); | 177 | + console.log(rs); |
174 | if(rs.data){ | 178 | if(rs.data){ |
175 | jsonMain = rs.data; | 179 | jsonMain = rs.data; |
176 | } | 180 | } |
177 | - if(jsonMain.templateName){ | ||
178 | - curTemplateType = jsonMain.templateName; | ||
179 | - } | ||
180 | //没有装修信息,初始化装修信息 | 181 | //没有装修信息,初始化装修信息 |
181 | if($.isEmptyObject(jsonMain.resources)){ | 182 | if($.isEmptyObject(jsonMain.resources)){ |
182 | jsonMain.resources = $.extend(true,{},resourcesNew); | 183 | jsonMain.resources = $.extend(true,{},resourcesNew); |
183 | } | 184 | } |
184 | //装修信息中品牌内容为空,初始化品牌 | 185 | //装修信息中品牌内容为空,初始化品牌 |
185 | - if(jsonMain.resources.brandBrowse.data.length < 1 && jsonMain.brandList){ | ||
186 | - cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data); | 186 | + if(jsonMain.brandList){ |
187 | + if(jsonMain.resources.brandBrowse.data.length < 1){ | ||
188 | + cloneArr(jsonMain.brandList,jsonMain.resources.brandBrowse.data); | ||
189 | + } | ||
190 | + }else{ | ||
191 | + common.util.__tip("店铺没有品牌,无法装修,请返回添加品牌!"); | ||
192 | + return; | ||
193 | + } | ||
194 | + if(jsonMain.templateName){ | ||
195 | + curTemplateType = jsonMain.templateName; | ||
187 | } | 196 | } |
188 | //装修json克隆 | 197 | //装修json克隆 |
189 | jsonClone = $.extend(true,{},jsonMain); | 198 | jsonClone = $.extend(true,{},jsonMain); |
@@ -247,7 +256,7 @@ function saveDecoration(submitStatus){ | @@ -247,7 +256,7 @@ function saveDecoration(submitStatus){ | ||
247 | } | 256 | } |
248 | //Ajax审核,审核通过:300,驳回:900 | 257 | //Ajax审核,审核通过:300,驳回:900 |
249 | function checkDecoration(checkStatus,comment){ | 258 | function checkDecoration(checkStatus,comment){ |
250 | - if(comment){ | 259 | + if(comment){ //驳回 |
251 | common.util.__ajax({ | 260 | common.util.__ajax({ |
252 | url:'/store/shop-decoration-check', | 261 | url:'/store/shop-decoration-check', |
253 | data: { | 262 | data: { |
@@ -256,12 +265,12 @@ function checkDecoration(checkStatus,comment){ | @@ -256,12 +265,12 @@ function checkDecoration(checkStatus,comment){ | ||
256 | "comment": comment | 265 | "comment": comment |
257 | } | 266 | } |
258 | },function(rs){ | 267 | },function(rs){ |
259 | - common.util.__tip("审核通过成功!","success"); | 268 | + common.util.__tip("审核驳回成功!","success"); |
260 | setTimeout(function() { | 269 | setTimeout(function() { |
261 | location.href="/supplier/check/index"; | 270 | location.href="/supplier/check/index"; |
262 | }, 1000); | 271 | }, 1000); |
263 | },true); | 272 | },true); |
264 | - }else{ | 273 | + }else{ //通过 |
265 | common.util.__ajax({ | 274 | common.util.__ajax({ |
266 | url:'/store/shop-decoration-check', | 275 | url:'/store/shop-decoration-check', |
267 | data: { | 276 | data: { |
@@ -269,7 +278,7 @@ function checkDecoration(checkStatus,comment){ | @@ -269,7 +278,7 @@ function checkDecoration(checkStatus,comment){ | ||
269 | "checkStatus": checkStatus | 278 | "checkStatus": checkStatus |
270 | } | 279 | } |
271 | },function(rs){ | 280 | },function(rs){ |
272 | - common.util.__tip("审核驳回成功!","success"); | 281 | + common.util.__tip("审核通过成功!","success"); |
273 | setTimeout(function() { | 282 | setTimeout(function() { |
274 | location.href="/supplier/check/index"; | 283 | location.href="/supplier/check/index"; |
275 | }, 1000); | 284 | }, 1000); |
@@ -289,11 +298,7 @@ function gridInit(id){ | @@ -289,11 +298,7 @@ function gridInit(id){ | ||
289 | el:"#"+id, | 298 | el:"#"+id, |
290 | columns:[ | 299 | columns:[ |
291 | {display:"店铺banner图片", render:function(item){ | 300 | {display:"店铺banner图片", render:function(item){ |
292 | - if(curTemplateType == "2"){ | ||
293 | - return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />"; | ||
294 | - }else{ | ||
295 | - return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc0+"' />"; | ||
296 | - } | 301 | + return "<input type=file name='shopBannerImage' id='shopBannerImage_"+item.__index+"' value='"+item.shopSrc+"' />"; |
297 | }}, | 302 | }}, |
298 | {display:"是否显示店铺名称", render:function(item){ | 303 | {display:"是否显示店铺名称", render:function(item){ |
299 | if(item.isShowShopName == "Y"){ | 304 | if(item.isShowShopName == "Y"){ |
@@ -336,20 +341,26 @@ function gridInit(id){ | @@ -336,20 +341,26 @@ function gridInit(id){ | ||
336 | 341 | ||
337 | //店铺大图资源位 | 342 | //店铺大图资源位 |
338 | case "editor-largePic": | 343 | case "editor-largePic": |
344 | + $('.editorTitle').html("<a href='javascript:' class='btn btn-success addBtn2' style='margin-right: 20px'><i class='fa fa-plus'></i> 添加资源大图</a><span class='largePicAddTip'></span>").css("margin-bottom","10px"); | ||
339 | g = new common.grid({ | 345 | g = new common.grid({ |
340 | hash: false, | 346 | hash: false, |
341 | el:"#"+id, | 347 | el:"#"+id, |
342 | columns:[ | 348 | columns:[ |
343 | {display:"排序", render:function(item){ | 349 | {display:"排序", render:function(item){ |
350 | + item.position=item.position || (item.__index+1); | ||
344 | return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />"; | 351 | return "<input class='form-control numInput inputChange' type=text name='position' value='"+item.position+"' data-index='"+item.__index+"' />"; |
345 | }}, | 352 | }}, |
346 | - { | ||
347 | - display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " + | 353 | + {display:"<div class='row'><div class='col-sm-2'>图片</div><div class='col-sm-3'>链接</div><div class='col-sm-2'>开始时间</div><div class='col-sm-2'>结束时间</div> " + |
348 | "<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>", | 354 | "<div class='col-sm-1'>状态</div><div class='col-sm-2'>操作</div></div>", |
349 | render: function (item) { | 355 | render: function (item) { |
350 | return resourcesHtmlInit(item,"largePic"); | 356 | return resourcesHtmlInit(item,"largePic"); |
351 | } | 357 | } |
352 | - } | 358 | + }, |
359 | + {display:"操作", render:function(item){ | ||
360 | + if(g.__rows.length > 1){ | ||
361 | + return "<input type=button class='btn btn-warning btn-xs deleteBtn' value='删除' data-index='"+item.__index+"' />"; | ||
362 | + } | ||
363 | + }} | ||
353 | ] | 364 | ] |
354 | }); | 365 | }); |
355 | g.__rows=""||jsonClone.resources.largeSlideImg.data; | 366 | g.__rows=""||jsonClone.resources.largeSlideImg.data; |
@@ -511,10 +522,10 @@ function gridInit(id){ | @@ -511,10 +522,10 @@ function gridInit(id){ | ||
511 | return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />"; | 522 | return "<input class='form-control inputChange' type=text name='url' value='"+item.url+"' data-index='"+item.__index+"' />"; |
512 | }}, | 523 | }}, |
513 | {display:"开始时间", render:function(item){ | 524 | {display:"开始时间", render:function(item){ |
514 | - return "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:end:endTime_"+item.__index+"' id='startTime_"+item.__index+"' name='startTime' value='"+item.startTime+"' data-index='"+item.__index+"' />"; | 525 | + return "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"' id='startTime_"+item.__index+"' name='startTime' value='"+item.startTime+"' data-index='"+item.__index+"' />"; |
515 | }}, | 526 | }}, |
516 | {display:"结束时间", render:function(item){ | 527 | {display:"结束时间", render:function(item){ |
517 | - return "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:start:startTime_"+item.__index+"' id='endTime_"+item.__index+"' name='endTime' value='"+item.endTime+"' data-index='"+item.__index+"' />"; | 528 | + return "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"' id='endTime_"+item.__index+"' name='endTime' value='"+item.endTime+"' data-index='"+item.__index+"' />"; |
518 | }}, | 529 | }}, |
519 | {display:"状态", render:function(item){ | 530 | {display:"状态", render:function(item){ |
520 | return "<span style='white-space: nowrap'>" + (item.publishStatus==0?"未发布":"已发布") + "</span>"; | 531 | return "<span style='white-space: nowrap'>" + (item.publishStatus==0?"未发布":"已发布") + "</span>"; |
@@ -990,11 +1001,7 @@ function untilEditorEvent(id){ | @@ -990,11 +1001,7 @@ function untilEditorEvent(id){ | ||
990 | e.on("callback",function(obj){ | 1001 | e.on("callback",function(obj){ |
991 | if(/^file_onComplete_shopBannerImage_/.test(obj.key)){ | 1002 | if(/^file_onComplete_shopBannerImage_/.test(obj.key)){ |
992 | var _index = obj.key.replace(/^file_onComplete_shopBannerImage_/,''); | 1003 | var _index = obj.key.replace(/^file_onComplete_shopBannerImage_/,''); |
993 | - if(curTemplateType == "2"){ | ||
994 | - g.__rows[_index].shopSrc = obj.data; | ||
995 | - }else{ | ||
996 | - g.__rows[_index].shopSrc0 = obj.data; | ||
997 | - } | 1004 | + g.__rows[_index].shopSrc = obj.data; |
998 | } | 1005 | } |
999 | if(/^file_onComplete_DetailbannerImage_/.test(obj.key)){ | 1006 | if(/^file_onComplete_DetailbannerImage_/.test(obj.key)){ |
1000 | var _index = obj.key.replace(/^file_onComplete_DetailbannerImage_/,''); | 1007 | var _index = obj.key.replace(/^file_onComplete_DetailbannerImage_/,''); |
@@ -1020,8 +1027,7 @@ function untilEditorEvent(id){ | @@ -1020,8 +1027,7 @@ function untilEditorEvent(id){ | ||
1020 | } | 1027 | } |
1021 | }); | 1028 | }); |
1022 | $("#"+id+" nav").hide(); | 1029 | $("#"+id+" nav").hide(); |
1023 | - $(".modal-dialog").css("width","900px"); | ||
1024 | - $(".modal-dialog .modal-body .editor-dialog").css("max-height",($(window).height()-300) + "px"); | 1030 | + $(".modal-dialog").css("width","960px"); |
1025 | $(".modal-dialog .modal-body .editor-dialog").css("overflow-y","auto"); | 1031 | $(".modal-dialog .modal-body .editor-dialog").css("overflow-y","auto"); |
1026 | $(".modal-dialog .modal-body .editor-dialog").css("overflow-x","hidden"); | 1032 | $(".modal-dialog .modal-body .editor-dialog").css("overflow-x","hidden"); |
1027 | } | 1033 | } |
@@ -1033,10 +1039,15 @@ function resourcesHtmlInit(item,resName){ | @@ -1033,10 +1039,15 @@ function resourcesHtmlInit(item,resName){ | ||
1033 | htmlPic += "<div class='row'>" + | 1039 | htmlPic += "<div class='row'>" + |
1034 | "<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" + | 1040 | "<div class='col-sm-2'><input type=file name='"+ resName +"Image' id='"+ resName +"Image_"+item.__index+"_"+i+"' value='"+picList[i].src+"' /></div>" + |
1035 | "<div class='col-sm-3'><input type=text class='form-control inputChange' name='url' value='"+ picList[i].url +"' data-index='"+ item.__index +"_"+ i +"' /></div>" + | 1041 | "<div class='col-sm-3'><input type=text class='form-control inputChange' name='url' value='"+ picList[i].url +"' data-index='"+ item.__index +"_"+ i +"' /></div>" + |
1036 | - "<div class='col-sm-2'>" + | ||
1037 | - "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" + | ||
1038 | - "<div class='col-sm-2'>" + | ||
1039 | - "<input type=text class='form-control inputChange' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" + | 1042 | + "<div class='col-sm-2'>"; |
1043 | + if(i>0){ | ||
1044 | + htmlPic += "<input type=text class='form-control' disabled jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' />" + | ||
1045 | + "<span style='color: #999; font-size: 12px'>*上一条结束时间</span>"; | ||
1046 | + }else{ | ||
1047 | + htmlPic += "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:end:endTime_"+item.__index+"_"+ i +"' id='startTime_"+item.__index+"_"+ i +"' name='startTime' value='"+ picList[i].startTime +"' data-index='"+ item.__index +"_"+ i +"' />"; | ||
1048 | + } | ||
1049 | + htmlPic += "</div><div class='col-sm-2'>" + | ||
1050 | + "<input type=text class='form-control inputChange' style='background-color:#fff' readOnly='true' jsaction='time:start:startTime_"+item.__index+"_"+ i +"' id='endTime_"+item.__index+"_"+ i +"' name='endTime' value='"+ picList[i].endTime +"' data-index='"+ item.__index +"_"+ i +"' /></div>" + | ||
1040 | "<div class='col-sm-1'><span style='white-space: nowrap;'>"+ (picList[i].publishStatus==0?"未发布":"已发布") +"</span></div>" + | 1051 | "<div class='col-sm-1'><span style='white-space: nowrap;'>"+ (picList[i].publishStatus==0?"未发布":"已发布") +"</span></div>" + |
1041 | "<div class='col-sm-2'>"; | 1052 | "<div class='col-sm-2'>"; |
1042 | if(i == (picList.length-1) && picList.length > 1){ | 1053 | if(i == (picList.length-1) && picList.length > 1){ |
@@ -1189,12 +1200,28 @@ $(document).on("click",".addBtn",function(){ | @@ -1189,12 +1200,28 @@ $(document).on("click",".addBtn",function(){ | ||
1189 | 1200 | ||
1190 | if(indexList.length > 1){ | 1201 | if(indexList.length > 1){ |
1191 | g.__rows[indexList[0]].data.push($.extend({},ENUM[curDialogId])); | 1202 | g.__rows[indexList[0]].data.push($.extend({},ENUM[curDialogId])); |
1203 | + if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic"){ | ||
1204 | + (g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = (g.__rows[indexList[0]].data)[indexList[1]].endTime; | ||
1205 | + } | ||
1192 | }else{ | 1206 | }else{ |
1193 | g.__rows.push($.extend({},ENUM[curDialogId])); | 1207 | g.__rows.push($.extend({},ENUM[curDialogId])); |
1194 | } | 1208 | } |
1195 | g.init(g.__rows); | 1209 | g.init(g.__rows); |
1196 | untilEditorEvent(curDialogId); | 1210 | untilEditorEvent(curDialogId); |
1197 | }); | 1211 | }); |
1212 | +//资源位大图添加一条资源位 | ||
1213 | +$(document).on("click",".addBtn2",function(){ | ||
1214 | + if(g.__rows.length > 4){ | ||
1215 | + $(".largePicAddTip").text("* 最多只能添加5个资源位大图!").css("color","#ff0000"); | ||
1216 | + return; | ||
1217 | + }else{ | ||
1218 | + $(".largePicAddTip").empty(); | ||
1219 | + g.__rows.push($.extend(true,{},ENUM["editor-largePic2"])); | ||
1220 | + g.init(g.__rows); | ||
1221 | + untilEditorEvent(curDialogId); | ||
1222 | + } | ||
1223 | + | ||
1224 | +}); | ||
1198 | //input change同时更新json | 1225 | //input change同时更新json |
1199 | $(document).on("change",".inputChange",function(){ | 1226 | $(document).on("change",".inputChange",function(){ |
1200 | var _index = $(this).attr("data-index"); | 1227 | var _index = $(this).attr("data-index"); |
@@ -1206,6 +1233,14 @@ $(document).on("change",".inputChange",function(){ | @@ -1206,6 +1233,14 @@ $(document).on("change",".inputChange",function(){ | ||
1206 | }else{ | 1233 | }else{ |
1207 | g.__rows[indexList[0]][_name] = $(this).val(); | 1234 | g.__rows[indexList[0]][_name] = $(this).val(); |
1208 | } | 1235 | } |
1236 | + if(curDialogId == "editor-largePic" || curDialogId == "editor-smallPic"){ | ||
1237 | + if($(this).attr("name") == "endTime"){ | ||
1238 | + if(g.__rows[indexList[0]].data.length - 1 > indexList[1]){ | ||
1239 | + $(this).parents(".row").next().children().find("input[name='startTime']").val($(this).val()); | ||
1240 | + (g.__rows[indexList[0]].data)[(parseInt(indexList[1]) + 1)].startTime = $(this).val(); | ||
1241 | + } | ||
1242 | + } | ||
1243 | + } | ||
1209 | $(this).removeClass("error"); | 1244 | $(this).removeClass("error"); |
1210 | }); | 1245 | }); |
1211 | //checkBox change同时更新json | 1246 | //checkBox change同时更新json |
1 | -var jQuery = require('jquery'); | ||
2 | -jQuery(document).ready(function() { | ||
3 | - | ||
4 | - "use strict"; | ||
5 | - var $ = jQuery; | ||
6 | - // Tooltip | ||
7 | - jQuery('.tooltips').tooltip({ | ||
8 | - container: 'body' | ||
9 | - }); | ||
10 | - | ||
11 | - // Popover | ||
12 | - jQuery('.popovers').popover(); | ||
13 | - | ||
14 | - // Show panel buttons when hovering panel heading | ||
15 | - jQuery('.panel-heading').hover(function() { | ||
16 | - jQuery(this).find('.panel-btns').fadeIn('fast'); | ||
17 | - }, function() { | ||
18 | - jQuery(this).find('.panel-btns').fadeOut('fast'); | ||
19 | - }); | ||
20 | - | ||
21 | - // Close Panel | ||
22 | - jQuery('.panel .panel-close').click(function() { | ||
23 | - jQuery(this).closest('.panel').fadeOut(200); | ||
24 | - return false; | ||
25 | - }); | ||
26 | - | ||
27 | - // Minimize Panel | ||
28 | - jQuery('.panel .panel-minimize').click(function() { | ||
29 | - var t = jQuery(this); | ||
30 | - var p = t.closest('.panel'); | ||
31 | - if (!jQuery(this).hasClass('maximize')) { | ||
32 | - p.find('.panel-body, .panel-footer').slideUp(200); | ||
33 | - t.addClass('maximize'); | ||
34 | - t.find('i').removeClass('fa-minus').addClass('fa-plus'); | ||
35 | - jQuery(this).attr('data-original-title', 'Maximize Panel').tooltip(); | ||
36 | - } else { | ||
37 | - p.find('.panel-body, .panel-footer').slideDown(200); | ||
38 | - t.removeClass('maximize'); | ||
39 | - t.find('i').removeClass('fa-plus').addClass('fa-minus'); | ||
40 | - jQuery(this).attr('data-original-title', 'Minimize Panel').tooltip(); | ||
41 | - } | ||
42 | - return false; | ||
43 | - }); | ||
44 | - | ||
45 | - jQuery('.leftpanel .nav .parent > a').click(function() { | ||
46 | - | ||
47 | - var coll = jQuery(this).parents('.collapsed').length; | ||
48 | - | ||
49 | - if (!coll) { | ||
50 | - jQuery('.leftpanel .nav .parent-focus').each(function() { | ||
51 | - jQuery(this).find('.children').slideUp('fast'); | ||
52 | - jQuery(this).removeClass('parent-focus'); | ||
53 | - }); | ||
54 | - | ||
55 | - var child = jQuery(this).parent().find('.children'); | ||
56 | - if (!child.is(':visible')) { | ||
57 | - child.slideDown('fast'); | ||
58 | - if (!child.parent().hasClass('active')) | ||
59 | - child.parent().addClass('parent-focus'); | ||
60 | - } else { | ||
61 | - child.slideUp('fast'); | ||
62 | - child.parent().removeClass('parent-focus'); | ||
63 | - } | ||
64 | - } | ||
65 | - return false; | ||
66 | - }); | ||
67 | - | ||
68 | - | ||
69 | - // Menu Toggle | ||
70 | - jQuery('.menu-collapse').click(function() { | ||
71 | - if (!$('body').hasClass('hidden-left')) { | ||
72 | - if ($('.headerwrapper').hasClass('collapsed')) { | ||
73 | - $('.headerwrapper, .mainwrapper').removeClass('collapsed'); | ||
74 | - } else { | ||
75 | - $('.headerwrapper, .mainwrapper').addClass('collapsed'); | ||
76 | - $('.children').hide(); // hide sub-menu if leave open | ||
77 | - } | ||
78 | - } else { | ||
79 | - if (!$('body').hasClass('show-left')) { | ||
80 | - $('body').addClass('show-left'); | ||
81 | - } else { | ||
82 | - $('body').removeClass('show-left'); | ||
83 | - } | ||
84 | - } | ||
85 | - return false; | ||
86 | - }); | ||
87 | - | ||
88 | - // Add class nav-hover to mene. Useful for viewing sub-menu | ||
89 | - jQuery('.leftpanel .nav li').hover(function() { | ||
90 | - $(this).addClass('nav-hover'); | ||
91 | - }, function() { | ||
92 | - $(this).removeClass('nav-hover'); | ||
93 | - }); | ||
94 | - | ||
95 | - // For Media Queries | ||
96 | - jQuery(window).resize(function() { | ||
97 | - hideMenu(); | ||
98 | - }); | ||
99 | - | ||
100 | - hideMenu(); // for loading/refreshing the page | ||
101 | - function hideMenu() { | ||
102 | - | ||
103 | - if ($('.header-right').css('position') == 'relative') { | ||
104 | - $('body').addClass('hidden-left'); | ||
105 | - $('.headerwrapper, .mainwrapper').removeClass('collapsed'); | ||
106 | - } else { | ||
107 | - $('body').removeClass('hidden-left'); | ||
108 | - } | ||
109 | - | ||
110 | - // Seach form move to left | ||
111 | - if ($(window).width() <= 360) { | ||
112 | - if ($('.leftpanel .form-search').length == 0) { | ||
113 | - $('.form-search').insertAfter($('.profile-left')); | ||
114 | - } | ||
115 | - } else { | ||
116 | - if ($('.header-right .form-search').length == 0) { | ||
117 | - $('.form-search').insertBefore($('.btn-group-notification')); | ||
118 | - } | ||
119 | - } | ||
120 | - } | ||
121 | - | ||
122 | - collapsedMenu(); // for loading/refreshing the page | ||
123 | - function collapsedMenu() { | ||
124 | - | ||
125 | - if ($('.logo').css('position') == 'relative') { | ||
126 | - $('.headerwrapper, .mainwrapper').addClass('collapsed'); | ||
127 | - } else { | ||
128 | - $('.headerwrapper, .mainwrapper').removeClass('collapsed'); | ||
129 | - } | ||
130 | - } | ||
131 | - | ||
132 | -}); | ||
1 | +// var jQuery = require('jquery'); | ||
2 | +// jQuery(document).ready(function() { | ||
3 | + | ||
4 | +// "use strict"; | ||
5 | +// var $ = jQuery; | ||
6 | +// // Tooltip | ||
7 | +// jQuery('.tooltips').tooltip({ | ||
8 | +// container: 'body' | ||
9 | +// }); | ||
10 | + | ||
11 | +// // Popover | ||
12 | +// jQuery('.popovers').popover(); | ||
13 | + | ||
14 | +// // Show panel buttons when hovering panel heading | ||
15 | +// jQuery('.panel-heading').hover(function() { | ||
16 | +// jQuery(this).find('.panel-btns').fadeIn('fast'); | ||
17 | +// }, function() { | ||
18 | +// jQuery(this).find('.panel-btns').fadeOut('fast'); | ||
19 | +// }); | ||
20 | + | ||
21 | +// // Close Panel | ||
22 | +// jQuery('.panel .panel-close').click(function() { | ||
23 | +// jQuery(this).closest('.panel').fadeOut(200); | ||
24 | +// return false; | ||
25 | +// }); | ||
26 | + | ||
27 | +// // Minimize Panel | ||
28 | +// jQuery('.panel .panel-minimize').click(function() { | ||
29 | +// var t = jQuery(this); | ||
30 | +// var p = t.closest('.panel'); | ||
31 | +// if (!jQuery(this).hasClass('maximize')) { | ||
32 | +// p.find('.panel-body, .panel-footer').slideUp(200); | ||
33 | +// t.addClass('maximize'); | ||
34 | +// t.find('i').removeClass('fa-minus').addClass('fa-plus'); | ||
35 | +// jQuery(this).attr('data-original-title', 'Maximize Panel').tooltip(); | ||
36 | +// } else { | ||
37 | +// p.find('.panel-body, .panel-footer').slideDown(200); | ||
38 | +// t.removeClass('maximize'); | ||
39 | +// t.find('i').removeClass('fa-plus').addClass('fa-minus'); | ||
40 | +// jQuery(this).attr('data-original-title', 'Minimize Panel').tooltip(); | ||
41 | +// } | ||
42 | +// return false; | ||
43 | +// }); | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | +// // Menu Toggle | ||
48 | +// jQuery('.menu-collapse').click(function() { | ||
49 | +// if (!$('body').hasClass('hidden-left')) { | ||
50 | +// if ($('.headerwrapper').hasClass('collapsed')) { | ||
51 | +// $('.headerwrapper, .mainwrapper').removeClass('collapsed'); | ||
52 | +// } else { | ||
53 | +// $('.headerwrapper, .mainwrapper').addClass('collapsed'); | ||
54 | +// $('.children').hide(); // hide sub-menu if leave open | ||
55 | +// } | ||
56 | +// } else { | ||
57 | +// if (!$('body').hasClass('show-left')) { | ||
58 | +// $('body').addClass('show-left'); | ||
59 | +// } else { | ||
60 | +// $('body').removeClass('show-left'); | ||
61 | +// } | ||
62 | +// } | ||
63 | +// return false; | ||
64 | +// }); | ||
65 | + | ||
66 | +// // Add class nav-hover to mene. Useful for viewing sub-menu | ||
67 | +// jQuery('.leftpanel .nav li').hover(function() { | ||
68 | +// $(this).addClass('nav-hover'); | ||
69 | +// }, function() { | ||
70 | +// $(this).removeClass('nav-hover'); | ||
71 | +// }); | ||
72 | + | ||
73 | +// // For Media Queries | ||
74 | +// jQuery(window).resize(function() { | ||
75 | +// hideMenu(); | ||
76 | +// }); | ||
77 | + | ||
78 | +// hideMenu(); // for loading/refreshing the page | ||
79 | +// function hideMenu() { | ||
80 | + | ||
81 | +// if ($('.header-right').css('position') == 'relative') { | ||
82 | +// $('body').addClass('hidden-left'); | ||
83 | +// $('.headerwrapper, .mainwrapper').removeClass('collapsed'); | ||
84 | +// } else { | ||
85 | +// $('body').removeClass('hidden-left'); | ||
86 | +// } | ||
87 | + | ||
88 | +// // Seach form move to left | ||
89 | +// if ($(window).width() <= 360) { | ||
90 | +// if ($('.leftpanel .form-search').length == 0) { | ||
91 | +// $('.form-search').insertAfter($('.profile-left')); | ||
92 | +// } | ||
93 | +// } else { | ||
94 | +// if ($('.header-right .form-search').length == 0) { | ||
95 | +// $('.form-search').insertBefore($('.btn-group-notification')); | ||
96 | +// } | ||
97 | +// } | ||
98 | +// } | ||
99 | + | ||
100 | +// collapsedMenu(); // for loading/refreshing the page | ||
101 | +// function collapsedMenu() { | ||
102 | + | ||
103 | +// if ($('.logo').css('position') == 'relative') { | ||
104 | +// $('.headerwrapper, .mainwrapper').addClass('collapsed'); | ||
105 | +// } else { | ||
106 | +// $('.headerwrapper, .mainwrapper').removeClass('collapsed'); | ||
107 | +// } | ||
108 | +// } | ||
109 | + | ||
110 | +// }); |
1 | 1 | ||
2 | { | 2 | { |
3 | "name": "yohobuy-portal", | 3 | "name": "yohobuy-portal", |
4 | - "version": "0.3.4", | 4 | + "version": "0.3.5", |
5 | "description": "yohobuy-portal", | 5 | "description": "yohobuy-portal", |
6 | "keywords": [], | 6 | "keywords": [], |
7 | "homepage": "", | 7 | "homepage": "", |
@@ -15,8 +15,7 @@ | @@ -15,8 +15,7 @@ | ||
15 | "dependencies": { | 15 | "dependencies": { |
16 | "jquery": "2.1.4", | 16 | "jquery": "2.1.4", |
17 | "import-style": "1.0.0", | 17 | "import-style": "1.0.0", |
18 | - "yoho.handlebars": "3.0.3", | ||
19 | - "yoho.bootstrap": "0.0.4" | 18 | + "yoho.handlebars": "3.0.3" |
20 | }, | 19 | }, |
21 | "devDependencies": { | 20 | "devDependencies": { |
22 | "expect.js": "0.3.1" | 21 | "expect.js": "0.3.1" |
@@ -7,9 +7,9 @@ | @@ -7,9 +7,9 @@ | ||
7 | .edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} | 7 | .edui-dialog-image .edui-image-form{position: absolute;left: 0px;top: 0px;width: 100%;height: 100%;opacity: 0;cursor: pointer;} |
8 | .edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} | 8 | .edui-dialog-image .edui-image-form .edui-image-file{width: 100%;height:100%;filter: alpha(opacity=0)} |
9 | 9 | ||
10 | -.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('../images/upload1.png')} | 10 | +.edui-dialog-image .edui-image-upload1 .edui-image-icon{display: inline-block;width:44px;height:38px;background-image: url('../assets/images/upload1.png')} |
11 | .edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} | 11 | .edui-dialog-image .edui-image-upload1 .edui-image-icon.hover{background-position: -50px 0;} |
12 | -.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('../images/upload2.png')} | 12 | +.edui-dialog-image .edui-image-upload2 .edui-image-icon{display: inline-block;width:120px;height:120px;background-image: url('../assets/images/upload2.png')} |
13 | 13 | ||
14 | .edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; | 14 | .edui-dialog-image .edui-image-dragTip{position: absolute;display:none;top:50%;left:50%;margin-top:30px;margin-left: -60px; |
15 | color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} | 15 | color: #222;font-size:14px;text-shadow: 0px 2px 3px #555;} |
@@ -38,5 +38,5 @@ | @@ -38,5 +38,5 @@ | ||
38 | /*common*/ | 38 | /*common*/ |
39 | .edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} | 39 | .edui-dialog-image .edui-image-item{position:relative;float:left;width:120px;height:120px;border: 1px solid #CCC;cursor: default;margin: 5px 0 0 5px;} |
40 | .edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} | 40 | .edui-dialog-image .edui-image-item .edui-image-pic{position: absolute;left:-9999px;} |
41 | -.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('../images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} | 41 | +.edui-dialog-image .edui-image-item .edui-image-close{position:absolute;right:0;background: url('../assets/images/close.png');width:17px;height:17px;cursor:pointer;z-index:1} |
42 | .edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} | 42 | .edui-dialog-image .edui-image-item.hover .edui-image-close{display: block;} |
@@ -107,8 +107,8 @@ ul { | @@ -107,8 +107,8 @@ ul { | ||
107 | border: 1px solid #ddd; | 107 | border: 1px solid #ddd; |
108 | margin: 0; | 108 | margin: 0; |
109 | padding-left: 20px; | 109 | padding-left: 20px; |
110 | - background: #fff url("/images/ico-search.png") 4px center no-repeat; | ||
111 | - background-image: -webkit-image-set(url("/images/ico-search.png") 1x, url("/images/ico-search@2x.png") 2x); | 110 | + background: #fff url("../assets/images/ico-search.png") 4px center no-repeat; |
111 | + background-image: -webkit-image-set(url("../assets/images/ico-search.png") 1x, url("../assets/images/ico-search@2x.png") 2x); | ||
112 | border-radius: 2px; | 112 | border-radius: 2px; |
113 | -webkit-transition: width linear 0.25s; | 113 | -webkit-transition: width linear 0.25s; |
114 | -moz-transition: width linear 0.25s; | 114 | -moz-transition: width linear 0.25s; |
@@ -58,7 +58,7 @@ | @@ -58,7 +58,7 @@ | ||
58 | position:absolute; | 58 | position:absolute; |
59 | top: 10px; | 59 | top: 10px; |
60 | right: 10px; | 60 | right: 10px; |
61 | - background: url(../images/close-white.png) no-repeat center center; | 61 | + background: url(../assets/images/close-white.png) no-repeat center center; |
62 | cursor:pointer; | 62 | cursor:pointer; |
63 | width:10px; | 63 | width:10px; |
64 | height:11px; | 64 | height:11px; |
@@ -66,8 +66,8 @@ | @@ -66,8 +66,8 @@ | ||
66 | margin: 0; | 66 | margin: 0; |
67 | padding:0; | 67 | padding:0; |
68 | background-repeat: no-repeat; | 68 | background-repeat: no-repeat; |
69 | - background-image: url(../images/icons.png); | ||
70 | - background-image: url(../images/icons.gif) \9; | 69 | + background-image: url(../assets/images/icons.png); |
70 | + background-image: url(../assets/images/icons.gif) \9; | ||
71 | } | 71 | } |
72 | 72 | ||
73 | /*状态反射*/ | 73 | /*状态反射*/ |
@@ -230,8 +230,8 @@ | @@ -230,8 +230,8 @@ | ||
230 | *zoom:1; | 230 | *zoom:1; |
231 | width: 8px; | 231 | width: 8px; |
232 | height: 20px; | 232 | height: 20px; |
233 | - background: url(../images/icons.png) -741px 0; | ||
234 | - _background: url(../images/icons.gif) -741px 0; | 233 | + background: url(../assets/images/icons.png) -741px 0; |
234 | + _background: url(../assets/images/icons.gif) -741px 0; | ||
235 | } | 235 | } |
236 | 236 | ||
237 | .edui-btn-toolbar .edui-splitbutton, | 237 | .edui-btn-toolbar .edui-splitbutton, |
@@ -295,8 +295,8 @@ | @@ -295,8 +295,8 @@ | ||
295 | width: 12px; | 295 | width: 12px; |
296 | margin: 0; | 296 | margin: 0; |
297 | padding: 0; | 297 | padding: 0; |
298 | - background: url(../images/icons.png) -741px 0; | ||
299 | - _background: url(../images/icons.gif) -741px 0; | 298 | + background: url(../assets/images/icons.png) -741px 0; |
299 | + _background: url(../assets/images/icons.gif) -741px 0; | ||
300 | } | 300 | } |
301 | .edui-btn-toolbar .edui-combobox.edui-disabled{ | 301 | .edui-btn-toolbar .edui-combobox.edui-disabled{ |
302 | opacity: 0.2; | 302 | opacity: 0.2; |
@@ -352,7 +352,7 @@ | @@ -352,7 +352,7 @@ | ||
352 | height: 25px; | 352 | height: 25px; |
353 | background: red; | 353 | background: red; |
354 | vertical-align: bottom; | 354 | vertical-align: bottom; |
355 | - background: url(../images/ok.gif) no-repeat 1000px 1000px; | 355 | + background: url(../assets/images/ok.gif) no-repeat 1000px 1000px; |
356 | } | 356 | } |
357 | 357 | ||
358 | .edui-combobox-menu .edui-combobox-checked .edui-combobox-icon { | 358 | .edui-combobox-menu .edui-combobox-checked .edui-combobox-icon { |
@@ -514,7 +514,7 @@ | @@ -514,7 +514,7 @@ | ||
514 | margin-top: 2px; | 514 | margin-top: 2px; |
515 | padding: 1px; | 515 | padding: 1px; |
516 | border: 0; | 516 | border: 0; |
517 | - background: url("../images/close.png") no-repeat center center; | 517 | + background: url("../assets/images/close.png") no-repeat center center; |
518 | cursor: pointer; | 518 | cursor: pointer; |
519 | } | 519 | } |
520 | .edui-modal-header .edui-close.edui-hover { | 520 | .edui-modal-header .edui-close.edui-hover { |
@@ -604,7 +604,7 @@ | @@ -604,7 +604,7 @@ | ||
604 | } | 604 | } |
605 | .edui-popup{ | 605 | .edui-popup{ |
606 | display: none; | 606 | display: none; |
607 | - background: url('../images/pop-bg.png') repeat #fff; | 607 | + background: url('../assets/images/pop-bg.png') repeat #fff; |
608 | padding: 2px; | 608 | padding: 2px; |
609 | } | 609 | } |
610 | .edui-popup .edui-popup-body{ | 610 | .edui-popup .edui-popup-body{ |
@@ -616,10 +616,10 @@ | @@ -616,10 +616,10 @@ | ||
616 | height: 11px; | 616 | height: 11px; |
617 | } | 617 | } |
618 | .edui-popup .edui-popup-caret.up{ | 618 | .edui-popup .edui-popup-caret.up{ |
619 | - background:url('../images/caret.png') no-repeat 0 0; | 619 | + background:url('../assets/images/caret.png') no-repeat 0 0; |
620 | } | 620 | } |
621 | .edui-popup .edui-popup-caret.down{ | 621 | .edui-popup .edui-popup-caret.down{ |
622 | - background:url('../images/caret.png') no-repeat 0 0; | 622 | + background:url('../assets/images/caret.png') no-repeat 0 0; |
623 | } | 623 | } |
624 | 624 | ||
625 | 625 | ||
@@ -762,8 +762,8 @@ | @@ -762,8 +762,8 @@ | ||
762 | width: 2px; | 762 | width: 2px; |
763 | height: 20px; | 763 | height: 20px; |
764 | padding: 1px 2px; | 764 | padding: 1px 2px; |
765 | - background: url(../images/icons.png) -179px 1px; | ||
766 | - background: url(../images/icons.gif) -179px 1px \9; | 765 | + background: url(../assets/images/icons.png) -179px 1px; |
766 | + background: url(../assets/images/icons.gif) -179px 1px \9; | ||
767 | display: inline-block ; | 767 | display: inline-block ; |
768 | vertical-align: top; | 768 | vertical-align: top; |
769 | *display: inline ; | 769 | *display: inline ; |
@@ -163,11 +163,11 @@ | @@ -163,11 +163,11 @@ | ||
163 | line-height: 48px; | 163 | line-height: 48px; |
164 | padding: 0 0 0 50px; | 164 | padding: 0 0 0 50px; |
165 | margin: 0 200px; | 165 | margin: 0 200px; |
166 | - background: url(../images/excel.png) no-repeat left center; | 166 | + background: url(../assets/images/excel.png) no-repeat left center; |
167 | } | 167 | } |
168 | 168 | ||
169 | .load { | 169 | .load { |
170 | - background-image: url(../images/loading.gif); | 170 | + background-image: url(../assets/images/loading.gif); |
171 | background-repeat: no-repeat; | 171 | background-repeat: no-repeat; |
172 | background-position: center center; | 172 | background-position: center center; |
173 | } | 173 | } |
No preview for this file type
No preview for this file type
No preview for this file type
public/fonts/glyphicons-halflings-regular.eot
→
public/assets/fonts/glyphicons-halflings-regular.eot
No preview for this file type
public/fonts/glyphicons-halflings-regular.svg
→
public/assets/fonts/glyphicons-halflings-regular.svg
public/fonts/glyphicons-halflings-regular.ttf
→
public/assets/fonts/glyphicons-halflings-regular.ttf
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
public/fonts/weathericons-regular-webfont.eot
→
public/assets/fonts/weathericons-regular-webfont.eot
No preview for this file type
public/fonts/weathericons-regular-webfont.svg
→
public/assets/fonts/weathericons-regular-webfont.svg
public/fonts/weathericons-regular-webfont.ttf
→
public/assets/fonts/weathericons-regular-webfont.ttf
No preview for this file type
No preview for this file type
-
Please register or login to post a comment