Authored by 梁志锋

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

... ... @@ -13,7 +13,6 @@ var $addressForm = $('.edit-address'),
$submit = $('.submit'),
$editAddressPage = $('.my-edit-address-page'),
$addressListPage = $('.my-address-list-page'),
$footer = $('#yoho-footer'),
$backBtn = $('.nav-back'),
$navTitle = $('.nav-title'),
$input = $('input, textarea'),
... ... @@ -111,12 +110,6 @@ $submit.on('touchend', function() {
$(this).removeClass('highlight');
});
$input.on('focus', function() {
$footer.hide();
}).on('blur', function() {
$footer.show();
});
// 省市区列表异步加载
$.get('/home/locationList').then(function(html) {
$addressListPage.html(html);
... ... @@ -124,9 +117,7 @@ $.get('/home/locationList').then(function(html) {
// 省市区
$area.on('touchend', function() {
$editAddressPage.hide();
$addressListPage.show(1, function() {
$footer.hide();
});
$addressListPage.show();
currentPage = 'list';
$navTitle.html('地区选择');
});
... ... @@ -165,7 +156,6 @@ $.get('/home/locationList').then(function(html) {
$editAddressPage.show();
currentPage = 'edit';
$navTitle.html(navTitle);
$footer.show();
// 恢复默认的三级选择
$addressListPage.hide();
... ...
... ... @@ -25,7 +25,6 @@ var end = false,
var winH = $(window).height();
load.init();
function moreRecord(cb) {
var count = $page.children('.browse-record-good').length;
... ... @@ -61,7 +60,7 @@ function moreRecord(cb) {
lazyLoad($page.find('.browse-record-good:gt(' + (count - 1) + ') .lazy'));
}
window.rePosFooter();
page++;
if (cb) {
... ... @@ -99,6 +98,7 @@ $page.on('touchstart', '.del-icon', function() {
rightBtnText: '确定'
}
}, function() {
$.ajax({
type: 'GET',
url: '/home/delRecord',
... ... @@ -107,7 +107,12 @@ $page.on('touchstart', '.del-icon', function() {
},
success: function(data) {
if (data.code === 200) {
window.history.go(0);
dialog.showDialog({
dialogText: '删除浏览记录成功',
autoHide: true,
fast: true
});
setTimeout(function(){window.history.go(0);},1000);
}
},
complete: function() {
... ...
... ... @@ -119,7 +119,8 @@ $likeBtn.bind('click', function() {
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id
suggest_id: id,
reliable: 1
}
}).then(function(data) {
if (data.code === 200) {
... ... @@ -146,7 +147,8 @@ $disLikeBtn.bind('click', function() {
method: 'post',
url: '/home/upAndDown',
data: {
suggest_id: id
suggest_id: id,
reliable: 2
}
}).then(function(data) {
if (data.code === 200) {
... ...
... ... @@ -38,7 +38,7 @@ if (0 === $('.goodsDiscount .discount-folder').children().length) {
}
//goods-discount下拉按钮点击事件
$('.goodsDiscount .dropdown').on('click', function() {
$('.goodsDiscount .dropdown').on('touchend', function(e) {
if ($discountFolder.is(':hidden')) {
$discountArrow.removeClass('icon-down').addClass('icon-up').html('');
$discountFolder.slideDown();
... ... @@ -46,5 +46,7 @@ $('.goodsDiscount .dropdown').on('click', function() {
$discountArrow.removeClass('icon-up').addClass('icon-down').html('');
$discountFolder.slideUp();
}
return false;
});
require('./like');
... ...
... ... @@ -3,100 +3,101 @@
* @author: Lynnic
* @date: 2015/11/25
*/
var $ = require('jquery'),
loading = require('../../plugin/loading'),
tip = require('../../plugin/tip');
var loadMoreUrl = $('#loadMoreUrl').val(),
$commentsDiv = $('#goods-comments'),
$consultsDiv = $('#goods-consults'),
winH = $(window).height(),
searching = false,
end = false;
var jsonObj;
//插入评论列表底部
function insertCommentsDiv(json) {
var html = '';
var i;
for (i = 0; i < json.length; i++) {
html += '<div class="comment-item">';
html += '<span class="user-name">' + json[i].userName + '</span>';
html += '<span class="goods-spec">' + json[i].desc + '</span>';
html += '<span class="goods-spec">' + json[i].content + '</span>';
html += '<span class="goods-spec">' + json[i].time + '</span>';
}
$commentsDiv.append(html);
}
//插入咨询列表底部
function insertConsultsDiv(json) {
var html = '';
var i;
for (i = 0; i < json.length; i++) {
html += '<div class="consult-item"> ';
html += '<div class="question"> ';
html += '<span class="iconfont">&#xe639;</span> ';
html += '<p> ';
html += json[i].question + '<br> ';
html += '<span class="time">' + json[i].time + '</span> ';
html += '</p> ';
html += '</div> ';
html += '<div class="answer"> ';
html += '<span class="iconfont">&#xe63c;</span> ';
html += '<p>' + json[i].answer + '</p> ';
html += '</div> ';
html += '</div> ';
}
$consultsDiv.append(html);
}
function search() {
if (searching || end) {
return;
}
searching = true;
loading.showLoadingMask();
$.ajax({
type: 'GET',
url: loadMoreUrl,
success: function(data) {
if (data.length > 0) {
jsonObj = JSON.parse(data);
if ($commentsDiv.length > 0) {
insertCommentsDiv(jsonObj);
} else if ($consultsDiv.length > 0) {
insertConsultsDiv(jsonObj);
}
}
searching = false;
end = true;
loading.hideLoadingMask();
},
error: function() {
tip.show('网络断开连接了~');
searching = false;
loading.hideLoadingMask();
}
});
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
search();
}
}
//srcoll to load more
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
\ No newline at end of file
// var $ = require('jquery'),
// loading = require('../../plugin/loading'),
// tip = require('../../plugin/tip');
// var loadMoreUrl = $('#loadMoreUrl').val(),
// $commentsDiv = $('#goods-comments'),
// $consultsDiv = $('#goods-consults'),
// winH = $(window).height(),
// searching = false,
// end = false;
// var jsonObj;
// //插入评论列表底部
// function insertCommentsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="comment-item">';
// html += '<span class="user-name">' + json[i].userName + '</span>';
// html += '<span class="goods-spec">' + json[i].desc + '</span>';
// html += '<span class="goods-spec">' + json[i].content + '</span>';
// html += '<span class="goods-spec">' + json[i].time + '</span>';
// }
// $commentsDiv.append(html);
// }
// //插入咨询列表底部
// function insertConsultsDiv(json) {
// var html = '';
// var i;
// for (i = 0; i < json.length; i++) {
// html += '<div class="consult-item"> ';
// html += '<div class="question"> ';
// html += '<span class="iconfont">&#xe639;</span> ';
// html += '<p> ';
// html += json[i].question + '<br> ';
// html += '<span class="time">' + json[i].time + '</span> ';
// html += '</p> ';
// html += '</div> ';
// html += '<div class="answer"> ';
// html += '<span class="iconfont">&#xe63c;</span> ';
// html += '<p>' + json[i].answer + '</p> ';
// html += '</div> ';
// html += '</div> ';
// }
// $consultsDiv.append(html);
// }
// function search() {
// if (searching || end) {
// return;
// }
// searching = true;
// loading.showLoadingMask();
// $.ajax({
// type: 'GET',
// url: loadMoreUrl,
// success: function(data) {
// if (data.length > 0) {
// jsonObj = JSON.parse(data);
// if ($commentsDiv.length > 0) {
// insertCommentsDiv(jsonObj);
// } else if ($consultsDiv.length > 0) {
// insertConsultsDiv(jsonObj);
// }
// }
// searching = false;
// end = true;
// loading.hideLoadingMask();
// },
// error: function() {
// tip.show('网络断开连接了~');
// searching = false;
// loading.hideLoadingMask();
// }
// });
// }
// function scrollHandler() {
// if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
// search();
// }
// }
// //srcoll to load more
// $(window).scroll(function() {
// window.requestAnimationFrame(scrollHandler);
// });
\ No newline at end of file
... ...
... ... @@ -97,8 +97,7 @@ a {
left: 50%;
margin-left: -35%;
margin-top: -45px;
background-color: #000;
opacity: 0.7;
background-color: rgba(0,0,0,.7);
color: #fff;
font-size: 18px;
border: none;
... ...
... ... @@ -44,6 +44,7 @@
padding: 0 pxToRem(28px);
height: pxToRem(120px);
background-color: #ffffff;
border-bottom: 1px solid $borderC;
i,
span,
a {
... ... @@ -64,6 +65,8 @@
margin-top: pxToRem(30px);
padding: pxToRem(20px) pxToRem(28px);
background-color: #fff;
border-bottom: 1px solid $borderC;
border-top: 1px solid $borderC;
.question {
font-size: pxToRem(24px);
color: $mainFontC;
... ...
... ... @@ -169,7 +169,7 @@ $basicBtnC:#eb0313;
overflow: hidden;
ul {
position: relative;
height: 100%;
height: auto;
li {
float: left;
}
... ...
... ... @@ -11,6 +11,6 @@
<div class="null">
<i></i>
<p>您还没有优惠券!</p>
<a href="{{topURL}}">随便逛逛</a>
<a href="/product/new">随便逛逛</a>
</div>
{{/ noRecord}}
... ...
... ... @@ -3,7 +3,7 @@
<div class="goto-consult">
<i class="iconfont consult-logo">&#xe639;</i>
<span>我要咨询</span>
<a href="{{consultUrl}}" class="iconfont enter-consult-page">&#xe604;</a>
<a href="/product/detail/consultform" class="iconfont enter-consult-page">&#xe604;</a>
</div>
{{# consults}}
<div class="goods-consults" id="goods-consults">
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<div id="hotRank"></div>
{{#if brand}}
... ...
... ... @@ -26,9 +26,9 @@
<span class="iconfont">&#xe63c;</span>暂无评论
</div>
{{/if}}
<div class="comment-content-footer">
<!-- <div class="comment-content-footer">
<a href="{{link}}">查看更多 <span class="iconfont">&#xe604;</span></a>
</div>
</div> -->
</div>
<div class="consult-content content hide ">
... ... @@ -50,7 +50,7 @@
{{/ consults}}
</div>
<div class="consult-content-footer">
<a href="{{link}}">
<a href="/product/detail/consults">
查看更多
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -181,7 +181,8 @@ class HomeController extends AbstractAction
$this->setNavHeader('浏览记录', true, SITE_MAIN);
$this->_view->display('browse-record', array(
'browseRecordPage' => true
'browseRecordPage' => true,
'pageFooter' => true
));
}
... ... @@ -351,7 +352,6 @@ class HomeController extends AbstractAction
$id = $this->get('id', null);
$data = array(
'addressActionPage' => true,
'pageFooter' => true,
'addressList' => UserModel::getAddressListData($uid)
);
... ...
... ... @@ -84,6 +84,18 @@ class BrandModel
$result['bannerTop']['list'][] = $build;
}
}
// 顶部的轮翻广告列表
elseif (!empty($brand['brandTop']['list'][0]['data'])) {
$build = array();
foreach ($brand['brandTop']['list'][0]['data'] as $value) {
if (isset($value['url'])) {
$build['url'] = Helpers::getFilterUrl($value['url']);
}
$build['img'] = Helpers::getImageUrl($value['src'], 640, 310);
$build['title'] = $value['title'];
$result['bannerTop']['list'][] = $build;
}
}
/* 顶部的热门品牌列表 (备注: 当没有轮翻广告的时候,此处内部的foreach不会被执行) */
if (!empty($brand['brandTop'][1]['data']['list'])) {
... ...
... ... @@ -98,8 +98,8 @@ class HomeModel
// 调用接口获取数据
$banner = IndexData::getBannerStart(self::CODE_BG);
if (isset($banner['data'][0]['data']['list'][0]['src'])) {
$result = Helpers::getImageUrl($banner['data'][0]['data']['list'][0]['src'], 640, 800, 2);
if (isset($banner['code']) && $banner['code'] == 200 && $banner['data']['total'] > 0) {
$result = Helpers::getImageUrl($banner['data']['list'][0]['data']['list'][0]['src'], 640, 800, 2);
}
if (USE_CACHE) {
... ...
... ... @@ -302,7 +302,7 @@ class UserModel
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
}
... ...
... ... @@ -184,12 +184,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if(count($newsale['data']['list']) === 1) {
if (isset($newsale['code']) && isset($newsale['data']['list']) && !empty($newsale['data']['list'])) {
if(count($newsale['data']['list'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
foreach ($newsale['data']['list'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
}
}
}
... ...