Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
14 changed files
with
71 additions
and
27 deletions
@@ -63,7 +63,7 @@ class BackData | @@ -63,7 +63,7 @@ class BackData | ||
63 | $param['code'] = $code; | 63 | $param['code'] = $code; |
64 | 64 | ||
65 | // 默认返回的不是json类型数据,是html | 65 | // 默认返回的不是json类型数据,是html |
66 | - return Yohobuy::post(Yohobuy::YOHOBUY_URL.'passport/back/update', $param, true); | 66 | + return Yohobuy::get(Yohobuy::YOHOBUY_URL.'passport/back/update', $param, true); |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 |
static/img/yohologo.png
0 → 100644
5.23 KB
@@ -11,7 +11,8 @@ var $ = require('jquery'), | @@ -11,7 +11,8 @@ var $ = require('jquery'), | ||
11 | 11 | ||
12 | var $authorIntro = $('.author .intro'); | 12 | var $authorIntro = $('.author .intro'); |
13 | 13 | ||
14 | -var isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false; | 14 | +var isEzinPage = false, |
15 | + isIphone = navigator.userAgent.indexOf('iPhone') > 0 ? true : false; | ||
15 | 16 | ||
16 | var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false; | 17 | var hasCollocationBlock = $('.collocation-block').length > 0 ? true : false; |
17 | 18 | ||
@@ -41,7 +42,7 @@ function posCollocationArrow($curCo) { | @@ -41,7 +42,7 @@ function posCollocationArrow($curCo) { | ||
41 | backgroundPosition: bgPos + ' bottom' | 42 | backgroundPosition: bgPos + ' bottom' |
42 | }); | 43 | }); |
43 | 44 | ||
44 | - if (isIphone) { | 45 | + if (isIphone && !isEzinPage) { |
45 | $fixedThumbContainer.css({ | 46 | $fixedThumbContainer.css({ |
46 | backgroundPosition: bgPos + ' bottom' | 47 | backgroundPosition: bgPos + ' bottom' |
47 | }); | 48 | }); |
@@ -61,7 +62,7 @@ function thumbTouchEvt(e) { | @@ -61,7 +62,7 @@ function thumbTouchEvt(e) { | ||
61 | 62 | ||
62 | $thumbs.filter('.focus').removeClass('focus'); | 63 | $thumbs.filter('.focus').removeClass('focus'); |
63 | 64 | ||
64 | - if (isIphone) { | 65 | + if (isIphone && !isEzinPage) { |
65 | if ($curCo.closest('.fixed-thumb-container').length > 0) { | 66 | if ($curCo.closest('.fixed-thumb-container').length > 0) { |
66 | $brother = $thumbContainer; | 67 | $brother = $thumbContainer; |
67 | } else { | 68 | } else { |
@@ -85,7 +86,7 @@ function thumbTouchEvt(e) { | @@ -85,7 +86,7 @@ function thumbTouchEvt(e) { | ||
85 | // | 86 | // |
86 | lazyLoad($curProds.find('.lazy')); | 87 | lazyLoad($curProds.find('.lazy')); |
87 | 88 | ||
88 | - if (isIphone) { | 89 | + if (isIphone && !isEzinPage) { |
89 | if (myScroll) { | 90 | if (myScroll) { |
90 | myScroll.scrollToElement(scrollToEl, 400); | 91 | myScroll.scrollToElement(scrollToEl, 400); |
91 | } | 92 | } |
@@ -98,7 +99,7 @@ function thumbTouchEvt(e) { | @@ -98,7 +99,7 @@ function thumbTouchEvt(e) { | ||
98 | myScroll && myScroll.refresh(); | 99 | myScroll && myScroll.refresh(); |
99 | } | 100 | } |
100 | 101 | ||
101 | -if (isIphone) { | 102 | +if (isIphone && !isEzinPage) { |
102 | if ($('.yoho-header').length > 0) { | 103 | if ($('.yoho-header').length > 0) { |
103 | $('#wrapper').addClass('ios has-head'); | 104 | $('#wrapper').addClass('ios has-head'); |
104 | } else { | 105 | } else { |
@@ -116,7 +117,8 @@ $('.info-list .title, .one-good .reco-name').each(function() { | @@ -116,7 +117,8 @@ $('.info-list .title, .one-good .reco-name').each(function() { | ||
116 | }); | 117 | }); |
117 | 118 | ||
118 | //offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名 | 119 | //offset.left约等于marginLeft的值则表示介绍被换行,则清除intro的paddingTop让其更靠近头像和作者名 |
119 | -if (parseInt($authorIntro.offset().left, 10) === parseInt($authorIntro.css('margin-left'), 10)) { | 120 | +if ($authorIntro.offset() && (parseInt($authorIntro.offset().left, 10) === |
121 | + parseInt($authorIntro.css('margin-left'), 10))) { | ||
120 | $authorIntro.css('padding-top', 0); | 122 | $authorIntro.css('padding-top', 0); |
121 | } | 123 | } |
122 | 124 | ||
@@ -145,18 +147,27 @@ if (hasCollocationBlock) { | @@ -145,18 +147,27 @@ if (hasCollocationBlock) { | ||
145 | 147 | ||
146 | $thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); | 148 | $thumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); |
147 | 149 | ||
148 | - if (isIphone) { | 150 | + if (isIphone && !isEzinPage) { |
149 | $fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); | 151 | $fixedThumbContainer.delegate('.thumb', 'touchend', thumbTouchEvt); |
150 | } | 152 | } |
151 | } | 153 | } |
152 | 154 | ||
155 | +/** | ||
156 | + * 初始化页面参数 | ||
157 | + */ | ||
158 | +exports.init = function (flag) { | ||
159 | + if (flag === true) { | ||
160 | + isEzinPage = true; | ||
161 | + } | ||
162 | +}; | ||
163 | + | ||
153 | // 初始化iscroll | 164 | // 初始化iscroll |
154 | window.onload = function() { | 165 | window.onload = function() { |
155 | var $scroller = $('#scroller'); | 166 | var $scroller = $('#scroller'); |
156 | 167 | ||
157 | var winH, tcH, cbH, cbTop, fixedThumbDom; | 168 | var winH, tcH, cbH, cbTop, fixedThumbDom; |
158 | 169 | ||
159 | - if (!isIphone) { | 170 | + if (!isIphone || isEzinPage) { |
160 | return; | 171 | return; |
161 | } | 172 | } |
162 | 173 |
@@ -47,7 +47,13 @@ function setLazyLoadAndMellipsis($infos) { | @@ -47,7 +47,13 @@ function setLazyLoadAndMellipsis($infos) { | ||
47 | * @params $container 逛资讯列表容器 | 47 | * @params $container 逛资讯列表容器 |
48 | */ | 48 | */ |
49 | function initInfosEvt($container) { | 49 | function initInfosEvt($container) { |
50 | - var cHammer = new Hammer($container[0]); | 50 | + var cHammer; |
51 | + | ||
52 | + if (typeof $container === 'undefined') { | ||
53 | + return; | ||
54 | + } | ||
55 | + | ||
56 | + cHammer = new Hammer($container[0]); | ||
51 | 57 | ||
52 | cHammer.on('tap', function(e) { | 58 | cHammer.on('tap', function(e) { |
53 | var $this = $(e.target), | 59 | var $this = $(e.target), |
@@ -46,6 +46,11 @@ cHammer.on('tap', function() { | @@ -46,6 +46,11 @@ cHammer.on('tap', function() { | ||
46 | $input.val('').trigger('input'); | 46 | $input.val('').trigger('input'); |
47 | }); | 47 | }); |
48 | 48 | ||
49 | +$('#search').on('touchend', function() { | ||
50 | + $(this).closest('form').submit(); | ||
51 | + return false; | ||
52 | +}); | ||
53 | + | ||
49 | //初始化历史搜索的内容 | 54 | //初始化历史搜索的内容 |
50 | (function() { | 55 | (function() { |
51 | var html = '', | 56 | var html = '', |
@@ -69,6 +69,13 @@ var $listNav = $('#list-nav'), | @@ -69,6 +69,13 @@ var $listNav = $('#list-nav'), | ||
69 | btnIntroHammer, | 69 | btnIntroHammer, |
70 | introHammer, | 70 | introHammer, |
71 | brandColHammer; | 71 | brandColHammer; |
72 | +/** | ||
73 | + * 手动触发搜索 | ||
74 | + */ | ||
75 | +$('#search').on('touchend', function() { | ||
76 | + $(this).closest('form').submit(); | ||
77 | + return false; | ||
78 | +}); | ||
72 | 79 | ||
73 | /** | 80 | /** |
74 | * 筛选注册的回调,筛选子项点击后逻辑 | 81 | * 筛选注册的回调,筛选子项点击后逻辑 |
@@ -56,19 +56,17 @@ | @@ -56,19 +56,17 @@ | ||
56 | right: -74rem / $pxConvertRem; | 56 | right: -74rem / $pxConvertRem; |
57 | font-size: 32rem / $pxConvertRem; | 57 | font-size: 32rem / $pxConvertRem; |
58 | line-height: 60rem / $pxConvertRem; | 58 | line-height: 60rem / $pxConvertRem; |
59 | - color: #bdbdbd; | 59 | + color: #666; |
60 | } | 60 | } |
61 | 61 | ||
62 | .cancel-btn { | 62 | .cancel-btn { |
63 | display: inline; | 63 | display: inline; |
64 | - color: #bdbdbd; | ||
65 | font-size: 32rem / $pxConvertRem; | 64 | font-size: 32rem / $pxConvertRem; |
66 | vertical-align: middle; | 65 | vertical-align: middle; |
67 | } | 66 | } |
68 | 67 | ||
69 | .clear-text { | 68 | .clear-text { |
70 | margin-right: 20rem / $pxConvertRem; | 69 | margin-right: 20rem / $pxConvertRem; |
71 | - color: #666; | ||
72 | } | 70 | } |
73 | } | 71 | } |
74 | } | 72 | } |
@@ -10,13 +10,23 @@ | @@ -10,13 +10,23 @@ | ||
10 | line-height: 96rem / $pxConvertRem; | 10 | line-height: 96rem / $pxConvertRem; |
11 | 11 | ||
12 | .index-logo { | 12 | .index-logo { |
13 | + display: table-cell; | ||
13 | float: left; | 14 | float: left; |
14 | font-size: 50rem / $pxConvertRem; | 15 | font-size: 50rem / $pxConvertRem; |
15 | width: 216rem / $pxConvertRem; | 16 | width: 216rem / $pxConvertRem; |
17 | + height: 96rem / $pxConvertRem; | ||
16 | color: #343434; | 18 | color: #343434; |
19 | + vertical-align: middle; | ||
17 | opacity: 1; | 20 | opacity: 1; |
18 | transition: all 400ms; | 21 | transition: all 400ms; |
19 | 22 | ||
23 | + img { | ||
24 | + display: inline; | ||
25 | + vertical-align: middle; | ||
26 | + width: 207rem / $pxConvertRem; | ||
27 | + height: 49rem / $pxConvertRem; | ||
28 | + } | ||
29 | + | ||
20 | &.action { | 30 | &.action { |
21 | opacity: 0; | 31 | opacity: 0; |
22 | width: 0; | 32 | width: 0; |
@@ -34,7 +44,7 @@ | @@ -34,7 +44,7 @@ | ||
34 | } | 44 | } |
35 | 45 | ||
36 | .search-box { | 46 | .search-box { |
37 | - margin-left: 80rem / $pxConvertRem; | 47 | + // margin-left: 80rem / $pxConvertRem; |
38 | } | 48 | } |
39 | } | 49 | } |
40 | } | 50 | } |
@@ -82,7 +92,7 @@ | @@ -82,7 +92,7 @@ | ||
82 | } | 92 | } |
83 | .search-icon { | 93 | .search-icon { |
84 | right: 10rem / $pxConvertRem; | 94 | right: 10rem / $pxConvertRem; |
85 | - color: #000; | 95 | + color: #666; |
86 | 96 | ||
87 | &.empty { | 97 | &.empty { |
88 | color: #e6e6e6; | 98 | color: #e6e6e6; |
@@ -91,13 +101,11 @@ | @@ -91,13 +101,11 @@ | ||
91 | } | 101 | } |
92 | 102 | ||
93 | .no-search { | 103 | .no-search { |
94 | - position: absolute; | ||
95 | display: none; | 104 | display: none; |
96 | float: left; | 105 | float: left; |
97 | margin-right: 10rem / $pxConvertRem; | 106 | margin-right: 10rem / $pxConvertRem; |
98 | color: #999; | 107 | color: #999; |
99 | font-size: 28rem / $pxConvertRem; | 108 | font-size: 28rem / $pxConvertRem; |
100 | - @inlcude transition(display .4s); | ||
101 | } | 109 | } |
102 | } | 110 | } |
103 | .index-container { | 111 | .index-container { |
@@ -35,10 +35,10 @@ | @@ -35,10 +35,10 @@ | ||
35 | .search { | 35 | .search { |
36 | position: absolute; | 36 | position: absolute; |
37 | top: 18rem / $pxConvertRem; | 37 | top: 18rem / $pxConvertRem; |
38 | - left: 515rem / $pxConvertRem; | 38 | + right: 40rem / $pxConvertRem; |
39 | border: none; | 39 | border: none; |
40 | background: transparent; | 40 | background: transparent; |
41 | - color: #000; | 41 | + color: #666; |
42 | font-size: 30rem / $pxConvertRem; | 42 | font-size: 30rem / $pxConvertRem; |
43 | line-height: 56rem / $pxConvertRem; | 43 | line-height: 56rem / $pxConvertRem; |
44 | } | 44 | } |
@@ -31,11 +31,17 @@ | @@ -31,11 +31,17 @@ | ||
31 | } | 31 | } |
32 | 32 | ||
33 | .search { | 33 | .search { |
34 | - float: right; | ||
35 | - margin-top: 6px; | 34 | + position: absolute; |
35 | + top: 2px; | ||
36 | + right: -30px; | ||
36 | border: none; | 37 | border: none; |
37 | background: transparent; | 38 | background: transparent; |
38 | font-size: 16px; | 39 | font-size: 16px; |
40 | + width: 3rem; | ||
41 | + height: 30px; | ||
42 | + overflow: hidden; | ||
43 | + line-height: 30px; | ||
44 | + color: #666; | ||
39 | } | 45 | } |
40 | } | 46 | } |
41 | 47 |
@@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
2 | <div class="index-page yoho-page"> | 2 | <div class="index-page yoho-page"> |
3 | <div class="index-container"> | 3 | <div class="index-container"> |
4 | <div class="index-header clearfix"> | 4 | <div class="index-header clearfix"> |
5 | - <div class="iconfont index-logo"></div> | 5 | + <div class="index-logo"> |
6 | + <img src="http://static.dev.yohobuy.com/img/yohologo.png"> | ||
7 | + </div> | ||
6 | <div class="box"> | 8 | <div class="box"> |
7 | <a href="javascript:void(0);" class="no-search">取消</a> | 9 | <a href="javascript:void(0);" class="no-search">取消</a> |
8 | <form action="{{searchUrl}}" class="index-search"> | 10 | <form action="{{searchUrl}}" class="index-search"> |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <input type="text" placeholder="搜索商品" name="query"> | 7 | <input type="text" placeholder="搜索商品" name="query"> |
8 | <input type="hidden" name="from" value="search"> | 8 | <input type="hidden" name="from" value="search"> |
9 | <i class="clear-input iconfont hide"></i> | 9 | <i class="clear-input iconfont hide"></i> |
10 | - <button id="search" class="search" type="submit">搜索</button> | 10 | + <span id="search" class="search" type="submit">搜索</span> |
11 | </form> | 11 | </form> |
12 | </div> | 12 | </div> |
13 | <div class="search-items"> | 13 | <div class="search-items"> |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | <input type="text" value="{{default}}" name="query"> | 6 | <input type="text" value="{{default}}" name="query"> |
7 | <input type="hidden" value="search" name="from"> | 7 | <input type="hidden" value="search" name="from"> |
8 | <i class="clear-input iconfont hide"></i> | 8 | <i class="clear-input iconfont hide"></i> |
9 | - <button id="search" class="search" type="submit">搜索</button> | 9 | + <span id="search" class="search" type="submit">搜索</span> |
10 | </form> | 10 | </form> |
11 | </div> | 11 | </div> |
12 | {{/ search}} | 12 | {{/ search}} |
@@ -129,7 +129,8 @@ class BackController extends AbstractAction | @@ -129,7 +129,8 @@ class BackController extends AbstractAction | ||
129 | 129 | ||
130 | $data = BackData::modifyPasswordByEmail($pwd, $code); | 130 | $data = BackData::modifyPasswordByEmail($pwd, $code); |
131 | 131 | ||
132 | - $result = array('code'=>200); | 132 | + $result = array('code'=>200, 'data' => '/signin.html'); |
133 | + print_r($data); | ||
133 | if(strpos($data, 'history.back') !== false) | 134 | if(strpos($data, 'history.back') !== false) |
134 | { | 135 | { |
135 | $result['code'] = 400; | 136 | $result['code'] = 400; |
@@ -238,14 +239,14 @@ class BackController extends AbstractAction | @@ -238,14 +239,14 @@ class BackController extends AbstractAction | ||
238 | $result = BackData::validateMobileCode($phoneNum, $code, $areaCode); | 239 | $result = BackData::validateMobileCode($phoneNum, $code, $areaCode); |
239 | if($result['code'] === 200) | 240 | if($result['code'] === 200) |
240 | { | 241 | { |
241 | - $result['data'] = '/passport/back/password?phoneNum='.$phoneNum.'&token='.$result['data']['token'].'&areaCode='.$areaCode; | 242 | + $result['data'] = '/passport/back/backcode?phoneNum='.$phoneNum.'&token='.$result['data']['token'].'&areaCode='.$areaCode; |
242 | } | 243 | } |
243 | 244 | ||
244 | $this->echoJson($result); | 245 | $this->echoJson($result); |
245 | } | 246 | } |
246 | } | 247 | } |
247 | 248 | ||
248 | - public function passwordAction() | 249 | + public function backcodeAction() |
249 | { | 250 | { |
250 | $phoneNum = $this->get('phoneNum', ''); | 251 | $phoneNum = $this->get('phoneNum', ''); |
251 | // 手机验证令牌 | 252 | // 手机验证令牌 |
-
Please register or login to post a comment