lizhen 2 днів тому
батько
коміт
67e9b8fec1

+ 3 - 3
application/admin/lang/zh-cn/zhengcejiedu.php

@@ -2,12 +2,12 @@
 
 return [
     'Id'          => 'ID',
-    'Title'       => '名称',
-    'Image'       => 'LOGO',
+    'Title'       => '标题',
+    'Image'       => '封面图',
     'Audio_file'  => '音频文件',
     'Video_file'  => '视频文件',
     'Video_image' => '视频缩略图',
-    'Content'     => '内容',
+    'Content'     => '详情内容',
     'Createtime'  => '创建时间',
     'Updatetime'  => '更新时间',
     'Status'      => '状态',

+ 3 - 3
application/admin/view/zhengcejiedu/add.html

@@ -3,7 +3,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-title" class="form-control" name="row[title]" type="text" value="">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="">
         </div>
     </div>
     <div class="form-group">
@@ -48,7 +48,7 @@
             <ul class="row list-inline faupload-preview" id="p-video_file"></ul>
         </div>
     </div>
-    <div class="form-group">
+   <!-- <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Video_image')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
@@ -61,7 +61,7 @@
             </div>
             <ul class="row list-inline faupload-preview" id="p-video_image"></ul>
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 3 - 3
application/admin/view/zhengcejiedu/edit.html

@@ -3,7 +3,7 @@
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
         <div class="col-xs-12 col-sm-8">
-            <input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
+            <input id="c-title" data-rule="required" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
         </div>
     </div>
     <div class="form-group">
@@ -48,7 +48,7 @@
             <ul class="row list-inline faupload-preview" id="p-video_file"></ul>
         </div>
     </div>
-    <div class="form-group">
+    <!--<div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Video_image')}:</label>
         <div class="col-xs-12 col-sm-8">
             <div class="input-group">
@@ -61,7 +61,7 @@
             </div>
             <ul class="row list-inline faupload-preview" id="p-video_image"></ul>
         </div>
-    </div>
+    </div>-->
     <div class="form-group">
         <label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
         <div class="col-xs-12 col-sm-8">

+ 2 - 2
application/admin/view/zhengcejiedu/index.html

@@ -18,8 +18,8 @@
                     <div id="toolbar" class="toolbar">
                         <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                         <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('zhengcejiedu/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
-                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('zhengcejiedu/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
-                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('zhengcejiedu/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
+<!--                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('zhengcejiedu/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
+<!--                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('zhengcejiedu/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
                         
 
                         <div class="dropdown btn-group {:$auth->check('zhengcejiedu/multi')?'':'hide'}">

+ 2 - 2
application/api/controller/Index.php

@@ -41,8 +41,8 @@ class Index extends Api
 
         $gonggao = Db::name('message_sys')->field('id,title,info,updatetime')->order('weigh','desc')->find();
 
-        $zhengce = Db::name('zhengcejiedu')->field('id,title,image,updatetime')->order('weigh','desc')->find();
-        $zhengce = info_domain_image($zhengce,['image']);
+        $zhengce = Db::name('zhengcejiedu')->field('id,title,image,audio_file,video_file,updatetime')->order('weigh','desc')->find();
+        $zhengce = info_domain_image($zhengce,['image','audio_file','video_file']);
         //
         $result = [
             'index_logo' => localpath_to_netpath(config('site.index_logo')),

+ 5 - 4
public/assets/js/backend/zhengcejiedu.js

@@ -24,16 +24,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 sortName: 'weigh',
                 fixedColumns: true,
                 fixedRightNumber: 1,
+                search: false,
                 columns: [
                     [
                         {checkbox: true},
                         {field: 'id', title: __('Id')},
                         {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                         {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
-                        {field: 'audio_file', title: __('Audio_file'), operate: false, formatter: Table.api.formatter.file},
-                        {field: 'video_file', title: __('Video_file'), operate: false, formatter: Table.api.formatter.file},
-                        {field: 'video_image', title: __('Video_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
-                        {field: 'content', title: __('Content')},
+                        {field: 'audio_file', title: __('Audio_file'), operate: false, formatter: Table.api.formatter.audio},
+                        {field: 'video_file', title: __('Video_file'), operate: false, formatter: Table.api.formatter.video},
+                        // {field: 'video_image', title: __('Video_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
+                        // {field: 'content', title: __('Content')},
                         {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                         {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"0":__('Status 0')}, formatter: Table.api.formatter.status},

+ 24 - 0
public/assets/js/require-table.js

@@ -732,6 +732,30 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                     //渲染fontawesome图标
                     return '<i class="' + value + '"></i> ' + value;
                 },
+                audio: function (value, row, index) {
+                    value = value == null || value.length === 0 ? '' : value.toString();
+
+                    if(!value){
+                        return '';
+                    }
+
+                    return '<audio controls="controls" src="' + value + '" /></audio>';
+                },
+                video: function (value, row, index) {
+                    value = value == null || value.length === 0 ? '' : value.toString();
+
+                    if(!value){
+                        return '';
+                    }
+
+                    return '<video width="100" height="100" controls><source src="'+ Fast.api.cdnurl(value) +'" type="video/ogg"></video>';
+                },
+                color: function (value, row, index) {
+                    value = value == null || value.length === 0 ? '' : value.toString();
+                    value = value ? value : '#ffffff';
+
+                    return '<input disabled type="color" value="' + value + '">';
+                },
                 image: function (value, row, index) {
                     return Table.api.formatter.images.call(this, value, row, index);
                 },