细节优化

This commit is contained in:
devil_gong 2019-04-22 14:41:20 +08:00
parent fea6adb8c2
commit 620043d06d
9 changed files with 87 additions and 84 deletions

View File

@ -59,6 +59,7 @@
<th>所属平台</th>
<th>导航图标</th>
<th>事件值</th>
<th>是否需要登录</th>
<th>是否启用</th>
<th>创建时间</th>
<th>操作</th>
@ -88,7 +89,10 @@
{{/if}}
</td>
<td class="am-hide-sm-only">
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/apphomenav/statusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-is-update-status="1"></a>
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_need_login'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/apphomenav/statusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_need_login']}}" data-field="is_need_login"></a>
</td>
<td class="am-hide-sm-only">
<a href="javascript:;" class="am-icon-btn am-icon-check submit-state {{if $v['is_enable'] eq 1}}am-success{{else /}}am-default{{/if}}" data-url="{{:MyUrl('admin/apphomenav/statusupdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}" data-field="is_enable" data-is-update-status="1"></a>
</td>
<td>{{$v.add_time_time}}</td>
<td class="view-operation">

View File

@ -73,6 +73,11 @@
<label>顺序</label>
<input type="number" placeholder="顺序" name="sort" min="0" max="255" data-validation-message="顺序 0~255 之间的数值" class="am-radius" value="{{if isset($data['sort'])}}{{$data.sort}}{{else /}}0{{/if}}" required />
</div>
<div class="am-form-group">
<label class="block">是否需要登录</label>
<input name="is_need_login" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if !empty($data) and $data['is_need_login'] eq 1}} checked="true"{{/if}} />
</div>
<div class="am-form-group">
<label class="block">是否启用</label>
<input name="is_enable" value="1" type="checkbox" data-off-text="否" data-on-text="是" data-size="xs" data-on-color="success" data-off-color="default" data-handle-width="50" data-am-switch {{if !empty($data) and $data['is_enable'] eq 1}} checked="true"{{/if}} />

View File

