roomedit.php 6.14 KB
<?php
use yii\web\View;
use yii\helpers\Html;
use backend\widgets\YHGImage\Common\Images as CommonImages;

$this->title = $this->params['main_title'].'-'.$this->params['sub_title'];
?>
<?php
$this->registerCssFile('/css/select2.css',array('postion'=>View::POS_END));

$this->registerJsFile('/js/My97DatePicker/WdatePicker.js',array('postion'=>View::POS_END));
$this->registerJsFile('/js/select2.min.js',array('postion'=>View::POS_END));
?>
<script type="text/javascript">
<?php $this->beginBlock('javascript');?>
jQuery(document).ready(function() {
    // Select2
    jQuery(".select-basic").select2();

});
<?php 
$this->endBlock();
$this->registerJs($this->blocks['javascript'],View::POS_END)
?>
</script>

<div class="col-md-6">
    <form id="form" method="POST" action="">
        <div class="panel panel-default">

            <div class="panel-body">
                <div class="row">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">房间号: </label>
                        <div class="col-sm-9">
                            <?=$model->room_id ? : '保存后生成'?>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">直播标题: <span class="asterisk">*</span></label>
                        <div class="col-sm-5">
                            <input type="text" name="title" class="form-control" required="required" value="<?=$model->title?>">(建议不超过18个汉字)
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">水印文案: </label>
                        <div class="col-sm-5">
                            <input type="text" name="watermark" class="form-control" value="<?=$model->watermark?>">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">所属应用: <span class="asterisk">*</span></label>
                        <div class="col-sm-5">
                            <?php echo Html::dropDownList('app', $model->app,Yii::$app->params['config']['app'], ['class' => 'width300 select-basic']);?>
                        </div>
                        
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">主播: <span class="asterisk">*</span></label>
                        <div class="col-sm-5">
                            <?php echo Html::dropDownList('master_id', $model->master_id,$masters, ['class' => 'width300 select-basic', 'required'=>"required"]);?>
                        </div>
                        
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label">预告开始时间: </label>
                        <div class="col-sm-5">
                            <input type="text" name="starting_time" class="form-control" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'%y-%M-%d %H:%m:%s'})" value="<?=$model->starting_time ? date('Y-m-d H:i:s',$model->starting_time) : ''?>">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">房间密钥: <span class="asterisk">*</span></label>
                        <div class="col-sm-5">
                            <input type="text" name="secret" class="form-control" required="required" value="<?=$model->secret?>">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">是否精选: </label>
                        <div class="col-sm-2">
                            <?php echo Html::dropDownList('best', $model->best,Yii::$app->params['config']['best'], ['class' => 'form-control']);?>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label">马甲状态: </label>
                        <div class="col-sm-2">
                            <?php echo Html::dropDownList('vest', $model->vest,Yii::$app->params['config']['vest'], ['class' => 'form-control']);?>
                        </div>
                    </div>
                    
                    <div class="form-group" style="display: none">
                        <label class="col-sm-3 control-label">直播状态: </label>
                        <div class="col-sm-2">
                            <?php echo Html::dropDownList('living', $model->living,Yii::$app->params['config']['room_living'], ['class' => 'form-control']);?>
                        </div>
                    </div>
                    
                    <div class="form-group" id="uploader">
                        <label class="col-sm-3 control-label">头图: <span class="asterisk">*</span></label>
                        <div class="col-sm-9">
                            <?=$uploader?>
                            <?php if ($model->pic):?>
                            <div class="file-item thumbnail upload-state-done"><img src="<?=CommonImages::getImageUrl($model->pic, 110, 110)?>"><div class="info">当前图片</div></div>
                            <?php endif;?>
                        </div>
                    </div>
                    
                </div><!-- row -->
            </div><!-- panel-body -->
            <div class="panel-footer">
                <div class="row">
                    <div class="col-sm-9 col-sm-offset-3">
                        <button class="btn btn-primary mr5" id="upload_button">保存</button>
                        <a href="<?=$_refer?>" class="btn btn-dark">取消</a>
                    </div>
                </div>
            </div><!-- panel-footer -->
        </div><!-- panel -->
    </form>

</div>