dever 5 роки тому
батько
коміт
dc5c6f3931

+ 1 - 1
app/collection/database/type.php

@@ -101,7 +101,7 @@ return array
             '"四宫格图片","content/pic_grid",188,1,' . DEVER_TIME,
 
             '"普通视频","content/video",179,1,' . DEVER_TIME,
-            '"短视频","content/video_short",178,1,' . DEVER_TIME,
+            '"短视频","content/video_short-list",178,1,' . DEVER_TIME,
 
             '"普通音频","content/audio",169,1,' . DEVER_TIME,
 

+ 42 - 30
app/collection/lib/Content.php

@@ -38,41 +38,53 @@ class Content
 
 		$data['data'] = Dever::db($table)->$method(array('content_id' => $data['id'], 'info_id' => $data['info_id']));
 
-		$data['data']['num_view'] = 1;
+        if (isset($data['data']['id'])) {
+            $data['data'] = $this->getData($data['data']);
+        } else {
+            foreach ($data['data'] as $k => $v) {
+                $data['data'][$k] = $this->getData($v);
+            }
+        }
+		return $data;
+	}
 
-		$data['data']['date'] = '';
-		if (isset($data['data']['cdate'])) {
-			$data['data']['date'] = date('Y-m-d H:i:s', $data['data']['cdate']);
-		}
+    public function getData($data)
+    {
+        $data['num_view'] = 1;
 
-		if (isset($data['data']['text'])) {
-			$data['data']['text'] = Dever::array_decode($data['data']['text']);
-
-			foreach ($data['data']['text'] as $k => $v) {
-				if (isset($v['name']) && $v['name']) {
-					$data['data']['text'][$k]['name_array'] = explode("\r\n", $v['name']);
-				}
-
-				if (isset($v['bgcolor_type']) && $v['bgcolor_type'][0] == 2) {
-					$data['data']['text'][$k]['bgcolor'] = '';
-				}
-				
-				if (isset($v['content']) && $v['content']) {
-					$data['data']['text'][$k]['content_array'] = $this->getContent($v);
-				}
-			}
-		}
+        $data['date'] = '';
+        if (isset($data['cdate'])) {
+            $data['date'] = date('Y-m-d H:i:s', $data['cdate']);
+        }
 
-		if (isset($data['data']['author_id']) && $data['data']['author_id'] > 0) {
-			$data['data']['author'] = Dever::db('store/author')->one($data['data']['author_id']);
-		}
+        if (isset($data['text'])) {
+            $data['text'] = Dever::array_decode($data['text']);
 
-		if (isset($data['data']['content']) && $data['data']['content']) {
-			$data['data'] = $this->getContent($data['data']);
-		}
+            foreach ($data['text'] as $k => $v) {
+                if (isset($v['name']) && $v['name']) {
+                    $data['text'][$k]['name_array'] = explode("\r\n", $v['name']);
+                }
 
-		return $data;
-	}
+                if (isset($v['bgcolor_type']) && $v['bgcolor_type'][0] == 2) {
+                    $data['text'][$k]['bgcolor'] = '';
+                }
+                
+                if (isset($v['content']) && $v['content']) {
+                    $data['text'][$k]['content_array'] = $this->getContent($v);
+                }
+            }
+        }
+
+        if (isset($data['author_id']) && $data['author_id'] > 0) {
+            $data['author'] = Dever::db('store/author')->one($data['author_id']);
+        }
+
+        if (isset($data['content']) && $data['content']) {
+            $data = $this->getContent($data);
+        }
+
+        return $data;
+    }
 
 	public function getContent($data, $uid = false)
     {

+ 1 - 1
app/collection/lib/Manage.php

@@ -220,7 +220,7 @@ class Manage
                     Dever::setInput('oper_project', 'collection');
                 }
 
