Authored by weiqingting

Merge branch 'develop' of http://git.dev.yoho.cn/platform/yohobuy-portal-fe into develop

1 -var dragging = function(el, array, callback) { 1 +var $ = require('jquery');
  2 +
  3 +var drag = function(el, array, callback) {
2 this.el = el; 4 this.el = el;
3 this.dataArray = array; 5 this.dataArray = array;
4 this.callback = callback; 6 this.callback = callback;
5 } 7 }
6 -dragging.prototype = {  
7 - constructor: dragging, 8 +drag.prototype = {
  9 + constructor: drag,
8 minZindex: 1, 10 minZindex: 1,
9 dragItemList: null, 11 dragItemList: null,
10 dragItemPos: [], 12 dragItemPos: [],
11 13
12 Initialize: function(){ 14 Initialize: function(){
13 - console.log(list);  
14 -  
15 - this.dragItemList = $("#" + this.el).find(".dragItem"); 15 + this.dragItemList = $(this.el).find("li");
16 if(this.dragItemList.length < 1){ 16 if(this.dragItemList.length < 1){
17 return; 17 return;
18 } 18 }
19 19
  20 + var elHeight = 0;
  21 + $(this.el).css("position","relative");
  22 +
20 for(var i=0;i<this.dragItemList.length;i++){ 23 for(var i=0;i<this.dragItemList.length;i++){
21 var top = this.dragItemList[i].offsetTop; 24 var top = this.dragItemList[i].offsetTop;
22 var left = this.dragItemList[i].offsetLeft; 25 var left = this.dragItemList[i].offsetLeft;
@@ -24,7 +27,12 @@ dragging.prototype = { @@ -24,7 +27,12 @@ dragging.prototype = {
24 27
25 this.dragItemPos[i] = {left:left, top:top}; 28 this.dragItemPos[i] = {left:left, top:top};
26 this.dragItemList[i].index = i; 29 this.dragItemList[i].index = i;
  30 +
  31 + if(i == this.dragItemList.length - 1){
  32 + elHeight = top + $(this.dragItemList[i]).height() + 20;
  33 + }
27 } 34 }
  35 + $(this.el).css("height", elHeight + "px");
28 36
29 for(var i=0; i<this.dragItemList.length; i++){ 37 for(var i=0; i<this.dragItemList.length; i++){
30 $(this.dragItemList[i]).css("position", "absolute").css("margin", 0); 38 $(this.dragItemList[i]).css("position", "absolute").css("margin", 0);
@@ -82,6 +90,11 @@ dragging.prototype = { @@ -82,6 +90,11 @@ dragging.prototype = {
82 _self.move(oNear,_self.dragItemPos[obj.index]); 90 _self.move(oNear,_self.dragItemPos[obj.index]);
83 _self.move(obj,_self.dragItemPos[oNear.index]); 91 _self.move(obj,_self.dragItemPos[oNear.index]);
84 92
  93 + /*
  94 + $(oNear).css("top",_self.dragItemPos[obj.index].top+"px").css("left",_self.dragItemPos[obj.index].left+"px");
  95 + $(obj).css("top",_self.dragItemPos[oNear.index].top+"px").css("left",_self.dragItemPos[oNear.index].left+"px");
  96 + */
  97 +
85 //交换index 98 //交换index
86 oNear.index += obj.index; 99 oNear.index += obj.index;
87 obj.index = oNear.index - obj.index; 100 obj.index = oNear.index - obj.index;
@@ -191,3 +204,5 @@ dragging.prototype = { @@ -191,3 +204,5 @@ dragging.prototype = {
191 } 204 }
192 205
193 } 206 }
  207 +
  208 +module.exports = drag;
@@ -142,6 +142,13 @@ var Bll = { @@ -142,6 +142,13 @@ var Bll = {
142 }, 142 },
143 __render: function(selecter, templater, data) { 143 __render: function(selecter, templater, data) {
144 $(selecter).html(common.util.__template2($("#" + templater).html(), data)); 144 $(selecter).html(common.util.__template2($("#" + templater).html(), data));
  145 +
  146 + var contentDrag = new common.drag("#add-content", Bll.contentDatas, function(data){
  147 + console.log(data);
  148 + Bll.contentDatas = data;
  149 + Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
  150 + });
  151 + contentDrag.Initialize();
145 }, 152 },
146 Tags: [] 153 Tags: []
147 } 154 }
@@ -185,6 +192,8 @@ Bll.__render("#add-content","template_content",{modules:Bll.contentDatas}); @@ -185,6 +192,8 @@ Bll.__render("#add-content","template_content",{modules:Bll.contentDatas});
185 192
186 193
187 194
  195 +
  196 +
188 new common.dropDown({ 197 new common.dropDown({
189 el: "#authorId", 198 el: "#authorId",
190 ajax: "guangGetAuthorList" 199 ajax: "guangGetAuthorList"
@@ -371,7 +380,7 @@ $(document).on("click", ".del", function() { @@ -371,7 +380,7 @@ $(document).on("click", ".del", function() {
371 380
372 $(document).on("change", ".observe", function() { 381 $(document).on("change", ".observe", function() {
373 var $this = $(this); 382 var $this = $(this);
374 - var name = $this.data("field"); 383 + var name = $this.data("field");//a.b.2.d
375 Bll.module.contentData.data=common.util.__buildobj(name, '.', Bll.module.contentData.data, function(obj, name) { 384 Bll.module.contentData.data=common.util.__buildobj(name, '.', Bll.module.contentData.data, function(obj, name) {
376 obj[name] = $this.val(); 385 obj[name] = $this.val();
377 }); 386 });
@@ -641,3 +650,5 @@ $(document).on("click","#brandAutoBtn",function(){ @@ -641,3 +650,5 @@ $(document).on("click","#brandAutoBtn",function(){
641 },true); 650 },true);
642 } 651 }
643 }); 652 });
  653 +
  654 +
@@ -35,17 +35,17 @@ var Button=[ @@ -35,17 +35,17 @@ var Button=[
35 { 35 {
36 template_intro:"焦点图", 36 template_intro:"焦点图",
37 template_name:"focus", 37 template_name:"focus",
38 - dialog:"", 38 + dialog:"focus-template",
39 data:[ 39 data:[
40 { 40 {
41 "src": "", 41 "src": "",
42 "alt": "", 42 "alt": "",
43 "url": {}, 43 "url": {},
44 "bgColor": "", 44 "bgColor": "",
45 - "imgId": "" 45 + "imgId": "0"
46 } 46 }
47 ], 47 ],
48 - focus_type:"" 48 + focus_type:"1"
49 }, 49 },
50 { 50 {
51 template_intro:"添加商品", 51 template_intro:"添加商品",
@@ -228,7 +228,7 @@ var Button=[ @@ -228,7 +228,7 @@ var Button=[
228 { 228 {
229 "template_name": "singleNameImage", 229 "template_name": "singleNameImage",
230 "template_intro": "标题广告", 230 "template_intro": "标题广告",
231 - dialog:"", 231 + dialog:"singleNameImage-template",
232 "data": { 232 "data": {
233 "title": "", 233 "title": "",
234 "src": "", 234 "src": "",
@@ -401,7 +401,7 @@ var Button=[ @@ -401,7 +401,7 @@ var Button=[
401 }, 401 },
402 { 402 {
403 template_intro:"添加促销", 403 template_intro:"添加促销",
404 - dialog:"", 404 + dialog:"promotion-template",
405 template_name:"promotion", 405 template_name:"promotion",
406 data: { 406 data: {
407 "promotionId": "" 407 "promotionId": ""
@@ -413,7 +413,12 @@ var Button=[ @@ -413,7 +413,12 @@ var Button=[
413 dialog:"carouselBanner-template", 413 dialog:"carouselBanner-template",
414 "data": { 414 "data": {
415 "speed": "", 415 "speed": "",
416 - "list": [] 416 + "list": [
  417 + {
  418 + "src": "",
  419 + "url": {}
  420 + }
  421 + ]
417 } 422 }
418 }, 423 },
419 { 424 {
@@ -605,7 +610,92 @@ var Button=[ @@ -605,7 +610,92 @@ var Button=[
605 } 610 }
606 }, 611 },
607 "blocks": [], 612 "blocks": [],
608 - "list": [], 613 + "list": [
  614 + {
  615 + "url": {
  616 + "action": "",
  617 + "url": ""
  618 + },
  619 + "name": ""
  620 + },
  621 + {
  622 + "url": {
  623 + "action": "",
  624 + "url": ""
  625 + },
  626 + "name": ""
  627 + },
  628 + {
  629 + "url": {
  630 + "action": "",
  631 + "url": ""
  632 + },
  633 + "name": ""
  634 + },
  635 + {
  636 + "url": {
  637 + "action": "",
  638 + "url": ""
  639 + },
  640 + "name": ""
  641 + },
  642 + {
  643 + "url": {
  644 + "action": "",
  645 + "url": ""
  646 + },
  647 + "name": ""
  648 + },
  649 + {
  650 + "url": {
  651 + "action": "",
  652 + "url": ""
  653 + },
  654 + "name": ""
  655 + },
  656 + {
  657 + "url": {
  658 + "action": "",
  659 + "url": ""
  660 + },
  661 + "name": ""
  662 + },
  663 + {
  664 + "url": {
  665 + "action": "",
  666 + "url": ""
  667 + },
  668 + "name": ""
  669 + },
  670 + {
  671 + "url": {
  672 + "action": "",
  673 + "url": ""
  674 + },
  675 + "name": ""
  676 + },
  677 + {
  678 + "url": {
  679 + "action": "",
  680 + "url": ""
  681 + },
  682 + "name": ""
  683 + },
  684 + {
  685 + "url": {
  686 + "action": "",
  687 + "url": ""
  688 + },
  689 + "name": ""
  690 + },
  691 + {
  692 + "url": {
  693 + "action": "",
  694 + "url": ""
  695 + },
  696 + "name": ""
  697 + }
  698 + ],
609 "imgs": [] 699 "imgs": []
610 } 700 }
611 }, 701 },
@@ -804,6 +894,27 @@ var Button=[ @@ -804,6 +894,27 @@ var Button=[
804 ] 894 ]
805 } 895 }
806 }, 896 },
  897 + {
  898 + "template_name": "getCoupon",
  899 + "template_intro": "领券频道",
  900 + dialog:"getCoupon-template",
  901 + "data": {
  902 + "title":"",
  903 + "isShow":"YES",
  904 + "image":{
  905 + "src": "",
  906 + "url": {
  907 + "action": "",
  908 + "url": ""
  909 + }
  910 + },
  911 + "couponID":"",
  912 + "goShopping":{
  913 + "action": "",
  914 + "url": ""
  915 + }
  916 + }
  917 + }
807 ]; 918 ];
808 919
809 module.exports = Button; 920 module.exports = Button;
@@ -195,8 +195,7 @@ $(document).on("click", '#icon-delOne', function() { @@ -195,8 +195,7 @@ $(document).on("click", '#icon-delOne', function() {
195 }); 195 });
196 /*自定义参数*/ 196 /*自定义参数*/
197 $(document).on("click", '.paramsGroupDel', function() { 197 $(document).on("click", '.paramsGroupDel', function() {
198 - console.log($(this).data("index"));  
199 - Bll.module.contentData.data.list.splice($(this).data("index")); 198 + Bll.module.contentData.data.list.splice($(this).data("index"),1);
200 Bll.renderDialog("paramsGroup-template"); 199 Bll.renderDialog("paramsGroup-template");
201 }); 200 });
202 $(document).on("click", '#paramsGroup-addOne', function() { 201 $(document).on("click", '#paramsGroup-addOne', function() {
@@ -222,6 +221,171 @@ $(document).on("click", '#newUserFloor-addBanner', function() { @@ -222,6 +221,171 @@ $(document).on("click", '#newUserFloor-addBanner', function() {
222 ); 221 );
223 Bll.renderDialog("newUserFloor-template"); 222 Bll.renderDialog("newUserFloor-template");
224 }); 223 });
  224 +/*有序焦点添加*/
  225 +$(document).on("click", '#debrisSlider-addLeft', function() {
  226 + Bll.module.contentData.data.left.push(
  227 + {
  228 + "src": "",
  229 + "url": {
  230 + "action": "",
  231 + "url": ""
  232 + },
  233 + "title": ""
  234 + }
  235 + );
  236 + Bll.renderDialog("debrisSlider-template");
  237 +});
  238 +$(document).on("click", '#debrisSlider-addCenter', function() {
  239 + Bll.module.contentData.data.big_image.push(
  240 + {
  241 + "src": "",
  242 + "url": {
  243 + "action": "",
  244 + "url": ""
  245 + },
  246 + "title": ""
  247 + }
  248 + );
  249 + Bll.renderDialog("debrisSlider-template");
  250 +});
  251 +$(document).on("click", '#debrisSlider-addRight', function() {
  252 + Bll.module.contentData.data.right.push(
  253 + {
  254 + "src": "",
  255 + "url": {
  256 + "action": "",
  257 + "url": ""
  258 + },
  259 + "title": ""
  260 + }
  261 + );
  262 + Bll.renderDialog("debrisSlider-template");
  263 +});
  264 +//*****************************************************************//
  265 +/*热门品类*/
  266 +$(document).on("click", '#hotCategory-addLeft', function() {
  267 + Bll.module.contentData.data.blocks.push(
  268 + {
  269 + "src": "",
  270 + "url": {
  271 + "action": "",
  272 + "url": ""
  273 + },
  274 + "title": ""
  275 + }
  276 + );
  277 + Bll.renderDialog("hotCategory-template");
  278 +});
  279 +$(document).on("click", '#hotCategory-addRight', function() {
  280 + Bll.module.contentData.data.imgs.push(
  281 + {
  282 + "src": "",
  283 + "url": {
  284 + "action": "",
  285 + "url": ""
  286 + },
  287 + "title": ""
  288 + }
  289 + );
  290 + Bll.renderDialog("hotCategory-template");
  291 +});
  292 +$(document).on("click", '.hotCategory-delLeft', function() {
  293 + Bll.module.contentData.data.blocks.splice($(this).data("index"),1);
  294 + Bll.renderDialog("hotCategory-template");
  295 +});
  296 +$(document).on("click", '.hotCategory-delRight', function() {
  297 + Bll.module.contentData.data.imgs.splice($(this).data("index"),1);
  298 + Bll.renderDialog("hotCategory-template");
  299 +});
  300 +//*****************************************************************//
  301 +/*图片列表*/
  302 +$(document).on("click", '#imageList-addOne', function() {
  303 + Bll.module.contentData.data.list.push(
  304 + {
  305 + "src": "",
  306 + "url": {
  307 + "action": "",
  308 + "url": ""
  309 + },
  310 + "title": ""
  311 + }
  312 + );
  313 + Bll.renderDialog("imageList-template");
  314 +});
  315 +$(document).on("click", '.imageList-del', function() {
  316 + Bll.module.contentData.data.list.splice($(this).data("index"),1);
  317 + Bll.renderDialog("imageList-template");
  318 +});
  319 +$(document).on("checked", '#imageList_Y', function() {
  320 + Bll.module.contentData.data.title.is_show_name = "Y";
  321 + Bll.renderDialog("imageList-template");
  322 +});
  323 +$(document).on("checked", '#imageList_N', function() {
  324 + Bll.module.contentData.data.title.is_show_name = "N";
  325 + Bll.renderDialog("imageList-template");
  326 +});
  327 +//*****************************************************************//
  328 +/*文本导航*/
  329 +$(document).on("click", '#textNav-addOne', function() {
  330 + Bll.module.contentData.data.push(
  331 + {
  332 + "name": "",
  333 + "url": {
  334 + "action": "",
  335 + "url": ""
  336 + }
  337 + }
  338 + );
  339 + Bll.renderDialog("textNav-template");
  340 +});
  341 +$(document).on("click", '.textNav-delOne', function() {
  342 + Bll.module.contentData.data.splice($(this).data("index"), 1);
  343 + Bll.renderDialog("textNav-template");
  344 +});
  345 +//*****************************************************************//
  346 +/*推荐(标题 + 12张图)*/
  347 +$(document).on("change", '#recommendContentFive-is_show', function() {
  348 + Bll.module.contentData.data.title.is_show = 1-Bll.module.contentData.data.title.is_show;
  349 + Bll.renderDialog("recommendContent-template");
  350 +});
  351 +//*****************************************************************//
  352 +/*焦点图*/
  353 +$(document).on("click", '#focus-addOne', function() {
  354 + Bll.module.contentData.data.push(
  355 + {
  356 + "src": "",
  357 + "alt": "",
  358 + "url": {},
  359 + "bgColor": "",
  360 + "imgId": "0"
  361 + }
  362 + );
  363 + Bll.renderDialog("focus-template");
  364 +});
  365 +$(document).on("click", '.focus-del', function() {
  366 + Bll.module.contentData.data.splice($(this).data("index"), 1);
  367 + Bll.renderDialog("focus-template");
  368 +});
  369 +$(document).on("change", '#focus-select', function() {
  370 + Bll.module.contentData.focus_type = $(this).val();
  371 + Bll.renderDialog("focus-template");
  372 +});
  373 +//*****************************************************************//
  374 +/*轮播banner*/
  375 +$(document).on("click", '#carouselBanner-addOne', function() {
  376 + Bll.module.contentData.data.list.push(
  377 + {
  378 + "src": "",
  379 + "url": {}
  380 + }
  381 + );
  382 + Bll.renderDialog("carouselBanner-template");
  383 +});
  384 +$(document).on("click", '.carouselBanner-del', function() {
  385 + Bll.module.contentData.data.list.splice($(this).data("index"), 1);
  386 + Bll.renderDialog("carouselBanner-template");
  387 +});
  388 +//*****************************************************************//
225 389
226 $(document).on("click", "#sub_btn", function() { 390 $(document).on("click", "#sub_btn", function() {
227 var data = { 391 var data = {
@@ -266,13 +266,14 @@ @@ -266,13 +266,14 @@
266 [[each btns as btn index]] 266 [[each btns as btn index]]
267 <li><a href="javascript:void(0)" name="text" class="add_btn" data-index="[[index]]">[[btn.template_intro]]</a></li> 267 <li><a href="javascript:void(0)" name="text" class="add_btn" data-index="[[index]]">[[btn.template_intro]]</a></li>
268 [[/each]] 268 [[/each]]
  269 +<div class="clearfix"></div>
269 </script> 270 </script>
270 271
271 272
272 <script type="text/template" id="template_content"> 273 <script type="text/template" id="template_content">
273 <!-- 文本内容 --> 274 <!-- 文本内容 -->
274 [[each modules as module index]] 275 [[each modules as module index]]
275 - <li class="form-group custom-group" data-index="[[index]]"> 276 + <li class="form-group custom-group" data-index="[[index]]" style="width: 100%">
276 [[if module.contentData.template_name=='text']] 277 [[if module.contentData.template_name=='text']]
277 <div class="col-sm-12"><h3>[[module.contentData.data.text]]</h3></div> 278 <div class="col-sm-12"><h3>[[module.contentData.data.text]]</h3></div>
278 [[else if module.contentData.template_name=='singleImage']] 279 [[else if module.contentData.template_name=='singleImage']]
  1 +<!--领券楼层-->
  2 +
1 <!-- 标题图片 --> 3 <!-- 标题图片 -->
2 <script type="text/template" id="titleImage-template"> 4 <script type="text/template" id="titleImage-template">
3 <div class="panel-body" id="titleImage-baseFrom"> 5 <div class="panel-body" id="titleImage-baseFrom">
@@ -215,7 +217,8 @@ @@ -215,7 +217,8 @@
215 <input type="text" class="form-control observe" value="[[contentData.data.title.title]]" required="required" data-field="title.title"> 217 <input type="text" class="form-control observe" value="[[contentData.data.title.title]]" required="required" data-field="title.title">
216 </div> 218 </div>
217 <label class="col-sm-4 control-label">是否显示 219 <label class="col-sm-4 control-label">是否显示
218 - <input type="checkbox" value="[[contentData.data.title.is_show]]" checked="[[contentData.data.title.is_show?'checked':'']]" class="observe" data-field="title.is_show"> 220 + <input type="checkbox" name="is_show" value="1" id="recommendContentFive-is_show">
  221 + <input type="hidden" id="is_show" for="checkbox" value="[[contentData.data.title.is_show]]" />
219 </label> 222 </label>
220 </div> 223 </div>
221 [[/if]] 224 [[/if]]
@@ -250,7 +253,11 @@ @@ -250,7 +253,11 @@
250 [[/if]] 253 [[/if]]
251 [[each contentData.data.list as item index]] 254 [[each contentData.data.list as item index]]
252 <tr> 255 <tr>
  256 + [[if contentData.data.big_image]]
253 <td>[[index+2]]</td> 257 <td>[[index+2]]</td>
  258 + [[else]]
  259 + <td>[[index+1]]</td>
  260 + [[/if]]
254 <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src"/></td> 261 <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src"/></td>
255 <td> 262 <td>
256 <div class="col-sm-12"> 263 <div class="col-sm-12">
@@ -419,7 +426,7 @@ @@ -419,7 +426,7 @@
419 <script type="text/template" id="debrisSlider-template"> 426 <script type="text/template" id="debrisSlider-template">
420 <div class="panel-body" id="debrisSlider-baseFrom"> 427 <div class="panel-body" id="debrisSlider-baseFrom">
421 <div class="debris_slider"> 428 <div class="debris_slider">
422 - <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加左图" style="margin:10px;" id="select-left-pic"></p> 429 + <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加左图" style="margin:10px;" id="debrisSlider-addLeft"></p>
423 <table class="table table-hover table-bordered responsive dataTable no-footer"> 430 <table class="table table-hover table-bordered responsive dataTable no-footer">
424 <thead> 431 <thead>
425 <tr> 432 <tr>
@@ -435,57 +442,53 @@ @@ -435,57 +442,53 @@
435 <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="left.[[index]].src"/></td> 442 <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="left.[[index]].src"/></td>
436 <td> 443 <td>
437 <div class="col-sm-12"> 444 <div class="col-sm-12">
438 - <select name="goTo" class="observe" value="[[url.action]]" data-field="left.[[index]].action"> 445 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="left.[[index]].url.action">
439 [[layout action_template]] 446 [[layout action_template]]
440 </select> 447 </select>
441 </div> 448 </div>
442 <div class="col-sm-12"> 449 <div class="col-sm-12">
443 - <input value="[[item.url.url]]" class="observe" required="required" data-field="left.[[index]].url.url"/> 450 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="left.[[index]].url.url"/>
444 </div> 451 </div>
445 <div class="col-sm-12"> 452 <div class="col-sm-12">
446 - <input placeholder="图片描述" value="[[item.title]]" class="observe" required="required" data-field="left.[[index]].title"/> 453 + <input placeholder="图片描述" value="[[item.title]]" class="observe form-control" required="required" data-field="left.[[index]].title"/>
447 </div> 454 </div>
448 </td> 455 </td>
449 </tr> 456 </tr>
450 [[/each]] 457 [[/each]]
451 </tbody> 458 </tbody>
452 </table> 459 </table>
453 - <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加中间图" style="margin:10px;" id="select-big-pic"></p>  
454 - <div class="image-info">  
455 - <ul class="sortable" style="width:100%;">  
456 - <table class="table table-hover table-bordered responsive dataTable no-footer">  
457 - <thead>  
458 - <tr>  
459 - <th>序号</th>  
460 - <th>资源位</th>  
461 - <th>选项</th>  
462 - </tr>  
463 - </thead>  
464 - <tbody>  
465 - [[each contentData.data.big_image as item index]]  
466 - <tr>  
467 - <td>[[index+1]]</td>  
468 - <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="big_image.[[index]].src"/></td>  
469 - <td>  
470 - <div class="col-sm-12">  
471 - <select name="goTo" class="observe" value="[[url.action]]" data-field="big_image.[[index]].action">  
472 - [[layout action_template]]  
473 - </select>  
474 - </div>  
475 - <div class="col-sm-12">  
476 - <input value="[[item.url.url]]" class="observe" required="required" data-field="big_image.[[index]].url.url"/>  
477 - </div>  
478 - <div class="col-sm-12">  
479 - <input placeholder="图片描述" value="[[item.title]]" class="observe" required="required" data-field="big_image.[[index]].title"/>  
480 - </div>  
481 - </td>  
482 - </tr>  
483 - [[/each]]  
484 - </tbody>  
485 - </table>  
486 - </ul>  
487 - </div>  
488 - <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加右图" style="margin:10px;" id="select-right-pic"></p> 460 + <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加中间图" style="margin:10px;" id="debrisSlider-addCenter"></p>
  461 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  462 + <thead>
  463 + <tr>
  464 + <th>序号</th>
  465 + <th>资源位</th>
  466 + <th>选项</th>
  467 + </tr>
  468 + </thead>
  469 + <tbody>
  470 + [[each contentData.data.big_image as item index]]
  471 + <tr>
  472 + <td>[[index+1]]</td>
  473 + <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="big_image.[[index]].src"/></td>
  474 + <td>
  475 + <div class="col-sm-12">
  476 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="big_image.[[index]].url.action">
  477 + [[layout action_template]]
  478 + </select>
  479 + </div>
  480 + <div class="col-sm-12">
  481 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="big_image.[[index]].url.url"/>
  482 + </div>
  483 + <div class="col-sm-12">
  484 + <input placeholder="图片描述" value="[[item.title]]" class="observe form-control" required="required" data-field="big_image.[[index]].title"/>
  485 + </div>
  486 + </td>
  487 + </tr>
  488 + [[/each]]
  489 + </tbody>
  490 + </table>
  491 + <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加右图" style="margin:10px;" id="debrisSlider-addRight"></p>
489 <table class="table table-hover table-bordered responsive dataTable no-footer"> 492 <table class="table table-hover table-bordered responsive dataTable no-footer">
490 <thead> 493 <thead>
491 <tr> 494 <tr>
@@ -501,15 +504,15 @@ @@ -501,15 +504,15 @@
501 <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="right.[[index]].src"/></td> 504 <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="right.[[index]].src"/></td>
502 <td> 505 <td>
503 <div class="col-sm-12"> 506 <div class="col-sm-12">
504 - <select name="goTo" class="observe" value="[[url.action]]" data-field="right.[[index]].action"> 507 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="right.[[index]].url.action">
505 [[layout action_template]] 508 [[layout action_template]]
506 </select> 509 </select>
507 </div> 510 </div>
508 <div class="col-sm-12"> 511 <div class="col-sm-12">
509 - <input value="[[item.url.url]]" class="observe" required="required" data-field="right.[[index]].url.url"/> 512 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="right.[[index]].url.url"/>
510 </div> 513 </div>
511 <div class="col-sm-12"> 514 <div class="col-sm-12">
512 - <input placeholder="图片描述" value="[[item.title]]" class="observe" required="required" data-field="right.[[index]].title"/> 515 + <input placeholder="图片描述" value="[[item.title]]" class="observe form-control" required="required" data-field="right.[[index]].title"/>
513 </div> 516 </div>
514 </td> 517 </td>
515 </tr> 518 </tr>
@@ -519,6 +522,264 @@ @@ -519,6 +522,264 @@
519 </div> 522 </div>
520 </div> 523 </div>
521 </script> 524 </script>
  525 +<!--热门品类-->
  526 +<script type="text/template" id="hotCategory-template">
  527 + <div class="hotCategory">
  528 + <p>
  529 + 标题 : <input type="text" class="observe" data-field="title.name" value="[[contentData.data.title.name]]" required> 更多名称 : <input type="text" class="observe" data-field="title.more_name" value="[[contentData.data.title.more_name]]" style="width:50px;"><br>
  530 + 跳转目的 : <select name="goTo" class="observe" value="[[contentData.data.title.more_url.action]]" data-field="title.more_url.action">
  531 + [[layout action_template]]
  532 + </select>
  533 + 跳转url : <input value="[[contentData.data.title.more_url.url]]" class="observe" required="required" data-field="title.more_url.url"/>
  534 + </p>
  535 + <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加左上图片" style="margin:10px;" id="hotCategory-addLeft"></p>
  536 + [[if contentData.data.blocks.length]]
  537 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  538 + <thead>
  539 + <tr>
  540 + <th>序号</th>
  541 + <th>资源位</th>
  542 + <th>选项</th>
  543 + <th>操作</th>
  544 + </tr>
  545 + </thead>
  546 + <tbody>
  547 + [[each contentData.data.blocks as item index]]
  548 + <tr>
  549 + <td>[[index+1]]</td>
  550 + <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="blocks.[[index]].src"/></td>
  551 + <td>
  552 + <div class="col-sm-12">
  553 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="blocks.[[index]].url.action">
  554 + [[layout action_template]]
  555 + </select>
  556 + </div>
  557 + <div class="col-sm-12">
  558 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="blocks.[[index]].url.url"/>
  559 + </div>
  560 + <div class="col-sm-12">
  561 + <input placeholder="图片描述" value="[[item.title]]" class="observe form-control" required="required" data-field="blocks.[[index]].title"/>
  562 + </div>
  563 + </td>
  564 + <td><button class="btn btn-danger btn-sm hotCategory-delLeft" type="button" data-index="[[index]]">删除</button></td>
  565 + </tr>
  566 + [[/each]]
  567 + </tbody>
  568 + </table>
  569 + [[/if]]
  570 + <p>添加左下导航:</p>
  571 + [[each contentData.data.list as item index]]
  572 + <p>
  573 + 导航名称:<input type="text" class="observe" value="[[item.name]]" data-field="list.[[index]].name">
  574 + <select name="goTo" class="observe" value="[[item.url.action]]" data-field="list.[[index]].url.action">
  575 + [[layout action_template]]
  576 + </select>
  577 + <input value="[[item.url.url]]" class="observe" required="required" data-field="list.[[index]].url.url"/>
  578 + </p>
  579 + [[/each]]
  580 + <p>
  581 + <input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加右侧图片" style="margin:10px;" id="hotCategory-addRight">
  582 + </p>
  583 + [[if contentData.data.imgs.length]]
  584 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  585 + <thead>
  586 + <tr>
  587 + <th>序号</th>
  588 + <th>资源位</th>
  589 + <th>选项</th>
  590 + <th>操作</th>
  591 + </tr>
  592 + </thead>
  593 + <tbody>
  594 + [[each contentData.data.imgs as item index]]
  595 + <tr>
  596 + <td>[[index+1]]</td>
  597 + <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="imgs.[[index]].src"/></td>
  598 + <td>
  599 + <div class="col-sm-12">
  600 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="imgs.[[index]].url.action">
  601 + [[layout action_template]]
  602 + </select>
  603 + </div>
  604 + <div class="col-sm-12">
  605 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="imgs.[[index]].url.url"/>
  606 + </div>
  607 + <div class="col-sm-12">
  608 + <input placeholder="图片描述" value="[[item.title]]" class="observe form-control" required="required" data-field="imgs.[[index]].title"/>
  609 + </div>
  610 + </td>
  611 + <td><button class="btn btn-danger btn-sm hotCategory-delRight" type="button" data-index="[[index]]">删除</button></td>
  612 + </tr>
  613 + [[/each]]
  614 + </tbody>
  615 + </table>
  616 + [[/if]]
  617 + </div>
  618 +</script>
  619 +<!--图片列表-->
  620 +<script type="text/template" id="imageList-template">
  621 + <p>
  622 + 标题:<input type="text" class="observe" data-field="title.title" value="[[contentData.data.title.title]]" style="width:100px;">
  623 + 显示名称: <input type="radio" name="is_show_name" id="imageList_Y" value="Y"> <input type="radio" name="is_show_name" id="imageList_N" value="N"> &nbsp;&nbsp;&nbsp;&nbsp;
  624 + <input type="hidden" id="is_show_name" for="radio" value="[[contentData.data.title.is_show_name]]" />
  625 + 每行显示:<input style="width:60px;" type="number" data-field="title.column_num" class="observe" value="[[contentData.data.title.column_num]]"> 张图片
  626 + </p>
  627 + <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加图片" style="margin:10px;" id="imageList-addOne"></p>
  628 + [[if contentData.data.list.length]]
  629 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  630 + <thead>
  631 + <tr>
  632 + <th>序号</th>
  633 + <th>资源位</th>
  634 + <th>选项</th>
  635 + <th>操作</th>
  636 + </tr>
  637 + </thead>
  638 + <tbody>
  639 + [[each contentData.data.list as item index]]
  640 + <tr>
  641 + <td>[[index+1]]</td>
  642 + <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src"/></td>
  643 + <td>
  644 + <div class="col-sm-12">
  645 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="list.[[index]].url.action">
  646 + [[layout action_template]]
  647 + </select>
  648 + </div>
  649 + <div class="col-sm-12">
  650 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="list.[[index]].url.url"/>
  651 + </div>
  652 + <div class="col-sm-12">
  653 + <input placeholder="图片描述" value="[[item.title]]" class="observe form-control" required="required" data-field="list.[[index]].title"/>
  654 + </div>
  655 + </td>
  656 + <td><button class="btn btn-danger btn-sm imageList-del" type="button" data-index="[[index]]">删除</button></td>
  657 + </tr>
  658 + [[/each]]
  659 + </tbody>
  660 + </table>
  661 + [[/if]]
  662 +</script>
  663 +<!--文本导航-->
  664 +<script type="text/template" id="textNav-template">
  665 + <div class="textNav-baseForm">
  666 + <p><input type="button" name="select-pic" class="btn btn-info btn-xs" value="添加一个" style="margin:10px;" id="textNav-addOne"></p>
  667 + [[each contentData.data as item index]]
  668 + <p>
  669 + 导航名称:<input type="text" value="[[item.name]]" class="observe" data-field="[[index]].name" required>
  670 + <select name="goTo" class="observe" value="[[item.url.action]]" data-field="[[index]].url.action">
  671 + [[layout action_template]]
  672 + </select>
  673 + <input value="[[item.url.url]]" data-field="[[index]].url.url" class="observe" required="required"/>
  674 + <a type="button" class="btn btn-danger btn-xs textNav-delOne" data-index="[[index]]">删除</a>
  675 + </p>
  676 + [[/each]]
  677 + </div>
  678 +</script>
  679 +<!--轮播banner-->
  680 +<script type="text/template" id="carouselBanner-template">
  681 + <input type="button" name="select-pic" value="添加图片" class="btn btn-info btn-xs" style="margin:10px;" id="carouselBanner-addOne">
  682 +   轮播速度:<input type="text" class="observe" data-field="speed" value="[[contentData.data.speed]]"><br>
  683 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  684 + <thead>
  685 + <tr>
  686 + <th>序号</th>
  687 + <th>资源位</th>
  688 + <th>操作</th>
  689 + </tr>
  690 + </thead>
  691 + <tbody>
  692 + [[each contentData.data.list as item index]]
  693 + <tr>
  694 + <td>[[index+1]]</td>
  695 + <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="list.[[index]].src"/></td>
  696 + <td><button class="btn btn-danger btn-sm carouselBanner-del" type="button" data-index="[[index]]">删除</button></td>
  697 + </tr>
  698 + [[/each]]
  699 + </tbody>
  700 + </table>
  701 +</script>
  702 +<!--添加促销-->
  703 +<script type="text/template" id="promotion-template">
  704 + <p> 添加促销id<input type="text" class="observe" value="[[contentData.data.promotionId]]" data-field="promotionId"></p>
  705 +</script>
  706 +<!--标题广告-->
  707 +<script type="text/template" id="singleNameImage-template">
  708 + <p style="margin:10px;">添加标题: <input type="text" class="observe" value="[[contentData.data.title]]" data-field="title"></p>
  709 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  710 + <thead>
  711 + <tr>
  712 + <th>序号</th>
  713 + <th>资源位</th>
  714 + <th>选项</th>
  715 + </tr>
  716 + </thead>
  717 + <tbody>
  718 + <tr>
  719 + <td>1</td>
  720 + <td><input type="file" name="file" value="[[contentData.data.src]]" class="observe" data-field="src" required/></td>
  721 + <td>
  722 + <div class="col-sm-12">
  723 + <select name="goTo" class="observe form-control" value="[[contentData.data.url.action]]" data-field="url.action">
  724 + [[layout action_template]]
  725 + </select>
  726 + </div>
  727 + <div class="col-sm-12">
  728 + <input placeholder="url" value="[[contentData.data.url.url]]" class="observe form-control" required="required" data-field="url.url"/>
  729 + </div>
  730 + <div class="col-sm-12">
  731 + <input placeholder="图片描述" value="[[contentData.data.alt]]" class="observe form-control" data-field="alt"/>
  732 + </div>
  733 + </td>
  734 + </tr>
  735 + </tbody>
  736 + </table>
  737 +</script>
  738 +<!--焦点图-->
  739 +<script type="text/template" id="focus-template">
  740 + <input type="button" class="btn btn-info btn-xs" id="focus-addOne" value="添加图片" style="margin:10px;"><br>
  741 + 焦点图类型:&nbsp;&nbsp;
  742 + <select id="focus-select" value="[[contentData.focus_type]]">
  743 + <option value="1">通栏</option>
  744 + <option value="2">左右滑动</option>
  745 + <option value="3">手风琴</option>
  746 + </select>
  747 + <table class="table table-hover table-bordered responsive dataTable no-footer">
  748 + <thead>
  749 + <tr>
  750 + <th>序号</th>
  751 + <th>资源位</th>
  752 + <th>选项</th>
  753 + <th>操作</th>
  754 + </tr>
  755 + </thead>
  756 + <tbody>
  757 + [[each contentData.data as item index]]
  758 + <tr>
  759 + <td>[[index+1]]</td>
  760 + <td><input type="file" name="file" value="[[item.src]]" class="observe" data-field="[[index]].src" required/></td>
  761 + <td>
  762 + <div class="col-sm-12">
  763 + <select name="goTo" class="observe form-control" value="[[item.url.action]]" data-field="[[index]].url.action">
  764 + [[layout action_template]]
  765 + </select>
  766 + </div>
  767 + <div class="col-sm-12">
  768 + <input placeholder="url" value="[[item.url.url]]" class="observe form-control" required="required" data-field="[[index]].url.url"/>
  769 + </div>
  770 + <div class="col-sm-12">
  771 + <input placeholder="图片描述" value="[[item.alt]]" class="observe form-control" data-field="[[index]].alt"/>
  772 + </div>
  773 + <div class="col-sm-12">
  774 + <input placeholder="通栏背景色" value="[[item.bgColor]]" class="observe form-control" data-field="[[index]].bgColor"/>
  775 + </div>
  776 + </td>
  777 + <td><button class="btn btn-danger btn-sm focus-del" type="button" data-index="[[index]]">删除</button></td>
  778 + </tr>
  779 + [[/each]]
  780 + </tbody>
  781 + </table>
  782 +</script>
522 <!--select选项--> 783 <!--select选项-->
523 <script type="text/template" id="action_template"> 784 <script type="text/template" id="action_template">
524 <option value="">选择跳转目标</option> 785 <option value="">选择跳转目标</option>
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <img src="/js/source/plugins/trendgoodsTopic/trend.png" width="96%"> 77 <img src="/js/source/plugins/trendgoodsTopic/trend.png" width="96%">
78 </div> 78 </div>
79 </div> 79 </div>
80 -[[else if module.contentData.template_name=='customBrands']] 80 +[[else if module.contentData.template_name=='appHotBrands']]
81 <div class="custom-pic"> 81 <div class="custom-pic">
82 <div class="hot-brand-title">[[module.contentData.data.title]]</div> 82 <div class="hot-brand-title">[[module.contentData.data.title]]</div>
83 <ul class="custom-pic clearfix"> 83 <ul class="custom-pic clearfix">
@@ -141,7 +141,7 @@ @@ -141,7 +141,7 @@
141 [[else if module.contentData.template_name=='imageList']] 141 [[else if module.contentData.template_name=='imageList']]
142 <div class="custom-pic"> 142 <div class="custom-pic">
143 <div class="hot-brand-title" style="margin:0px auto; text-align:center;">[[module.contentData.data.title.title]]</div> 143 <div class="hot-brand-title" style="margin:0px auto; text-align:center;">[[module.contentData.data.title.title]]</div>
144 - <ul class="custom-pic clearfix image-list-box resource-row li[[12/module.contentData.data.title.column_num]]"> 144 + <ul class="custom-pic clearfix image-list-box resource-row li[[module.contentData.data.title.column_num]]">
145 [[each module.contentData.data.list as item index]] 145 [[each module.contentData.data.list as item index]]
146 <li><img src="[[item.src]]"></li> 146 <li><img src="[[item.src]]"></li>
147 [[/each]] 147 [[/each]]
@@ -231,7 +231,7 @@ @@ -231,7 +231,7 @@
231 </div> 231 </div>
232 <div class='row'> 232 <div class='row'>
233 [[each module.contentData.data.list as item index]] 233 [[each module.contentData.data.list as item index]]
234 - <div class='col-sm-6 matchImage'><img src="[[item.src]]"></div> 234 + <div class='col-sm-4 matchImage'><img src="[[item.src]]"></div>
235 [[/each]] 235 [[/each]]
236 </div> 236 </div>
237 </div> 237 </div>