Authored by yyq

猜你喜欢

... ... @@ -662,7 +662,7 @@
[[if contentData.data.length]]
<ul class="draggable" data-array="data">
[[each contentData.data as item index]]
<li>
<li class="change-toggle-root">
<table class="table table-hover table-bordered responsive dataTable no-footer">
<tbody>
<tr>
... ... @@ -704,6 +704,53 @@
<div class="form-group">
<div class="col-sm-10">
<label>类型</label>
<select class="form-control input-form observe change-toggle-show" value="[[item.type]]" data-field="[[index]].type" data-toggle="rankList::rank-list-data">
<option value="">默认</option>
<option value="rankList">排行榜</option>
</select>
</div>
</div>
<div class="rank-list-data" style="display: [[item.type ? 'block' : 'none']];">
<div class="form-group">
<div class="col-sm-10">
<label>排版</label>
<select class="form-control input-form observe" value="[[item.rankType || '2']]" data-field="[[index]].rankType">
<option value="1">一行一个</option>
<option value="2">一行两个</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<label>推荐商品</label>
<input class="form-control observe" value="[[item.rankRecommendProduct || '']]"
data-field='[[index]].rankRecommendProduct'/>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<label>推荐逻辑</label>
<input class="form-control observe" value="[[item.rankRecommendParam || '']]"
data-field='[[index]].rankRecommendParam'/>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<label>背景图</label>
<input type="file" name="file" value="[[item.backgroundImage]]"
data-field="[[index]].backgroundImage" data-index="[[index]]" />
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<label>资源码</label>
<input class="form-control observe" value="[[item.resources_code?item.resources_code:'']]" placeholder="资源码"
data-field='[[index]].resources_code'/>
... ...
... ... @@ -741,6 +741,25 @@ $(document).on("change", ".observe2", function () {
});
});
$(document).on("change", ".change-toggle-show", function () {
var $this = $(this);
var changeValue = $this.val();
var $toggleRoot = $this.closest('.change-toggle-root');
var toggle = $this.data('toggle') || '';
var toggleClass;
toggle = toggle.split('|');
toggle.forEach(function(val) {
var list = val.split('::');
if (changeValue && list[0] === changeValue) {
$toggleRoot.find('.' + list[1]).show();
} else {
$toggleRoot.find('.' + list[1]).hide();
}
});
});
/**
* 绑定监听,输入数据必须是key1=value2&key2=value2的数据
*/
... ...