@ -14,6 +14,7 @@ use app\service\BannerService;
use app\service\GoodsService;
use app\service\ArticleService;
use app\service\OrderService;
use app\service\AppNavService;
/**
* 首页
@ -49,6 +50,9 @@ class Index extends Common
// 首页轮播
$this->assign('banner_list', BannerService::Banner());
// H5导航
$this->assign('navigation', AppNavService::AppHomeNav());
// 楼层数据
$this->assign('goods_floor_list', GoodsService::HomeFloorList());

View File

@ -15,26 +15,28 @@
<div class="goods-detail" data-id="{{$goods.id}}" data-spec-detail-ajax-url="{{:MyUrl('index/goods/specdetail')}}" data-spec-type-ajax-url="{{:MyUrl('index/goods/spectype')}}">
<!-- 轮播 -->
<div class="scoll">
<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false}' >
<ul class="am-slides">
{{if !empty($goods.photo)}}
{{foreach $goods.photo as $photo}}
<li>
<img src="{{$photo.images}}" title="{{$goods.title}}" />
</li>
{{/foreach}}
{{/if}}
</ul>
</div>
<div class="slider-content">
<div data-am-widget="slider" class="am-slider am-slider-a1" data-am-slider='{"directionNav":false}' >
<ul class="am-slides">
{{if !empty($goods.photo)}}
{{foreach $goods.photo as $photo}}
<li>
<img src="{{$photo.images}}" title="{{$goods.title}}" />
</li>
{{/foreach}}
{{/if}}
</ul>
</div>
<!-- 视频 -->
{{if !empty($goods.video)}}
<i class="am-icon-play-circle-o goods-video-submit-start"></i>
<i class="goods-video-submit-close none">&times;</i>
<video class="goods-video-container none" src="{{$goods.video}}" controls="controls" preload="auto">
your browser does not support the video tag
</video>
{{/if}}
<!-- 视频 -->
{{if !empty($goods.video)}}
<i class="am-icon-play-circle-o goods-video-submit-start"></i>
<i class="goods-video-submit-close none">&times;</i>
<video class="goods-video-container none" src="{{$goods.video}}" controls="controls" preload="auto">
your browser does not support the video tag
</video>
{{/if}}
</div>
<!-- 商品页面相册底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}

View File

@ -21,43 +21,23 @@
<!-- 轮播上内容 -->
<div class="am-container slideall">
<!-- 轮播右侧-内容1 -->
<div class="am-g am-g-fixed small-nav">
<div class="am-u-sm-3">
<a href="{{:MyUrl('index/category/index')}}">
<div class="nav-icon mini-nav-goods-category">
<img src="{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/home-mini-nav-category-icon.png" />
<!-- 轮播右侧-手机导航 -->
{{if !empty($navigation)}}
<div class="am-g am-g-fixed small-nav">
{{foreach $navigation as $nav}}
<div class="am-u-sm-3">
<a {{if $nav['is_need_login'] eq 1 and empty($user)}} href="javascript:;" class="login-event" {{else /}} href="{{$nav.event_value}}" {{/if}} >
<div class="nav-icon" style="{{if !empty($nav['bg_color'])}}background:{{$nav.bg_color}};{{/if}}">
<img src="{{$nav.images_url}}" alt="{{$nav.name}}" />
</div>
<div class="mini-nav-title">{{$nav.name}}</div>
</a>
</div>
<div class="mini-nav-title">分类</div>
</a>
{{/foreach}}
</div>
<div class="am-u-sm-3">
<a {{if empty($user)}}href="javascript:;" class="login-event"{{else /}} href="{{:MyUrl('index/Cart/index')}}"{{/if}}>
<div class="nav-icon mini-nav-cart">
<img src="{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/home-mini-nav-cart-icon.png" />
</div>
<div class="mini-nav-title">购物车</div>
</a>
</div>
<div class="am-u-sm-3">
<a {{if empty($user)}}href="javascript:;" class="login-event"{{else /}} href="{{:MyUrl('index/order/index')}}"{{/if}}>
<div class="nav-icon mini-nav-order">
<img src="{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/home-mini-nav-order-icon.png" />
</div>
<div class="mini-nav-title">订单</div>
</a>
</div>
<div class="am-u-sm-3">
<a {{if empty($user)}}href="javascript:;" class="login-event"{{else /}} href="{{:MyUrl('index/user/index')}}"{{/if}}>
<div class="nav-icon mini-nav-user">
<img src="{{$attachment_host}}/static/{{$module_name}}/{{$default_theme}}/images/home-mini-nav-user-icon.png" />
</div>
<div class="mini-nav-title">我的</div>
</a>
</div>
</div>
{{/if}}
<!--轮播右侧-内容2 -->
<!--轮播右侧-聚合内容 -->
<div class="marqueen">
<div class="mod-vip">
<div class="m-baseinfo">

View File

@ -46,8 +46,15 @@ class AppNavService
$common_platform_type = lang('common_platform_type');
$common_is_enable_tips = lang('common_is_enable_tips');
$common_app_event_type = lang('common_app_event_type');
$common_is_text_list = lang('common_is_text_list');
foreach($data as &$v)
{
// 是否需要登录
if(isset($v['is_need_login']))
{
$v['is_need_login_text'] = $common_is_text_list[$v['is_need_login']]['name'];
}
// 是否启用
if(isset($v['is_enable']))
{
@ -221,6 +228,7 @@ class AppNavService
'bg_color' => isset($params['bg_color']) ? $params['bg_color'] : '',
'sort' => intval($params['sort']),
'is_enable' => isset($params['is_enable']) ? intval($params['is_enable']) : 0,
'is_need_login' => isset($params['is_need_login']) ? intval($params['is_need_login']) : 0,
];
if(empty($params['id']))
@ -292,6 +300,11 @@ class AppNavService
'key_name' => 'id',
'error_msg' => '操作id有误',
],
[
'checked_type' => 'empty',
'key_name' => 'field',
'error_msg' => '操作字段有误',
],
[
'checked_type' => 'in',
'key_name' => 'state',
@ -306,7 +319,7 @@ class AppNavService
}
// 数据更新
if(Db::name('AppHomeNav')->where(['id'=>intval($params['id'])])->update(['is_enable'=>intval($params['state'])]))
if(Db::name('AppHomeNav')->where(['id'=>intval($params['id'])])->update([$params['field']=>intval($params['state'])]))
{
return DataReturn('编辑成功');
}
@ -324,7 +337,8 @@ class AppNavService
*/
public static function AppHomeNav($params = [])
{
$data = Db::name('AppHomeNav')->field('id,name,images_url,event_value,event_type,bg_color')->where(['platform'=>APPLICATION_CLIENT_TYPE, 'is_enable'=>1])->order('sort asc')->select();
$client_type = (APPLICATION_CLIENT_TYPE == 'pc') ? (IsMobile() ? 'h5' : 'pc') : APPLICATION_CLIENT_TYPE;
$data = Db::name('AppHomeNav')->field('id,name,images_url,event_value,event_type,bg_color,is_need_login')->where(['platform'=>$client_type, 'is_enable'=>1])->order('sort asc')->select();
if(!empty($data))
{
foreach($data as &$v)

File diff suppressed because one or more lines are too long

View File

@ -179,6 +179,7 @@ ul.am-tabs-nav.am-nav.am-nav-tabs {background: #F5F5F5;}
.box .goods-video-container { line-height: 32px; font-size: 32px; color: #f00; background: #fff; text-align: center; width: 100%; height: 100%; top: 0; left: 0; z-index: 3; }
/* 视频 轮播下 */
.scoll .slider-content { overflow: hidden; position: relative; }
.scoll .goods-video-submit-start { left: 0; bottom: 0; z-index: 2; padding: 10px 10px 5px 10px; }
.scoll .goods-video-submit-close { right: 10px; }
.scoll .goods-video-container { line-height: 32px; font-size: 32px; color: #f00; background: #fff; text-align: center; width: 100%; height: 100%; top: 0; left: 0; z-index: 3; }
@ -220,8 +221,6 @@ li.am-active hr{border-top: 1px solid #f00;}
.match-title{height: 36px;line-height: 36px;font-size: 16px;margin: 0px 10px;border-bottom: 1px solid #E6E6E6;color:#E4393C;font-weight: 700;}
.like_list{overflow: hidden;}
.like_list li{float: left;margin-left: 5px;margin-right: 5px;padding-bottom: 15px;text-align: center;}
.s_picBox {width:100px;overflow: hidden;display: block;}
.s_picBox img{width:100% ;}
.info-box-price { color: #E4393C;font-size: 16px;font-family: arial;font-weight: 600;}
.info-original-price {display:none;text-decoration: line-through;font-size: 12px;color: #999;margin-left: 5px;font-family: arial;font-weight: 400;}
.like_list .plus_icon {width: 10px;text-align: center;font-size: 20px;color: #C3C3C3;height:100px ;line-height:100px;margin:0px 0px;}
@ -300,7 +299,7 @@ li.am-comment{ width:100%}
/*导航固定*/
ul.am-tabs-nav.am-nav.am-nav-tabs {margin-right:10px ;margin-left: 10px;width: auto;}
.scoll{float: left;width: calc(45% - 10px);max-width:360px;padding-right:20px; }
.scoll .am-slider { border: 1px solid #eee; }
.scoll .slider-content { border: 1px solid #eee; }
.clearfix-right{float:left;width:55%;min-height: 270px;}
.iteminfo_parameter.freight{display: block;margin-top: 10px;margin-bottom:10px ;}
.iteminfo_parameter.freight dt{margin-left:-70px ;float: left;margin-right:10px ;padding-top:5px ;padding-bottom:20px ;}
@ -320,7 +319,6 @@ li.am-comment{ width:100%}
.tm-ind-panel .tm-count {display: inline-block;line-height: 16px;height: 16px;color: #C40000;font-weight: 700;margin-left: 3px;}
/*搭配*/
.s_picBox {width:150px;}
.like_list .plus_icon {height:150px ;line-height:150px;}
.info-original-price ,.c-title{display: inline;}
.like_list .total_price .buy_now {width:102px;line-height: 32px;font-size: 14px;}

View File

@ -13,17 +13,12 @@ img{max-width:100%;}
.method3 li{border:none;border-left:1px #e8e8e8 solid;border-top:1px #e8e8e8 solid}
dt + dd {margin-top: 0;}
/*手机专享*/
/*手机导航*/
.small-nav {padding:10px 0px; font-size:12px;}
.small-nav .am-u-sm-3 { text-align: center; margin: 5px 0; }
.small-nav .nav-icon {max-width: 50px; max-height: 50px; padding: 12px; margin: 0 auto; border-radius: 50px; background-color: #d2364c; }
.small-nav .nav-icon {max-width: 50px; max-height: 50px; padding: 12px; margin: 0 auto; border-radius: 50px; background-color: #ccc; }
.small-nav .am-u-sm-3:last-child { float: left; }
.small-nav .mini-nav-title { margin-top: 5px; }
.small-nav .mini-nav-goods-category { background-color: #FB6E52; }
.small-nav .mini-nav-cart { background-color: #48CFAE; }
.small-nav .mini-nav-user { background-color: #49acfa; }
.small-nav .mini-nav-order { background-color: #fa506c; }
.small-nav .mini-nav-seconds { background-color: #fa506c; }
.small-nav a { text-decoration: none !important; }
/*走马灯*/