You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
138 lines
7.5 KiB
138 lines
7.5 KiB
{php include wl_template('common/header');}
|
|
<style>
|
|
.show-image{
|
|
padding: 0!important;
|
|
width: 34px;
|
|
height: 34px;
|
|
}
|
|
.show-image img{
|
|
height:100%;
|
|
width:100%;
|
|
}
|
|
.show-link{
|
|
margin: 0!important;
|
|
}
|
|
|
|
|
|
</style>
|
|
<ul class="nav nav-tabs" id="myTab">
|
|
<li class="active"><a href="#tab_basic">个人中心设置</a></li>
|
|
</ul>
|
|
<div class="app-content">
|
|
<div class="app-form">
|
|
<form action="" method="post" class="form-horizontal form form-validate">
|
|
<div class="panel panel-default">
|
|
<div class="app-table-list">
|
|
<div class="table-responsive">
|
|
<table class="table table-hover">
|
|
<tbody id="param-items-level">
|
|
{loop $setInfo $key $val}
|
|
<tr class="text-center" id="row_{$key}">
|
|
<td>{$val['title']}</td>
|
|
<td>
|
|
<input type="text" class="form-control set-title" maxlength="6" name="set[{$key}][diy_title]" value="{$val['diy_title']}" placeholder="{$val['title']}"/>
|
|
</td>
|
|
<td>
|
|
<div class="input-group img-item">
|
|
<div class="input-group-addon show-image">
|
|
<img src="{php echo tomedia($val['icon'])}" id="pimg-{$key}" />
|
|
</div>
|
|
<input type="text" class="form-control set-image" id="cimg-{$key}" name="set[{$key}][icon]" readonly="readonly" value="{$val['icon']}"/>
|
|
<div class="input-group-btn">
|
|
<button type="button" class="btn btn-default"
|
|
data-toggle="selectAttachment"
|
|
data-input="#cimg-{$key}"
|
|
data-img="#pimg-{$key}">选择图片</button>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td >
|
|
<div class="input-group form-group show-link">
|
|
<input name="set[{$key}][link]" type="text" readonly="readonly" class="form-control param_value set-link" value="{$val['link']}" id="advlink_{$key}" placeholder="跳转链接"/>
|
|
<span data-input="#advlink_{$key}" data-toggle="selectUrl" class="input-group-addon btn btn-default">选择链接</span>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<input class="js-switch" type="checkbox" name="set[{$key}][switch]" value="1" {if $val['switch']==1}checked="checked"{/if}/>
|
|
</td>
|
|
<td>
|
|
<select multiple class="selectpicker form-control" id="number-multiple-{$key}" name="set[{$key}][identity][]" data-container="body" data-live-search="false" title="--请选择关联身份--" data-hide-disabled="true" data-actions-box="true" data-virtual-scroll="false">
|
|
{loop $identityList $identity}
|
|
<option value="{$identity['id']}">{$identity['name']}</option>
|
|
{/loop}
|
|
</select>
|
|
</td>
|
|
<td>
|
|
<a href="javascript:;" class="fa fa-move" title="拖动调整此显示顺序"><i class="fa fa-arrows"></i></a>
|
|
</td>
|
|
<td>
|
|
<input name="set[{$key}][title]" type="text" class="form-control hide default-title" value="{$val['title']}" />
|
|
<input name="set[{$key}][default]" type="text" class="form-control hide default-default" value="{$val['default']}"/>
|
|
<input type="text" class="form-control hide default-show_img" value="{$val['show_img']}"/>
|
|
<input name="set[{$key}][image]" type="text" class="form-control hide default-image" value="{$val['image']}"/>
|
|
<a class="btn btn-sm btn-default restore-default" data-row_id="#row_{$key}" href="javascript:;" >恢复默认</a>
|
|
</td>
|
|
</tr>
|
|
{php $keyList['number-multiple-'.$key] = $val['identity'];}
|
|
{/loop}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class="app-table-foot clearfix">
|
|
<div class="pull-left">
|
|
<input type="submit" name="submit" value="保存" class="btn btn-primary col-lg-1 min-width" />
|
|
<input type="hidden" name="token" value="{$_W['token']}" />
|
|
</div>
|
|
<div class="pull-right"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
const selectedValues = JSON.parse('{php echo json_encode($keyList)}'); // 选中的选项的值
|
|
for (let attr in selectedValues) {
|
|
if (selectedValues[attr] !== null) {
|
|
let select = document.getElementById(attr);
|
|
$(select).selectpicker('val',selectedValues[attr]);
|
|
}
|
|
}
|
|
|
|
$(function(){
|
|
require(['jquery.ui'],function($){
|
|
$("#param-items-level").sortable({handle:'.fa-move'});
|
|
});
|
|
bindEvents();
|
|
});
|
|
function bindEvents() {
|
|
require(['jquery', 'util'], function ($, util) {
|
|
$('.btn-select-pic').unbind('click').click(function () {
|
|
var imgitem = $(this).closest('.img-item');
|
|
util.image('', function (data) {
|
|
imgitem.find('img').attr('src', data['url']);
|
|
imgitem.find('input').val(data['attachment']);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
/**
|
|
* 点击恢复默认
|
|
*/
|
|
$(".restore-default").on('click',function () {
|
|
//参数信息获取
|
|
let _this = $(this),
|
|
id = _this.data("row_id"),
|
|
//title = _this.siblings(".default-title").val(),
|
|
defaults = _this.siblings(".default-default").val(),
|
|
show_img = _this.siblings(".default-show_img").val(),
|
|
image = _this.siblings(".default-image").val();
|
|
//默认信息获取
|
|
$(id).find(".set-title").val('');//标题
|
|
$(id).find(".set-link").val(defaults);//链接
|
|
$(id).find(".set-image").val(image);//图片
|
|
$(id).find(".show-image").children('img').attr('src',show_img);//显示图片
|
|
});
|
|
</script>
|
|
{php include wl_template('common/footer');}
|