-                http://192.168.33.10/dreamland/package/manage/?l=project/database/list&project=collection&page_type=1&table=content&table=content&save_table=link&save_project=content&project=collection&page_type=1&oper_table=info&oper_project=collection&menu=collection&menu_id=24&search_option_state=1&search_option_info_id=1
+               // http://192.168.33.10/dreamland/package/manage/?l=project/database/list&project=collection&page_type=1&table=content&table=content&save_table=link&save_project=content&project=collection&page_type=1&oper_table=info&oper_project=collection&menu=collection&menu_id=24&search_option_state=1&search_option_info_id=1
 
                // http://192.168.33.10/dreamland/package/manage/?l=project/database/list&project=collection&page_type=2&table=content&search_option_info_id=1&oper_table=info&page_type=1&menu=collection&menu_id=24&search_option_state=1
                 

+ 164 - 40
app/content/database/video_short.php

@@ -2,6 +2,32 @@
 
 $status = Dever::config('base')->status;
 
+$is_button = array
+(
+    1 => '显示',
+    2 => '不显示',
+);
+
+$text = array
+(
+    1 => '上左',
+    2 => '上中',
+    3 => '上右',
+    4 => '中左',
+    5 => '正中',
+    6 => '中右',
+    7 => '下左',
+    8 => '下中',
+    9 => '下右',
+    //10 => '自定义',
+);
+
+$bgcolor_type = array
+(
+    1 => '设置背景颜色',
+    2 => '不设置背景颜色',
+);
+
 return array
 (
 	# 表名
@@ -21,7 +47,7 @@ return array
 			'default' 	=> '',
 			'desc' 		=> '',
 			'match' 	=> 'is_numeric',
-			'list'		=> true,
+			//'list'		=> true,
 		),
 
 		'info_id'      => array
@@ -54,7 +80,7 @@ return array
 			'desc' 		=> '标题',
 			'match' 	=> 'option',
 			'update'	=> 'text',
-			'list'		=> true,
+			//'list'		=> true,
 			'search'	=> 'fulltext',
 			//增加预览
 			'preview'	=> true,
@@ -69,64 +95,150 @@ return array
 			'match' 	=> 'option',
 			'update'	=> 'textarea',
 		),
+		
+		'pic'		=> array
+		(
+			'type' 		=> 'varchar-150',
+			'name' 		=> '封面图-封面图图片尺寸750*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式',
+			'default' 	=> '',
+			'desc' 		=> '封面图',
+			'match' 	=> 'option',
+			'update'	=> 'image',
+			'key' 		=> '1',
+			'place'		=> '750*1386',
+			'list'		=> '"<img src=\"{pic}\" class=\"dever-pic\" width=\"150\" \/>"',
+		),
+
+        'video'     => array
+        (
+            'type'      => 'varchar-800',
+            'name'      => '上传视频-视频格式mp4,上传大小不能超过4G',
+            'default'   => '',
+            'desc'      => '上传点播视频',
+            'match'     => 'is_string',
+            'update'    => 'upload',
+            'key'       => '3',
+            'place'     => '150',
+            'upload'    => 'qiniu',
+            'large'     => true,
+            //不覆盖原文件,生成新文件
+            'cover'     => 2,   
+        ),
+
+        'udate'		=> array
+		(
+			'type' 		=> 'int-11',
+			'name' 		=> '更新时间',
+			'match' 	=> array('is_numeric', time()),
+			'desc' 		=> '',
+		),
+
+        'video_info'        => array
+        (
+            'type'      => 'text-255',
+            'name'      => '视频信息',
+            'default'   => '',
+            'desc'      => '视频信息',
+            'match'     => 'is_string',
+        ),
 
         'text'       => array
         (
             'type'      => 'text-1000',
-            'name'      => '短视频设置',
+            'name'      => '文字设置',
             'default'   => '',
-            'desc'      => '短视频设置',
+            'desc'      => '文字设置',
             'match'     => 'is_string',
-            'show'      => 'type=31',
+            'option'    => $text,
             'update'    => array
             (
-            	array
+                array
                 (
                     'col'       => 'name',
-                    'name'      => '标题-为空则不显示',
+                    'name'      => '文字内容',
                     'default'   => '',
                     'desc'      => '文字内容',
-                    'match'     => 'option',
+                    'match'     => 'is_string',
                     'update'    => 'textarea',
                 ),
 
                 array
                 (
-                    'col'       => 'pic',
-                    'name' 		=> '封面图-图片尺寸750*1386px或等比尺寸,上传大小不能超过2M,支持JPG、PNG、GIF格式,建议上传JPG格式,同时用于分享图片',
-					'default' 	=> '',
-					'desc' 		=> '封面图',
-					'match' 	=> 'option',
-					'update'	=> 'image',
-					'key' 		=> '1',
-					'place'		=> '750*1386',
+                    'col'       => 'color',
+                    'name'      => '文字颜色',
+                    'default'   => '#000000',
+                    'desc'      => '文字颜色',
+                    'match'     => 'is_string',
+                    'update'    => 'color',
+                ),
+
+                array
+                (
+                    'col'       => 'bgcolor_type',
+                    'name'      => '是否设置背景颜色',
+                    'default'   => '2',
+                    'desc'      => '是否设置背景颜色',
+                    'match'     => 'is_string',
+                    'update'    => 'radio',
+                    'option'    => $bgcolor_type,
+                    'control'   => 'bgcolor_type',
+                ),
+
+                array
+                (
+                    'col'       => 'bgcolor',
+                    'name'      => '背景颜色',
+                    'default'   => '#000000',
+                    'desc'      => '背景颜色',
+                    'match'     => 'is_string',
+                    'update'    => 'color',
+                    'show'      => 'bgcolor_type=1'
                 ),
-                
+
                 array
                 (
-                    'col'       => 'video',
-                    'name'      => '上传视频-视频格式mp4,上传大小不能超过4G',
-		            'default'   => '',
-		            'desc'      => '上传视频',
-		            'match'     => 'is_string',
-		            'update'    => 'upload',
-		            'key'       => '3',
-		            'place'     => '150',
-		            'upload'    => 'qiniu',
-		            'large'     => true,
-		            //不覆盖原文件,生成新文件
-		            'cover'     => 2,   
+                    'col'       => 'size',
+                    'name'      => '文字大小-直接输入像素数字',
+                    'default'   => '16',
+                    'desc'      => '结果描述',
+                    'match'     => 'is_numeric',
+                    'update'    => 'text',
                 ),
             ),
         ),
 
