Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
Overview
Overview
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
杨昕
media-resource
Commits
f82b7e02
Commit
f82b7e02
authored
Jul 01, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加媒资管理
parent
ad9a0c65
Pipeline
#9751
passed with stages
in 32 seconds
Changes
7
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
836 additions
and
8 deletions
+836
-8
MediaController.php
app/Http/Controllers/Web/MediaController.php
+10
-5
MemberController.php
app/Http/Controllers/Web/MemberController.php
+0
-3
MediaRoute.php
app/Http/Routes/Web/MediaRoute.php
+22
-0
MediaModel.php
app/Model/MediaModel.php
+47
-0
media_add.blade.php
resources/views/admin/media/media_add.blade.php
+227
-0
media_edit.blade.php
resources/views/admin/media/media_edit.blade.php
+213
-0
media_list.blade.php
resources/views/admin/media/media_list.blade.php
+317
-0
No files found.
app/Http/Controllers/Web/MediaController.php
View file @
f82b7e02
...
...
@@ -2,19 +2,24 @@
namespace
App\Http\Controllers\Web
;
use
App\Model\MediaModel
;
use
Illuminate\Http\Request
;
use
App\Http\Controllers\Controller
;
class
MediaController
extends
Controller
{
public
static
function
generateMediaNum
(){
public
static
function
index
(
Request
$request
){
$medias
=
MediaModel
::
mediaList
(
$request
);
return
view
(
'admin.media.media_list'
,
[
'users'
=>
$medias
,
'start_time'
=>
substr
(
$request
->
start_time
,
0
,
10
),
'end_time'
=>
substr
(
$request
->
end_time
,
0
,
10
),
'name'
=>
$request
->
name
,
'STATUS'
=>
[
'启用'
,
'停用'
],
]);
}
...
...
app/Http/Controllers/Web/MemberController.php
View file @
f82b7e02
...
...
@@ -82,9 +82,6 @@ class MemberController extends Controller
*/
public
function
store
(
Request
$request
)
{
echo
444
;
die
;
//print_r(Auth::guard('web')->check());die;
handler_drive
(
function
()
use
(
$request
)
{
...
...
app/Http/Routes/Web/MediaRoute.php
0 → 100644
View file @
f82b7e02
<?php
/**
* Created by PhpStorm.
* User: nxtvadmin
* Date: 2018/7/17
* Time: 11:28
* 会用路由
*/
namespace
App\Http\Routes\Web
;
use
Illuminate\Contracts\Routing\Registrar
;
class
MediaRoute
extends
AuthenRoute
{
public
function
map
(
Registrar
$router
,
$callback
){
parent
::
map
(
$router
,
function
()
use
(
$router
){
$router
->
resource
(
'media'
,
'MediaController'
);
});
}
}
\ No newline at end of file
app/Model/MediaModel.php
0 → 100644
View file @
f82b7e02
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
class
MediaModel
extends
Model
{
protected
$collection
=
'media'
;
protected
$connection
=
'mongodb'
;
//使用mongodb
protected
$primaryKey
=
'_id'
;
public
static
function
mediaList
(
$request
){
try
{
$where
=
[];
if
(
$request
->
name
){
$where
[
'name'
]
=
$request
->
name
;
}
$users
=
DB
::
connection
(
'mongodb'
)
->
collection
(
'users'
)
->
where
(
$where
)
->
paginate
(
10
);
// dd($users);die;
foreach
(
$users
as
$user
){
$idArr
=
(
$user
[
'_id'
])
->
jsonSerialize
();
$user
[
'_id'
]
=
$idArr
[
'$oid'
];
}
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
$exception
->
getMessage
());
}
return
$users
;
}
}
resources/views/admin/media/media_add.blade.php
0 → 100644
View file @
f82b7e02
<!DOCTYPE html>
<html>
<head>
@include('admin.common.commonMedia')
<!-- Core stylesheets -->
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/css/form.css')}}"
>
<style>
form
.cmxform
label
.error
,
label
.error
{
/* remove the next line when you have trouble in IE6 with labels in list */
color
:
red
;
font-style
:
italic
;
margin-top
:
11px
;
}
</style>
</head>
<body>
<!--====================================================
MAIN NAVBAR
======================================================-->
@include('admin.common.header')
<!--====================================================
PAGE CONTENT
======================================================-->
<div
class=
"page-content d-flex align-items-stretch"
>
<!--***** SIDE NAVBAR *****-->
@include('admin.common.left')
<div
class=
"content-inner form-cont"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<!--***** FORM GROUP *****-->
<div
class=
"card form"
>
<div
class=
"card-header"
>
<h3><i
class=
"fa fa-user-circle"
></i>
管理员注册
</h3>
</div>
<br>
<form
id=
"newForm"
>
<input
type=
"hidden"
name=
"_token"
value=
"{{ csrf_token() }}"
>
<div
class=
"form-group"
>
<label
for=
"uesrname"
>
姓名
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-user-o"
></i></div>
<input
type=
"text"
class=
"form-control"
name=
"name"
id=
"uesrname"
placeholder=
"姓名"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"nickname"
>
昵称
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-user-o"
></i></div>
<input
type=
"text"
class=
"form-control"
name=
"nickname"
id=
"nickname"
placeholder=
"昵称"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"formGroupExampleInput2"
>
密码
<span
class=
"red"
>
*
</span></label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-lock"
></i></div>
<input
type=
"password"
class=
"form-control"
value=
"123123"
id=
"inlineFormInputGroup"
>
<small
class=
"form-text text-muted"
>
6到16个字符
</small>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"formGroupExampleInput2"
>
确认密码
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-lock"
></i></div>
<input
type=
"password"
name=
"password"
class=
"form-control"
value=
"123123"
id=
"inlineFormInputGroup"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"mobile"
>
电话号码
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-phone"
></i></div>
<input
type=
"text"
class=
"form-control"
name=
"mobile"
id=
"mobile"
placeholder=
"电话号码"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"mobile"
>
邮箱
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"iconfont"
>

</i></div>
<input
type=
"text"
class=
"form-control"
name=
"email"
id=
"emial"
placeholder=
"邮箱"
>
</div>
</div>
<div
class=
"form-group"
>
<label
for=
"role"
>
角色
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-phone"
></i></div>
-->
<div
class=
"checkbox"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inlineRadioOptions"
id=
"inlineRadio1"
value=
"option1"
>
<span
class=
"mr5"
style=
"margin-right: 20px;"
>
1
</span>
</label>
</div>
<div
class=
"checkbox"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"inlineRadioOptions"
id=
"inlineRadio1"
value=
"option1"
>
<span
class=
"mr5"
style=
"margin-right: 20px;"
>
1
</span>
</label>
</div>
</div>
</div>
<button
type=
"submit"
onclick=
"registerUser();"
class=
"btn btn-general btn-blue mr-2"
>
确认
</button>
<button
type=
"reset"
class=
"btn btn-general btn-white"
>
重置
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!--Global Javascript -->
@include('admin.common_bak.foot')
<script
src=
"{{ asset('xadmin/extra/toast/js/toast.js')}}"
></script>
<script
src=
"{{ asset('xadmin/js/jquery.validate.js')}}"
></script>
{{--
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/toast/css/toast.css')}}"
>
--}}
<!--Core Javascript -->
<script
type=
"text/javascript"
>
function
registerUser
()
{
$
(
"#newForm"
).
validate
({
rules
:
{
nickname
:
"required"
,
name
:
{
required
:
true
,
minlength
:
2
},
password
:
{
required
:
true
,
minlength
:
5
},
confirm_password
:
{
required
:
true
,
minlength
:
5
,
equalTo
:
"#password"
},
email
:
{
required
:
true
,
email
:
true
},
},
messages
:
{
nickname
:
{
required
:
''
},
name
:
{
required
:
"昵称不能为空"
,
minlength
:
"昵称至少2个字符"
},
password
:
{
required
:
"请输入密码"
,
minlength
:
"密码长度不能小于5"
},
confirm_password
:
{
required
:
"请输入确认密码"
,
minlength
:
"密码长度不能小于5"
,
equalTo
:
"两次密码输入不一致"
},
email
:
"请输入有效邮箱"
,
},
submitHandler
:
function
(
form
)
{
var
form
=
document
.
querySelector
(
"#newForm"
);
var
formdata
=
new
FormData
(
form
);
fetch_response
(
'POST'
,
'/web/member'
,
formdata
).
then
(
function
(
res
)
{
if
(
res
.
code
==
200
)
{
//console.log('dsfsfsd')
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
setTimeout
(
function
()
{
window
.
location
.
href
=
'/web/member'
;
},
2000
)
}
else
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
}
});
}
});
}
</script>
</body>
</html>
\ No newline at end of file
resources/views/admin/media/media_edit.blade.php
0 → 100644
View file @
f82b7e02
<!DOCTYPE html>
<html>
<head>
@include('admin.common.commonMedia')
<!-- Core stylesheets -->
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/css/form.css')}}"
>
<style>
form
.cmxform
label
.error
,
label
.error
{
/* remove the next line when you have trouble in IE6 with labels in list */
color
:
red
;
font-style
:
italic
;
margin-top
:
11px
;
}
</style>
</head>
<body>
<!--====================================================
MAIN NAVBAR
======================================================-->
@include('admin.common.header')
<!--====================================================
PAGE CONTENT
======================================================-->
<div
class=
"page-content d-flex align-items-stretch"
>
<!--***** SIDE NAVBAR *****-->
@include('admin.common.left')
<div
class=
"content-inner form-cont"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<!--***** FORM GROUP *****-->
<div
class=
"card form"
id=
"form5"
>
<div
class=
"card-header"
>
<h3>
编辑用户
</h3>
</div>
<br>
<form
id=
"newForm"
>
<input
type=
"hidden"
name=
"_token"
value=
"{{csrf_token()}}"
>
{{ method_field('PUT')}}
<input
type=
"hidden"
name=
"id"
value=
"{{$info['_id']}}"
>
<div
class=
"form-group"
>
<label
for=
"uesrname"
>
姓名
</label>
<div
class=
"input-group "
>
<div
class=
"input-group-addon"
><i
class=
"fa fa-user-o"
></i></div>
<input
type=
"text"
class=
"form-control"
name=
"name"
id=
"uesrname"
placeholder=
"姓名"
value=
"{{$info['name']}}"
>
</div>
</div>
{{--
<div
class=
"form-group"
>
--}}
{{--
<label
for=
"mobile"
>
电话号码
</label>
--}}
{{--
<div
class=
"input-group "
>
--}}
{{--
<div
class=
"input-group-addon"
><i
class=
"fa fa-phone"
></i></div>
--}}
{{--
<input
type=
"text"
class=
"form-control"
name=
"mobile"
id=
"mobile"
--
}}
{{
--placeholder=
"电话号码"
value=
"123456"
>
--}}
{{--
</div>
--}}
{{--
</div>
--}}
{{--
<div
class=
"form-group"
>
--}}
{{--
<label
for=
"mobile"
>
邮箱
</label>
--}}
{{--
<div
class=
"input-group "
>
--}}
{{--
<div
class=
"input-group-addon"
><i
class=
"iconfont"
>

</i></div>
--}}
{{--
<input
type=
"text"
class=
"form-control"
name=
"email"
id=
"emial"
value=
"{{$info['email']}}"
--
}}
{{
--placeholder=
"邮箱"
>
--}}
{{--
</div>
--}}
{{--
</div>
--}}
<div
class=
"form-group"
>
<label
for=
"role"
>
状态
</label>
<div
class=
"input-group "
>
<div
class=
"checkbox"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"status"
value=
"1"
@
if
($
info
['
status
']
==
1
)
checked
@
endif
>
<span
class=
"mr5"
style=
"margin-right: 20px;"
>
不可用
</span>
</label>
</div>
<div
class=
"checkbox"
>
<label
class=
"radio-inline"
>
<input
type=
"radio"
name=
"status"
value=
"0"
@
if
($
info
['
status
']
==
0
)
checked
@
endif
>
<span
class=
"mr5"
style=
"margin-right: 20px;"
>
可用
</span>
</label>
</div>
</div>
</div>
<button
type=
"submit"
onclick=
"registerUser();"
class=
"btn btn-general btn-blue mr-2"
>
确认
</button>
<button
type=
"reset"
onclick=
"cancle()"
class=
"btn btn-general btn-white"
>
取消
</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!--Global Javascript -->
@include('admin.common.foot')
<script
src=
"{{ asset('xadmin/extra/toast/js/toast.js')}}"
></script>
<script
src=
"{{ asset('xadmin/js/jquery.validate.js')}}"
></script>
{{--
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/toast/css/toast.css')}}"
>
--}}
<!--Core Javascript -->
<script
type=
"text/javascript"
>
function
registerUser
()
{
$
(
"#newForm"
).
validate
({
rules
:
{
name
:
{
required
:
true
,
minlength
:
2
},
// password: {
// required: true,
// minlength: 5
// },
// confirm_password: {
// required: true,
// minlength: 5,
// equalTo: "#password"
// },
// email: {
// required: true,
// email: true
// },
},
messages
:
{
name
:
{
required
:
"Please enter a username"
,
minlength
:
"Your username must consist of at least 2 characters"
},
// password: {
// required: "Please provide a password",
// minlength: "Your password must be at least 5 characters long"
// },
// confirm_password: {
// required: "Please provide a password",
// minlength: "Your password must be at least 5 characters long",
// equalTo: "Please enter the same password as above"
// },
//email: "Please enter a valid email address",
},
submitHandler
:
function
(
form
)
{
var
form
=
document
.
querySelector
(
"#newForm"
);
var
formdata
=
new
FormData
(
form
);
console
.
log
(
"formdata"
,
formdata
)
fetch_response
(
'POST'
,
"/web/member/{{$info['_id']}}"
,
formdata
).
then
(
function
(
res
)
{
if
(
res
.
code
==
200
)
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
setTimeout
(
function
()
{
window
.
location
.
href
=
'/web/member'
;
},
2000
)
}
else
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
}
});
}
});
}
function
cancle
()
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
'已取消'
,
duration
:
1000
,
top
:
'50%'
});
setTimeout
(
function
()
{
window
.
history
.
back
();
},
2000
)
}
</script>
</body>
</html>
\ No newline at end of file
resources/views/admin/media/media_list.blade.php
0 → 100644
View file @
f82b7e02
<!DOCTYPE html>
<html>
@include('admin.common.commonMedia')
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/datepicker/css/daterangepicker.css')}}"
>
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/datepicker/css/htmleaf-demo.css')}}"
>
<script
src=
"{{ asset('xadmin/extra/datepicker/js/moment.js')}}"
></script>
<script
src=
"{{ asset('xadmin/extra/datepicker/js/daterangepicker.js')}}"
></script>
<body>
<!--====================================================
MAIN NAVBAR
======================================================-->
@include('admin.common.header')
<!--====================================================
PAGE CONTENT
======================================================-->
<div
class=
"page-content d-flex align-items-stretch"
>
<!--***** SIDE NAVBAR *****-->
@include('admin.common.left')
<div
class=
"content-inner chart-cont"
>
<div
class=
"card form"
>
<div
class=
"card-header"
>
<h3><i
class=
"fa fa-user-circle"
></i>
用户列表
</h3>
</div>
<br>
<!--***** CONTENT *****-->
<div
class=
"row ml20"
>
<div
class=
"xblock"
>
<button
class=
"btn btn-primary"
onclick=
"x_admin_show('/web/member/create')"
>
添加
</button>
<form>
<input
type=
"text"
name=
"name"
class=
"form-input"
placeholder=
"用户名称"
value=
"{{$name}}"
>
<input
id=
"endDate"
width=
"312"
class=
"form-input"
/>
<button
type=
"submit"
class=
"btn btn-primary"
>
搜索
</button>
</form>
{{--
<span
style=
"display: inline-block;height: 40px;line-height: 40px; float: right"
>
共{{$users->total()}}条
</span>
--}}
</div>
<table
class=
"table table-hover"
>
<thead>
<tr
class=
"bg-info text-white"
>
<th>
序号
</th>
<th>
用户名
</th>
<th>
用户类型
</th>
<th>
加入时间
</th>
<th>
状态
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
@if(count($users)>0)
@foreach ($users as $key => $user)
<tr
class=
"
<?php
if
(
$key
%
2
==
0
)
echo
'table-success'
;
?>
"
>
<td>
{{$key+1}}
</td>
<td>
{{$user['name']}}
</td>
<td>
@if($user['user_type']) 管理员@else 普通用户 @endif
</td>
<td>
{{$user['create_time']}}
</td>
<td
class=
"td-status"
>
<span
class=
"label "
>
已{{$STATUS[$user['status']]}}
</span>
</td>
<td
class=
"td-manage"
>
<a
onclick=
"member_stop(this,'{{$user["
_id
"]}}')"
href=
"javascript:;"
status=
"{{$user['status']}}"
>
<i
class=
"iconfont"
>
@if( $user['status'] == 1 )

