Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
25 changed files
with
341 additions
and
298 deletions
@@ -283,6 +283,9 @@ class AbstractAction extends Controller_Abstract | @@ -283,6 +283,9 @@ class AbstractAction extends Controller_Abstract | ||
283 | */ | 283 | */ |
284 | protected function getUid($useSession = false) | 284 | protected function getUid($useSession = false) |
285 | { | 285 | { |
286 | + // @todo | ||
287 | + $useSession = false; | ||
288 | + | ||
286 | if (!$this->_uid) { | 289 | if (!$this->_uid) { |
287 | $cookie = $this->getCookie('_UID'); | 290 | $cookie = $this->getCookie('_UID'); |
288 | if (!empty($cookie)) { | 291 | if (!empty($cookie)) { |
@@ -491,8 +491,10 @@ class Helpers | @@ -491,8 +491,10 @@ class Helpers | ||
491 | return false; | 491 | return false; |
492 | } | 492 | } |
493 | 493 | ||
494 | - //格式化订单商品 | ||
495 | - public static function formatOrderGoods($orderGoods) | 494 | + /** |
495 | + * 格式化订单商品 | ||
496 | + */ | ||
497 | + public static function formatOrderGoods($orderGoods, &$count = 0) | ||
496 | { | 498 | { |
497 | $arr = array(); | 499 | $arr = array(); |
498 | foreach ($orderGoods as $key => $vo) { | 500 | foreach ($orderGoods as $key => $vo) { |
@@ -512,6 +514,8 @@ class Helpers | @@ -512,6 +514,8 @@ class Helpers | ||
512 | if (!empty($vo['expect_arrival_time'])) { | 514 | if (!empty($vo['expect_arrival_time'])) { |
513 | $arr[$key]['appearDate'] = $vo['expect_arrival_time']; | 515 | $arr[$key]['appearDate'] = $vo['expect_arrival_time']; |
514 | } | 516 | } |
517 | + // 累计购买数 | ||
518 | + $count += intval($vo['buy_number']); | ||
515 | } | 519 | } |
516 | return $arr; | 520 | return $arr; |
517 | } | 521 | } |
@@ -17,6 +17,7 @@ var $icon = $('.search-icon'); | @@ -17,6 +17,7 @@ var $icon = $('.search-icon'); | ||
17 | var $form = $('#search-form'); | 17 | var $form = $('#search-form'); |
18 | 18 | ||
19 | var $history = $('.history'); | 19 | var $history = $('.history'); |
20 | +var $historySearch = $('.history-search'); | ||
20 | 21 | ||
21 | var $clearHistory = $('#clear-history'); | 22 | var $clearHistory = $('#clear-history'); |
22 | 23 | ||
@@ -31,6 +32,8 @@ chHammer.on('tap', function() { | @@ -31,6 +32,8 @@ chHammer.on('tap', function() { | ||
31 | localStorage.removeItem('historys'); | 32 | localStorage.removeItem('historys'); |
32 | 33 | ||
33 | $history.html(''); | 34 | $history.html(''); |
35 | + $historySearch.hide(); | ||
36 | + $clearHistory.hide(); | ||
34 | 37 | ||
35 | window.rePosFooter(); | 38 | window.rePosFooter(); |
36 | }); | 39 | }); |
@@ -80,7 +83,7 @@ $('#search').on('touchend', function() { | @@ -80,7 +83,7 @@ $('#search').on('touchend', function() { | ||
80 | 83 | ||
81 | $history.html(html); | 84 | $history.html(html); |
82 | $clearHistory.removeClass('hide'); | 85 | $clearHistory.removeClass('hide'); |
83 | - | 86 | + $historySearch.removeClass('hide'); |
84 | window.rePosFooter(); | 87 | window.rePosFooter(); |
85 | } | 88 | } |
86 | } | 89 | } |
@@ -15,7 +15,11 @@ var $loading, | @@ -15,7 +15,11 @@ var $loading, | ||
15 | 15 | ||
16 | // 初始化 | 16 | // 初始化 |
17 | function init($container) { | 17 | function init($container) { |
18 | - var html = '<div class="loading-mask hide"><div class="loading"></div></div>'; | 18 | + var html = '<div class="loading-mask hide">' + |
19 | + '<div class="loading">' + | ||
20 | + '<div></div><div></div><div></div>' + | ||
21 | + '</div>' + | ||
22 | + '</div>'; | ||
19 | 23 | ||
20 | hasInit = true; | 24 | hasInit = true; |
21 | if ($container === undefined) { | 25 | if ($container === undefined) { |
@@ -9,7 +9,7 @@ var $ = require('jquery'), | @@ -9,7 +9,7 @@ var $ = require('jquery'), | ||
9 | 9 | ||
10 | var commentsNum,consultsNum; | 10 | var commentsNum,consultsNum; |
11 | 11 | ||
12 | -var consultFooterEle = document.getElementById('consult-content-footer'), | 12 | +var consultFooterEle = $('.consult-content-footer')[0], |
13 | consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), | 13 | consultFooterHammer = consultFooterEle && new Hammer(consultFooterEle), |
14 | 14 | ||
15 | navtabEle = document.getElementById('nav-tab'), | 15 | navtabEle = document.getElementById('nav-tab'), |
@@ -68,13 +68,13 @@ if (navtabHammer) { | @@ -68,13 +68,13 @@ if (navtabHammer) { | ||
68 | 68 | ||
69 | if (consultFooterHammer) { | 69 | if (consultFooterHammer) { |
70 | consultFooterHammer.on('tap', function() { | 70 | consultFooterHammer.on('tap', function() { |
71 | - location.href = $(consultFooterEle).find('a').attr('href'); | 71 | + location.href = $(consultFooterEle).data('href'); |
72 | }); | 72 | }); |
73 | } | 73 | } |
74 | 74 | ||
75 | if (gotoConsultHammer) { | 75 | if (gotoConsultHammer) { |
76 | gotoConsultHammer.on('tap', function() { | 76 | gotoConsultHammer.on('tap', function() { |
77 | - location.href = $(gotoConsultEle).find('a').attr('href'); | 77 | + location.href = $(gotoConsultEle).data('href'); |
78 | }); | 78 | }); |
79 | } | 79 | } |
80 | 80 |
static/js/product/extract-url.js
deleted
100644 → 0
1 | -/** | ||
2 | - * 提取URL中的参数 | ||
3 | - * @author: xuqi<qi.xu@yoho.cn> | ||
4 | - * @date: 2015/11/19 | ||
5 | - */ | ||
6 | - | ||
7 | -var opt = {}; | ||
8 | - | ||
9 | -var paramStr = window.location.search.split('?')[1]; | ||
10 | - | ||
11 | -var keyVal = paramStr ? paramStr.split('&') : []; | ||
12 | - | ||
13 | -var i, key, val; | ||
14 | - | ||
15 | -for (i = keyVal.length; i > 0; i--) { | ||
16 | - key = keyVal[i - 1].split('='); | ||
17 | - | ||
18 | - val = key[1]; | ||
19 | - key = key[0]; | ||
20 | - | ||
21 | - //初始化默认参数 | ||
22 | - opt[key] = val; | ||
23 | - | ||
24 | - //discount = p_d,同时需要两个参数 | ||
25 | - if (key === 'discount' || key === 'p_d') { | ||
26 | - opt.discount = val; | ||
27 | - opt.p_d = val; | ||
28 | - } | ||
29 | -} | ||
30 | - | ||
31 | -if (typeof opt.gender === 'undefined') { | ||
32 | - switch (window.cookie('_Channel')) { | ||
33 | - case 'boys': | ||
34 | - opt.gender = '1,3'; | ||
35 | - break; | ||
36 | - case 'girls': | ||
37 | - opt.gender = '2,3'; | ||
38 | - break; | ||
39 | - default: | ||
40 | - opt.gender = '1,2,3'; | ||
41 | - } | ||
42 | -} | ||
43 | - | ||
44 | -module.exports = opt; |
@@ -31,7 +31,7 @@ var $input = $('#search-input input'), | @@ -31,7 +31,7 @@ var $input = $('#search-input input'), | ||
31 | $clear = $('#search-input .clear-input'); | 31 | $clear = $('#search-input .clear-input'); |
32 | 32 | ||
33 | //默认筛选条件 | 33 | //默认筛选条件 |
34 | -var defaultOpt = require('./extract-url'); | 34 | +var defaultOpt = require('./query-param'); |
35 | 35 | ||
36 | var $listNav = $('#list-nav'), | 36 | var $listNav = $('#list-nav'), |
37 | 37 |
@@ -24,7 +24,7 @@ var winH = $(window).height(), | @@ -24,7 +24,7 @@ var winH = $(window).height(), | ||
24 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 24 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
25 | 25 | ||
26 | //默认筛选条件 | 26 | //默认筛选条件 |
27 | -var defaultOpt = require('../extract-url'); | 27 | +var defaultOpt = require('../query-param'); |
28 | 28 | ||
29 | var $listNav = $('#list-nav'), | 29 | var $listNav = $('#list-nav'), |
30 | 30 |
@@ -27,7 +27,7 @@ var winH = $(window).height(), | @@ -27,7 +27,7 @@ var winH = $(window).height(), | ||
27 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; | 27 | noResult = '<p class="no-result">未找到相关搜索结果</p>'; |
28 | 28 | ||
29 | //默认筛选条件 | 29 | //默认筛选条件 |
30 | -var defaultOpt = require('../extract-url'); | 30 | +var defaultOpt = require('../query-param'); |
31 | 31 | ||
32 | var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置 | 32 | var storeOpt = $.extend({}, defaultOpt); //存储默认筛选条件以便重置 |
33 | 33 |
static/js/product/query-param.js
0 → 100644
@@ -5,16 +5,73 @@ | @@ -5,16 +5,73 @@ | ||
5 | bottom: 0; | 5 | bottom: 0; |
6 | right: 0; | 6 | right: 0; |
7 | left: 0; | 7 | left: 0; |
8 | + | ||
9 | + @-webkit-keyframes scale { | ||
10 | + 0% { | ||
11 | + -webkit-transform: scale(1); | ||
12 | + transform: scale(1); | ||
13 | + opacity: 1; | ||
14 | + } | ||
15 | + | ||
16 | + 45% { | ||
17 | + -webkit-transform: scale(0.1); | ||
18 | + transform: scale(0.1); | ||
19 | + opacity: 0.7; | ||
20 | + } | ||
21 | + | ||
22 | + 80% { | ||
23 | + -webkit-transform: scale(1); | ||
24 | + transform: scale(1); | ||
25 | + opacity: 1; | ||
26 | + } | ||
27 | + } | ||
28 | + | ||
29 | + @keyframes scale { | ||
30 | + 0% { | ||
31 | + -webkit-transform: scale(1); | ||
32 | + transform: scale(1); | ||
33 | + opacity: 1; | ||
34 | + } | ||
35 | + | ||
36 | + 45% { | ||
37 | + -webkit-transform: scale(0.1); | ||
38 | + transform: scale(0.1); | ||
39 | + opacity: 0.7; | ||
40 | + } | ||
41 | + | ||
42 | + 80% { | ||
43 | + -webkit-transform: scale(1); | ||
44 | + transform: scale(1); | ||
45 | + opacity: 1; | ||
46 | + } | ||
47 | + } | ||
8 | 48 | ||
9 | .loading { | 49 | .loading { |
10 | position: absolute; | 50 | position: absolute; |
11 | - width: 100rem / $pxConvertRem; | ||
12 | - height: 40rem / $pxConvertRem; | ||
13 | - background: image-url('loading.gif') no-repeat; | ||
14 | - background-size: 100% 100%; | 51 | + width: 60px; |
52 | + height: 20px; | ||
15 | top: 50%; | 53 | top: 50%; |
16 | left: 50%; | 54 | left: 50%; |
17 | - margin-left: -50rem / $pxConvertRem; | ||
18 | - margin-top: -20rem / $pxConvertRem; | 55 | + margin-top: -10px; |
56 | + margin-left: -30px; | ||
57 | + | ||
58 | + > div { | ||
59 | + display: inline-block; | ||
60 | + background: #fff; | ||
61 | + width: 15px; | ||
62 | + height: 15px; | ||
63 | + @include border-radius(100%); | ||
64 | + margin: 2px; | ||
65 | + | ||
66 | + $init: 0.12; | ||
67 | + @for $i from 1 through 3 { | ||
68 | + &:nth-child(#{$i}) { | ||
69 | + -webkit-animation: scale .75s #{$init}s infinite cubic-bezier(.2,.68,.18,1.08); | ||
70 | + animation: scale .75s #{$init}s infinite cubic-bezier(.2,.68,.18,1.08); | ||
71 | + } | ||
72 | + | ||
73 | + $init: ($i + 1) * 0.12; | ||
74 | + } | ||
75 | + } | ||
19 | } | 76 | } |
20 | } | 77 | } |
@@ -202,7 +202,7 @@ $basicBtnC:#eb0313; | @@ -202,7 +202,7 @@ $basicBtnC:#eb0313; | ||
202 | .goodsName { | 202 | .goodsName { |
203 | box-sizing: border-box; | 203 | box-sizing: border-box; |
204 | width: 100%; | 204 | width: 100%; |
205 | - min-height: pxToRem(83px); | 205 | + min-height: pxToRem(88px); |
206 | font-size: pxToRem(28px); | 206 | font-size: pxToRem(28px); |
207 | color: #fff; | 207 | color: #fff; |
208 | padding-left: pxToRem(28px); | 208 | padding-left: pxToRem(28px); |
@@ -236,7 +236,7 @@ $basicBtnC:#eb0313; | @@ -236,7 +236,7 @@ $basicBtnC:#eb0313; | ||
236 | .price-date { | 236 | .price-date { |
237 | // width: 100%; | 237 | // width: 100%; |
238 | color: $subFontC; | 238 | color: $subFontC; |
239 | - min-height: pxToRem(88px); | 239 | + height: pxToRem(88px); |
240 | padding-left: pxToRem(28px); | 240 | padding-left: pxToRem(28px); |
241 | padding-right: pxToRem(28px); | 241 | padding-right: pxToRem(28px); |
242 | background-color: #fff; | 242 | background-color: #fff; |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | {{/ hot}} | 21 | {{/ hot}} |
22 | </ul> | 22 | </ul> |
23 | </div> | 23 | </div> |
24 | - <div class="history-search"> | 24 | + <div class="history-search hide"> |
25 | <h3>历史搜索</h3> | 25 | <h3>历史搜索</h3> |
26 | <ul class="history clearfix"></ul> | 26 | <ul class="history clearfix"></ul> |
27 | </div> | 27 | </div> |
@@ -29,4 +29,4 @@ | @@ -29,4 +29,4 @@ | ||
29 | </div> | 29 | </div> |
30 | {{/ search}} | 30 | {{/ search}} |
31 | </div> | 31 | </div> |
32 | -{{> layout/footer}} | ||
32 | +{{> layout/footer}} |
1 | {{> layout/header}} | 1 | {{> layout/header}} |
2 | <div class="goods-consults-page yoho-page"> | 2 | <div class="goods-consults-page yoho-page"> |
3 | - <div class="goto-consult" id="goto-consult"> | 3 | + <div class="goto-consult" id="goto-consult" data-href="{{link}}"> |
4 | <i class="iconfont consult-logo"></i> | 4 | <i class="iconfont consult-logo"></i> |
5 | <span>我要咨询</span> | 5 | <span>我要咨询</span> |
6 | - <a href="{{link}}" class="iconfont enter-consult-page"></a> | 6 | + <a href="javascript:;" class="iconfont enter-consult-page"></a> |
7 | </div> | 7 | </div> |
8 | {{# consults}} | 8 | {{# consults}} |
9 | <div class="goods-consults" id="goods-consults"> | 9 | <div class="goods-consults" id="goods-consults"> |
@@ -4,58 +4,6 @@ | @@ -4,58 +4,6 @@ | ||
4 | {{> product/banner-swipe-and-single}} | 4 | {{> product/banner-swipe-and-single}} |
5 | {{/ headerBanner}} | 5 | {{/ headerBanner}} |
6 | <div id="hotRank"></div> | 6 | <div id="hotRank"></div> |
7 | - {{#if brand}} | ||
8 | - <input id="brand" type="hidden" value={{brand}}> | ||
9 | - {{/if}} | ||
10 | - | ||
11 | - {{#if gender}} | ||
12 | - <input id="gender" type="hidden" value={{gender}}> | ||
13 | - {{/if}} | ||
14 | - | ||
15 | - {{#if sort}} | ||
16 | - <input id="sort" type="hidden" value={{sort}}> | ||
17 | - {{/if}} | ||
18 | - | ||
19 | - {{#if msort}} | ||
20 | - <input id="msort" type="hidden" value={{msort}}> | ||
21 | - {{/if}} | ||
22 | - | ||
23 | - {{#if misort}} | ||
24 | - <input id="misort" type="hidden" value={{misort}}> | ||
25 | - {{/if}} | ||
26 | - | ||
27 | - {{#if color}} | ||
28 | - <input id="color" type="hidden" value={{color}}> | ||
29 | - {{/if}} | ||
30 | - | ||
31 | - {{#if size}} | ||
32 | - <input id="size" type="hidden" value={{size}}> | ||
33 | - {{/if}} | ||
34 | - | ||
35 | - {{#if price}} | ||
36 | - <input id="price" type="hidden" value={{price}}> | ||
37 | - {{/if}} | ||
38 | - | ||
39 | - {{#if p_d}} | ||
40 | - <input id="p_d" type="hidden" value={{p_d}}> | ||
41 | - {{/if}} | ||
42 | - | ||
43 | - {{#if channel}} | ||
44 | - <input id="channel" type="hidden" value={{channel}}> | ||
45 | - {{/if}} | ||
46 | - | ||
47 | - {{#if limit}} | ||
48 | - <input id="limit" type="hidden" value={{limit}}> | ||
49 | - {{/if}} | ||
50 | - | ||
51 | - {{#if page}} | ||
52 | - <input id="page" type="hidden" value={{page}}> | ||
53 | - {{/if}} | ||
54 | - | ||
55 | - {{#if discount}} | ||
56 | - <input id="discount" type="hidden" value={{discount}}> | ||
57 | - {{/if}} | ||
58 | - | ||
59 | {{> product/suspend-cart}} | 7 | {{> product/suspend-cart}} |
60 | </div> | 8 | </div> |
61 | {{> layout/footer}} | 9 | {{> layout/footer}} |
@@ -37,6 +37,9 @@ | @@ -37,6 +37,9 @@ | ||
37 | <div class="container hide clearfix"></div> | 37 | <div class="container hide clearfix"></div> |
38 | {{> filter}} | 38 | {{> filter}} |
39 | </div> | 39 | </div> |
40 | + | ||
41 | + {{> product/query-param}} | ||
42 | + | ||
40 | {{> product/suspend-cart}} | 43 | {{> product/suspend-cart}} |
41 | </div> | 44 | </div> |
42 | {{> layout/footer}} | 45 | {{> layout/footer}} |
@@ -49,8 +49,8 @@ | @@ -49,8 +49,8 @@ | ||
49 | </div> | 49 | </div> |
50 | {{/ consults}} | 50 | {{/ consults}} |
51 | </div> | 51 | </div> |
52 | - <div class="consult-content-footer" id="consult-content-footer"> | ||
53 | - <a href="{{link}}"> | 52 | + <div class="consult-content-footer" data-href="{{link}}"> |
53 | + <a href="javascript:;"> | ||
54 | 查看更多 | 54 | 查看更多 |
55 | <span class="iconfont"></span></a> | 55 | <span class="iconfont"></span></a> |
56 | </div> | 56 | </div> |
@@ -58,8 +58,9 @@ | @@ -58,8 +58,9 @@ | ||
58 | <div class="consult-content-main content-main no-item"> | 58 | <div class="consult-content-main content-main no-item"> |
59 | <span class="iconfont"></span>暂无咨询 | 59 | <span class="iconfont"></span>暂无咨询 |
60 | </div> | 60 | </div> |
61 | - <div class="consult-content-footer"> | ||
62 | - <a href="{{link}}"> | 61 | + |
62 | + <div class="consult-content-footer" data-href="{{link}}"> | ||
63 | + <a href="javascript:;"> | ||
63 | 我要咨询 | 64 | 我要咨询 |
64 | <span class="iconfont"></span></a> | 65 | <span class="iconfont"></span></a> |
65 | </div> | 66 | </div> |
1 | +{{#if brand}} | ||
2 | + <input class="query-param" type="hidden" data-attr="brand" value="{{brand}}"> | ||
3 | +{{/if}} | ||
4 | + | ||
5 | +{{#if gender}} | ||
6 | + <input class="query-param" type="hidden" data-attr="gender" value="{{gender}}"> | ||
7 | +{{/if}} | ||
8 | + | ||
9 | +{{#if sort}} | ||
10 | + <input class="query-param" type="hidden" data-attr="sort" value="{{sort}}"> | ||
11 | +{{/if}} | ||
12 | + | ||
13 | +{{#if msort}} | ||
14 | + <input class="query-param" type="hidden" data-attr="msort" value="{{msort}}"> | ||
15 | +{{/if}} | ||
16 | + | ||
17 | +{{#if misort}} | ||
18 | + <input class="query-param" type="hidden" data-attr="misort" value="{{misort}}"> | ||
19 | +{{/if}} | ||
20 | + | ||
21 | +{{#if color}} | ||
22 | + <input class="query-param" type="hidden" data-attr="color" value="{{color}}"> | ||
23 | +{{/if}} | ||
24 | + | ||
25 | +{{#if size}} | ||
26 | + <input class="query-param" type="hidden" data-attr="size" value="{{size}}"> | ||
27 | +{{/if}} | ||
28 | + | ||
29 | +{{#if price}} | ||
30 | + <input class="query-param" type="hidden" data-attr="price" value="{{price}}"> | ||
31 | +{{/if}} | ||
32 | + | ||
33 | +{{#if discount}} | ||
34 | + <input class="query-param" type="hidden" data-attr="discount" value="{{discount}}"> | ||
35 | +{{/if}} | ||
36 | + | ||
37 | +{{#if query}} | ||
38 | + <input class="query-param" type="hidden" data-attr="query" value="{{query}}"> | ||
39 | +{{/if}} | ||
40 | + | ||
41 | +{{#if style}} | ||
42 | + <input class="query-param" type="hidden" data-attr="style" value="{{style}}"> | ||
43 | +{{/if}} | ||
44 | + | ||
45 | +{{#if p_d}} | ||
46 | + <input class="query-param" type="hidden" data-attr="p_d" value="{{p_d}}"> | ||
47 | +{{/if}} | ||
48 | + | ||
49 | +{{#if channel}} | ||
50 | + <input class="query-param" type="hidden" data-attr="channel" value="{{channel}}"> | ||
51 | +{{/if}} | ||
52 | + | ||
53 | +{{#if dayLimit}} | ||
54 | + <input class="query-param" type="hidden" data-attr="dayLimit" value="{{dayLimit}}"> | ||
55 | +{{/if}} | ||
56 | + | ||
57 | +{{#if limit}} | ||
58 | + <input class="query-param" type="hidden" data-attr="limit" value="{{limit}}"> | ||
59 | +{{/if}} |
@@ -32,36 +32,33 @@ class SearchController extends AbstractAction | @@ -32,36 +32,33 @@ class SearchController extends AbstractAction | ||
32 | */ | 32 | */ |
33 | public function listAction() | 33 | public function listAction() |
34 | { | 34 | { |
35 | -// // 过滤请求参数 | ||
36 | -// $condition = filter_input_array(INPUT_GET, array( | ||
37 | -// 'query' => FILTER_DEFAULT, | ||
38 | -// 'brand' => FILTER_DEFAULT, | ||
39 | -// 'sort' => FILTER_DEFAULT, | ||
40 | -// 'msort' => FILTER_DEFAULT, | ||
41 | -// 'misort' => FILTER_DEFAULT, | ||
42 | -// 'color' => FILTER_DEFAULT, | ||
43 | -// 'size' => FILTER_DEFAULT, | ||
44 | -// 'style' => FILTER_DEFAULT, | ||
45 | -// 'price' => FILTER_DEFAULT, | ||
46 | -// 'discount' => FILTER_DEFAULT, | ||
47 | -// 'gender' => FILTER_DEFAULT, | ||
48 | -// 'p_d' => FILTER_DEFAULT,), false); | ||
49 | -// | ||
50 | -// $query = empty($condition['query']) ? null : strtolower(trim($condition['query'])); | ||
51 | -// if (isset($condition['discount'])) { | ||
52 | -// $condition['p_d'] = rawurldecode($condition['discount']); | ||
53 | -// // unset($condition['discount']); 为了兼容js中传参的discount | ||
54 | -// } | ||
55 | -// // 为了兼容现在运营在用的p_d | ||
56 | -// if (isset($condition['p_d'])) { | ||
57 | -// $condition['discount'] = rawurldecode($condition['p_d']); | ||
58 | -// } | ||
59 | -// if (isset($condition['query'])) { | ||
60 | -// $condition['query'] = rawurlencode($condition['query']); | ||
61 | -// } | ||
62 | - | ||
63 | - $query = $this->get('query', ''); | ||
64 | - $query = is_string($query) ? '' : strtolower(trim($query)); | 35 | + // 过滤请求参数 |
36 | + $condition = filter_input_array(INPUT_GET, array( | ||
37 | + 'query' => FILTER_DEFAULT, | ||
38 | + 'brand' => FILTER_DEFAULT, | ||
39 | + 'sort' => FILTER_DEFAULT, | ||
40 | + 'msort' => FILTER_DEFAULT, | ||
41 | + 'misort' => FILTER_DEFAULT, | ||
42 | + 'color' => FILTER_DEFAULT, | ||
43 | + 'size' => FILTER_DEFAULT, | ||
44 | + 'style' => FILTER_DEFAULT, | ||
45 | + 'price' => FILTER_DEFAULT, | ||
46 | + 'discount' => FILTER_DEFAULT, | ||
47 | + 'gender' => FILTER_DEFAULT, | ||
48 | + 'p_d' => FILTER_DEFAULT,), false); | ||
49 | + | ||
50 | + $query = empty($condition['query']) ? null : strtolower(trim($condition['query'])); | ||
51 | + if (isset($condition['discount'])) { | ||
52 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
53 | + // unset($condition['discount']); 为了兼容js中传参的discount | ||
54 | + } | ||
55 | + // 为了兼容现在运营在用的p_d | ||
56 | + if (isset($condition['p_d'])) { | ||
57 | + $condition['discount'] = rawurldecode($condition['p_d']); | ||
58 | + } | ||
59 | + if (isset($condition['query'])) { | ||
60 | + $condition['query'] = rawurlencode($condition['query']); | ||
61 | + } | ||
65 | 62 | ||
66 | // 标识用户是否有输入搜索内容 | 63 | // 标识用户是否有输入搜索内容 |
67 | $haveQuery = $query !== ''; | 64 | $haveQuery = $query !== ''; |
@@ -133,13 +130,13 @@ class SearchController extends AbstractAction | @@ -133,13 +130,13 @@ class SearchController extends AbstractAction | ||
133 | 130 | ||
134 | $classNames = array(); | 131 | $classNames = array(); |
135 | } | 132 | } |
136 | -// else { | ||
137 | -// $condition['query'] = ''; | ||
138 | -// } | 133 | + else { |
134 | + $condition['query'] = ''; | ||
135 | + } | ||
139 | 136 | ||
140 | $data = array(); | 137 | $data = array(); |
141 | $data['goodListPage'] = true; | 138 | $data['goodListPage'] = true; |
142 | - //$data['goodList'] = $condition; | 139 | + $data['goodList'] = $condition; |
143 | $data['query'] = $query; | 140 | $data['query'] = $query; |
144 | // 搜索是一级品类 | 141 | // 搜索是一级品类 |
145 | if ($isQueryFirstClass) { | 142 | if ($isQueryFirstClass) { |
@@ -70,20 +70,21 @@ class OrderModel | @@ -70,20 +70,21 @@ class OrderModel | ||
70 | if (!empty($data['data']['order_list'])) { | 70 | if (!empty($data['data']['order_list'])) { |
71 | // 订单的状态列表 | 71 | // 订单的状态列表 |
72 | //$orderStatus = Helpers::getOrderStatus(); | 72 | //$orderStatus = Helpers::getOrderStatus(); |
73 | - | 73 | + $count = 0; |
74 | foreach ($data['data']['order_list'] as $key => $vo) { | 74 | foreach ($data['data']['order_list'] as $key => $vo) { |
75 | // if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) { | 75 | // if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) { |
76 | // $vo['status'] = 1; | 76 | // $vo['status'] = 1; |
77 | // } | 77 | // } |
78 | + $count = 0; | ||
78 | //订单号,支付状态,订单商品数量,订单总价格 | 79 | //订单号,支付状态,订单商品数量,订单总价格 |
79 | $result[$key]['orderNum'] = $vo['order_code']; | 80 | $result[$key]['orderNum'] = $vo['order_code']; |
80 | //$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ]; | 81 | //$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ]; |
81 | $result[$key]['orderStatus'] = $vo['status_str']; | 82 | $result[$key]['orderStatus'] = $vo['status_str']; |
82 | - $result[$key]['count'] = count($vo['order_goods']); | ||
83 | $result[$key]['sumCost'] = $vo['amount']; | 83 | $result[$key]['sumCost'] = $vo['amount']; |
84 | //类内调用格式化订单商品数据方法 | 84 | //类内调用格式化订单商品数据方法 |
85 | - $result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods']); | 85 | + $result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods'], $count); |
86 | $result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time())); | 86 | $result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time())); |
87 | + $result[$key]['count'] = $count; | ||
87 | //根据订单status判断订单处于什么状态。 | 88 | //根据订单status判断订单处于什么状态。 |
88 | do { | 89 | do { |
89 | //订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。 | 90 | //订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。 |
@@ -304,7 +304,7 @@ class DetailModel | @@ -304,7 +304,7 @@ class DetailModel | ||
304 | /* 参考尺码 */ | 304 | /* 参考尺码 */ |
305 | $boyReference = !empty($sizeInfo['productExtra']['boyReference']); | 305 | $boyReference = !empty($sizeInfo['productExtra']['boyReference']); |
306 | $girlReference = !empty($sizeInfo['productExtra']['girlReference']); | 306 | $girlReference = !empty($sizeInfo['productExtra']['girlReference']); |
307 | - $gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3; | 307 | + $gender = isset($sizeInfo['productDescBo']['gender']) ? $sizeInfo['productDescBo']['gender'] : 3; |
308 | $referenceName = '参考尺码'; | 308 | $referenceName = '参考尺码'; |
309 | if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) { | 309 | if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) { |
310 | $referenceName = '参考尺码'; | 310 | $referenceName = '参考尺码'; |
@@ -23,66 +23,66 @@ class IndexController extends AbstractAction | @@ -23,66 +23,66 @@ class IndexController extends AbstractAction | ||
23 | */ | 23 | */ |
24 | public function indexAction() | 24 | public function indexAction() |
25 | { | 25 | { |
26 | -// // 过滤请求参数 | ||
27 | -// $condition = filter_input_array(INPUT_GET, array( | ||
28 | -// 'brand' => FILTER_DEFAULT, | ||
29 | -// 'sort' => FILTER_DEFAULT, | ||
30 | -// 'msort' => FILTER_DEFAULT, | ||
31 | -// 'misort' => FILTER_DEFAULT, | ||
32 | -// 'color' => FILTER_DEFAULT, | ||
33 | -// 'size' => FILTER_DEFAULT, | ||
34 | -// 'style' => FILTER_DEFAULT, | ||
35 | -// 'price' => FILTER_DEFAULT, | ||
36 | -// 'discount' => FILTER_DEFAULT, | ||
37 | -// 'gender' => FILTER_DEFAULT, | ||
38 | -// 'p_d' => FILTER_DEFAULT,), false); | ||
39 | -// | ||
40 | -// // 转义品牌 | ||
41 | -// if (isset($condition['brand'])) { | ||
42 | -// $condition['brand'] = rawurldecode($condition['brand']); | ||
43 | -// } | ||
44 | -// // 转义分类 | ||
45 | -// if (isset($condition['sort'])) { | ||
46 | -// $condition['sort'] = rawurldecode($condition['sort']); | ||
47 | -// } | ||
48 | -// // 转义一级分类 | ||
49 | -// if (isset($condition['msort'])) { | ||
50 | -// $condition['msort'] = rawurldecode($condition['msort']); | ||
51 | -// } | ||
52 | -// // 转义二级分类 | ||
53 | -// if (isset($condition['misort'])) { | ||
54 | -// $condition['misort'] = rawurldecode($condition['misort']); | ||
55 | -// } | ||
56 | -// // 转义颜色 | ||
57 | -// if (isset($condition['color'])) { | ||
58 | -// $condition['color'] = rawurldecode($condition['color']); | ||
59 | -// } | ||
60 | -// // 转义尺码 | ||
61 | -// if (isset($condition['size'])) { | ||
62 | -// $condition['size'] = rawurldecode($condition['size']); | ||
63 | -// } | ||
64 | -// // 转义风格 | ||
65 | -// if (isset($condition['style'])) { | ||
66 | -// $condition['style'] = rawurldecode($condition['style']); | ||
67 | -// } | ||
68 | -// // 转义价格 | ||
69 | -// if (isset($condition['price'])) { | ||
70 | -// $condition['price'] = rawurldecode($condition['price']); | ||
71 | -// } | ||
72 | -// // 转换折扣 | ||
73 | -// if (isset($condition['discount'])) { | ||
74 | -// $condition['p_d'] = rawurldecode($condition['discount']); | ||
75 | -// } | ||
76 | -// // 为了兼容现在运营在用的p_d | ||
77 | -// if (isset($condition['p_d'])) { | ||
78 | -// $condition['discount'] = rawurldecode($condition['p_d']); | ||
79 | -// } | ||
80 | -// // 性别参数,不传则从COOKIE获取 | ||
81 | -// if (!isset($condition['gender'])) { | ||
82 | -// $condition['gender'] = Helpers::getGenderByCookie(); | ||
83 | -// } else { | ||
84 | -// $condition['gender'] = rawurldecode($condition['gender']); | ||
85 | -// } | 26 | + // 过滤请求参数 |
27 | + $condition = filter_input_array(INPUT_GET, array( | ||
28 | + 'brand' => FILTER_DEFAULT, | ||
29 | + 'sort' => FILTER_DEFAULT, | ||
30 | + 'msort' => FILTER_DEFAULT, | ||
31 | + 'misort' => FILTER_DEFAULT, | ||
32 | + 'color' => FILTER_DEFAULT, | ||
33 | + 'size' => FILTER_DEFAULT, | ||
34 | + 'style' => FILTER_DEFAULT, | ||
35 | + 'price' => FILTER_DEFAULT, | ||
36 | + 'discount' => FILTER_DEFAULT, | ||
37 | + 'gender' => FILTER_DEFAULT, | ||
38 | + 'p_d' => FILTER_DEFAULT,), false); | ||
39 | + | ||
40 | + // 转义品牌 | ||
41 | + if (isset($condition['brand'])) { | ||
42 | + $condition['brand'] = rawurldecode($condition['brand']); | ||
43 | + } | ||
44 | + // 转义分类 | ||
45 | + if (isset($condition['sort'])) { | ||
46 | + $condition['sort'] = rawurldecode($condition['sort']); | ||
47 | + } | ||
48 | + // 转义一级分类 | ||
49 | + if (isset($condition['msort'])) { | ||
50 | + $condition['msort'] = rawurldecode($condition['msort']); | ||
51 | + } | ||
52 | + // 转义二级分类 | ||
53 | + if (isset($condition['misort'])) { | ||
54 | + $condition['misort'] = rawurldecode($condition['misort']); | ||
55 | + } | ||
56 | + // 转义颜色 | ||
57 | + if (isset($condition['color'])) { | ||
58 | + $condition['color'] = rawurldecode($condition['color']); | ||
59 | + } | ||
60 | + // 转义尺码 | ||
61 | + if (isset($condition['size'])) { | ||
62 | + $condition['size'] = rawurldecode($condition['size']); | ||
63 | + } | ||
64 | + // 转义风格 | ||
65 | + if (isset($condition['style'])) { | ||
66 | + $condition['style'] = rawurldecode($condition['style']); | ||
67 | + } | ||
68 | + // 转义价格 | ||
69 | + if (isset($condition['price'])) { | ||
70 | + $condition['price'] = rawurldecode($condition['price']); | ||
71 | + } | ||
72 | + // 转换折扣 | ||
73 | + if (isset($condition['discount'])) { | ||
74 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
75 | + } | ||
76 | + // 为了兼容现在运营在用的p_d | ||
77 | + if (isset($condition['p_d'])) { | ||
78 | + $condition['discount'] = rawurldecode($condition['p_d']); | ||
79 | + } | ||
80 | + // 性别参数,不传则从COOKIE获取 | ||
81 | + if (!isset($condition['gender'])) { | ||
82 | + $condition['gender'] = Helpers::getGenderByCookie(); | ||
83 | + } else { | ||
84 | + $condition['gender'] = rawurldecode($condition['gender']); | ||
85 | + } | ||
86 | 86 | ||
87 | // 品类名称参数, 不传则默认为全部 | 87 | // 品类名称参数, 不传则默认为全部 |
88 | $name = $this->get('sort_name'); | 88 | $name = $this->get('sort_name'); |
@@ -92,11 +92,10 @@ class IndexController extends AbstractAction | @@ -92,11 +92,10 @@ class IndexController extends AbstractAction | ||
92 | $this->setTitle($name); | 92 | $this->setTitle($name); |
93 | $this->setNavHeader($name, true, SITE_MAIN); | 93 | $this->setNavHeader($name, true, SITE_MAIN); |
94 | 94 | ||
95 | -// if (!$condition) { | ||
96 | -// $condition = array(); | ||
97 | -// } | ||
98 | -// $goodList = $condition; | ||
99 | - $goodList = array(); | 95 | + if (!$condition) { |
96 | + $condition = array(); | ||
97 | + } | ||
98 | + $goodList = $condition; | ||
100 | $goodList['cartUrl'] = Helpers::url('/cart/index/index', null); | 99 | $goodList['cartUrl'] = Helpers::url('/cart/index/index', null); |
101 | 100 | ||
102 | $this->_view->display('index', array( | 101 | $this->_view->display('index', array( |
@@ -133,13 +132,6 @@ class IndexController extends AbstractAction | @@ -133,13 +132,6 @@ class IndexController extends AbstractAction | ||
133 | $brandId = $brandLogo['id']; | 132 | $brandId = $brandLogo['id']; |
134 | } | 133 | } |
135 | 134 | ||
136 | - /* 通过品牌域名找到对应的品牌ID */ | ||
137 | -// $domainList = Product\ListModel::getAllBrandDomains(); | ||
138 | -// $brandIds = array_keys($domainList, $domain); | ||
139 | -// $brandId = 0; | ||
140 | -// if (isset($brandIds[0])) { | ||
141 | -// $brandId = $brandIds[0]; | ||
142 | -// } | ||
143 | // 当前的登录用户UID | 135 | // 当前的登录用户UID |
144 | $uid = $this->getUid(); | 136 | $uid = $this->getUid(); |
145 | 137 | ||
@@ -147,64 +139,64 @@ class IndexController extends AbstractAction | @@ -147,64 +139,64 @@ class IndexController extends AbstractAction | ||
147 | $from = $this->get('from'); | 139 | $from = $this->get('from'); |
148 | $query = $this->get('query'); | 140 | $query = $this->get('query'); |
149 | 141 | ||
150 | -// /* 过滤请求参数 */ | ||
151 | -// $condition = filter_input_array(INPUT_GET, array( | ||
152 | -// 'sort' => FILTER_DEFAULT, | ||
153 | -// 'msort' => FILTER_DEFAULT, | ||
154 | -// 'misort' => FILTER_DEFAULT, | ||
155 | -// 'color' => FILTER_DEFAULT, | ||
156 | -// 'size' => FILTER_DEFAULT, | ||
157 | -// 'style' => FILTER_DEFAULT, | ||
158 | -// 'price' => FILTER_DEFAULT, | ||
159 | -// 'discount' => FILTER_DEFAULT, | ||
160 | -// 'gender' => FILTER_DEFAULT, | ||
161 | -// 'p_d' => FILTER_DEFAULT,), false); | ||
162 | -// $condition['brand'] = $brandId; | ||
163 | -// // 转义分类 | ||
164 | -// if (isset($condition['sort'])) { | ||
165 | -// $condition['sort'] = rawurldecode($condition['sort']); | ||
166 | -// } | ||
167 | -// // 转义一级分类 | ||
168 | -// if (isset($condition['msort'])) { | ||
169 | -// $condition['msort'] = rawurldecode($condition['msort']); | ||
170 | -// } | ||
171 | -// // 转义二级分类 | ||
172 | -// if (isset($condition['misort'])) { | ||
173 | -// $condition['misort'] = rawurldecode($condition['misort']); | ||
174 | -// } | ||
175 | -// // 转义颜色 | ||
176 | -// if (isset($condition['color'])) { | ||
177 | -// $condition['color'] = rawurldecode($condition['color']); | ||
178 | -// } | ||
179 | -// // 转义尺码 | ||
180 | -// if (isset($condition['size'])) { | ||
181 | -// $condition['size'] = rawurldecode($condition['size']); | ||
182 | -// } | ||
183 | -// // 转义风格 | ||
184 | -// if (isset($condition['style'])) { | ||
185 | -// $condition['style'] = rawurldecode($condition['style']); | ||
186 | -// } | ||
187 | -// // 转义价格 | ||
188 | -// if (isset($condition['price'])) { | ||
189 | -// $condition['price'] = rawurldecode($condition['price']); | ||
190 | -// } | ||
191 | -// // 转换折扣 | ||
192 | -// if (isset($condition['discount'])) { | ||
193 | -// $condition['p_d'] = rawurldecode($condition['discount']); | ||
194 | -// } | ||
195 | -// // 为了兼容现在运营在用的p_d | ||
196 | -// if (isset($condition['p_d'])) { | ||
197 | -// $condition['discount'] = rawurldecode($condition['p_d']); | ||
198 | -// } | ||
199 | -// if ($brandId === 0) { | ||
200 | -// $condition['query'] = $domain; | ||
201 | -// } | ||
202 | -// | ||
203 | -// if (isset($condition['gender'])) { | ||
204 | -// $condition['gender'] = rawurldecode($condition['gender']); | ||
205 | -// } else { | ||
206 | -// $condition['gender'] = Helpers::getGenderByCookie(); | ||
207 | -// } | 142 | + /* 过滤请求参数 */ |
143 | + $condition = filter_input_array(INPUT_GET, array( | ||
144 | + 'sort' => FILTER_DEFAULT, | ||
145 | + 'msort' => FILTER_DEFAULT, | ||
146 | + 'misort' => FILTER_DEFAULT, | ||
147 | + 'color' => FILTER_DEFAULT, | ||
148 | + 'size' => FILTER_DEFAULT, | ||
149 | + 'style' => FILTER_DEFAULT, | ||
150 | + 'price' => FILTER_DEFAULT, | ||
151 | + 'discount' => FILTER_DEFAULT, | ||
152 | + 'gender' => FILTER_DEFAULT, | ||
153 | + 'p_d' => FILTER_DEFAULT,), false); | ||
154 | + $condition['brand'] = $brandId; | ||
155 | + // 转义分类 | ||
156 | + if (isset($condition['sort'])) { | ||
157 | + $condition['sort'] = rawurldecode($condition['sort']); | ||
158 | + } | ||
159 | + // 转义一级分类 | ||
160 | + if (isset($condition['msort'])) { | ||
161 | + $condition['msort'] = rawurldecode($condition['msort']); | ||
162 | + } | ||
163 | + // 转义二级分类 | ||
164 | + if (isset($condition['misort'])) { | ||
165 | + $condition['misort'] = rawurldecode($condition['misort']); | ||
166 | + } | ||
167 | + // 转义颜色 | ||
168 | + if (isset($condition['color'])) { | ||
169 | + $condition['color'] = rawurldecode($condition['color']); | ||
170 | + } | ||
171 | + // 转义尺码 | ||
172 | + if (isset($condition['size'])) { | ||
173 | + $condition['size'] = rawurldecode($condition['size']); | ||
174 | + } | ||
175 | + // 转义风格 | ||
176 | + if (isset($condition['style'])) { | ||
177 | + $condition['style'] = rawurldecode($condition['style']); | ||
178 | + } | ||
179 | + // 转义价格 | ||
180 | + if (isset($condition['price'])) { | ||
181 | + $condition['price'] = rawurldecode($condition['price']); | ||
182 | + } | ||
183 | + // 转换折扣 | ||
184 | + if (isset($condition['discount'])) { | ||
185 | + $condition['p_d'] = rawurldecode($condition['discount']); | ||
186 | + } | ||
187 | + // 为了兼容现在运营在用的p_d | ||
188 | + if (isset($condition['p_d'])) { | ||
189 | + $condition['discount'] = rawurldecode($condition['p_d']); | ||
190 | + } | ||
191 | + if ($brandId === 0) { | ||
192 | + $condition['query'] = $domain; | ||
193 | + } | ||
194 | + | ||
195 | + if (isset($condition['gender'])) { | ||
196 | + $condition['gender'] = rawurldecode($condition['gender']); | ||
197 | + } else { | ||
198 | + $condition['gender'] = Helpers::getGenderByCookie(); | ||
199 | + } | ||
208 | 200 | ||
209 | $data = array(); | 201 | $data = array(); |
210 | $data['goodListPage'] = true; | 202 | $data['goodListPage'] = true; |
-
Please register or login to post a comment