Authored by hf

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

... ... @@ -63,7 +63,7 @@ class BackData
$param['code'] = $code;
// 默认返回的不是json类型数据,是html
return Yohobuy::post(Yohobuy::YOHOBUY_URL.'passport/back/update', $param, true);
return Yohobuy::get(Yohobuy::YOHOBUY_URL.'passport/back/update', $param, true);
}
... ...
... ... @@ -11,7 +11,8 @@ var $ = require('jquery'),
var $authorIntro = $('.author .intro');
var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
var isEzinPage = false,
isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false;
var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false;
... ... @@ -41,7 +42,7 @@ function posCollocationArrow($curCo) {
backgroundPosition: bgPos + ' bottom'
});
if (isIphone) {
if (isIphone && !isEzinPage) {
$fixedThumbContainer.css({
backgroundPosition: bgPos + ' bottom'
});
... ... @@ -61,7 +62,7 @@ function thumbTouchEvt(e) {
$thumbs.filter('.focus').removeClass('focus');
if (isIphone) {
if (isIphone && !isEzinPage) {
if ($curCo.closest('.fixed-thumb-container').length > 0) {
$brother = $thumbContainer;
} else {
... ... @@ -85,7 +86,7 @@ function thumbTouchEvt(e) {
//
lazyLoad($curProds.find('.lazy'));
if (isIphone) {
if (isIphone && !isEzinPage) {
if (myScroll) {
myScroll.scrollToElement(scrollToEl, 400);
}
... ... @@ -98,7 +99,7 @@ function thumbTouchEvt(e) {
myScroll && myScroll.refresh();
}
if (isIphone) {
if (isIphone && !isEzinPage) {
if ($('.yoho-header').length > 0) {
$('#wrapper').addClass('ios has-head');
} else {
... ... @@ -116,7 +117,8 @@ $('.info-list .title, .one-good .reco-name').each(function() {
});
//offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名
if (parseInt($authorIntro.offset().left, 10) === parseInt($authorIntro.css('margin-left'), 10)) {
if ($authorIntro.offset() && (parseInt($authorIntro.offset().left, 10) ===
parseInt($authorIntro.css('margin-left'), 10))) {
$authorIntro.css('padding-top', 0);
}
... ... @@ -145,18 +147,27 @@ if (hasCollocationBlock) {
$thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
if (isIphone) {
if (isIphone && !isEzinPage) {
$fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt);
}
}
/**
* 初始化页面参数
*/
exports.init = function (flag) {
if (flag === true) {
isEzinPage = true;
}
};
// 初始化iscroll
window.onload = function() {
var $scroller = $('#scroller');
var winH, tcH, cbH, cbTop, fixedThumbDom;
if (!isIphone) {
if (!isIphone || isEzinPage) {
return;
}
... ...
... ... @@ -47,7 +47,13 @@ function setLazyLoadAndMellipsis($infos) {
* @params $container 逛资讯列表容器
*/
function initInfosEvt($container) {
var cHammer = new Hammer($container[0]);
var cHammer;
if (typeof $container === 'undefined') {
return;
}
cHammer = new Hammer($container[0]);
cHammer.on('tap', function(e) {
var $this = $(e.target),
... ...
... ... @@ -46,6 +46,11 @@ cHammer.on('tap', function() {
$input.val('').trigger('input');
});
$('#search').on('touchend', function() {
$(this).closest('form').submit();
return false;
});
//初始化历史搜索的内容
(function() {
var html = '',
... ...
... ... @@ -69,6 +69,13 @@ var $listNav = $('#list-nav'),
btnIntroHammer,
introHammer,
brandColHammer;
/**
* 手动触发搜索
*/
$('#search').on('touchend', function() {
$(this).closest('form').submit();
return false;
});
/**
* 筛选注册的回调,筛选子项点击后逻辑
... ...
... ... @@ -56,19 +56,17 @@
right: -74rem / $pxConvertRem;
font-size: 32rem / $pxConvertRem;
line-height: 60rem / $pxConvertRem;
color: #bdbdbd;
color: #666;
}
.cancel-btn {
display: inline;
color: #bdbdbd;
font-size: 32rem / $pxConvertRem;
vertical-align: middle;
}
.clear-text {
margin-right: 20rem / $pxConvertRem;
color: #666;
}
}
}
... ...
... ... @@ -10,13 +10,23 @@
line-height: 96rem / $pxConvertRem;
.index-logo {
display: table-cell;
float: left;
font-size: 50rem / $pxConvertRem;
width: 216rem / $pxConvertRem;
height: 96rem / $pxConvertRem;
color: #343434;
vertical-align: middle;
opacity: 1;
transition: all 400ms;
img {
display: inline;
vertical-align: middle;
width: 207rem / $pxConvertRem;
height: 49rem / $pxConvertRem;
}
&.action {
opacity: 0;
width: 0;
... ... @@ -34,7 +44,7 @@
}
.search-box {
margin-left: 80rem / $pxConvertRem;
// margin-left: 80rem / $pxConvertRem;
}
}
}
... ... @@ -82,7 +92,7 @@
}
.search-icon {
right: 10rem / $pxConvertRem;
color: #000;
color: #666;
&.empty {
color: #e6e6e6;
... ... @@ -91,13 +101,11 @@
}
.no-search {
position: absolute;
display: none;
float: left;
margin-right: 10rem / $pxConvertRem;
color: #999;
font-size: 28rem / $pxConvertRem;
@inlcude transition(display .4s);
}
}
.index-container {
... ...
... ... @@ -35,10 +35,10 @@
.search {
position: absolute;
top: 18rem / $pxConvertRem;
left: 515rem / $pxConvertRem;
right: 40rem / $pxConvertRem;
border: none;
background: transparent;
color: #000;
color: #666;
font-size: 30rem / $pxConvertRem;
line-height: 56rem / $pxConvertRem;
}
... ...
... ... @@ -31,11 +31,17 @@
}
.search {
float: right;
margin-top: 6px;
position: absolute;
top: 2px;
right: -30px;
border: none;
background: transparent;
font-size: 16px;
width: 3rem;
height: 30px;
overflow: hidden;
line-height: 30px;
color: #666;
}
}
... ...
... ... @@ -2,7 +2,9 @@
<div class="index-page yoho-page">
<div class="index-container">
<div class="index-header clearfix">
<div class="iconfont index-logo">&#xe60e;</div>
<div class="index-logo">
<img src="http://static.dev.yohobuy.com/img/yohologo.png">
</div>
<div class="box">
<a href="javascript:void(0);" class="no-search">取消</a>
<form action="{{searchUrl}}" class="index-search">
... ...
... ... @@ -7,7 +7,7 @@
<input type="text" placeholder="搜索商品" name="query">
<input type="hidden" name="from" value="search">
<i class="clear-input iconfont hide">&#xe626;</i>
<button id="search" class="search" type="submit">搜索</button>
<span id="search" class="search" type="submit">搜索</span>
</form>
</div>
<div class="search-items">
... ...
... ... @@ -6,7 +6,7 @@
<input type="text" value="{{default}}" name="query">
<input type="hidden" value="search" name="from">
<i class="clear-input iconfont hide">&#xe61a;</i>
<button id="search" class="search" type="submit">搜索</button>
<span id="search" class="search" type="submit">搜索</span>
</form>
</div>
{{/ search}}
... ...
... ... @@ -129,7 +129,8 @@ class BackController extends AbstractAction
$data = BackData::modifyPasswordByEmail($pwd, $code);
$result = array('code'=>200);
$result = array('code'=>200, 'data' => '/signin.html');
print_r($data);
if(strpos($data, 'history.back') !== false)
{
$result['code'] = 400;
... ... @@ -238,14 +239,14 @@ class BackController extends AbstractAction
$result = BackData::validateMobileCode($phoneNum, $code, $areaCode);
if($result['code'] === 200)
{
$result['data'] = '/passport/back/password?phoneNum='.$phoneNum.'&token='.$result['data']['token'].'&areaCode='.$areaCode;
$result['data'] = '/passport/back/backcode?phoneNum='.$phoneNum.'&token='.$result['data']['token'].'&areaCode='.$areaCode;
}
$this->echoJson($result);
}
}
public function passwordAction()
public function backcodeAction()
{
$phoneNum = $this->get('phoneNum', '');
// 手机验证令牌
... ...