@else

@endif
</i>
</a>
<a
title=
"编辑"
href=
"/web/member/{{$user['_id']}}/edit"
>
<i
class=
"iconfont"
>

</i>
</a>
{{--
<a
onclick=
"x_admin_show('修改密码','/web/password/{{$user->id}}',500,300)"
title=
"修改密码"
--
}}
{{
--href=
"javascript:;"
>
--}}
{{--
<i
class=
"iconfont"
>

</i>
--}}
{{--
</a>
--}}
<a
title=
"删除"
onclick=
"member_del(this,'{{$user["
_id
"]}}')"
href=
"javascript:;"
>
<i
class=
"iconfont"
>

</i>
</a>
</td>
</tr>
@endforeach
@else
<tr>
<td
colspan=
"9"
style=
"text-align:center"
>
暂无数据
</td>
</tr>
@endif
</tbody>
</table>
<div
class=
"page"
>
<div>
{{$users->appends(['name'=>$name])->links()}}
</div>
</div>
</div>
</div>
</div>
</div>
<!--Global Javascript -->
@include('admin.common.foot')
<!--Core Javascript -->
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/jqueryConfirm/css/jquery-confirm.css')}}"
>
<script
src=
"{{ asset('xadmin/extra/jqueryConfirm/js/jquery-confirm.min.js')}}"
></script>
<script
src=
"{{ asset('xadmin/extra/toast/js/toast.js')}}"
></script>
{{--
<link
rel=
"stylesheet"
href=
"{{ asset('xadmin/extra/toast/css/toast.css')}}"
>
--}}
<script
src=
"{{ asset('xadmin/js/jquery.validate.js')}}"
></script>
<script
type=
"text/javascript"
>
function
x_admin_show
(
url
){
window
.
location
.
href
=
url
;
// window.open(url);
}
function
member_del
(
row
,
id
){
$
.
confirm
({
// confirmButtonClass: 'btn-info',
// cancelButtonClass: 'btn-info',
cancelButtonClass
:
'btn-info'
,
confirmButtonClass
:
'btn-danger'
,
content
:
'确认要刪除吗?'
,
confirmButton
:
'确认'
,
cancelButton
:
'取消'
,
confirm
:
function
()
{
fetch_response
(
'DELETE'
,
"/web/member/"
+
id
).
then
(
function
(
res
)
{
if
(
res
.
code
==
200
)
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
setTimeout
(
function
()
{
window
.
location
.
href
=
'/web/member'
;
},
2000
)
}
else
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
}
})
},
cancel
:
function
()
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
'已取消'
,
duration
:
1000
,
top
:
'50%'
});
}
});
}
function
member_stop
(
obj
,
id
){
var
status
=
$
(
obj
).
attr
(
'status'
);
var
opts
=
new
FormData
();
var
title
=
"停用"
;
opts
.
append
(
'_token'
,
"{{csrf_token()}}"
)
if
(
status
==
'1'
){
title
=
"开启"
;
}
$
.
confirm
({
// confirmButtonClass: 'btn-info',
// cancelButtonClass: 'btn-info',
cancelButtonClass
:
'btn-info'
,
confirmButtonClass
:
'btn-danger'
,
content
:
'确认要'
+
title
+
'吗?'
,
confirmButton
:
'确认'
,
cancelButton
:
'取消'
,
confirm
:
function
()
{
if
(
title
==
'停用'
){
//发异步把用户状态进行更改
opts
.
append
(
'id'
,
id
);
opts
.
append
(
'status'
,
0
);
fetch_response
(
'POST'
,
'/web/member/disable'
,
opts
).
then
(
function
(
res
){
if
(
res
.
code
==
200
){
$
(
obj
).
attr
(
'title'
,
'启用'
)
$
(
obj
).
find
(
'i'
).
html
(
''
);
$
(
obj
).
parents
(
"tr"
).
find
(
".td-status"
).
find
(
'span'
).
addClass
(
'layui-btn-disabled'
).
html
(
'已停用'
);
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
'已停用'
,
duration
:
1000
,
top
:
'50%'
});
setTimeout
(
function
()
{
window
.
location
.
href
=
'/web/member'
;
},
2000
)
}
else
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
}
});
}
else
{
opts
.
append
(
'id'
,
id
);
opts
.
append
(
'status'
,
1
);
fetch_response
(
'POST'
,
'/web/member/disable'
,
opts
).
then
(
function
(
res
){
if
(
res
.
code
==
200
){
$
(
obj
).
attr
(
'title'
,
'停用'
)
$
(
obj
).
find
(
'i'
).
html
(
''
);
$
(
obj
).
parents
(
"tr"
).
find
(
".td-status"
).
find
(
'span'
).
removeClass
(
'layui-btn-disabled'
).
html
(
'已启用'
);
// layer.msg('已启用!',{icon: 6,time:1000},function(){
// window.location.reload();
// });
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
'已启用'
,
duration
:
1000
,
top
:
'50%'
});
setTimeout
(
function
()
{
window
.
location
.
href
=
'/web/member'
;
},
2000
)
}
else
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
res
.
msg
,
duration
:
1000
,
top
:
'50%'
});
}
});
}
},
cancel
:
function
()
{
$
(
'body'
).
toast
({
position
:
'fixed'
,
content
:
'已取消'
,
duration
:
1000
,
top
:
'50%'
});
}
});
}
updateConfig
();
function
updateConfig
()
{
var
options
=
{};
options
.
locale
=
{
// direction: $('#rtl').is(':checked') ? 'rtl' : 'ltr',
// format: 'MM/DD/YYYY HH:mm',
format
:
'YYYY/MM/DD'
,
separator
:
' - '
,
applyLabel
:
'确定'
,
cancelLabel
:
'取消'
,
fromLabel
:
'From'
,
toLabel
:
'To'
,
customRangeLabel
:
'Custom'
,
daysOfWeek
:
[
'日'
,
'一'
,
'二'
,
'三'
,
'四'
,
'五'
,
'六'
],
monthNames
:
[
'一月'
,
'二月'
,
'三月'
,
'四月'
,
'五月'
,
'六月'
,
'七月'
,
'八月'
,
'九月'
,
'十月'
,
'十一月'
,
'十二月'
],
firstDay
:
1
,
autoApply
:
false
,
};
$
(
'#endDate'
).
daterangepicker
(
options
,
function
(
start
,
end
)
{
console
.
log
(
'New date range selected: '
+
start
.
format
(
'YYYY-MM-DD'
)
+
' to '
+
end
.
format
(
'YYYY-MM-DD'
)
);
});
}
</script>
</body>
</html>
\ No newline at end of file
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