Authored by 杨延青

Merge branch 'feature/200315' into 'test6.9.22'

猜你喜欢



See merge request !10
@@ -662,7 +662,7 @@ @@ -662,7 +662,7 @@
662 [[if contentData.data.length]] 662 [[if contentData.data.length]]
663 <ul class="draggable" data-array="data"> 663 <ul class="draggable" data-array="data">
664 [[each contentData.data as item index]] 664 [[each contentData.data as item index]]
665 - <li> 665 + <li class="change-toggle-root">
666 <table class="table table-hover table-bordered responsive dataTable no-footer"> 666 <table class="table table-hover table-bordered responsive dataTable no-footer">
667 <tbody> 667 <tbody>
668 <tr> 668 <tr>
@@ -704,6 +704,53 @@ @@ -704,6 +704,53 @@
704 704
705 <div class="form-group"> 705 <div class="form-group">
706 <div class="col-sm-10"> 706 <div class="col-sm-10">
  707 + <label>类型</label>
  708 + <select class="form-control input-form observe change-toggle-show" value="[[item.type]]" data-field="[[index]].type" data-toggle="rankList::rank-list-data">
  709 + <option value="">默认</option>
  710 + <option value="rankList">排行榜</option>
  711 + </select>
  712 + </div>
  713 + </div>
  714 +
  715 + <div class="rank-list-data" style="display: [[item.type ? 'block' : 'none']];">
  716 + <div class="form-group">
  717 + <div class="col-sm-10">
  718 + <label>排版</label>
  719 + <select class="form-control input-form observe" value="[[item.rankType || '2']]" data-field="[[index]].rankType">
  720 + <option value="1">一行一个</option>
  721 + <option value="2">一行两个</option>
  722 + </select>
  723 + </div>
  724 + </div>
  725 +
  726 + <div class="form-group">
  727 + <div class="col-sm-10">
  728 + <label>推荐商品</label>
  729 + <input class="form-control observe" value="[[item.rankRecommendProduct || '']]"
  730 + data-field='[[index]].rankRecommendProduct'/>
  731 + </div>
  732 + </div>
  733 +
  734 + <div class="form-group">
  735 + <div class="col-sm-10">
  736 + <label>推荐逻辑</label>
  737 + <input class="form-control observe" value="[[item.rankRecommendParam || '']]"
  738 + data-field='[[index]].rankRecommendParam'/>
  739 + </div>
  740 + </div>
  741 +
  742 +
  743 + <div class="form-group">
  744 + <div class="col-sm-10">
  745 + <label>背景图</label>
  746 + <input type="file" name="file" value="[[item.backgroundImage]]"
  747 + data-field="[[index]].backgroundImage" data-index="[[index]]" />
  748 + </div>
  749 + </div>
  750 + </div>
  751 +
  752 + <div class="form-group">
  753 + <div class="col-sm-10">
707 <label>资源码</label> 754 <label>资源码</label>
708 <input class="form-control observe" value="[[item.resources_code?item.resources_code:'']]" placeholder="资源码" 755 <input class="form-control observe" value="[[item.resources_code?item.resources_code:'']]" placeholder="资源码"
709 data-field='[[index]].resources_code'/> 756 data-field='[[index]].resources_code'/>
@@ -741,6 +741,25 @@ $(document).on("change", ".observe2", function () { @@ -741,6 +741,25 @@ $(document).on("change", ".observe2", function () {
741 }); 741 });
742 }); 742 });
743 743
  744 +$(document).on("change", ".change-toggle-show", function () {
  745 + var $this = $(this);
  746 + var changeValue = $this.val();
  747 + var $toggleRoot = $this.closest('.change-toggle-root');
  748 + var toggle = $this.data('toggle') || '';
  749 + var toggleClass;
  750 +
  751 + toggle = toggle.split('|');
  752 + toggle.forEach(function(val) {
  753 + var list = val.split('::');
  754 +
  755 + if (changeValue && list[0] === changeValue) {
  756 + $toggleRoot.find('.' + list[1]).show();
  757 + } else {
  758 + $toggleRoot.find('.' + list[1]).hide();
  759 + }
  760 + });
  761 +});
  762 +
744 /** 763 /**
745 * 绑定监听,输入数据必须是key1=value2&key2=value2的数据 764 * 绑定监听,输入数据必须是key1=value2&key2=value2的数据
746 */ 765 */