Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
e512eac5
Commit
e512eac5
authored
Mar 07, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
参数设置
parent
8e8958eb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
33 deletions
+119
-33
Setting.php
application/index/controller/Setting.php
+27
-1
navigation.html
application/index/view/global/navigation.html
+6
-0
index.html
application/index/view/setting/index.html
+3
-29
route.php
application/route.php
+2
-3
setting.js
public/resource/js/setting.js
+56
-0
setting_template_tpl.html
public/resource/template/setting_template_tpl.html
+25
-0
No files found.
application/index/controller/Setting.php
View file @
e512eac5
...
...
@@ -9,10 +9,35 @@
namespace
app\index\controller
;
class
Setting
use
app\index\extend\Basic
;
use
think\Cache
;
class
Setting
extends
Basic
{
/**
* 页面视图
*
* @return \think\response\View
*/
public
function
index
()
{
return
view
(
'setting/index'
);
}
/**
* 修改和新增
*
* @return \think\Response
*/
public
function
getSetting
()
{
$data
=
[];
if
(
$this
->
request
->
isGet
())
{
$data
=
Cache
::
get
(
'Setting'
);
}
else
{
$data
[
'is_privacy'
]
=
$this
->
params
[
'is_privacy'
];
$data
[
'day_num'
]
=
$this
->
params
[
'day_num'
];
Cache
::
set
(
'Setting'
,
$data
);
}
return
$this
->
response
(
200
,
''
,
$data
);
}
}
\ No newline at end of file
application/index/view/global/navigation.html
View file @
e512eac5
...
...
@@ -76,6 +76,12 @@
<!--<li role="presentation">-->
<!--<a href="/admin.php/index/bindPhoneListIndex.html">号码绑定列表</a>-->
<!--</li>-->
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/setting_index.html"
>
参数设置
</a>
</li>
<li
role=
"presentation"
>
<a
href=
"/admin.php/index/uLabelIndex.html"
>
客户标签
</a>
</li>
</ul>
</nav>
...
...
application/index/view/setting/index.html
View file @
e512eac5
{layout name="global/frame_tpl" /}
<input
type=
"hidden"
class=
"page-load"
id=
"
version
"
/>
<input
type=
"hidden"
class=
"page-load"
id=
"
setting
"
/>
<!--导航star-->
...
...
@@ -13,37 +13,13 @@
<div
class=
"col-lg-10 col-lg-offset-0"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading breadcrumb"
>
<li><a
href=
"
#
"
>
参数管理
</a></li>
<li><a
href=
"
javascript:;
"
>
参数管理
</a></li>
</div>
<div
class=
"panel-body"
>
<form
class=
"form-horizontal"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
style=
"text-align: right"
>
是否使用隐号系统:
</label>
<div
class=
"col-sm-9"
>
<div
class=
"radio"
style=
"display: inline-block"
>
<label>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios1"
value=
"0"
checked
>
关闭
<div
id=
"info"
>
</label>
</div>
<div
class=
"radio"
style=
"display: inline-block"
>
<label>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios2"
value=
"1"
>
开启
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-3 control-label"
style=
"text-align: right"
>
隐号绑定天数
:
</label>
<div
class=
"col-sm-9"
>
<input
type=
"text"
class=
"form-control btn5"
name=
"title"
id=
"version_no"
placeholder=
"隐号绑定天数"
>
</div>
</div>
<div
class=
"form-group"
>
...
...
@@ -51,10 +27,8 @@
<div
class=
"col-sm-9"
style=
"text-align: left;"
>
<button
type=
"button"
class=
"btn btn-primary"
id=
"save"
>
保存修改
</button>
</div>
</div>
</form>
</div>
</div>
</div>
...
...
application/route.php
View file @
e512eac5
...
...
@@ -161,9 +161,8 @@ Route::group('index', [
'useraction_search'
=>
[
'index/remark/useraction_search'
,
[
'method'
=>
'get|post'
]
],
//后台客户详情
'select_by_phone'
=>
[
'index/remark/select_by_phone'
,
[
'method'
=>
'get|post'
]
],
//后台客户详情--客方搜索
'setting_index'
=>
[
'index/Setting/index'
,
[
'method'
=>
'get|post'
]
],
//全局参数设置
'setting_index'
=>
[
'index/Setting/index'
,
[
'method'
=>
'get'
]
],
//全局参数设置页面
'getSetting'
=>
[
'index/Setting/getSetting'
,
[
'method'
=>
'get|post'
]
],
//新增和修改全局参数设置
]);
...
...
public/resource/js/setting.js
0 → 100644
View file @
e512eac5
/**
* Created by zw on 2017/12/15.
*/
define
([
'doT'
,
'text!temp/setting_template_tpl.html'
,
'css!style/home.css'
],
function
(
doT
,
template
)
{
var
Setting
=
{
init
:
function
()
{
//初始化dot
$
(
"body"
).
append
(
template
);
Setting
.
event
();
Setting
.
getInfo
();
},
event
:
function
()
{
$
(
"#save"
).
click
(
function
()
{
Setting
.
saveSetting
();
});
},
getInfo
:
function
()
{
var
param
=
{};
$
.
ajax
({
url
:
'/admin.php/index/getSetting'
,
type
:
'GET'
,
async
:
true
,
data
:
param
,
dataType
:
'json'
,
success
:
function
(
data
)
{
console
.
log
(
data
.
data
);
var
temp
=
document
.
getElementById
(
'setting_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#info"
).
html
(
doTtmpl
(
data
.
data
));
}
});
},
saveSetting
:
function
()
{
var
param
=
{};
param
.
is_privacy
=
$
(
"input[type='radio']:checked"
).
val
();
param
.
day_num
=
$
(
"input[name='day_num']"
).
val
();
$
.
ajax
({
url
:
'/admin.php/index/getSetting'
,
type
:
'POST'
,
async
:
true
,
data
:
param
,
dataType
:
'json'
,
success
:
function
(
data
)
{
if
(
data
.
code
==
200
)
{
Setting
.
getInfo
();
alert
(
'添加成功'
);
}
else
{
alert
(
'操作失败'
);
}
}
});
}
};
return
Setting
;
});
public/resource/template/setting_template_tpl.html
0 → 100644
View file @
e512eac5
<script
id=
"setting_list_tpl"
type=
"text/template"
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-3 control-label"
style
=
"text-align: right"
>
是否使用隐号系统:
<
/label
>
<
div
class
=
"col-sm-9"
>
<
div
class
=
"radio"
style
=
"display: inline-block"
>
<
label
>
<
input
type
=
"radio"
name
=
"optionsRadios"
id
=
"optionsRadios1"
value
=
"0"
[
%
if
(
it
.
is_privacy
==
0
)
{
%
]
checked
[
%
}
%
]
>
关闭
<
/label
>
<
/div
>
<
div
class
=
"radio"
style
=
"display: inline-block"
>
<
label
>
<
input
type
=
"radio"
name
=
"optionsRadios"
id
=
"optionsRadios2"
value
=
"1"
[
%
if
(
it
.
is_privacy
==
1
)
{
%
]
checked
[
%
}
%
]
>
开启
<
/label
>
<
/div
>
<
/div
>
<
/div
>
<
div
class
=
"form-group"
>
<
label
class
=
"col-sm-3 control-label"
style
=
"text-align: right"
>
隐号绑定有效期(天数):
<
/label
>
<
div
class
=
"col-sm-9"
>
<
input
type
=
"text"
class
=
"form-control btn5"
name
=
"day_num"
placeholder
=
"隐号绑定天数"
value
=
"[%= it['day_num'] %]"
>
<
/div
>
<
/div
>
</script>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment