diff --git a/application/admin/controller/style/HomeImages.php b/application/admin/controller/style/HomeImages.php index 9b0782e..83957b6 100644 --- a/application/admin/controller/style/HomeImages.php +++ b/application/admin/controller/style/HomeImages.php @@ -23,6 +23,8 @@ class HomeImages extends Backend parent::_initialize(); $this->model = new \app\admin\model\style\HomeImages; $this->view->assign("typeList", $this->model->getTypeList()); + $this->view->assign("showtypeList", $this->model->getShowtypeList()); + $this->view->assign("showtypeListJson", json_encode($this->model->getShowtypeList(), JSON_UNESCAPED_UNICODE)); } diff --git a/application/admin/lang/zh-cn/style/home_images.php b/application/admin/lang/zh-cn/style/home_images.php index 2673431..2ed2b98 100644 --- a/application/admin/lang/zh-cn/style/home_images.php +++ b/application/admin/lang/zh-cn/style/home_images.php @@ -5,6 +5,11 @@ return [ 'Type' => '跳转类型', 'Type in' => '内部跳转', 'Type out' => '外部跳转', + 'Showtype' => '展示类型', + 'Showtype image' => '图片', + 'Showtype video' => '视频', + + 'Url' => '跳转链接', 'Weigh' => '权重', 'Createtime' => '创建时间', diff --git a/application/admin/model/style/HomeImages.php b/application/admin/model/style/HomeImages.php index 1532e08..155e82a 100644 --- a/application/admin/model/style/HomeImages.php +++ b/application/admin/model/style/HomeImages.php @@ -25,7 +25,8 @@ class HomeImages extends Model // 追加属性 protected $append = [ - 'type_text' + 'type_text', + 'showtype_text' ]; @@ -53,6 +54,19 @@ class HomeImages extends Model return isset($list[$value]) ? $list[$value] : ''; } + public function getShowtypeList() + { + return ['image' => __('Showtype image'), 'video' => __('Showtype video')]; + } + + + public function getShowtypeTextAttr($value, $data) + { + $value = $value ? $value : (isset($data['showtype']) ? $data['showtype'] : ''); + $list = $this->getShowtypeList(); + return isset($list[$value]) ? $list[$value] : ''; + } + diff --git a/application/admin/view/style/home_images/add.html b/application/admin/view/style/home_images/add.html index bd9b1fe..f1e0e3e 100644 --- a/application/admin/view/style/home_images/add.html +++ b/application/admin/view/style/home_images/add.html @@ -1,13 +1,27 @@