Authored by liuyue

封面 搭配 悬浮导航修改

@@ -193,3 +193,10 @@ $('.floatnav').on('click', 'li', function() { @@ -193,3 +193,10 @@ $('.floatnav').on('click', 'li', function() {
193 $(window).scrollTop(scrollTop); 193 $(window).scrollTop(scrollTop);
194 return false; 194 return false;
195 }); 195 });
  196 +
  197 +//导航样式
  198 +$('.floatnav').on('mouseenter', function() {
  199 + $('.floatnav').addClass('show');
  200 +}).on('mouseleave', function() {
  201 + $('.floatnav').removeClass('show');
  202 +});
@@ -133,7 +133,7 @@ var Bll = { @@ -133,7 +133,7 @@ var Bll = {
133 133
134 var d = new common.dialog({ 134 var d = new common.dialog({
135 title: title, 135 title: title,
136 - width: '60%', 136 + width: '800px',
137 content: common.util.__template2($("#wqt-template1").html(), item), 137 content: common.util.__template2($("#wqt-template1").html(), item),
138 button: [{ 138 button: [{
139 value: "提交", 139 value: "提交",
@@ -232,7 +232,7 @@ $(document).on("click", "#dapeiTable .edit", function() { @@ -232,7 +232,7 @@ $(document).on("click", "#dapeiTable .edit", function() {
232 } 232 }
233 }, function(data) { 233 }, function(data) {
234 Bll.toast("添加搭配", data.data, "/netSale/updateCollocation"); 234 Bll.toast("添加搭配", data.data, "/netSale/updateCollocation");
235 - }); 235 + }, true);
236 // item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}]; 236 // item.infoStr=[{"top":223,"left":380,"id":"ffffff"},{"top":454,"left":309,"id":"ggggg"}];
237 // Bll.toast("添加搭配",item,"/netSale/updateCollocation"); 237 // Bll.toast("添加搭配",item,"/netSale/updateCollocation");
238 }); 238 });
@@ -272,52 +272,67 @@ common.edit.ajaxfileupload(".fenmianfile", { @@ -272,52 +272,67 @@ common.edit.ajaxfileupload(".fenmianfile", {
272 item.push(data); 272 item.push(data);
273 goodsList[$(this).data("index")].goodsImagesList = item; 273 goodsList[$(this).data("index")].goodsImagesList = item;
274 $(this).parents(".cover-image-item").before(common.util.__template2($("#fenmianImgTemp").html(), data)); 274 $(this).parents(".cover-image-item").before(common.util.__template2($("#fenmianImgTemp").html(), data));
275 - $(this).parents(".form-group").next().find('.cover-color').append($($('#colorCoverTemp').html()));  
276 } else { 275 } else {
277 common.util.__tip(response.message); 276 common.util.__tip(response.message);
278 } 277 }
279 } 278 }
280 }); 279 });
281 280
282 -  
283 -$('.cover-color').on("click", ".btn-metro", function() {  
284 - var index = $(this).parents(".form-group").prev().find('.cover-image-list').data("index");  
285 - var index1 = $(this).parents(".cover-color-box").index(); 281 +//颜色封面点击事件
  282 +$('.cover-image-list').on("click", ".btn-metro", function() {
  283 + var index = $(this).parents(".cover-image-list").data("index");
  284 + var index1 = $(this).parents(".cover-image-item").index();
286 var item = goodsList[index].goodsImagesList[index1]; 285 var item = goodsList[index].goodsImagesList[index1];
287 - var $groups = $(this).parents(".cover-color-box");  
288 var colorIndex = $(this).index(); 286 var colorIndex = $(this).index();
289 287
290 if ($(this).hasClass('info')) { 288 if ($(this).hasClass('info')) {
291 $(this).removeClass('info'); 289 $(this).removeClass('info');
292 } else { 290 } else {
293 - $groups.siblings('.cover-color-box').each(function() { 291 + $(this).parents('.cover-image-item').siblings().each(function() {
294 $(this).find('.btn-metro').eq(colorIndex).removeClass('info'); 292 $(this).find('.btn-metro').eq(colorIndex).removeClass('info');
295 }); 293 });
296 -  
297 $(this).siblings('.btn-metro').removeClass('info').end().addClass('info'); 294 $(this).siblings('.btn-metro').removeClass('info').end().addClass('info');
298 } 295 }
299 296
300 - item.isDefault = $groups.find('.btn-metro').eq(0).hasClass('info') ? 'Y' : 'N'; 297 + var isDefault = $(this).parents('.cover-color').find('.btn-metro').eq(0).hasClass('info') ? 'Y' : 'N';
  298 + var genderCover = $(this).parents('.cover-color').find('.info').index() >= 0 ? $(this).parents('.cover-color').find('.info').index() : 0;
301 299
302 - if ($groups.find('.btn-metro').eq(1).hasClass('info')) {  
303 - item.genderCover = 1;  
304 - } else if (item.genderCover = $groups.find('.btn-metro').eq(2).hasClass('info')) {  
305 - item.genderCover = 2;  
306 - } else {  
307 - item.genderCover = 0; 300 + $.each(goodsList[index].goodsImagesList, function(i, value) {
  301 + if (value.genderCover == genderCover) {
  302 + value.genderCover = 0;
308 } 303 }
  304 + if (value.isDefault == isDefault) {
  305 + value.isDefault = 'N';
  306 + }
  307 + });
  308 +
  309 + item.genderCover = genderCover;
  310 + item.isDefault = isDefault;
  311 +
309 }); 312 });
310 -$(document).on("click", ".goods-color a", function() { 313 +//商品封面点击事件
  314 +$(document).on("click", ".cover-goods a", function() {
311 var index = $(this).data("index"); 315 var index = $(this).data("index");
312 var item = goodsList[index]; 316 var item = goodsList[index];
313 if ($(this).hasClass("info")) { 317 if ($(this).hasClass("info")) {
314 $(this).removeClass("info"); 318 $(this).removeClass("info");
315 } else { 319 } else {
316 - $('.goods-color a').removeClass("info"); 320 + $('.cover-goods a').removeClass("info");
317 $(this).addClass("info"); 321 $(this).addClass("info");
318 } 322 }
319 item.isDefault = $(this).hasClass("info") ? "Y" : "N"; 323 item.isDefault = $(this).hasClass("info") ? "Y" : "N";
320 }); 324 });
  325 +
  326 +//封面图删除
  327 +$(document).on('click', '.remove-item-btn', function() {
  328 + var index = $(this).parents(".cover-image-list").data("index");
  329 + var index1 = $(this).parents(".cover-image-item").index();
  330 + $(this).parents('.cover-image-item').remove();
  331 + goodsList[index].goodsImagesList.splice(index1, 1);
  332 + console.log(goodsList[index].goodsImagesList);
  333 +});
  334 +
  335 +//单独保存封面
