正在显示
11 个修改的文件
包含
288 行增加
和
0 行删除
application/admin/controller/Textrule.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\controller; | ||
4 | + | ||
5 | +use app\common\controller\Backend; | ||
6 | + | ||
7 | +/** | ||
8 | + * 续约规则 | ||
9 | + * | ||
10 | + * @icon fa fa-circle-o | ||
11 | + */ | ||
12 | +class Textrule extends Backend | ||
13 | +{ | ||
14 | + | ||
15 | + /** | ||
16 | + * Textrule模型对象 | ||
17 | + * @var \app\admin\model\Textrule | ||
18 | + */ | ||
19 | + protected $model = null; | ||
20 | + | ||
21 | + public function _initialize() | ||
22 | + { | ||
23 | + parent::_initialize(); | ||
24 | + $this->model = new \app\admin\model\Textrule; | ||
25 | + | ||
26 | + } | ||
27 | + | ||
28 | + /** | ||
29 | + * 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法 | ||
30 | + * 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑 | ||
31 | + * 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改 | ||
32 | + */ | ||
33 | + | ||
34 | + | ||
35 | +} |
application/admin/lang/zh-cn/textrule.php
0 → 100644
application/admin/model/Textrule.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\model; | ||
4 | + | ||
5 | +use think\Model; | ||
6 | + | ||
7 | + | ||
8 | +class Textrule extends Model | ||
9 | +{ | ||
10 | + | ||
11 | + | ||
12 | + | ||
13 | + | ||
14 | + | ||
15 | + // 表名 | ||
16 | + protected $name = 'textrule'; | ||
17 | + | ||
18 | + // 自动写入时间戳字段 | ||
19 | + protected $autoWriteTimestamp = 'int'; | ||
20 | + | ||
21 | + // 定义时间戳字段名 | ||
22 | + protected $createTime = 'createtime'; | ||
23 | + protected $updateTime = 'updatetime'; | ||
24 | + protected $deleteTime = false; | ||
25 | + | ||
26 | + // 追加属性 | ||
27 | + protected $append = [ | ||
28 | + | ||
29 | + ]; | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | +} |
application/admin/validate/Rule.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\validate; | ||
4 | + | ||
5 | +use think\Validate; | ||
6 | + | ||
7 | +class Rule extends Validate | ||
8 | +{ | ||
9 | + /** | ||
10 | + * 验证规则 | ||
11 | + */ | ||
12 | + protected $rule = [ | ||
13 | + ]; | ||
14 | + /** | ||
15 | + * 提示消息 | ||
16 | + */ | ||
17 | + protected $message = [ | ||
18 | + ]; | ||
19 | + /** | ||
20 | + * 验证场景 | ||
21 | + */ | ||
22 | + protected $scene = [ | ||
23 | + 'add' => [], | ||
24 | + 'edit' => [], | ||
25 | + ]; | ||
26 | + | ||
27 | +} |
application/admin/validate/Textrule.php
0 → 100644
1 | +<?php | ||
2 | + | ||
3 | +namespace app\admin\validate; | ||
4 | + | ||
5 | +use think\Validate; | ||
6 | + | ||
7 | +class Textrule extends Validate | ||
8 | +{ | ||
9 | + /** | ||
10 | + * 验证规则 | ||
11 | + */ | ||
12 | + protected $rule = [ | ||
13 | + ]; | ||
14 | + /** | ||
15 | + * 提示消息 | ||
16 | + */ | ||
17 | + protected $message = [ | ||
18 | + ]; | ||
19 | + /** | ||
20 | + * 验证场景 | ||
21 | + */ | ||
22 | + protected $scene = [ | ||
23 | + 'add' => [], | ||
24 | + 'edit' => [], | ||
25 | + ]; | ||
26 | + | ||
27 | +} |
application/admin/view/textrule/add.html
0 → 100644
1 | +<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
3 | + <div class="form-group"> | ||
4 | + <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label> | ||
5 | + <div class="col-xs-12 col-sm-8"> | ||
6 | + <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea> | ||
7 | + </div> | ||
8 | + </div> | ||
9 | + <div class="form-group layer-footer"> | ||
10 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
13 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
14 | + </div> | ||
15 | + </div> | ||
16 | +</form> |
application/admin/view/textrule/edit.html
0 → 100644
1 | +<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action=""> | ||
2 | + | ||
3 | + <div class="form-group"> | ||
4 | + <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label> | ||
5 | + <div class="col-xs-12 col-sm-8"> | ||
6 | + <textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea> | ||
7 | + </div> | ||
8 | + </div> | ||
9 | + <div class="form-group layer-footer"> | ||
10 | + <label class="control-label col-xs-12 col-sm-2"></label> | ||
11 | + <div class="col-xs-12 col-sm-8"> | ||
12 | + <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button> | ||
13 | + <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button> | ||
14 | + </div> | ||
15 | + </div> | ||
16 | +</form> |
application/admin/view/textrule/index.html
0 → 100644
1 | +<div class="panel panel-default panel-intro"> | ||
2 | + {:build_heading()} | ||
3 | + | ||
4 | + <div class="panel-body"> | ||
5 | + <div id="myTabContent" class="tab-content"> | ||
6 | + <div class="tab-pane fade active in" id="one"> | ||
7 | + <div class="widget-body no-padding"> | ||
8 | + <div id="toolbar" class="toolbar"> | ||
9 | + <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a> | ||
10 | + <!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('textrule/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>--> | ||
11 | + <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('textrule/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a> | ||
12 | + <!--<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('textrule/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>--> | ||
13 | + <!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('textrule/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>--> | ||
14 | + | ||
15 | + <div class="dropdown btn-group {:$auth->check('textrule/multi')?'':'hide'}"> | ||
16 | + <a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a> | ||
17 | + <ul class="dropdown-menu text-left" role="menu"> | ||
18 | + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li> | ||
19 | + <li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li> | ||
20 | + </ul> | ||
21 | + </div> | ||
22 | + | ||
23 | + | ||
24 | + </div> | ||
25 | + <table id="table" class="table table-striped table-bordered table-hover table-nowrap" | ||
26 | + data-operate-edit="{:$auth->check('textrule/edit')}" | ||
27 | + data-operate-del="{:$auth->check('textrule/del')}" | ||
28 | + width="100%"> | ||
29 | + </table> | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + | ||
33 | + </div> | ||
34 | + </div> | ||
35 | +</div> |
@@ -163,6 +163,33 @@ class Order extends Api | @@ -163,6 +163,33 @@ class Order extends Api | ||
163 | } | 163 | } |
164 | 164 | ||
165 | /** | 165 | /** |
166 | + * @ApiTitle (续约规则) | ||
167 | + * @ApiSummary (续约规则) | ||
168 | + * @ApiMethod (POST) | ||
169 | + * @ApiRoute (/api/order/rule) | ||
170 | + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token") | ||
171 | + * | ||
172 | + * @ApiReturn({ | ||
173 | + "code": 1, | ||
174 | + "msg": "SUCCESS", | ||
175 | + "time": "1553839125", | ||
176 | + "data": { | ||
177 | + "content"://续约规则 | ||
178 | + } | ||
179 | + }) | ||
180 | + */ | ||
181 | + public function rule() | ||
182 | + { | ||
183 | + $user_id = $this->getUserId(); | ||
184 | + $data = Db::name('textrule') | ||
185 | + ->where('id',1) | ||
186 | + ->field('content') | ||
187 | + ->find(); | ||
188 | + $this->success('success',$data['content']); | ||
189 | + | ||
190 | + } | ||
191 | + | ||
192 | + /** | ||
166 | * @ApiTitle (续约订单支付) | 193 | * @ApiTitle (续约订单支付) |
167 | * @ApiSummary (续约订单支付) | 194 | * @ApiSummary (续约订单支付) |
168 | * @ApiMethod (POST) | 195 | * @ApiMethod (POST) |
此 diff 太大无法显示。
public/assets/js/backend/textrule.js
0 → 100644
1 | +define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { | ||
2 | + | ||
3 | + var Controller = { | ||
4 | + index: function () { | ||
5 | + // 初始化表格参数配置 | ||
6 | + Table.api.init({ | ||
7 | + extend: { | ||
8 | + index_url: 'textrule/index' + location.search, | ||
9 | + add_url: 'textrule/add', | ||
10 | + edit_url: 'textrule/edit', | ||
11 | + del_url: 'textrule/del', | ||
12 | + multi_url: 'textrule/multi', | ||
13 | + table: 'textrule', | ||
14 | + } | ||
15 | + }); | ||
16 | + | ||
17 | + var table = $("#table"); | ||
18 | + | ||
19 | + // 初始化表格 | ||
20 | + table.bootstrapTable({ | ||
21 | + url: $.fn.bootstrapTable.defaults.extend.index_url, | ||
22 | + pk: 'id', | ||
23 | + sortName: 'id', | ||
24 | + columns: [ | ||
25 | + [ | ||
26 | + {checkbox: true}, | ||
27 | + {field: 'id', title: __('Id')}, | ||
28 | + {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
29 | + {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, | ||
30 | + {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) { | ||
31 | + var that = $.extend({}, this); | ||
32 | + var table = $(that.table).clone(true); | ||
33 | + $(table).data("operate-del", null); | ||
34 | + that.table = table; | ||
35 | + return Table.api.formatter.operate.call(that, value, row, index); | ||
36 | + }} | ||
37 | + ] | ||
38 | + ] | ||
39 | + }); | ||
40 | + | ||
41 | + // 为表格绑定事件 | ||
42 | + Table.api.bindevent(table); | ||
43 | + }, | ||
44 | + add: function () { | ||
45 | + Controller.api.bindevent(); | ||
46 | + }, | ||
47 | + edit: function () { | ||
48 | + Controller.api.bindevent(); | ||
49 | + }, | ||
50 | + api: { | ||
51 | + bindevent: function () { | ||
52 | + Form.api.bindevent($("form[role=form]")); | ||
53 | + } | ||
54 | + } | ||
55 | + }; | ||
56 | + return Controller; | ||
57 | +}); |
-
请 注册 或 登录 后发表评论