会员级别与会员权益修改
This commit is contained in:
@@ -1,46 +1,48 @@
|
|||||||
<div class="panel panel-default panel-intro">
|
<div class="panel panel-default panel-intro">
|
||||||
|
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{:build_heading(null,FALSE)}
|
{:build_heading(null,FALSE)}
|
||||||
<ul class="nav nav-tabs" data-field="status">
|
<ul class="nav nav-tabs" data-field="status">
|
||||||
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
<li class="{:$Think.get.status === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
|
||||||
{foreach name="statusList" item="vo"}
|
{foreach name="statusList" item="vo"}
|
||||||
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
|
<li class="{:$Think.get.status === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div id="myTabContent" class="tab-content">
|
<div id="myTabContent" class="tab-content">
|
||||||
<div class="tab-pane fade active in" id="one">
|
<div class="tab-pane fade active in" id="one">
|
||||||
<div class="widget-body no-padding">
|
<div class="widget-body no-padding">
|
||||||
<div id="toolbar" class="toolbar">
|
<div id="toolbar" class="toolbar">
|
||||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('wdsxh/member/level/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('wdsxh/member/level/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('wdsxh/member/level/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('wdsxh/member/level/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('wdsxh/member/level/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('wdsxh/member/level/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
<div class="dropdown btn-group {:$auth->check('wdsxh/member/level/multi')?'':'hide'}">
|
<div class="dropdown btn-group {:$auth->check('wdsxh/member/level/multi')?'':'hide'}">
|
||||||
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
|
||||||
<ul class="dropdown-menu text-left" role="menu">
|
<ul class="dropdown-menu text-left" role="menu">
|
||||||
{foreach name="statusList" item="vo"}
|
{foreach name="statusList" item="vo"}
|
||||||
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key|htmlentities}">{:__('Set status to ' . $key)}</a></li>
|
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:" data-params="status={$key|htmlentities}">{:__('Set status to ' . $key)}</a></li>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
data-operate-edit="{:$auth->check('wdsxh/member/level/edit')}"
|
data-operate-edit="{:$auth->check('wdsxh/member/level/edit')}"
|
||||||
data-operate-del="{:$auth->check('wdsxh/member/level/del')}"
|
data-operate-del="{:$auth->check('wdsxh/member/level/del')}"
|
||||||
width="100%">
|
|
||||||
</table>
|
width="100%">
|
||||||
</div>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<button type="submit" class="btn btn-primary btn-embossed disabled">OK</button>
|
<button type="submit" class="btn btn-primary btn-embossed disabled">确认</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<button type="submit" class="btn btn-primary btn-embossed disabled">OK</button>
|
<button type="submit" class="btn btn-primary btn-embossed disabled">确认</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -1,56 +1,97 @@
|
|||||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
var Controller = {
|
var Controller = {
|
||||||
index: function () {
|
index: function () {
|
||||||
// 初始化表格参数配置
|
// 初始化表格参数配置
|
||||||
Table.api.init({
|
Table.api.init({
|
||||||
extend: {
|
extend: {
|
||||||
index_url: 'wdsxh/member/level/index' + location.search,
|
index_url: 'wdsxh/member/level/index' + location.search,
|
||||||
add_url: 'wdsxh/member/level/add',
|
add_url: 'wdsxh/member/level/add',
|
||||||
edit_url: 'wdsxh/member/level/edit',
|
edit_url: 'wdsxh/member/level/edit',
|
||||||
del_url: 'wdsxh/member/level/del',
|
del_url: 'wdsxh/member/level/del',
|
||||||
multi_url: 'wdsxh/member/level/multi',
|
multi_url: 'wdsxh/member/level/multi',
|
||||||
import_url: 'wdsxh/member/level/import',
|
import_url: 'wdsxh/member/level/import',
|
||||||
table: 'wdsxh_member_level',
|
table: 'wdsxh_member_level',
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var table = $("#table");
|
var table = $("#table");
|
||||||
|
|
||||||
// 初始化表格
|
// 初始化表格
|
||||||
table.bootstrapTable({
|
table.bootstrapTable({
|
||||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
pk: 'id',
|
pk: 'id',
|
||||||
sortName: 'weigh',
|
sortName: 'weigh',
|
||||||
columns: [
|
columns: [
|
||||||
[
|
[
|
||||||
{checkbox: true},
|
{checkbox: true},
|
||||||
{field: 'id', title: __('Id')},
|
{field: 'id', title: __('Id')},
|
||||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||||
{field: 'fees', title: __('Fees'), operate:'BETWEEN'},
|
{field: 'fees', title: __('Fees'), operate:'BETWEEN'},
|
||||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
// 为表格绑定事件
|
// 为表格绑定事件
|
||||||
Table.api.bindevent(table);
|
Table.api.bindevent(table);
|
||||||
},
|
|
||||||
add: function () {
|
// 添加跳转按钮函数
|
||||||
Controller.api.bindevent();
|
function addJumpButtons() {
|
||||||
},
|
var tbody = document.querySelector('table tbody');
|
||||||
edit: function () {
|
if (!tbody) return;
|
||||||
Controller.api.bindevent();
|
|
||||||
},
|
var rows = tbody.querySelectorAll('tr');
|
||||||
api: {
|
for (var i = 0; i < rows.length; i++) {
|
||||||
bindevent: function () {
|
var row = rows[i];
|
||||||
Form.api.bindevent($("form[role=form]"));
|
var lastTd = row.querySelector('td:last-child');
|
||||||
}
|
if (lastTd && !lastTd.querySelector('.btn-jump')) {
|
||||||
}
|
var rowIndex = row.getAttribute('data-index');
|
||||||
};
|
var rowData = table.bootstrapTable('getData')[rowIndex];
|
||||||
return Controller;
|
if (rowData && rowData.id) {
|
||||||
});
|
var jumpBtn = document.createElement('a');
|
||||||
|
jumpBtn.href = 'javascript:;';
|
||||||
|
jumpBtn.className = 'btn btn-xs btn-success btn-jump';
|
||||||
|
jumpBtn.setAttribute('data-id', rowData.id);
|
||||||
|
jumpBtn.style.marginLeft = '5px';
|
||||||
|
jumpBtn.innerHTML = '<i class="fa fa-external-link"></i> 权益';
|
||||||
|
|
||||||
|
// 绑定点击事件
|
||||||
|
jumpBtn.onclick = (function(id) {
|
||||||
|
return function() {
|
||||||
|
window.location.href = 'rights?id=' + id;
|
||||||
|
};
|
||||||
|
})(rowData.id);
|
||||||
|
|
||||||
|
lastTd.appendChild(jumpBtn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 延迟执行确保表格已加载
|
||||||
|
setTimeout(addJumpButtons, 500);
|
||||||
|
|
||||||
|
// 监听表格刷新完成事件
|
||||||
|
table.on('load-success.bs.table', function() {
|
||||||
|
setTimeout(addJumpButtons, 100);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Controller;
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user