web端商品参数
parent
c465b61442
commit
2bac7d300b
|
|
@ -2086,20 +2086,23 @@ function ParamsChecked($data, $params)
|
|||
}
|
||||
if(empty($data[$v['key_name']]))
|
||||
{
|
||||
return $v['error_msg'];
|
||||
return str_replace('{$var}', 'unique验证', $v['error_msg']);
|
||||
}
|
||||
$temp = db($v['checked_data'])->where([$v['key_name']=>$data[$v['key_name']]])->find();
|
||||
if(!empty($temp))
|
||||
{
|
||||
// 错误数据变量替换
|
||||
$error_msg = str_replace('{$var}', $data[$v['key_name']], $v['error_msg']);
|
||||
|
||||
// 是否需要排除当前操作数据
|
||||
if(isset($v['checked_key']))
|
||||
{
|
||||
if(empty($data[$v['checked_key']]) || (isset($temp[$v['checked_key']]) && $temp[$v['checked_key']] != $data[$v['checked_key']]))
|
||||
{
|
||||
return str_replace('{$var}', $data[$v['key_name']], $v['error_msg']);
|
||||
return $error_msg;
|
||||
}
|
||||
} else {
|
||||
return $v['error_msg'];
|
||||
return $error_msg;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ class Goods extends Common
|
|||
],
|
||||
'is_photo' => true,
|
||||
'is_spec' => true,
|
||||
'is_params' => true,
|
||||
];
|
||||
$ret = GoodsService::GoodsList($params);
|
||||
if(empty($ret['data'][0]) || $ret['data'][0]['is_delete_time'] != 0)
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@
|
|||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!--销量-->
|
||||
<!--销量/浏览/评论-->
|
||||
<ul class="tm-ind-panel">
|
||||
<li class="tm-ind-item">
|
||||
<div class="tm-indcon"><span class="tm-label">累计销量</span><span class="tm-count">{{$goods.sales_count}}</span></div>
|
||||
|
|
@ -239,6 +239,18 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
{{if !empty($goods['parameters']) and !empty($goods['parameters']['base'])}}
|
||||
<!-- 商品基础参数 -->
|
||||
<ul class="am-avg-sm-2 am-avg-md-2 am-avg-lg-3 am-padding-vertical-xs parameters-content parameters-base">
|
||||
{{foreach $goods.parameters.base as $v}}
|
||||
<li class="am-padding-vertical-xs am-padding-horizontal-sm am-text-truncate">
|
||||
<span>{{$v.name}}:</span>
|
||||
<span>{{$v.value}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
|
||||
<!--各种规格-->
|
||||
{{if $goods['is_shelves'] == 1 and $goods['inventory'] gt 0}}
|
||||
<dl class="iteminfo_parameter sys_item_specpara">
|
||||
|
|
@ -257,7 +269,7 @@
|
|||
<a href="javascript:;" title="关闭" class="close am-icon-close am-icon-sm"></a>
|
||||
</div>
|
||||
<div class="theme-popbod dform">
|
||||
<form class="theme-signin" name="loginform" action="javascript:;">
|
||||
<form class="theme-signin am-padding-sm" action="javascript:;">
|
||||
<div class="theme-signin-left">
|
||||
{{if !empty($goods['specifications']['choose'])}}
|
||||
{{foreach $goods.specifications.choose as $key=>$spec}}
|
||||
|
|
@ -494,46 +506,40 @@
|
|||
<!-- 详情 -->
|
||||
<div class="am-tabs-bd">
|
||||
<div class="am-tab-panel am-fade am-in am-active">
|
||||
{{if !empty($goods['attribute'])}}
|
||||
<div class="specifications">
|
||||
<div class="spacing-nav-title">
|
||||
<span class="line"></span>
|
||||
<span class="text-wrapper">产品参数</span>
|
||||
</div>
|
||||
<ul class="detail-attr">
|
||||
{{if !empty($goods['attribute'])}}
|
||||
{{foreach $goods.attribute as $key=>$attribute}}
|
||||
<li>{{$attribute.name}}: {{:implode(',', array_column($attribute['find'], 'name'))}}</li>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
{{if !empty($goods['parameters']) and !empty($goods['parameters']['detail'])}}
|
||||
<!-- 商品详情参数 -->
|
||||
<div class="am-cf tabs-nav-base-container">
|
||||
<ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-padding-vertical-xs parameters-content parameters-detail">
|
||||
{{foreach $goods.parameters.detail as $v}}
|
||||
<li class="am-padding-vertical-xs am-padding-horizontal-sm am-text-truncate">
|
||||
<span>{{$v.name}}:</span>
|
||||
<span>{{$v.value}}</span>
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<!-- 详情内容 -->
|
||||
<div class="details">
|
||||
<div class="spacing-nav-title">
|
||||
<span class="line"></span>
|
||||
<span class="text-wrapper">商品细节</span>
|
||||
</div>
|
||||
<div class="detail-content">
|
||||
{{if isset($common_is_goods_detail_show_photo) and $common_is_goods_detail_show_photo eq 1 and !empty($goods.photo)}}
|
||||
<div class="content-photo">
|
||||
{{foreach $goods.photo as $photo}}
|
||||
<li>
|
||||
<img src="{{$photo.images}}" title="{{$goods.title}}" />
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="content-web am-scrollable-horizontal">{{$goods.content_web|raw}}</div>
|
||||
</div>
|
||||
<div class="detail-content am-margin-top-sm">
|
||||
{{if isset($common_is_goods_detail_show_photo) and $common_is_goods_detail_show_photo eq 1 and !empty($goods.photo)}}
|
||||
<!-- 详情相册 -->
|
||||
<div class="content-photo">
|
||||
{{foreach $goods.photo as $photo}}
|
||||
<li>
|
||||
<img src="{{$photo.images}}" title="{{$goods.title}}" />
|
||||
</li>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<!-- web详情 -->
|
||||
<div class="content-web am-scrollable-horizontal">{{$goods.content_web|raw}}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 评论 -->
|
||||
<div class="am-tab-panel am-fade goods-comment" data-goods-id="{{$goods.id}}" data-url="{{:MyUrl('index/goods/comments')}}">
|
||||
<div class="am-cf score-container">
|
||||
<div class="am-cf tabs-nav-base-container score-container">
|
||||
<div class="score am-fl">
|
||||
<p class="name">动态评分</p>
|
||||
<p class="value">{{$goods_score.avg}}</p>
|
||||
|
|
|
|||
|
|
@ -635,10 +635,10 @@ class GoodsService
|
|||
{
|
||||
$base = [];
|
||||
$detail = [];
|
||||
$data = Db::name('GoodsParams')->where(['goods_id'=>$goods_id])->order('id asc')->select();
|
||||
if(!empty($data))
|
||||
$list = Db::name('GoodsParams')->where(['goods_id'=>$goods_id])->order('id asc')->select();
|
||||
if(!empty($list))
|
||||
{
|
||||
foreach($data as $v)
|
||||
foreach($list as $v)
|
||||
{
|
||||
$temp = [
|
||||
'name' => $v['name'],
|
||||
|
|
@ -658,10 +658,23 @@ class GoodsService
|
|||
}
|
||||
}
|
||||
}
|
||||
return [
|
||||
|
||||
// 返回的数据
|
||||
$data = [
|
||||
'base' => $base,
|
||||
'detail' => $detail,
|
||||
];
|
||||
|
||||
// 商品参数钩子
|
||||
$hook_name = 'plugins_service_goods_parameters_data';
|
||||
Hook::listen($hook_name, [
|
||||
'hook_name' => $hook_name,
|
||||
'is_backend' => true,
|
||||
'data' => &$data,
|
||||
'goods_id' => $goods_id,
|
||||
]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -210,6 +210,7 @@ class UserService
|
|||
'key_name' => 'username',
|
||||
'checked_data' => 'User',
|
||||
'checked_key' => 'id',
|
||||
'is_checked' => 1,
|
||||
'error_msg' => '用户已存在[{$var}]',
|
||||
],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -34,9 +34,8 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
|
|||
|
||||
/*可选规格*/
|
||||
.iteminfo_parameter { margin-bottom: 10px; }
|
||||
.theme-signin-left{padding-bottom:30px;max-height:250px ;overflow-y: scroll;background: #fff;}
|
||||
.theme-options{display: block;overflow: hidden;padding-left: 10px;padding-right:10px; margin-bottom: 5px;}
|
||||
.theme-signin-left .cart-title{font-size:14px ;font-weight: 600;}
|
||||
.theme-signin-left{max-height:250px ;overflow-y: scroll;background: #fff;}
|
||||
.theme-options{display: block;overflow: hidden;padding-left: 10px;padding-right:10px; margin-bottom: 5px;color: #666;}
|
||||
.theme-signin-left .sku-line{float: left; margin:10px;margin-left:0;border-radius:3px ; background:#efefef ;padding:3px 8px; border: 1px solid #d5d5d5;}
|
||||
.theme-signin-left .sku-line.selected{background:#d2364c;color: #fff; border: 1px solid #d2364c;}
|
||||
.sku-line-images { padding:3px !important; }
|
||||
|
|
@ -61,26 +60,6 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
|
|||
.text-active { color: #cf2915 !important; }
|
||||
.buy-nav-opt span { font-size: 12px; color: #555; }
|
||||
|
||||
/* 商品评论 */
|
||||
.goods-comment .am-comment { margin-top: 15px; text-align: left; }
|
||||
.goods-comment .am-comment-main { border: 1px solid #eee; }
|
||||
.goods-comment .comment-spec { color: #B0B0B0; }
|
||||
.comment-reply { border-top: 1px dashed #eee; margin-top: 10px; padding-top: 10px; }
|
||||
.goods-comment .am-comment .am-comment-hd { background: #fbfbfb; }
|
||||
.goods-comment .am-comment .am-comment-main:after { border-right-color: #fbfbfb; }
|
||||
.goods-comment .comment-images, .goods-comment .comment-spec { margin-top: 5px; }
|
||||
.goods-comment .comment-images img { width: 50px; height: 50px; border: 1px solid #eee; }
|
||||
.goods-comment .comment-images li:not(:last-child) { margin-right: 5px; }
|
||||
.comment-reply-title { color: #666; }
|
||||
.comment-reply-desc { color: #905602; }
|
||||
|
||||
/* 评分 */
|
||||
.score-container { border-color: #eee; padding: 15px 25px; border-style: none solid solid solid; border-width: 1px; }
|
||||
.score-container .score { width: 80px; border-right: 1px solid #eee; padding-right: 25px; }
|
||||
.score-container .score .name { color: #666; }
|
||||
.score-container .score .value { color: #f03726; font-weight: 700; font-size: 32px; line-height: 32px; margin-top: 5px; }
|
||||
.score-container .am-progress { width: calc(100% - 105px); margin-bottom: 0; margin-top: 18px; line-height: 2rem; text-align: center; }
|
||||
|
||||
/*详情*/
|
||||
.detail-content img { max-width: 100%; height: auto; }
|
||||
|
||||
|
|
@ -90,7 +69,7 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
|
|||
.theme-poptit{display: none;}
|
||||
|
||||
/*商品规格*/
|
||||
.theme-signin-left{padding-top:10px ;float: left;max-height: none;overflow: visible;}
|
||||
.theme-signin-left{max-height: none;overflow: visible;}
|
||||
.theme-options .cart-title{margin-top:5px ;}
|
||||
.theme-options ul{float: left;}
|
||||
|
||||
|
|
@ -119,37 +98,17 @@ input{font-size:12px;font-size:100%;outline:none;line-height:normal;color:#444;}
|
|||
|
||||
@media only screen and (min-width:1025px) {
|
||||
i.buy-event{display: none;}
|
||||
.theme-signin-left{padding-top:15px ;float: left;max-width:none;padding-bottom:0px ;}
|
||||
.theme-signin-right{float: left;display:block;overflow: hidden;padding: 10px;}
|
||||
.theme-signin-right .img-info,.theme-signin-right .text-info{position: static;}
|
||||
.theme-signin-right .img-info img{width:120px;height:120px; }
|
||||
}
|
||||
|
||||
dt + dd {
|
||||
margin:0px 0px;padding:0px 0px;
|
||||
}
|
||||
.am-selected-text{font-size:14px ;}
|
||||
ul,li,ol{ list-style:none;}
|
||||
dl,dd{ margin:auto;}
|
||||
img{ border:none;}
|
||||
button {
|
||||
padding: 1px 6px;
|
||||
}
|
||||
li{ list-style:none;}
|
||||
|
||||
a img,:link img,:visited img { border: none; }
|
||||
table { border-collapse: collapse; border-spacing: 0; font-size: 14px;}
|
||||
:focus { outline: none; }
|
||||
*{margin:0;padding:0;}
|
||||
|
||||
fieldset {padding:0px;padding-left:7px;padding-right:7px;padding-bottom:7px;}
|
||||
fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
|
||||
/*导航*/
|
||||
.introduce-main .am-nav > li > a{padding:4px 0px;font-size: 12px;}
|
||||
.introduce-main .am-nav-tabs > li > a { margin-right:0px;}
|
||||
.introduce-main .am-nav-tabs > li {border-top: 2px solid #f5f5f5;}
|
||||
.introduce-main .am-nav-tabs > li.am-active { border-bottom: 2px solid #F03726; }
|
||||
|
||||
/*导航*/
|
||||
.introduce ul.am-tabs-nav.am-nav.am-nav-tabs {background: #F5F5F5;}
|
||||
.introduce .am-nav-tabs, .introduce .am-tabs-bd{border-color:transparent ;}
|
||||
.introduce .am-nav-tabs > li.am-active > a,
|
||||
|
|
@ -162,16 +121,35 @@ fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
|
|||
.introduce .am-tabs-nav li {height:36px;font-size:14px;line-height:36px ;}
|
||||
.introduce .am-tabs-nav li a,
|
||||
.introduce .am-tabs-nav li.am-active a,
|
||||
.introduce .am-tabs-nav li{cursor: pointer;}
|
||||
.introduce .am-tabs-nav li{cursor: pointer !important;}
|
||||
.introduce .am-nav-tabs > li span{font-size:14px;font-weight:500;}
|
||||
.introduce .am-nav-tabs > li.am-active span{color: #E4393C;}
|
||||
|
||||
/**
|
||||
* 小导航基础容器
|
||||
*/
|
||||
.tabs-nav-base-container { border-color: #eee; border-style: none solid solid solid; border-width: 1px; }
|
||||
|
||||
/* 商品评论 */
|
||||
.goods-comment .am-comment { margin-top: 15px; text-align: left; }
|
||||
.goods-comment .am-comment-main { border: 1px solid #eee; }
|
||||
.goods-comment .comment-spec { color: #B0B0B0; }
|
||||
.comment-reply { border-top: 1px dashed #eee; margin-top: 10px; padding-top: 10px; }
|
||||
.goods-comment .am-comment .am-comment-hd { background: #fbfbfb; }
|
||||
.goods-comment .am-comment .am-comment-main:after { border-right-color: #fbfbfb; }
|
||||
.goods-comment .comment-images, .goods-comment .comment-spec { margin-top: 5px; }
|
||||
.goods-comment .comment-images img { width: 50px; height: 50px; border: 1px solid #eee; }
|
||||
.goods-comment .comment-images li:not(:last-child) { margin-right: 5px; }
|
||||
.comment-reply-title { color: #666; }
|
||||
.comment-reply-desc { color: #905602; }
|
||||
|
||||
/* 评分 */
|
||||
.score-container { padding: 15px 25px; }
|
||||
.score-container .score { width: 80px; border-right: 1px solid #eee; padding-right: 25px; }
|
||||
.score-container .score .name { color: #666; }
|
||||
.score-container .score .value { color: #f03726; font-weight: 700; font-size: 32px; line-height: 32px; margin-top: 5px; }
|
||||
.score-container .am-progress { width: calc(100% - 105px); margin-bottom: 0; margin-top: 18px; line-height: 2rem; text-align: center; }
|
||||
|
||||
/*tab*/
|
||||
.tab{ line-height:56px; font-size:12px;}
|
||||
.tab a{ color:#07c;}
|
||||
.tab a:hover{ color:#c00;}
|
||||
.tab a.cur{ font-weight:bold;}
|
||||
|
||||
/*商品详细页*/
|
||||
.simple-desc { color: #f00; }
|
||||
|
|
@ -219,11 +197,16 @@ fieldset legend{margin-left:15px;padding-left:3px;padding-right:3px;color:#333;}
|
|||
.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; }
|
||||
|
||||
/*销量*/
|
||||
.tm-ind-panel, .iteminfo_parameter { border-bottom: 1px solid #F5F5F5; }
|
||||
.tm-ind-panel, .iteminfo_parameter, .parameters-base { border-bottom: 1px dotted #dadada; }
|
||||
.tm-ind-panel {padding: 10px 5px;position: relative;overflow: hidden;clear: both;display: flex;}
|
||||
.tm-ind-item {float: left;width: 33%;text-align: center;position: relative;left: -1px;border-left: 1px solid #E5DFDA;
|
||||
flex: 1 1 0%;line-height: 16px;cursor: pointer;}
|
||||
.tm-ind-panel .tm-count {display: inline-block;line-height: 16px;height: 16px;color: #C40000;font-weight: 700;margin-left: 3px;}
|
||||
.tm-ind-panel .tm-count {display: inline-block;line-height: 16px;height: 16px;color: #C40000;font-weight: 700;margin-left: 3px;}
|
||||
|
||||
/**
|
||||
* 商品基础参数
|
||||
*/
|
||||
.parameters-base { color: #666; }
|
||||
|
||||
/*规格*/
|
||||
.theme-signin .btn-op.act{display: none;}
|
||||
|
|
@ -253,7 +236,10 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;}
|
|||
.buy-nav .buy-nav-opt { padding-top: 8px; }
|
||||
}
|
||||
@media only screen and (max-width:640px) {
|
||||
.theme-signin-left { margin-bottom:30px; }
|
||||
.buy-nav .nav-icon {display:inline-block;width: 50%;float: left; ;cursor: pointer; border-top: 1px solid #f5f5f5; border-left: 1px solid #f5f5f5; text-align: center; }
|
||||
.parameters-content li:nth-child(2n-1) { padding-left: 5px; }
|
||||
.parameters-content li:nth-child(2n) { padding-right: 5px; }
|
||||
header { display: none; }
|
||||
}
|
||||
|
||||
|
|
@ -264,10 +250,6 @@ flex: 1 1 0%;line-height: 16px;cursor: pointer;}
|
|||
.introduce-main .am-tab-panel { padding: 0px; }
|
||||
|
||||
|
||||
/*产品参数*/
|
||||
ul.detail-attr{overflow: hidden;text-align: left;}
|
||||
ul.detail-attr li {height: 26px;overflow: hidden;line-height: 26px;vertical-align: top;white-space: nowrap; text-overflow: ellipsis;color: #666;font-size:14px;}
|
||||
|
||||
/*推荐商品*/
|
||||
.like{margin-top:25px;border-radius:4px;}
|
||||
.like li{ float:left; padding:8px 10px 5px;font: 14px/1.5 tahoma,arial,"Hiragino Sans GB",宋体,sans-serif;}
|
||||
|
|
@ -296,12 +278,10 @@ ul.detail-attr li {height: 26px;overflow: hidden;line-height: 26px;vertical-alig
|
|||
.iteminfo_parameter.freight dt{margin-left:-70px ;float: left;margin-right:10px ;padding-top:5px ;padding-bottom:20px ;}
|
||||
.buy-nav{position: static; margin-top: 20px; overflow: hidden; }
|
||||
ul.am-avg-sm-4.am-tabs-nav.am-nav.am-nav-tabs {width: auto;}
|
||||
ul.detail-attr li {display: inline;float: left;width: 33.33%;}
|
||||
|
||||
/*可选规格*/
|
||||
.buy-event .cart-title{border:none ;margin-left: -60px;position: relative;padding:10px 0px 5px 10px ;}
|
||||
.buy-event .cart-title .am-icon-angle-right {position: absolute;right: -50px;}
|
||||
.iteminfo_parameter { border-bottom: 0; }
|
||||
|
||||
/*销量*/
|
||||
.tm-ind-panel {border-width:1px 0px;margin: -1px 0px 0px 0px;padding: 10px 0px;
|
||||
|
|
@ -312,7 +292,6 @@ ul.detail-attr li {height: 26px;overflow: hidden;line-height: 26px;vertical-alig
|
|||
|
||||
/*基础*/
|
||||
.tb-detail-price .items dt { min-width: 65px; }
|
||||
.theme-signin-left{float:none;padding-bottom:0;margin:0 ;}
|
||||
.iteminfo_parameter {padding-left: 50px;}
|
||||
.tb-detail-hd,.tb-detail-price{text-align: left;}
|
||||
.tb-detail-hd h1 {font-size: 16px;}
|
||||
|
|
@ -366,9 +345,8 @@ ul.detail-attr li {height: 26px;overflow: hidden;line-height: 26px;vertical-alig
|
|||
|
||||
.theme-options{overflow: visible;padding:0px 0px; margin-bottom: 5px;}
|
||||
.theme-options ul{overflow: hidden;float: none;}
|
||||
.theme-signin-left {max-width:100%;margin-bottom: 0;}
|
||||
.theme-signin-left .sku-line{cursor: pointer; }
|
||||
.theme-signin-left .cart-title{margin-left: -46px;font-size:12px ;font-weight: 100;float: left;}
|
||||
.theme-signin-left .cart-title{margin-left: -46px;float: left;}
|
||||
|
||||
.scoll{display: none;}
|
||||
.item-inform{max-width:1000px; background:#fff; margin-top: 20px; margin-bottom: 30px; }
|
||||
|
|
@ -376,6 +354,7 @@ ul.detail-attr li {height: 26px;overflow: hidden;line-height: 26px;vertical-alig
|
|||
.clearfix-right{width:calc(100% - 370px);margin-left:10px;}
|
||||
.freight{width:400px;float: left;}
|
||||
.iteminfo_parameter.freight dt{padding-top:6px ;padding-bottom:0px ;}
|
||||
.iteminfo_parameter { border-bottom: 0; }
|
||||
|
||||
/*左侧商品-看了又看*/
|
||||
.introduce-main{width:80%;float:left;background:#fff ;}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ $(function()
|
|||
}
|
||||
|
||||
// 备注
|
||||
$('form.nav-buy input[name=user_note]').val($('.order-user-info input.memo-input').val());
|
||||
$('form.nav-buy input[name="user_note"]').val($('.buy-message input.memo-input').val());
|
||||
});
|
||||
|
||||
// 自提点地址
|
||||
|
|
|
|||
Loading…
Reference in New Issue