-        'video_info'        => array
+        'is_button'     => array
         (
-            'type'      => 'text-255',
-            'name'      => '视频信息',
-            'default'   => '',
-            'desc'      => '视频信息',
-            'match'     => 'is_string',
+            'type'      => 'int-11',
+            'name'      => '是否显示保存按钮',
+            'default'   => '2',
+            'desc'      => '是否显示保存按钮',
+            'match'     => 'is_numeric',
+            'update'    => 'radio',
+            'option'    => $is_button,
+            'control'   => 'is_button',
+        ),
+
+        'button_name'     => array
+        (
+            'type'      => 'varchar-80',
+            'name'      => '保存按钮文字内容',
+            'default'   => '保存图片',
+            'desc'      => '保存按钮文字内容',
+            'match'     => 'option',
+            'update'    => 'textarea',
+            'show'		=> 'is_button=1',
+        ),
+
+        'button_color'     => array
+        (
+            'type'      => 'varchar-10',
+            'name'      => '保存按钮文字颜色',
+            'default'   => '#000000',
+            'desc'      => '保存按钮文字颜色',
+            'match'     => 'option',
+            'update'    => 'color', 
+            'show'		=> 'is_button=1',
         ),
 
 		'udate'		=> array
@@ -146,9 +258,9 @@ return array
 			'match' 	=> 'is_numeric',
 			//'update'	=> 'select',
 			'option'	=> $status,
-			'search'	=> 'select',
-			'list'		=> true,
-			'edit'		=> true,
+			//'search'	=> 'select',
+			//'list'		=> true,
+			//'edit'		=> true,
 		),
 
 		'reorder'		=> array
@@ -188,12 +300,24 @@ return array
 	# 管理功能
 	'manage' => array
 	(
-		
+
 	),
 
 	# request 请求接口定义
 	'request' => array
 	(
-		
+		'getAll' => array
+        (
+            # 匹配的正则或函数 选填项
+            'option' => array
+            (
+                'info_id' => 'yes',
+                'content_id' => 'yes',
+                'state' => 1,
+            ),
+            'type' => 'all',
+            'order' => array('reorder' => 'desc', 'id' => 'desc'),
+            'col' => '*',
+        ),
 	),
 );