From 096299af06ac4e608e24d27be34014e778571b96 Mon Sep 17 00:00:00 2001 From: Devil Date: Sun, 29 Dec 2019 18:27:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BC=98=E5=8C=96+=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=B8=AD=E5=BF=83=E8=8F=9C=E5=8D=95=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common.php | 6 +- .../index/view/default/category/index.html | 2 +- .../index/view/default/public/user_menu.html | 4 +- application/service/NavigationService.php | 26 ++++----- public/static/index/default/css/category.css | 56 +++++++++---------- public/static/index/default/js/category.js | 10 ++-- 6 files changed, 50 insertions(+), 54 deletions(-) diff --git a/application/common.php b/application/common.php index 2410a0887..eae721803 100755 --- a/application/common.php +++ b/application/common.php @@ -452,11 +452,7 @@ function FunEach(&$data) */ function PriceNumberFormat($value, $decimals = 2, $dec_point = '.') { - if(isset($value)) - { - return number_format($value, $decimals, $dec_point, ''); - } - return 0.00; + return number_format((float) $value, $decimals, $dec_point, ''); } /** diff --git a/application/index/view/default/category/index.html b/application/index/view/default/category/index.html index bc0803500..bbe557d90 100755 --- a/application/index/view/default/category/index.html +++ b/application/index/view/default/category/index.html @@ -17,7 +17,7 @@ {{include file="public/goods_category" /}} -
+
{{if !empty($goods_category_list)}}
    {{foreach $goods_category_list as $k=>$v}} diff --git a/application/index/view/default/public/user_menu.html b/application/index/view/default/public/user_menu.html index d61ab06b9..e42bdfc09 100755 --- a/application/index/view/default/public/user_menu.html +++ b/application/index/view/default/public/user_menu.html @@ -6,7 +6,7 @@ {{foreach $user_left_menu as $k=>$v}} {{if $v.is_show eq 1}} {{if empty($v['item'])}} -
  • +
  • {{if !empty($v['icon'])}}{{/if}} {{$v.name}}
  • {{else /}} @@ -15,7 +15,7 @@
      {{foreach $v.item as $vs}} {{if $vs.is_show eq 1}} -
    • +
    • {{if !empty($vs['icon'])}}{{/if}} {{$vs.name}}
    • {{/if}} diff --git a/application/service/NavigationService.php b/application/service/NavigationService.php index fa34b221e..bd02ef77b 100755 --- a/application/service/NavigationService.php +++ b/application/service/NavigationService.php @@ -689,7 +689,7 @@ class NavigationService // name 名称 // url 页面地址 // is_show 是否显示(0否, 1是) - // contains 包含的子页面(包括自身) + // contains 包含的子页面(包括自身) 如用户中心(index 组, user 控制器, index 方法 [ indexuserindex ]) // icon icon类 // item 二级数据 // is_system 是否系统内置菜单(0否, 1是)扩展数据可空或0 @@ -700,7 +700,7 @@ class NavigationService 'name' => '个人中心', 'url' => MyUrl('index/user/index'), 'is_show' => 1, - 'contains' => ['userindex'], + 'contains' => ['indexuserindex'], 'icon' => 'am-icon-home', 'is_system' => 1, ], @@ -714,7 +714,7 @@ class NavigationService 'name' => '订单管理', 'url' => MyUrl('index/order/index'), 'is_show' => 1, - 'contains' => ['orderindex', 'orderdetail', 'ordercomments'], + 'contains' => ['indexorderindex', 'indexorderdetail', 'indexordercomments'], 'icon' => 'am-icon-th-list', 'is_system' => 1, ], @@ -722,14 +722,14 @@ class NavigationService 'name' => '订单售后', 'url' => MyUrl('index/orderaftersale/index'), 'is_show' => 1, - 'contains' => ['orderaftersaleindex', 'orderaftersaleaftersale'], + 'contains' => ['indexorderaftersaleindex', 'indexorderaftersaleaftersale'], 'icon' => 'am-icon-puzzle-piece', 'is_system' => 1, ], [ 'name' => '我的收藏', 'url' => MyUrl('index/userfavor/goods'), - 'contains' => ['userfavorgoods'], + 'contains' => ['indexuserfavorgoods'], 'is_show' => 1, 'icon' => 'am-icon-heart-o', 'is_system' => 1, @@ -745,7 +745,7 @@ class NavigationService [ 'name' => '我的积分', 'url' => MyUrl('index/userintegral/index'), - 'contains' => ['userintegralindex'], + 'contains' => ['indexuserintegralindex'], 'is_show' => 1, 'icon' => 'am-icon-fire', 'is_system' => 1, @@ -761,7 +761,7 @@ class NavigationService [ 'name' => '个人资料', 'url' => MyUrl('index/personal/index'), - 'contains' => ['personalindex', 'personalsaveinfo'], + 'contains' => ['indexpersonalindex', 'indexpersonalsaveinfo'], 'is_show' => 1, 'icon' => 'am-icon-gear', 'is_system' => 1, @@ -769,7 +769,7 @@ class NavigationService [ 'name' => '我的地址', 'url' => MyUrl('index/useraddress/index'), - 'contains' => ['useraddressindex', 'useraddresssaveinfo'], + 'contains' => ['indexuseraddressindex', 'indexuseraddresssaveinfo'], 'is_show' => 1, 'icon' => 'am-icon-street-view', 'is_system' => 1, @@ -777,7 +777,7 @@ class NavigationService [ 'name' => '安全设置', 'url' => MyUrl('index/safety/index'), - 'contains' => ['safetyindex', 'safetyloginpwdinfo', 'safetymobileinfo', 'safetynewmobileinfo', 'safetyemailinfo', 'safetynewemailinfo'], + 'contains' => ['indexsafetyindex', 'indexsafetyloginpwdinfo', 'indexsafetymobileinfo', 'indexsafetynewmobileinfo', 'indexsafetyemailinfo', 'indexsafetynewemailinfo'], 'is_show' => 1, 'icon' => 'am-icon-user-secret', 'is_system' => 1, @@ -785,7 +785,7 @@ class NavigationService [ 'name' => '我的消息', 'url' => MyUrl('index/message/index'), - 'contains' => ['messageindex'], + 'contains' => ['indexmessageindex'], 'is_show' => 1, 'icon' => 'am-icon-bell-o', 'is_system' => 1, @@ -793,7 +793,7 @@ class NavigationService [ 'name' => '我的足迹', 'url' => MyUrl('index/usergoodsbrowse/index'), - 'contains' => ['usergoodsbrowseindex'], + 'contains' => ['indexusergoodsbrowseindex'], 'is_show' => 1, 'icon' => 'am-icon-lastfm', 'is_system' => 1, @@ -801,7 +801,7 @@ class NavigationService [ 'name' => '问答/留言', 'url' => MyUrl('index/answer/index'), - 'contains' => ['answerindex'], + 'contains' => ['indexanswerindex'], 'is_show' => 1, 'icon' => 'am-icon-question', 'is_system' => 1, @@ -811,7 +811,7 @@ class NavigationService 'logout' => [ 'name' => '安全退出', 'url' => MyUrl('index/user/logout'), - 'contains' => ['userlogout'], + 'contains' => ['indexuserlogout'], 'is_show' => 1, 'icon' => 'am-icon-power-off', 'is_system' => 1, diff --git a/public/static/index/default/css/category.css b/public/static/index/default/css/category.css index 8ae89f00c..20e9fa280 100755 --- a/public/static/index/default/css/category.css +++ b/public/static/index/default/css/category.css @@ -1,16 +1,16 @@ -.category-list ul.category-nav, -.category-list .category-content { +.category-list-container ul.category-nav, +.category-list-container .category-content { overflow-y: auto; overflow-x: hidden; } -.category-list .category-content { +.category-list-container .category-content { width: calc(100% - 110px); } -.category-list ul.category-nav { +.category-list-container ul.category-nav { width: 100px; background: #f5f5f5; } -.category-list ul.category-nav li { +.category-list-container ul.category-nav li { height: 45px; line-height: 45px; font-weight: 500; @@ -19,68 +19,68 @@ border-left: 3px solid transparent; cursor: pointer; } -.category-list ul.category-nav li.active { +.category-list-container ul.category-nav li.active { background: #fff; color: #d2364c; border-left: 3px solid #d2364c; } -.category-list ul.category-nav li:not(:first-child) { +.category-list-container ul.category-nav li:not(:first-child) { border-top: 1px solid #e9e9e9; } -.category-list .category-content .category-icon { +.category-list-container .category-content .category-icon { max-width: 50px; max-height: 50px; } -.category-list .category-content .category-item { +.category-list-container .category-content .category-item { border: 1px solid #eee; } -.category-list .category-content .category-item:not(:last-child) { +.category-list-container .category-content .category-item:not(:last-child) { margin-bottom: 15px; } -.category-list .category-content ul { +.category-list-container .category-content ul { border-top: 1px dotted #e5e5e5; } -.category-list ul.category-nav li, -.category-list .category-content .title, -.category-list .category-content ul { +.category-list-container ul.category-nav li, +.category-list-container .category-content .title, +.category-list-container .category-content ul { overflow: hidden; } -.category-list .category-content .title a { +.category-list-container .category-content .title a { font-weight: 500; color: #888; } -.category-list .category-content ul li:not(:last-child) { +.category-list-container .category-content ul li:not(:last-child) { margin-right: 20px; } -.category-list .category-content ul li a { +.category-list-container .category-content ul li a { color: #787878; font-size: 12px; line-height: 22px; } @media only screen and (min-width:640px) { - .category-list { + .category-list-container { margin-top: 10px; } - .category-list .category-content { + .category-list-container .category-content { padding-top: 0; } - .category-list ul.category-nav, - .category-list .category-content { + .category-list-container ul.category-nav, + .category-list-container .category-content { height: 100vh; } - .category-list ul.category-nav { + .category-list-container ul.category-nav { margin-left: 5px; } - .category-list .category-content { + .category-list-container .category-content { margin-right: 5px; width: calc(100% - 120px); } } @media only screen and (min-width:1025px) { - .category-list ul.category-nav { + .category-list-container ul.category-nav { margin-left: 0; } - .category-list .category-content { + .category-list-container .category-content { margin-right: 0; width: calc(100% - 110px); } @@ -88,12 +88,12 @@ @media only screen and (max-width:640px) { .am-footer { padding-bottom: 50px; } - .category-list ul.category-nav, - .category-list .category-content { + .category-list-container ul.category-nav, + .category-list-container .category-content { height: calc(100vh - 138px); } - .category-list .category-content .category-item { + .category-list-container .category-content .category-item { margin-right: 10px; } } \ No newline at end of file diff --git a/public/static/index/default/js/category.js b/public/static/index/default/js/category.js index 5442e80e4..2199e1579 100644 --- a/public/static/index/default/js/category.js +++ b/public/static/index/default/js/category.js @@ -1,17 +1,17 @@ $(function() { // 一级分类显/隐操作 - $('.category-list ul.category-nav li').on('mouseover', function() + $('.category-list-container ul.category-nav li').on('mouseover', function() { var index = $(this).index(); - $('.category-list ul.category-nav li').removeClass('active'); + $('.category-list-container ul.category-nav li').removeClass('active'); $(this).addClass('active'); - $('.category-content').addClass('none'); - $('.category-content-'+index).removeClass('none'); + $('.category-list-container .category-content').addClass('none'); + $('.category-list-container .category-content-'+index).removeClass('none'); }); // 一级分类双击进入商品搜索页 - $('.category-list ul.category-nav li').on('dblclick', function() + $('.category-list-container ul.category-nav li').on('dblclick', function() { var url = $(this).data('url') || null; if(url != null)