会员权益项目

This commit is contained in:
2026-04-28 17:39:46 +08:00
parent 1f24148801
commit 43a4a1a8dd
5 changed files with 210 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ use app\common\controller\Backend;
*
* @icon fa fa-circle-o
*/
class Rights extends Backend
class RightsProject extends Backend
{
protected $join_config_model = null;

View File

@@ -0,0 +1,43 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">权益项目:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[title]" type="text" placeholder="请输入权益名称">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">状态:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
<label>
<input id="status_normal" name="row[disabled]" type="radio" value="0" checked> 显示
</label>
<label>
<input id="status_hidden" name="row[disabled]" type="radio" value="1"> 隐藏
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">排序:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" data-rule="required" class="form-control" name="row[sort]" type="number" value="0">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<input type="hidden" name="row[join_config_id]" value="{$join_config_id}">
<input type="hidden" name="row[level_id]" value="{$Think.get.level_id}">
<button type="submit" class="btn btn-primary btn-embossed disabled">确认</button>
</div>
</div>
</form>

View File

@@ -0,0 +1,44 @@
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">权益项目:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-name" data-rule="required" class="form-control" name="row[title]" value="{$row.title|htmlentities}" type="text" placeholder="请输入权益项目">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">状态:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
<label>
<input id="status_normal" name="row[disabled]" type="radio" value="0" {eq name="row.disabled" value="0"}checked{/eq}> 显示
</label>
<label>
<input id="status_hidden" name="row[disabled]" type="radio" value="1" {eq name="row.disabled" value="1"}checked{/eq}> 隐藏
</label>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">排序:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-weigh" data-rule="required" class="form-control" name="row[sort]" value="{$row.sort}" type="number" value="0">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<input type="hidden" name="row[join_config_id]" value="{$join_config_id}">
<input type="hidden" name="row[level_id]" value="{$Think.get.level_id|htmlentities}">
<button type="submit" class="btn btn-primary btn-embossed disabled">确认</button>
</div>
</div>
</form>

View File

@@ -0,0 +1,32 @@
<div class="panel panel-default panel-intro">
<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="disabled">
<li class="{:$Think.get.disabled === null ? 'active' : ''}"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li class="{:$Think.get.disabled === (string)$key ? 'active' : ''}"><a href="#t-{$key|htmlentities}" data-value="{$key|htmlentities}" data-toggle="tab">{$vo|htmlentities}</a></li>
{/foreach}
</ul>
</div>
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<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-success btn-add {:$auth->check('wdsxh/member/rights/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/rights/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('wdsxh/member/rights/edit')}"
data-operate-del="{:$auth->check('wdsxh/member/rights/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,90 @@
define(["jquery", "bootstrap", "backend", "table", "form"], function (
$,
undefined,
Backend,
Table,
Form,
) {
var Controller = {
index: function () {
// 初始化表格参数配置 rights_project.js
Table.api.init({
extend: {
index_url: "wdsxh/member/rights_project/index" + location.search,
add_url: "wdsxh/member/rights_project/add" + location.search,
edit_url: "wdsxh/member/rights_project/edit" + location.search,
del_url: "wdsxh/member/rights_project/del",
table: "wdsxh_member_rights_project",
},
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: "id",
sortName: "sort",
columns: [
[
{ checkbox: true },
{ field: "id", title: __("Id") },
{
field: "title",
title: __("Member Benefits Title"),
operate: "LIKE",
},
{
field: "desc",
title: __("Member Benefits Desc"),
operate: "LIKE",
},
{
field: "image",
title: __("Member Benefits Image"),
operate: false,
formatter: Table.api.formatter.image,
},
{
field: "sort",
title: __("Member Benefits Sort"),
operate: false,
},
{
field: "disabled",
title: __("Member Benefits Status"),
searchList: {
0: __("Member Benefits Enabled"),
1: __("Member Benefits Disabled"),
},
custom: { 0: "success", 1: "gray" },
formatter: Table.api.formatter.status,
},
{
field: "operate",
title: __("Member Benefits Operate"),
table: table,
events: Table.api.events.operate,
formatter: Table.api.formatter.operate,
},
],
],
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
},
},
};
return Controller;
});