From d0a7a5c0a0c3b678a04cf9777443de5659e972a8 Mon Sep 17 00:00:00 2001 From: devil_gong Date: Fri, 10 Aug 2018 13:45:24 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5banner=20nav?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GoodsCategoryController.class.php | 6 +- .../Admin/Lang/zh-cn/goodscategory.php | 6 + .../View/Default/GoodsCategory/Index.html | 10 +- .../Admin/View/Default/Slide/Index.html | 2 +- .../Home/Controller/IndexController.class.php | 27 ++++ .../Home/View/Default/Index/Index.html | 19 ++- .../Home/View/Default/Public/HeaderNav.html | 13 +- .../View/Default/Public/HeaderTopNav.html | 2 +- .../Home/View/Default/Public/HomeBanner.html | 16 ++- .../Home/View/Default/Public/NavSearch.html | 15 +- service/Public/Admin/Default/Css/Common.css | 54 ++++++++ service/Public/Common/Css/Common.css | 54 -------- .../Lib/colorpicker/jquery.colorpicker.js | 20 ++- service/Public/Home/Default/Css/Common.css | 129 ++++++++---------- service/Public/Home/Default/Css/Index.css | 8 +- .../slide/2018/08/20180810094402044087.jpeg | Bin 0 -> 260808 bytes .../slide/2018/08/20180810095910423687.jpeg | Bin 0 -> 144933 bytes .../slide/2018/08/20180810100811853567.jpeg | Bin 0 -> 152291 bytes .../slide/2018/08/20180810101045451156.jpeg | Bin 0 -> 172199 bytes .../slide/2018/08/20180810101106984022.jpeg | Bin 0 -> 102469 bytes .../slide/2018/08/20180810101154662873.jpeg | Bin 0 -> 131291 bytes .../slide/2018/08/20180810101224227323.jpeg | Bin 0 -> 96428 bytes .../slide/2018/08/20180810101305611263.jpeg | Bin 0 -> 299967 bytes service/core.php | 4 +- 24 files changed, 214 insertions(+), 171 deletions(-) create mode 100644 service/Public/Upload/slide/2018/08/20180810094402044087.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810095910423687.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810100811853567.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810101045451156.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810101106984022.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810101154662873.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810101224227323.jpeg create mode 100644 service/Public/Upload/slide/2018/08/20180810101305611263.jpeg diff --git a/service/Application/Admin/Controller/GoodsCategoryController.class.php b/service/Application/Admin/Controller/GoodsCategoryController.class.php index 9f75d9bd9..d160bfeae 100755 --- a/service/Application/Admin/Controller/GoodsCategoryController.class.php +++ b/service/Application/Admin/Controller/GoodsCategoryController.class.php @@ -60,7 +60,7 @@ class GoodsCategoryController extends CommonController } // 获取数据 - $field = array('id', 'pid', 'icon', 'name', 'sort', 'is_enable', 'bg_color', 'big_images'); + $field = array('id', 'pid', 'icon', 'name', 'sort', 'is_enable', 'bg_color', 'big_images', 'vice_name', 'describe'); $data = M('GoodsCategory')->field($field)->where(array('pid'=>intval(I('id', 0))))->select(); if(!empty($data)) { @@ -178,6 +178,8 @@ class GoodsCategoryController extends CommonController // 额外数据处理 $m->add_time = time(); $m->name = I('name'); + $m->vice_name = I('vice_name'); + $m->describe = I('describe'); // 写入数据库 if($m->add()) @@ -194,6 +196,8 @@ class GoodsCategoryController extends CommonController // 额外数据处理 $m->name = I('name'); $m->upd_time = time(); + $m->vice_name = I('vice_name'); + $m->describe = I('describe'); // 移除 id unset($m->id, $m->pid); diff --git a/service/Application/Admin/Lang/zh-cn/goodscategory.php b/service/Application/Admin/Lang/zh-cn/goodscategory.php index c8bc24b1e..9583aec87 100755 --- a/service/Application/Admin/Lang/zh-cn/goodscategory.php +++ b/service/Application/Admin/Lang/zh-cn/goodscategory.php @@ -13,5 +13,11 @@ return array( 'goods_category_edit_name' => '分类编辑', 'goods_category_big_images_text' => '大图片', + + 'goods_category_vice_name_text' => '副名称', + 'goods_category_vice_name_format' => '副名称最大60个字符', + + 'goods_category_describe_text' => '描述', + 'goods_category_describe_format' => '描述最大200个字符', ); ?> \ No newline at end of file diff --git a/service/Application/Admin/View/Default/GoodsCategory/Index.html b/service/Application/Admin/View/Default/GoodsCategory/Index.html index c82df1b77..6710482e3 100755 --- a/service/Application/Admin/View/Default/GoodsCategory/Index.html +++ b/service/Application/Admin/View/Default/GoodsCategory/Index.html @@ -50,6 +50,14 @@ +
+ + +
+
+ + +
@@ -68,7 +76,7 @@ -
+

{{:L('common_form_loading_tips')}}

diff --git a/service/Application/Admin/View/Default/Slide/Index.html b/service/Application/Admin/View/Default/Slide/Index.html index 86f65f5fd..6870f7674 100755 --- a/service/Application/Admin/View/Default/Slide/Index.html +++ b/service/Application/Admin/View/Default/Slide/Index.html @@ -71,7 +71,7 @@ style="background-color:{{$v.bg_color}};"> - + {{:L('common_on_fill_in_images')}} diff --git a/service/Application/Home/Controller/IndexController.class.php b/service/Application/Home/Controller/IndexController.class.php index 25bf6e89c..cf9a85d22 100755 --- a/service/Application/Home/Controller/IndexController.class.php +++ b/service/Application/Home/Controller/IndexController.class.php @@ -34,8 +34,35 @@ class IndexController extends CommonController public function Index() { + // 首页轮播 + $this->assign('banner_list', $this->GetHomeBanner()); $this->display('Index'); } + + /** + * 获取首页banner + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2018-08-10 + * @desc description + */ + private function GetHomeBanner() + { + // 轮播图片 + $banner = M('Slide')->field('jump_url,jump_url_type,images_url,name,bg_color')->where(['platform'=>APPLICATION_CLIENT_TYPE, 'is_enable'=>1])->select(); + if(!empty($banner)) + { + $images_host = C('IMAGE_HOST'); + foreach($banner as &$v) + { + $v['images_url'] = $images_host.$v['images_url']; + $v['jump_url'] = empty($v['jump_url']) ? null : $v['jump_url']; + } + $result['banner'] = $banner; + } + return $banner; + } } ?> \ No newline at end of file diff --git a/service/Application/Home/View/Default/Index/Index.html b/service/Application/Home/View/Default/Index/Index.html index f1f2a6048..5757d915c 100755 --- a/service/Application/Home/View/Default/Index/Index.html +++ b/service/Application/Home/View/Default/Index/Index.html @@ -96,8 +96,8 @@
-
-
+ -
-
+
@@ -450,10 +450,8 @@ \ No newline at end of file diff --git a/service/Application/Home/View/Default/Public/HeaderNav.html b/service/Application/Home/View/Default/Public/HeaderNav.html index 0f63f2f57..5f63289cf 100755 --- a/service/Application/Home/View/Default/Public/HeaderNav.html +++ b/service/Application/Home/View/Default/Public/HeaderNav.html @@ -3,11 +3,14 @@