321 $(document).on("click", "#fenMainSave", function() { 336 $(document).on("click", "#fenMainSave", function() {
322 337
323 var data = GOLABDATA.fire("fenmian"); 338 var data = GOLABDATA.fire("fenmian");
@@ -333,8 +348,6 @@ GOLABDATA.on("fenmian", function() { @@ -333,8 +348,6 @@ GOLABDATA.on("fenmian", function() {
333 goodsImagesBoList: [] 348 goodsImagesBoList: []
334 }; 349 };
335 350
336 -  
337 -  
338 $.each(goodsList, function(index, item) { 351 $.each(goodsList, function(index, item) {
339 if (item.isDefault == "Y") { 352 if (item.isDefault == "Y") {
340 map.productSkc = item.productSkc; 353 map.productSkc = item.productSkc;
@@ -39,7 +39,7 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month @@ -39,7 +39,7 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
39 39
40 40
41 .goods-img { 41 .goods-img {
42 - margin: 0 auto; 42 + margin: 10px auto 0;
43 border: 2px dashed #CCC; 43 border: 2px dashed #CCC;
44 } 44 }
45 45
@@ -50,15 +50,24 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month @@ -50,15 +50,24 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
50 } 50 }
51 51
52 .cover-color { 52 .cover-color {
53 - .cover-color-box {  
54 - float: left;  
55 - width: 135px;  
56 - } 53 + text-align: center;
  54 + height: 40px;
  55 + line-height: 40px;
57 .btn { 56 .btn {
58 padding: 2px 5px; 57 padding: 2px 5px;
59 } 58 }
60 } 59 }
61 60
  61 +.fm-side {
  62 + width: 110px;
  63 + .cover-color {
  64 + text-align: left;
  65 + }
  66 + .goods-img {
  67 + margin: 10px 0 0;
  68 + }
  69 +}
  70 +
62 .goods-img { 71 .goods-img {
63 position: relative; 72 position: relative;
64 width: 110px; 73 width: 110px;
@@ -76,6 +85,19 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month @@ -76,6 +85,19 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
76 max-height: 100%; 85 max-height: 100%;
77 } 86 }
78 } 87 }
  88 +
  89 + .remove-item-btn {
  90 + position: absolute;
  91 + font-size: 20px;
  92 + top: -10px;
  93 + right: -10px;
  94 + cursor: pointer;
  95 + color: #ccc;
  96 +
  97 + &:hover {
  98 + color: #000;
  99 + }
  100 + }
79 } 101 }
80 .poseditimg{ 102 .poseditimg{
81 position: relative; 103 position: relative;
@@ -96,6 +118,12 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month @@ -96,6 +118,12 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
96 } 118 }
97 } 119 }
98 } 120 }
  121 +
  122 +#dapei-form {
  123 + label {
  124 + min-width: 60px;
  125 + }
  126 +}
99 .btn.info{ 127 .btn.info{
100 color: #fff; 128 color: #fff;
101 background-color: #5bc0de; 129 background-color: #5bc0de;
@@ -105,9 +133,11 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month @@ -105,9 +133,11 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
105 .floatnav{ 133 .floatnav{
106 padding: 0; 134 padding: 0;
107 position: fixed; 135 position: fixed;
108 - right: 20px;  
109 - top: 20%; 136 + right: 0;
  137 + top: 50%;
110 z-index: 999; 138 z-index: 999;
  139 + margin: -280px 0 0;
  140 + transform: translateX(150px);
111 141
112 ul { 142 ul {
113 padding: 0; 143 padding: 0;
@@ -152,8 +182,42 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month @@ -152,8 +182,42 @@ input[type=date], input[type=time], input[type=datetime-local], input[type=month
152 } 182 }
153 183
154 } 184 }
  185 +
  186 + .glyphicon {
  187 + position: absolute;
  188 + font-size: 20px;
  189 + width: 30px;
  190 + height: 40px;
  191 + background: #f2dede;
  192 + border-radius: 10px 0 0 10px;
  193 + border: 1px solid #ebccd1;
  194 + left: -30px;
  195 + top: 50%;
  196 + margin: -20px 0 0 0;
  197 + color: #fff;
  198 + text-align: center;
  199 + line-height: 40px;
  200 + cursor: pointer;
  201 +
  202 + &.glyphicon-chevron-right {
  203 + display: none;
  204 + }
  205 + }
155 } 206 }
156 207
  208 +.floatnav.show {
  209 + transform: translateX(0);
  210 + transition: transform .5s;
  211 +
  212 + .glyphicon-chevron-right {
  213 + display: inline;
  214 + }
  215 + .glyphicon-chevron-left {
  216 + display: none;
  217 + }
  218 +
  219 +
  220 +}
157 221
158 .netsale-position { 222 .netsale-position {
159 position: absolute; 223 position: absolute;
@@ -97,6 +97,8 @@ @@ -97,6 +97,8 @@
97 </ul> 97 </ul>
98 </li> 98 </li>
99 </ul> 99 </ul>
  100 + <i class="glyphicon glyphicon-chevron-right"></i>
  101 + <i class="glyphicon glyphicon-chevron-left"></i>
100 </div> 102 </div>
101 103
102 <script type="text/template" id="picDialogTemp"> 104 <script type="text/template" id="picDialogTemp">
@@ -37,20 +37,20 @@ @@ -37,20 +37,20 @@
37 <div class="col-sm-4"> 37 <div class="col-sm-4">
38 <div class="rows" id="dapei-form"> 38 <div class="rows" id="dapei-form">
39 <div class="form-group"> 39 <div class="form-group">
40 - <label for="endTime" class="col-sm-2 control-label"><i class="red">*</i> 介绍</label>  
41 - <div class="col-sm-10"> 40 + <label class="control-label pull-left"><i class="red">*</i> 介绍</label>
  41 + <div class="pull-left" style="width: 160px;">
42 <input type="text" id="content" class="form-control panel-input hasDatepicker" placeholder="介绍" value="[[content]]" required> 42 <input type="text" id="content" class="form-control panel-input hasDatepicker" placeholder="介绍" value="[[content]]" required>
43 </div> 43 </div>
44 </div> 44 </div>
45 <div class="form-group"> 45 <div class="form-group">
46 - <label for="endTime" class="col-sm-2 control-label"><i class="red">*</i> 图片</label>  
47 - <div class="col-sm-10"> 46 + <label class="control-label pull-left"><i class="red">*</i> 图片</label>
  47 + <div class="pull-left" style="width: 160px;">
48 <input type="file" id="imageUrl" name="imageUrl" value="[[imageUrl]]" required/> 48 <input type="file" id="imageUrl" name="imageUrl" value="[[imageUrl]]" required/>
49 </div> 49 </div>
50 </div> 50 </div>
51 <div class="form-group"> 51 <div class="form-group">
52 - <label for="endTime" class="col-sm-2 control-label"><i class="red">*</i> 排序</label>  
53 - <div class="col-sm-10"> 52 + <label class="control-label pull-left"><i class="red">*</i> 排序</label>
  53 + <div class="pull-left" style="width: 160px;">
54 <input type="number" id="orderBy" class="form-control panel-input hasDatepicker" placeholder="排序" value="[[orderBy]]" required> 54 <input type="number" id="orderBy" class="form-control panel-input hasDatepicker" placeholder="排序" value="[[orderBy]]" required>
55 </div> 55 </div>
56 </div> 56 </div>
@@ -13,24 +13,44 @@ @@ -13,24 +13,44 @@
13 <div class="panel-footer"> 13 <div class="panel-footer">
14 <button class="btn btn-primary" id="fenMainSave">保存</button> 14 <button class="btn btn-primary" id="fenMainSave">保存</button>
15 </div> 15 </div>
16 - </div> 16 +</div>
  17 +
17 <script type="text/template" id="fenmianTemp"> 18 <script type="text/template" id="fenmianTemp">
18 [[each goodsList as item index]] 19 [[each goodsList as item index]]
19 <div class="form-group"> 20 <div class="form-group">
20 - <div class="col-sm-2"> 21 + <div class="fm-side col-sm-2">
21 <div class="goods-img"> 22 <div class="goods-img">
22 <p>SKC: [[item.productSkc]]</p> 23 <p>SKC: [[item.productSkc]]</p>
23 <p>[[item.goodsName]]</p> 24 <p>[[item.goodsName]]</p>
24 - <p>[[item.factoryGoodsName]]</p> 25 + <p>[[item.factoryGoodsName || '']]</p>
25 </div> 26 </div>
26 - 27 + <div class="cover-color">颜色封面:</div>
27 </div> 28 </div>
28 - <div class="col-sm-10">  
29 - <ul class="cover-image-list col-sm-12" data-index=[[index]]> 29 + <ul class="cover-image-list col-sm-10" style="padding: 0;margin: 0;" data-index=[[index]]>
30 [[each item.goodsImagesList as _item _index]] 30 [[each item.goodsImagesList as _item _index]]
31 <li class="cover-image-item fileinput-button" data-index=[[_index]]> 31 <li class="cover-image-item fileinput-button" data-index=[[_index]]>
32 <div class="goods-img"> 32 <div class="goods-img">
33 <a class="fileinput-button-icon" href="javascript:void(0);"><img src="[[_item.imageUrl]]"></a> 33 <a class="fileinput-button-icon" href="javascript:void(0);"><img src="[[_item.imageUrl]]"></a>
  34 + <i class="remove-item-btn glyphicon glyphicon-remove-circle"></i>
  35 + </div>
  36 + <div class="cover-color">
  37 + [[if _item.isDefault=="Y"]]
  38 + <a href="javascript:;" class="btn btn-default btn-metro info">默认</a>
  39 + [[else]]
  40 + <a href="javascript:;" class="btn btn-default btn-metro">默认</a>
  41 + [[/if]]
  42 +
  43 + [[if _item.genderCover==1]]
  44 + <a href="javascript:;" class="btn btn-default btn-metro info">男封</a>
  45 + [[else]]
  46 + <a href="javascript:;" class="btn btn-default btn-metro">男封</a>
  47 + [[/if]]
  48 +
  49 + [[if _item.genderCover==2]]
  50 + <a href="javascript:;" class="btn btn-default btn-metro info">女封</a>
  51 + [[else]]
  52 + <a href="javascript:;" class="btn btn-default btn-metro">女封</a>
  53 + [[/if]]
34 </div> 54 </div>
35 </li> 55 </li>
36 [[/each]] 56 [[/each]]
@@ -42,8 +62,7 @@ @@ -42,8 +62,7 @@
42 </li> 62 </li>
43 </ul> 63 </ul>
44 </div> 64 </div>
45 - </div>  
46 - <div class="form-group"> 65 + <!-- <div class="form-group">
47 <div class="col-sm-2"> 66 <div class="col-sm-2">
48 <div class="height40">颜色封面:</div> 67 <div class="height40">颜色封面:</div>
49 </div> 68 </div>
@@ -70,41 +89,39 @@ @@ -70,41 +89,39 @@
70 [[/if]] 89 [[/if]]
71 </div> 90 </div>
72 [[/each]] 91 [[/each]]
73 -  
74 -  
75 - </div>  
76 </div> 92 </div>
77 </div> 93 </div>
  94 + </div> -->
78 <div class="form-group"> 95 <div class="form-group">
79 - <div class="col-sm-2">  
80 - <div class="goods-color height40">商品封面:</div>  
81 - </div>  
82 - <div class="col-sm-10">  
83 - <div class="goods-color"> 96 + <div class="fm-side col-sm-2">商品封面:</div>
  97 + <div class="cover-goods col-sm-10">
84 [[if item.isDefault=="Y"]] 98 [[if item.isDefault=="Y"]]
85 <a href="javascript:;" class="btn btn-default btn-metro info" data-index=[[index]]>设置默认</a> 99 <a href="javascript:;" class="btn btn-default btn-metro info" data-index=[[index]]>设置默认</a>
86 [[else]] 100 [[else]]
87 <a href="javascript:;" class="btn btn-default btn-metro" data-index=[[index]]>设置默认</a> 101 <a href="javascript:;" class="btn btn-default btn-metro" data-index=[[index]]>设置默认</a>
88 [[/if]] 102 [[/if]]
89 - <!-- <a href="javascript:;" class="btn btn-default btn-metro">调用图片</a> -->  
90 - </div>  
91 </div> 103 </div>
92 </div> 104 </div>
93 [[/each]] 105 [[/each]]
94 -  
95 </script> 106 </script>
96 <script type="text/template" id="fenmianImgTemp"> 107 <script type="text/template" id="fenmianImgTemp">
97 - <li class="cover-image-item fileinput-button" data-index=[[__index]]> 108 + <li class="cover-image-item fileinput-button" data-index=[[_index]]>
98 <div class="goods-img"> 109 <div class="goods-img">
99 <a class="fileinput-button-icon" href="javascript:void(0);"><img src="[[imageUrl]]"></a> 110 <a class="fileinput-button-icon" href="javascript:void(0);"><img src="[[imageUrl]]"></a>
  111 + <i class="remove-item-btn glyphicon glyphicon-remove-circle"></i>
  112 + </div>
  113 + <div class="cover-color">
  114 + <a href="javascript:;" class="btn btn-default btn-metro">默认</a>
  115 + <a href="javascript:;" class="btn btn-default btn-metro">男封</a>
  116 + <a href="javascript:;" class="btn btn-default btn-metro">女封</a>
100 </div> 117 </div>
101 </li> 118 </li>
102 </script> 119 </script>
103 120
104 -<script type="text/template" id="colorCoverTemp"> 121 +<!-- <script type="text/template" id="colorCoverTemp">
105 <div class="cover-color-box height40"> 122 <div class="cover-color-box height40">
106 <a href="javascript:;" class="btn btn-default btn-metro">默认</a> 123 <a href="javascript:;" class="btn btn-default btn-metro">默认</a>
107 <a href="javascript:;" class="btn btn-default btn-metro">男封</a> 124 <a href="javascript:;" class="btn btn-default btn-metro">男封</a>
108 <a href="javascript:;" class="btn btn-default btn-metro">女封</a> 125 <a href="javascript:;" class="btn btn-default btn-metro">女封</a>
109 </div> 126 </div>
110 -</script>  
  127 +</script> -->