Authored by Lynnic

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into feature/detailFix

Showing 32 changed files with 392 additions and 186 deletions
... ... @@ -16,7 +16,7 @@ use Api\Sign;
*/
class SearchData
{
/**
* 获取搜索的服务地址
*
... ... @@ -29,9 +29,9 @@ class SearchData
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
switch (APPLICATION_ENV) {
case 'release':
case 'test':
case 'preview':
return 'http://100.98.132.63/yohosearch/search.json';
case 'test':
case 'preview':
case 'developer':
default:
return 'http://101.200.31.165/yohosearch/search.json';
... ... @@ -148,7 +148,7 @@ class SearchData
if (!isset($condition['order'])) {
$param['order'] = $orderMaps['s_t_desc'];
} else {
$param['order'] = $orderMaps[ $condition['order'] ];
$param['order'] = $orderMaps[$condition['order']];
}
if (!isset($condition['page'])) {
$param['page'] = 1;
... ...
... ... @@ -9,6 +9,7 @@ use Plugin\Helpers;
*/
class FloorProcess
{
/**
* 频道参数
*
... ... @@ -34,9 +35,9 @@ class FloorProcess
$build = array();
foreach ($data['list'] as $v) {
if (empty($v)) {
continue;
}
if (empty($v)) {
continue;
}
$fun = $v['template_name'];
if (empty($v['data']) || !is_callable("self::$fun")) {
... ... @@ -207,7 +208,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender='.self::$channel[$type];
isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -303,11 +304,11 @@ class FloorProcess
unset($one['src']);
}
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['big_list'] = $data['big_image'];
unset($data['big_image']);
}
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['big_list'] = $data['big_image'];
unset($data['big_image']);
}
foreach ($data['list'] as $kk => &$one) {
if ($kk == 0) {
... ...
... ... @@ -10,11 +10,23 @@ var $searchBox = $('.search-box'),
$box = $('.box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo'),
$channelLink = $('.index-channel a');
$channelLink = $('.index-channel a'),
$win = $(window),
$doc = $(document),
$appFloatLayer = $('#float-layer-app');
var $search = $searchBox.children('input[type="text"]'),
$cancelSearch = $box.children('.no-search'),
$searchIcon = $searchBox.children('.search-icon');
$cancelSearch = $box.children('.no-search'),
$searchIcon = $searchBox.children('.search-icon');
// variables for calculate the app download layer position
var layerInit = false,
windowViewHeight = 0,
layerContentHeight = $appFloatLayer.height(),
layerPaddingTop = parseInt($appFloatLayer.css('padding-top')),
layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')),
layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom,
layerNewPos;
require('../common');
... ... @@ -69,3 +81,40 @@ $channelLink.on('touchstart', function() {
borderColor: '#fff'
});
});
function updateLayerPosition() {
var winHeight = window.innerHeight,
bodyHeight = $doc.height(),
scrollTopPosition = $win.scrollTop();
if (layerInit) {
//keyboard is shown
if (windowViewHeight - winHeight > 200) {
if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) {
layerNewPos = 0;
} else {
layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight;
}
} else {
layerNewPos = bodyHeight - winHeight - scrollTopPosition;
}
} else {
windowViewHeight = winHeight;
layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight;
layerInit = true;
}
$appFloatLayer.css({
position: 'relative',
bottom: layerNewPos + 'px'
});
}
$(window).scroll(function() {
window.requestAnimationFrame(updateLayerPosition);
});
$doc.on('ready', updateLayerPosition);
... ...
/**
* 我要咨询提交页面
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/12/01
*/
var $ = require('jquery'),
tip = require('../../plugin/tip'),
loading = require('../../plugin/loading');
var $consultForm = $('.consult-form'),
$submit = $('#submit'),
$content = $('#content'),
productId = $('#product_id').val(),
isSubmiting;
$submit.on('touchend', function() {
$content.blur();
$consultForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
$content.on('focus', function() {
if ($content.val() === '请输入咨询内容') {
$content.val('');
}
}).on('blur', function() {
if ($content.val() === '') {
$content.val('请输入咨询内容');
}
});
// 提交表单请求
$consultForm.on('submit', function() {
var content;
if (isSubmiting) {
return false;
}
// 简单的表单校验
content = $content.val();
if (!content || content === '请输入咨询内容') {
tip.show('咨询内容不能为空');
return false;
}
isSubmiting = true;
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/product/detail/consultsubmit',
data: {
product_id: productId,
content: content
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.history.go(-1);
}
}).fail(function() {
tip.show('网络出了点问题~');
isSubmiting = false;
});
return false;
});
... ...
... ... @@ -9,10 +9,9 @@ var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var likeHammer = new Hammer(document.getElementById('likeBtn'));
var addToCartHammer = new Hammer(document.getElementById('addtoCart'));
var productId = $('#productId').val();
var likeHammer = new Hammer(document.getElementById('likeBtn')),
addToCartHammer = new Hammer(document.getElementById('addtoCart')),
productId = $('#productId').val();
likeHammer.on('tap', function(e) {
var opt,
... ...
... ... @@ -8,4 +8,5 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/desc');
\ No newline at end of file
require('./detail/loadmore');
require('./detail/consultform');
\ No newline at end of file
... ...
... ... @@ -23,7 +23,7 @@
display: inline-block;
max-width: pxToRem(380px);
overflow: hidden;
text-overflow: ellipsis;
text-overflow: ellipsis;
white-space: nowrap;
}
... ... @@ -37,10 +37,10 @@
}
.action {
font-size: pxToRem(40px);
font-size: pxToRem(32px);
line-height: pxToRem(60px);
text-align: right;
.edit,
.del {
display: inline-block;
... ... @@ -48,6 +48,10 @@
width: pxToRem(60px);
height: pxToRem(60px);
color: #999;
&:hover {
color: #666;
}
}
.edit {
... ... @@ -212,7 +216,7 @@
float: right;
color: #d0d0d0;
}
&.highlight {
background: #eee;
}
... ...
... ... @@ -23,7 +23,7 @@
}
}
}
.employ-list{
#employ{
width:100%;
height: auto;
overflow:hidden;
... ... @@ -32,7 +32,9 @@
height: 180rem / $pxConvertRem;
overflow: hidden;
margin: 20rem / $pxConvertRem auto;
background: image-url('me/employ/employ.jpg') top center no-repeat;
background-image: image-url('me/employ/employ.jpg');
background-position: top center;
background-repeat:no-repeat;
background-size: 100% 100%;
color: #fff;
position: relative;
... ... @@ -42,16 +44,21 @@
float: left;
text-align: center;
line-height: 180rem / $pxConvertRem;
font-size: 180em / $pxConvertRem;
font-size: 50px;
}
p{
width: 55.517241%;
height: auto;
padding: 0 5% 18em / $pxConvertRem;;
padding: 0 5% 18em / $pxConvertRem;
float: left;
&:first-of-type{
padding-top:30em / $pxConvertRem;
font-size: 60em / $pxConvertRem;
padding-top: 0.75rem;
font-size: 18px;
height: 76rem / $pxConvertRem;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
}
i{
... ...
... ... @@ -126,6 +126,7 @@
.price-underline {
text-decoration: line-through;
margin-left: pxToRem(15px);
}
}
... ... @@ -170,17 +171,14 @@
}
&.del-fav {
$width: pxToRem(image_width(sprite-file($fav, fav-del)));
$height: pxToRem(image_height(sprite-file($fav, fav-del)));
@include rem-sprite($fav, fav-del);
width: $width;
height: $height;
width: 2rem;
height: 1.5rem;
line-height: 1.5rem;
position: absolute;
top: 50%;
right: pxToRem(30px);
margin-top: -$height / 2;
margin-top: -0.75rem;
right: 0;
color: #666;
}
}
}
... ... @@ -188,6 +186,24 @@
}
//品牌收藏
.fav-brand-swiper {
border-top: 1px solid #e0e0e0;
border-bottom: pxToRem(28px) solid #f0f0f0;
position: relative;
&:nth-of-type(1) {
border-top: 0;
}
&:after {
content: '';
position: absolute;
left: 0;
bottom: -2px;
border-top: 1px solid #e0e0e0;
display: block;
width: 100%;
height: 1px;
}
.swiper-header {
height: pxToRem(100px);
... ... @@ -239,21 +255,30 @@
}
}
.fav-more {
$width: pxToRem(image_width(sprite-file($fav, fav-more)));
$height: pxToRem(image_height(sprite-file($fav, fav-more)));
@include rem-sprite($fav, fav-more);
width: $width;
height: $height;
width: 2.5rem;
height: 2.5rem;
position: absolute;
top: 50%;
right: pxToRem(30px);
margin-top: -$height / 2;
top: 0;
right: 0;
&:after {
$width: pxToRem(image_width(sprite-file($fav, fav-more)));
$height: pxToRem(image_height(sprite-file($fav, fav-more)));
@include rem-sprite($fav, fav-more);
width: $width;
height: $height;
position: absolute;
top: 50%;
right: pxToRem(30px);
margin-top: -$height / 2;
content: '';
}
}
}
.swiper-container {
height: pxToRem(300px);
height: pxToRem(365px);
margin: 0 pxToRem(30px);
.swiper-slide {
... ... @@ -270,9 +295,28 @@
img {
display: block;
width: 100%;
height: 100%;
height: pxToRem(300px);
overflow: hidden;
}
.brand-product {
height: pxToRem(65px);
line-height: pxToRem(65px);
text-align: center;
font-size: pxToRem(22px);
color: #fff;
.price-discount {
span {
color: #d1021c
}
b {
color: #b0b0b0;
text-decoration: line-through;
font-weight: normal;
margin-left: pxToRem(13px);
}
}
}
}
}
}
... ...
... ... @@ -140,6 +140,7 @@
border-top: 1px solid #e0e0e0;
.type-item {
position: relative;
float: left;
color: #444;
font-size: pxToRem(28px);
... ... @@ -149,6 +150,20 @@
&.highlight {
background: #eee;
}
.num {
position: absolute;
padding: 0 pxToRem(8px);
top: 0;
right: pxToRem(40px);
min-width: pxToRem(16px);
font-size: pxToRem(24px);
line-height: pxToRem(32px);
color: #fff;
background: #F03D35;
text-align: center;
border-radius: pxToRem(20px);
}
}
.iconfont {
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
$fav: sprite-map("me/fav/*.png", $spacing: 5px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "logistic";
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service", "my-guang", "ihelp", "browse-record";
... ...
... ... @@ -171,4 +171,4 @@
@extend %qa;
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -35,6 +35,9 @@
font-size: 48em / $pxConvertRem;
margin-right: 8%;
float: left;
text-overflow:ellipsis;
white-space:nowrap;
overflow:hidden;
.head-portrait{
width:90rem / $pxConvertRem;
height: 90rem / $pxConvertRem;
... ...
... ... @@ -31,18 +31,23 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
//意见反馈主体
.suggest-content {
border-top: pxToRem(30px) solid #fff;
border-top: 1px solid #e0e0e0;
.suggest-item {
width: 100%;
color: #444;
border-top: 1px solid #e0e0e0;
border-bottom: pxToRem(30px) solid #f0f0f0;
overflow: hidden;
> img {
display: block;
overflow: hidden;
.suggest-item-img {
width: 100%;
overflow: hidden;
> img {
margin: 0 auto;
display: block;
max-width: 100%;
}
}
> h2 {
... ... @@ -71,6 +76,7 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
&.suggest-active {
> div {
width: 50%;
height: 100%;
float: left;
text-align: left;
padding-left: pxToRem(128px);
... ... @@ -130,8 +136,29 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
line-height: pxToRem(88px);
text-align: center;
font-size: pxToRem(30px);
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
//border-top: 1px solid #e0e0e0;
//border-bottom: 1px solid #e0e0e0;
border-top: pxToRem(30px) solid #f0f0f0;
border-bottom: pxToRem(30px) solid #f0f0f0;
position: relative;
&:after {
content: '';
width: 100%;
height: 1px;
border-top: 1px solid #e0e0e0;
position: absolute;
left: 0;
top: 0;
}
&:before {
content: '';
width: 100%;
height: 1px;
border-bottom: 1px solid #e0e0e0;
position: absolute;
left: 0;
bottom: 0;
}
a {
color: #444;
... ... @@ -176,7 +203,8 @@ $suggest: sprite-map("me/suggest/*.png",$spacing: 5px);
.img-form {
padding: 0 pxToRem(30px);
float: left;
padding-top: pxToRem(40px);
overflow: hidden;
.upload-img-list {
float: left;
... ...
... ... @@ -16,6 +16,7 @@
.user-name {
font-size: 25rem / $pxConvertRem;
margin-right: 0.5rem;
}
.vip-icon {
... ...
... ... @@ -2,7 +2,7 @@
<div class="my-address-page yoho-page">
<div class="my-edit-address-page page-wrap">
<form class="edit-address">
<input type="hidden" name="id" value="{{address.id}}">
<input type="hidden" name="id" value="{{address.address_id}}">
<label class="username">
收件人姓名
<input type="text" name="consignee" maxlength="20" value="{{address.consignee}}">
... ... @@ -18,7 +18,7 @@
<span class="iconfont">&#xe604;</span>
</label>
<label class="address">
详细地址
详细地址
<textarea name="address" maxlength="255">{{address.address}}</textarea>
</label>
... ... @@ -28,6 +28,7 @@
确认
</div>
</div>
{{> me/address/address-list}}
<div class="my-address-list-page page-wrap hide">
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="employ">
<span class="active">未使用</span>
<span>已使用</span>
</div>
{{# couponsUrl}}
<div class="employ-list">
{{# used}}
<div class="employ-main">
<span>{{ money}}</span>
<p>{{ coupon_name}}</p>
<p>{{ couponValidity}}</p>
</div>
{{/ used}}
{{^ used}}
<div class="null">
<i></i>
<p>您还没有优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
</div>
{{/ used}}
<div class="yoho-page">
<div class="employ">
<span class="active">未使用</span>
<span>已使用</span>
</div>
<div class="employ-list not none">
{{# unused}}
<div class="employ-main">
<span>{{ money}}</span>
<p>{{ coupon_name}}</p>
<p>{{ couponValidity}}</p>
<i></i>
</div>
{{/ unused}}
{{^ unused}}
<div class="null">
<i></i>
<p>您还没有使用的优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
</div>
{{/ unused}}
<div id="employ"></div>
</div>
{{/ couponsUrl}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -17,7 +17,7 @@
<div class="fav-load-more fav-load-background hide"></div>
</div>
<div class="fav-type">
<div class="fav-brand-swiper"></div>
<div class="fav-brand-swiper-wrapper"></div>
<div class="fav-content-loading"></div>
<div class="fav-null-box hide">
... ...
... ... @@ -28,7 +28,7 @@
{{#isLogin}}{{brand_favorite_total}}{{/isLogin}}
<p>收藏的品牌</p>
</a>
<a class="link-item" href="/home/">
<a class="link-item" href="/home/record">
{{#isLogin}}{{product_browse}}{{/isLogin}}
<p>浏览记录</p>
</a>
... ... @@ -44,14 +44,23 @@
<a class="type-item" href="/home/order?type=2">
<span class="iconfont">&#xe634;</span>
<br>待付款
{{#if pendingPaymentCount}}
<span class="num">{{pendingPaymentCount}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=3">
<span class="iconfont">&#xe63b;</span>
<br>待发货
{{#if dueOutGoodsCount}}
<span class="num">{{dueOutGoodsCount}}</span>
{{/if}}
</a>
<a class="type-item" href="/home/order?type=4">
<span class="iconfont">&#xe633;</span>
<br>待收货
{{#if dueInGoodsCount}}
<span class="num">{{dueInGoodsCount}}</span>
{{/if}}
</a>
</div>
</div>
... ... @@ -94,7 +103,7 @@
</a>
</div>
<div class="group-list">
<a class="list-item" href="/home/IHelp">
<a class="list-item" href="/help.html">
<span class="iconfont icon">&#xe639;</span>
帮助
<span class="iconfont num">&#xe604;</span>
... ... @@ -106,4 +115,4 @@
</div>
{{> layout/download_app}}
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
... ... @@ -2,7 +2,7 @@
<div class="logistic-page yoho-page">
<div class="overview">
<div class="left" >
<a href="{{logisticUrl}}"><div class="icon" style='background-image:url("{{logisticImg}}")'></div></a>
<div class="icon" style='background-image:url("{{logisticImg}}")'> </div>
</div>
<div class="right">
... ... @@ -28,7 +28,7 @@
<span class="timeline-node"></span>
<div class="timeline-info">
<div class="timeline-info-row">
{{status}}
{{ city}}&nbsp;&nbsp;&nbsp;{{ status}}
</div>
<div class="timeline-info-row">
{{date}}
... ...
{{> layout/header}}
<div class="online-service-detail-page yoho-page">
<div class="qa-list">
{{# service}}
{{# list}}
<div class="question-item">
<div class="question">Q:{{q}}</div>
<div class="answer">{{a}}</div>
</div>
{{/ list}}
{{/ list}}
{{/ service}}
</div>
</div>
{{> layout/footer}}
\ No newline at end of file
{{> layout/footer}}
... ...
{{> layout/header}}
<div class="personal-details">
<ul>
<li><span>头像</span><span><i class="head-portrait"><img class="user-avatar" src="{{ head_ico }}"></i></span></li>
<li><span>头像</span><span><i class="head-portrait user-avatar" data-avatar="{{head_ico}}"></i></span></li>
<li><span>昵称</span><span>{{ nickname }}</span></li>
<li><span>性别</span><span>{{ gender }}</span></li>
<li><span>生日</span><span>{{ birthday }}</span></li>
... ...
... ... @@ -6,22 +6,30 @@
我们希望了解您的意见和建议
</h2>
<div class="create-new-suggest">
<a href="./suggestSub">
反馈问题<span>(功能意见,界面意见)</span>
</a>
</div>
<div class="suggest-content" id="suggest-content">
{{# suggestContent}}
<div class="suggest-item" data-id="{{suggest_id}}">
{{#if imgUrl}}
<div class="suggest-item-img">
<img class="lazy" data-original="{{imgUrl}}" alt=""/>
</div>
{{/if}}
<h2>{{title}}</h2>
<p>{{content}}</p>
<div class="suggest-type suggest-good">
<div class="suggest-type suggest-good {{#good}}show{{/good}}">
<div class="active">
<span class="iconfont">&#xe601;</span>
<span>靠谱,谢谢您的反馈</span>
</div>
</div>
<div class="suggest-type suggest-bad">
<div class="suggest-type suggest-bad {{# bad}}show{{/ bad}}">
<div class="active">
<span class="iconfont">&#xe601;</span>
<span>不靠谱,谢谢您的反馈</span>
... ... @@ -44,11 +52,6 @@
{{/ suggestContent}}
</div>
<div class="create-new-suggest">
<a href="./suggestSub">
反馈问题<span>(功能意见,界面意见)</span>
</a>
</div>
{{/ suggest}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -3,7 +3,7 @@
<form class="consult-form" url="{{formUrl}}">
<textarea id="content" name="content">请输入咨询内容</textarea>
<input type="hidden" id="product_id" value="{{productId}}">
<a type="submit">提交</a>
<a type="submit" id="submit">提交</a>
</form>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -95,7 +95,7 @@
{{else}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a href="/product/detail/consultform" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
<a href="{{link}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/if}}
... ... @@ -131,10 +131,10 @@
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
<input id="introUrl" type="hidden" value='{{introUrl}}'>
{{/if}}
{{#if id}}
<input id="productId" type="hidden" value={{id}}>
<input id="productId" type="hidden" value='{{id}}'>
{{/if}}
</div>
... ...
{{> layout/header}}
<div class="newarrival-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
<script>
seajs.use('js/common');
</script>
{{!-- 逛(PLUS+STAR) --}}
{{!-- 逛(PLUS+STAR) --}}
{{#if psList}}
<script>
seajs.use('js/guang/plus-star/list');
... ... @@ -175,6 +175,12 @@
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 商品详情我要咨询 --}}
{{#if consultformPage}}
<script>
seajs.use('js/product/detail/consultform');
</script>
{{/if}}
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
... ...
... ... @@ -59,7 +59,7 @@
<span class="iconfont">&#xe63d;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="/product/detail/consultform">
<a href="{{link}}">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -46,9 +46,9 @@ class HomeModel
const COOKIE_NAME_LIFESTYLE = 'lifestyle';
/* COOKIE标识访问的是男生频道底部Banner */
const CODE_NAME_BOYS_BOTTOM_BANNER = '8c48745a39373d621bf5fd80edf59b5e';
const CODE_NAME_BOYS_BOTTOM_BANNER = 'a2ec977c027d0cd9cdccb356ddf16b08';
/* COOKIE标识访问的是女生频道频道底部Banner */
const CODE_NAME_GIRLS_BOTTOM_BANNER = 'c63939b2ad458e9cb51147940c1da2e5';
const CODE_NAME_GIRLS_BOTTOM_BANNER = '8c8bd1b89a22e5895f05882e0825b493';
/**
* 选择频道
... ...
... ... @@ -31,8 +31,8 @@ class DetailModel
if (is_numeric($productId) && is_numeric($goodsId)) {
// 调用服务
$baseInfo = DetailData::baseInfo($productId, $uid);
$baseInfo = DetailData::baseInfo($productId, $uid);
// 判断商品是否在架
if (empty($baseInfo['status'])) {
return $result;
... ... @@ -41,7 +41,7 @@ class DetailModel
// 商品名称
if (isset($baseInfo['productName'])) {
$result['goodsName'] = $baseInfo['productName'];
}
}
// 商品标签
if (!empty($baseInfo['productTagBoList'])) {
... ... @@ -69,16 +69,6 @@ class DetailModel
}
}
// 新品标签
if (isset($baseInfo['isNew']) && $baseInfo['isNew'] === 'Y') {
$result['tags']['is_new'] = true;
}
// NEW和SALE只显示一个
if (isset($result['tags']['is_new']) && isset($result['tags']['is_discount'])) {
unset($result['tags']['is_discount']);
}
// 商品价格
if (isset($baseInfo['productPriceBo'])) {
$result['goodsPrice'] = array();
... ... @@ -97,11 +87,11 @@ class DetailModel
}
}
// 上市期
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月';
}
// 上市期
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月';
}
// 促销信息
if (isset($baseInfo['promotionBoList'])) {
$build = array();
... ... @@ -113,7 +103,7 @@ class DetailModel
}
$result['feedbacks'] = array();
// 商品咨询
$result['feedbacks']['consultsNum'] = 0;
if (!empty($baseInfo['consultBoWrapper'])) {
... ... @@ -127,12 +117,12 @@ class DetailModel
$result['feedbacks']['consults'][] = $build;
}
$result['feedbacks']['link'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
}
}
// 暂无咨询
else {
$result['feedbacks']['link'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
}
// 商品评价
$result['feedbacks']['commentsNum'] = 0;
if (!empty($baseInfo['commentBoWrapper'])) {
... ... @@ -141,7 +131,7 @@ class DetailModel
$build = array();
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
$build['userName'] = $value['nickName'];
$build['desc'] = $value['colorName'] . $value['sizeName'];
$build['desc'] = $value['colorName'] . '/' . $value['sizeName'];
$build['content'] = $value['content'];
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
... ... @@ -169,7 +159,7 @@ class DetailModel
$colorId = intval($value['colorId']);
// 商品按颜色进行分类分组
foreach ($value['goodsImagesList'] as $goods) {
$goodsList[ $goods['goodsId'] ] = $colorId;
$goodsList[$goods['goodsId']] = $colorId;
$goodsGroup[$colorId][] = array(
'goodsId' => $goods['goodsId'],
'img' => $goods['imageUrl'],
... ... @@ -182,14 +172,14 @@ class DetailModel
}
// 商品的尺码列表
foreach ($value['goodsSizeBoList'] as $size) {
$sizeGroup[ $colorId ] = array(
$sizeGroup[$colorId] = array(
'sizeName' => $size['sizeName'],
'sizeSku' => $size['goodsSizeSkuId'],
'sizeStorage' => $size['goodsSizeStorageNum'],
);
}
}
// 商品图
$goodsId = intval($goodsId);
if (isset($goodsList[$goodsId])) {
... ... @@ -217,13 +207,13 @@ class DetailModel
'numInCart' => 0,
'goodsInstore' => $baseInfo['storage'],
);
// 是否收藏
$result['isCollect'] = false;
if (isset($baseInfo['isCollect']) && $baseInfo['isCollect'] === 'Y') {
$result['isCollect'] = true;
}
// 底部简介的URL链接
$result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html');
$result['id'] = $productId;
... ... @@ -241,11 +231,11 @@ class DetailModel
public static function getSizeInfo($productSkn)
{
$result = array();
if (is_numeric($productSkn)) {
// 调用服务
$sizeInfo = DetailData::sizeInfo($productSkn);
// 商品信息
if (isset($sizeInfo['productDescBo']['erpProductId'])) {
$sex = '通用';
... ... @@ -259,7 +249,7 @@ class DetailModel
}
$result['goodsDescription'] = array(
'title' => '商品信息',
'enTitle' => 'DESCRIPTION',
'enTitle' => 'DESCRIPTION',
'detail' => array(
'list' => array(
array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']),
... ... @@ -277,7 +267,7 @@ class DetailModel
if (isset($sizeInfo['phrase'])) {
$result['goodsDescription']['desc'] = $sizeInfo['phrase'];
}
// 尺码信息
if (!empty($sizeInfo['sizeInfoBo'])) {
$result['sizeInfo'] = array(
... ... @@ -285,25 +275,25 @@ class DetailModel
'enTitle' => 'SIZE INFO',
'detail' => array('list' => array()),
);
$sizeNameList = array(0 => array('param' => '吊牌尺码')) ; // 尺码名称
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
$sizeBoGroup = array(); // 尺码按ID分组
foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
$sizeBoGroup[ $attr['id'] ][0] = array('param' => $attr['attributeName']);
$sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']);
}
foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) {
$sizeNameList[] = array('param' => $value['sizeName']);
foreach ($value['sortAttributes'] as $attr) {
$sizeBoGroup[ $attr['id'] ][] = array('param' => $attr['sizeValue']);
$sizeBoGroup[$attr['id']][] = array('param' => $attr['sizeValue']);
}
}
// 根据模板页面的显示,按表格一列一列来显示
$result['sizeInfo']['detail']['list'][0]['params'] = $sizeNameList;
foreach ($sizeBoGroup as $value) {
$result['sizeInfo']['detail']['list'][]['params'] = $value;
}
}
// 测量方式
if (!empty($sizeInfo['sizeImage'])) {
$result['measurementMethod'] = array(
... ... @@ -312,7 +302,7 @@ class DetailModel
'img' => $sizeInfo['sizeImage'],
);
}
// 模特试穿, 竖着输出排列显示
if (!empty($sizeInfo['modelBos'])) {
$result['reference'] = array(
... ... @@ -320,11 +310,11 @@ class DetailModel
'enTitle' => 'REFERENCE',
'detail' => array('list' => array()),
);
// 控制是否显示备注
$showRemark = false;
$remarkList = array(0 => array('param' => '备注'));
$result['reference']['detail']['list'][0]['params'] = array(0 => array('param' => '')); // 头像列表
$result['reference']['detail']['list'][1]['params'] = array(0 => array('param' => '模特')); // 模特名字列表
$result['reference']['detail']['list'][2]['params'] = array(0 => array('param' => '身高')); // 身高列表
... ... @@ -332,7 +322,7 @@ class DetailModel
$result['reference']['detail']['list'][4]['params'] = array(0 => array('param' => '三围')); // 三围列表
$result['reference']['detail']['list'][5]['params'] = array(0 => array('param' => '吊牌尺码')); // 吊牌尺码
$result['reference']['detail']['list'][6]['params'] = array(0 => array('param' => '试穿描述')); // 试穿描述
foreach ($sizeInfo['modelBos'] as $value) {
$result['reference']['detail']['list'][0]['params'][] = array('param' => $value['avatar']);
$result['reference']['detail']['list'][1]['params'][] = array('param' => $value['modelName']);
... ... @@ -348,13 +338,13 @@ class DetailModel
$remarkList[] = array('param' => '');
}
}
// 显示模特备注
if ($showRemark) {
$result['reference']['detail']['list'][7]['params'] = $remarkList;
}
}
// 商品材质
if (!empty($sizeInfo['productMaterialList'])) {
$result['materials'] = array(
... ... @@ -369,7 +359,7 @@ class DetailModel
);
}
}
// 洗涤提示
if (!empty($sizeInfo['washTipsBoList'])) {
$result['washTips']['list'] = array();
... ... @@ -394,7 +384,6 @@ class DetailModel
);
}
}
}
return $result;
... ... @@ -406,7 +395,7 @@ class DetailModel
public static function getComments($productId, $pageNum = 1, $pageSize = 100)
{
$result = array();
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$commentList = DetailData::commentList($productId, $pageNum, $pageSize);
if (!empty($commentList)) {
... ... @@ -420,10 +409,10 @@ class DetailModel
}
}
}
return $result;
}
/**
* 获取咨询列表
*
... ... @@ -435,7 +424,7 @@ class DetailModel
public static function getConsults($productId, $pageNum = 1, $pageSize = 100)
{
$result = array();
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
if (!empty($consultList)) {
... ... @@ -449,10 +438,10 @@ class DetailModel
}
$consultList = array();
}
return $result;
}
/**
* 获取为你优选的商品
*
... ... @@ -462,7 +451,7 @@ class DetailModel
public static function getPreference($productSkn)
{
$result = array();
if (is_numeric($productSkn)) {
$preference = DetailData::preference($productSkn);
if (!empty($preference['data'])) {
... ... @@ -471,8 +460,8 @@ class DetailModel
}
}
}
return $result;
}
}
... ...
... ... @@ -184,12 +184,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
if(count($newsale['data'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if(count($newsale['data']['list']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
}
}
}
... ...