分类优化+用户中心菜单优化

This commit is contained in:
Devil 2019-12-29 18:27:24 +08:00
parent 6fe6beb6ea
commit 096299af06
6 changed files with 50 additions and 54 deletions

View File

@ -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, '');
}
/**

View File

@ -17,7 +17,7 @@
{{include file="public/goods_category" /}}
<!-- content -->
<div class="am-container category-list">
<div class="am-container category-list-container">
{{if !empty($goods_category_list)}}
<ul class="category-nav am-fl">
{{foreach $goods_category_list as $k=>$v}}

View File

@ -6,7 +6,7 @@
{{foreach $user_left_menu as $k=>$v}}
{{if $v.is_show eq 1}}
{{if empty($v['item'])}}
<li class="{{if isset($v['contains']) and ((in_array(strtolower($controller_name.$action_name), $v['contains']) and isset($v['is_system']) and $v['is_system'] eq 1 and !isset($params['pluginscontrol'])) or (isset($params['pluginscontrol']) and isset($params['pluginsaction']) and in_array(strtolower($params['pluginscontrol'].$params['pluginsaction']), $v['contains']) and (!isset($v['is_system']) or $v['is_system'] neq 1)))}} am-active{{/if}}" >
<li class="{{if isset($v['contains']) and ((in_array(strtolower($module_name.$controller_name.$action_name), $v['contains']) and isset($v['is_system']) and $v['is_system'] eq 1 and !isset($params['pluginsname'])) or (isset($params['pluginsname']) and isset($params['pluginscontrol']) and isset($params['pluginsaction']) and in_array(strtolower($params['pluginsname'].$params['pluginscontrol'].$params['pluginsaction']), $v['contains']) and (!isset($v['is_system']) or $v['is_system'] neq 1)))}} am-active{{/if}}" >
<a href="{{$v.url}}">{{if !empty($v['icon'])}}<i class="{{$v.icon}}"></i>{{/if}} {{$v.name}}</a>
</li>
{{else /}}
@ -15,7 +15,7 @@
<ul class="am-list am-collapse user-sidebar-sub am-in" id="collapse-nav-{{$k}}">
{{foreach $v.item as $vs}}
{{if $vs.is_show eq 1}}
<li class="{{if isset($vs['contains']) and ((in_array(strtolower($controller_name.$action_name), $vs['contains']) and isset($vs['is_system']) and $vs['is_system'] eq 1 and !isset($params['pluginscontrol'])) or (isset($params['pluginscontrol']) and isset($params['pluginsaction']) and in_array(strtolower($params['pluginscontrol'].$params['pluginsaction']), $vs['contains']) and (!isset($vs['is_system']) or $vs['is_system'] neq 1)))}} am-active{{/if}}">
<li class="{{if isset($vs['contains']) and ((in_array(strtolower($module_name.$controller_name.$action_name), $vs['contains']) and isset($vs['is_system']) and $vs['is_system'] eq 1 and !isset($params['pluginsname'])) or (isset($params['pluginsname']) and isset($params['pluginscontrol']) and isset($params['pluginsaction']) and in_array(strtolower($params['pluginsname'].$params['pluginscontrol'].$params['pluginsaction']), $vs['contains']) and (!isset($vs['is_system']) or $vs['is_system'] neq 1)))}} am-active{{/if}}">
<a href="{{$vs.url}}" class="am-cf">{{if !empty($vs['icon'])}}<i class="{{$vs.icon}}"></i>{{/if}} {{$vs.name}}</a>
</li>
{{/if}}

View File

@ -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,

View File

@ -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;
}
}

View File

@ -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)