Commit de6c70ac by 杨昕

视频预览

parent 44ae8632
Pipeline #13701 passed with stages
in 41 seconds
...@@ -169,4 +169,22 @@ class MediaController extends Controller ...@@ -169,4 +169,22 @@ class MediaController extends Controller
return view('admin.control'); return view('admin.control');
} }
/**
* 视频预览
* @param Request $request
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function media_preview(Request $request){
$url = getRbac($request,'video/info','ec8747abc5dbe8288e64f327a76ac517','video_info');
$result = http_request_code($url,
null,
'GET'
);
$result = json_decode($result,true);
return view('errors.404',$result);
}
} }
...@@ -16,6 +16,8 @@ class MediaRoute extends AuthenRoute ...@@ -16,6 +16,8 @@ class MediaRoute extends AuthenRoute
parent::map($router,function() use ($router){ parent::map($router,function() use ($router){
$router->resource('media_model','MediaController'); $router->resource('media_model','MediaController');
$router->get('media_command','MediaController@media_command'); $router->get('media_command','MediaController@media_command');
$router->get('video_preview','MediaController@media_preview');
}); });
} }
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<th>视频类别</th> <th>视频类别</th>
<th>视频地址</th> <th>视频地址</th>
<th>创建时间</th> <th>创建时间</th>
<th>媒资号码</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
</thead> </thead>
...@@ -73,8 +74,15 @@ ...@@ -73,8 +74,15 @@
<td style="max-width: 200px;">{{$media['media_url']}}</td> <td style="max-width: 200px;">{{$media['media_url']}}</td>
<td style="max-width: 100px;">{{$media['create_time']}}</td> <td style="max-width: 100px;">{{$media['create_time']}}</td>
@if(isset($media['media_num']))
<td style="max-width: 100px;">{{$media['media_num']}}</td>
@else
<td>3ed312c523c38bdd685e4c6a5f2acdd6</td>
@endif
<td class="td-manage"> <td class="td-manage">
@if(permissionExist("manager_media","media_edit")) @if(permissionExist("manager_media","media_edit"))
<a title="编辑" href="/web/media_model/{{$media['_id']}}/edit"> <a title="编辑" href="/web/media_model/{{$media['_id']}}/edit">
<i class="iconfont">&#xe609;</i> <i class="iconfont">&#xe609;</i>
</a> </a>
...@@ -90,9 +98,15 @@ ...@@ -90,9 +98,15 @@
</a> </a>
@endif @endif
<a title="生成" onclick="member_del(this,'{{$media["_id"]}}')" href="javascript:;"> @if(!isset($media["media_num"]))
<i class="iconfont">&#xe61a;</i> <a title="视频预览" onclick="x_admin_show('/web/video_preview?media_id={{$media["_id"]}}')" href="javascript:;">
</a> <i class="iconfont">&#xe61a;</i>
</a>
@else
<a title="生成媒资号码" onclick="set_media_num(this,'{{$media["_id"]}}')" href="javascript:;">
<i class="iconfont">&#xe79f;</i>
</a>
@endif
</td> </td>
</tr> </tr>
...@@ -137,6 +151,7 @@ ...@@ -137,6 +151,7 @@
// window.open(url); // window.open(url);
} }
function member_del(row,id){ function member_del(row,id){
$.confirm({ $.confirm({
...@@ -179,6 +194,48 @@ ...@@ -179,6 +194,48 @@
}); });
} }
function set_media_num(row,id){
$.confirm({
cancelButtonClass: 'btn-info',
confirmButtonClass: 'btn-danger',
content:'确认要设置媒资编号吗?',
confirmButton:'确认',
cancelButton:'取消',
confirm: function () {
fetch_response('get',"/web/set_media_num?media_id="+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/media_model?media_name={{$media_name}}&media_id={{$media_id}}&start_time={{$start_time}}&end_time={{$end_time}}&category_id={{$category_id}}&appid={{$appid}}';
},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(1); // updateConfig(1);
$('#endDate').bind("onclickOnce",function () { $('#endDate').bind("onclickOnce",function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment