@extends('admin.layout')
@section('header')

    <link href="/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />

    <script src="/base/js/fileinput.js" type="text/javascript"></script>
    <script src="/base/js/fileinput_locale_zh.js" type="text/javascript"></script>

@endsection
@section('content')

<?php
    if(!isset($data)) $data = array();
    if(!$data && session("data")){
        $data = session("data");
    }
    if(!$data && session('_old_input')){
        $data = session("_old_input");
    }
?>
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>画册海报</h5>
					<div class="ibox-tools">
						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
						</a>
					</div>
				</div>
				<div class="ibox-content">


		            <div class="row">
                        <div class="col-lg-10">
                            <form name="form_product" id="form-validation" enctype="multipart/form-data" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
                                <input type="hidden" name="id" value="{{ $data['id'] or ''}}"/>
                                <div class="form-group">

                                    <label class="control-label col-sm-3">标题</label>

                                    <div class="col-sm-9">
                                        <input id="data_words" name="data[name]" class="form-control" value="{{ $data['name'] ?? ''}}"  required="" aria-required="true"  placeholder="">
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="control-label col-sm-3">分享类型</label>

                                    <div class="col-sm-9">
                                        <label class="radio-inline">
                                            <input type="radio" name="data[share_type]" value="1"
                                                   @if(isset($data['share_type']) && $data['share_type'] == '1')checked="checked" @endif/>视频
                                        </label>
                                        <label class="radio-inline">
                                            <input type="radio" name="data[share_type]" value="0"
                                                   @if(isset($data['share_type']) && $data['share_type'] == '0')checked="checked" @endif/>九张图
                                        </label>
                                    </div>

                                </div>
                                <div class="form-group">

                                    <label class="control-label col-sm-3">海报 <br/>
                                        <small class="text-navy">(440像素 * 440像素)</small></label>
                                    <div class="col-sm-9">
                                        {!!  widget('Tools.ImgUpload')->multi2('/upload/posters','posters',"data[posters]", isset($data['posters'])? $data['posters'] : '',array("sizex"=>440,"sizey"=>440)) !!}
                                    </div>

                                </div>
                                <div class="form-group">

                                 <label class="control-label col-sm-3">话术</label>

                                   <div class="col-sm-9">
                                       <textarea id="data_words" name="data[words]" class="form-control"  required="" aria-required="true"  placeholder="">{{ $data['words'] ?? ''}}</textarea>
                                    </div>

                                </div>


                               {{-- <div class="form-group">

                                    <label class="control-label col-sm-3">海报二维码(140*140)</label>
                                    <div class="col-sm-9">
                                        --}}{{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}{{--
                                        {!!  widget('Tools.ImgUpload')->single2('/upload/qrcode','qrcode',"qrcode",  isset($data['qrcode'])? $data['qrcode'] : '',array("sizex"=>140,"sizey"=>140)) !!}
                                    </div>
                                </div>--}}



                                <div class="form-group">
                                    <label class="control-label col-sm-3">分享视频</label>
                                    <div class="col-sm-9">
                                        <div style="height: auto;width: 200px;">
                                            <video controls width="100px" height="100px">
                                                <source src="{{$data['video_url'] ?? ''}}" type="video/mp4">
                                            </video>
                                        </div>
                                        <input id="file-0b" class="file" type="file" name="video_url" value="">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-sm-3">&nbsp;</label>
                                    <div class="col-sm-9">
                                        <input type="hidden" name="_referer" value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
                                        <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
                                        <input type="submit" class="btn btn-success" style="margin-right:20px;">
                                        <input type="reset" class="btn btn-default" >
                                    </div>
                                </div>
        
                            </form>
                        </div>
                        <!-- /.col-lg-10 -->
                    </div>
                    <!-- /.row -->
				</div>
			</div>
		</div>
	</div>
</div>

@endsection